Sucker-rod pumping well daily fluid production prediction model training method, prediction method and device

By converting the ground power diagram into a downhole pump power diagram, extracting features and training the prediction model, the problems of low prediction accuracy and complex calculation in traditional power diagram oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-meter oil-to-

CN120020769APending Publication Date: 2025-05-20PETROCHINA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311549564.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-20
Publication Date
2025-05-20

AI Technical Summary

Technical Problem

Due to the large error in the quantitative calculation process, the traditional power diagram oil-to-weight oil-to-weight oil production prediction accuracy is low, and the calculation process is complex and time-consuming, making it difficult to meet the real-time monitoring needs.

Method used

By converting the ground power diagram into an underground pump power diagram, the characteristics of the pump power diagram are extracted, and the basic feature library is constructed based on production data, and the dimensionality reduction is reduced by principal component analysis method, the extreme gradient enhancement tree model is trained, and the model is fusion model is integrated through the particle swarm optimization algorithm to establish a Nissan fluid prediction model for the rod pump oil well with rod pump.

Benefits of technology

It improves the accuracy and generalization ability of daily production volume prediction, shortens the calculation time, and can more accurately monitor oil well production in real time, solving the problems of low accuracy and complex calculations in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120020769A_ABST
    Figure CN120020769A_ABST
Patent Text Reader

Abstract

The invention discloses a training method, a prediction method and a device for a daily fluid production prediction model of a sucker-rod pumping well. The method comprises the steps that for each pumping well, ground indicator diagrams obtained in advance are converted into underground pump indicator diagrams, and a sample database is constructed; extracting features of each underground pump indicator diagram based on the sample database, and constructing a basic feature library in combination with pre-obtained production data; performing dimension reduction on the basic feature library based on a principal component analysis method to obtain dimension-reduced feature vectors; training a first prediction model according to the basic feature library to obtain a first base model; training a second prediction model according to the dimension reduction feature vector to obtain a second base model; and based on a particle swarm optimization algorithm, fusing the first base model and the second base model to obtain the daily fluid production prediction model of the sucker-rod pump oil well. According to the method, many production factors are considered during modeling, so that the model can distinguish tiny gaps among different data, the precision is high, and the requirement of a field production department for real-time control of the yield is effectively ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a method, a prediction method and a device for training a daily liquid production prediction model of a rod pumped well. Background Art

[0002] Volumetric oil measurement using dynamometer cards is an important technology for the production monitoring of rod pumped wells. It can help engineers analyze the wellhead output and the oilfield production, so as to optimize the production process. For example, oil production engineers can use the volumetric oil measurement technology using dynamometer cards to determine the reasons for the decline in oil well production and take corresponding measures to increase production. The volumetric oil measurement technology using dynamometer cards can also be used to optimize the water injection process to ensure that the water injection volume and injection rate match the output of the oil well, thereby improving the recovery rate and efficiency.

[0003] Traditional volumetric oil measurement technology using dynamometer cards is based on the theoretical dynamometer card of the plunger pump. It uses a one-dimensional damped wave equation to realize the conversion between the surface dynamometer card and the downhole pump dynamometer card. According to the pump dynamometer card, the closing point positions of the traveling valve and the fixed valve are determined, and then the leakage volume, filling degree and pump efficiency of the pump valve are quantitatively calculated. Then, according to the obtained valve point opening and closing positions, the quantitatively analyzed effective stroke and loss of the plunger, and the leakage volume of the pump body, etc., the daily liquid production of the rod pumped well is calculated.

[0004] The volumetric oil measurement technology using dynamometer cards is widely used in oilfield production because of its advantages such as no need to build a surface metering station, low engineering investment and the ability to realize real-time oil well production metering. However, the theoretical reasoning of traditional volumetric oil measurement is too ideal. In the process of quantitative calculation, due to unavoidable errors, there is a large error between the variable and the true value, which has become an insurmountable problem in theoretical calculation, and the problem of low accuracy of conventional volumetric oil measurement using dynamometer cards has gradually emerged. Summary of the Invention

[0005] In order to better realize the prediction of the daily liquid production of a rod pumped well, the embodiments of the present application provide a method, a prediction method and a device for training a daily liquid production prediction model of a rod pumped well.

[0006] In a first aspect, the embodiments of the present application provide a method for training a daily liquid production prediction model of a rod pumped well, the method including:

[0007] For each rod pumped well, convert the pre-obtained surface dynamometer cards into downhole pump dynamometer cards, and construct a sample database;

[0008] Based on the sample database, extract the features of each downhole pump dynamometer card, and combine with the pre-obtained production data to construct a basic feature library;

[0009] Based on the principal component analysis method, reduce the dimension of the basic feature library to obtain a reduced-dimensional feature vector;

[0010] Train a first prediction model according to the basic feature library to obtain a first base model;

[0011] Train a second prediction model based on the dimensionality-reduced eigenvector to obtain a second base model;

[0012] Based on the particle swarm optimization algorithm, fuse the first base model and the second base model to obtain a daily liquid production prediction model for rod pumped wells.

[0013] In an alternative embodiment of the present invention, for each pumping well, converting the pre-obtained surface dynamometer cards into downhole pump dynamometer cards includes:

[0014] For each pumping well, based on the one-dimensional wave equation, gradually convert the pre-obtained surface dynamometer cards into the next-level rod dynamometer cards until they are converted into downhole pump dynamometer cards.

[0015] In an alternative embodiment of the present invention, extracting the features of each downhole pump dynamometer card based on the sample database and combining the pre-obtained production data to construct a basic feature library includes:

[0016] Based on the pre-constructed sample database, extract the area of each downhole pump dynamometer card based on the following formula 1:

[0017]

[0018] where, sgts jk is the area of the k-th downhole pump dynamometer card on the j-th well on a certain day; m is the traversal variable; N is the number of data points contained in the curve data of the k-th downhole pump dynamometer card on the j-th well on a certain day; D 1 m is the value of the m-th dynamic load of the k-th downhole pump dynamometer card on the j-th well on a certain day; D 1' m is the dynamic load value calculated based on the interpolation function for the m-th displacement value of the k-th downhole pump dynamometer card on the j-th well on a certain day; U 1 m is the value of the m-th displacement of the k-th downhole pump dynamometer card on the j-th well on a certain day; U 1 m+1 is the value of the (m + 1)-th displacement of the k-th downhole pump dynamometer card on the j-th well on a certain day;

[0019] Based on the pre-constructed sample database, extract the pump filling degree of each downhole pump dynamometer card based on the following formula 2:

[0020]

[0021] where, cmcd jk is the pump filling degree corresponding to the k-th downhole pump dynamometer card on the j-th well on a certain day; s jk_1 is the effective stroke under the downhole pump dynamometer card; s jk_2is the effective stroke on the downhole pump dynamometer card;

[0022] Based on the pre - constructed sample database and the following formula 3, extract the calculated daily liquid production of each downhole pump dynamometer card:

[0023]

[0024] In the formula, jspl jk is the calculated daily liquid production corresponding to the k - th downhole pump dynamometer card of the j - th well on a certain day; Φ j_pump is the diameter of the sucker rod pump used in the j - th well; S jk_pump is the effective stroke of the pump corresponding to the k - th downhole pump dynamometer card of the j - th well on a certain day; CC jk is the pumping speed corresponding to the k - th downhole pump dynamometer card of the j - th well on a certain day; t j_prod is the production time of the j - th well on a certain day; I jk is the pump leakage coefficient corresponding to the k - th downhole pump dynamometer card of the j - th well on a certain day;

[0025] According to the area, pump filling degree, calculated daily liquid production and pump effective stroke of each downhole pump dynamometer card, combined with the pre - obtained production data, construct a basic feature library.

[0026] In an optional implementation manner of the embodiment of the present invention, based on the principal component analysis method, reduce the dimension of the basic feature library to obtain a reduced - dimension feature vector, including:

[0027] Convert the basic feature library into a matrix with zero - mean processing, and calculate the covariance matrix of the matrix;

[0028] According to the eigenvectors corresponding to the eigenvalues of the covariance matrix, sort the eigenvectors according to the magnitudes of the corresponding eigenvalues, and select the new matrix with the first preset number of rows as the reduced - dimension feature vector.

[0029] In an optional implementation manner of the embodiment of the present invention, training the first prediction model according to the basic feature library to obtain a first base model includes:

[0030] Input the basic feature library into the first prediction model for training to obtain a daily liquid production prediction result and the trained first prediction model;

[0031] Compare the daily liquid production prediction result with the true daily liquid production result, and update the trained first prediction model;

[0032] Repeat the above training process until the accuracy of the daily liquid production prediction result meets the preset conditions to obtain the first base model.

[0033] In an optional implementation manner of the embodiment of the present invention, update the trained first prediction model through the following method:

[0034] Based on the grid search method, set the value or value range of each hyperparameter to be optimized in the first prediction model, and generate multiple hyperparameter combinations;

[0035] According to the hyperparameter combinations, optimize the hyperparameters of the trained first prediction model.

[0036] In an optional implementation manner of the embodiment of the present invention, the training the second prediction model according to the dimensionality-reduced feature vector to obtain the second base model includes:

[0037] Input the dimensionality-reduced feature vector into the second prediction model for training to obtain the predicted daily liquid production result and the trained second prediction model;

[0038] Compare the predicted daily liquid production result with the actual daily liquid production result, and update the trained second prediction model;

[0039] Repeat the above training process until the accuracy of the predicted daily liquid production result meets the preset condition, and obtain the second base model.

[0040] In an optional implementation manner of the embodiment of the present invention, it further includes:

[0041] Use the hyperparameters of the first base model as the hyperparameters of the second base model.

[0042] In a second aspect, an embodiment of the present application provides a method for predicting the daily liquid production of a rod-pumped oil well, and the method includes:

[0043] For a target oil well, convert the pre-obtained surface dynamometer cards into downhole pump dynamometer cards;

[0044] Extract the features of each downhole pump dynamometer card, and combine with the pre-obtained production data to construct a feature library;

[0045] Input the feature library into the rod-pumped oil well daily liquid production prediction model to obtain the predicted daily liquid production result.

[0046] In a third aspect, an embodiment of the present application provides a training device for a rod-pumped oil well daily liquid production prediction model, and the device includes:

[0047] A first conversion module, configured to convert the pre-obtained surface dynamometer cards into downhole pump dynamometer cards for each oil well to construct a sample database;

[0048] A first extraction module, configured to extract the features of each downhole pump dynamometer card based on the sample database, and combine with the pre-obtained production data to construct a basic feature library;

[0049] A dimensionality reduction module, configured to reduce the dimension of the basic feature library based on the principal component analysis method to obtain a dimensionality-reduced feature vector;

[0050] A first training module, configured to train a first prediction model according to the basic feature library to obtain a first base model;

[0051] A second training module, configured to train a second prediction model according to the dimensionality-reduced feature vector to obtain a second base model;

[0052] A fusion module, configured to fuse the first base model and the second base model based on the particle swarm optimization algorithm to obtain a daily liquid production prediction model for a rod pumping well.

[0053] In a fourth aspect, an embodiment of the present application provides a device for predicting the daily liquid production of a rod pumping well. The device includes:

[0054] A second conversion module, configured to convert each pre-obtained surface dynamometer card into each downhole pump dynamometer card for a target pumping well;

[0055] A second extraction module, configured to extract the features of each downhole pump dynamometer card and construct a feature library in combination with pre-obtained production data;

[0056] A prediction module, configured to input the feature library into the daily liquid production prediction model for a rod pumping well to obtain a predicted result of the daily liquid production.

[0057] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the above-mentioned method for training a daily liquid production prediction model for a rod pumping well, and / or, the method for predicting the daily liquid production of a rod pumping well.

[0058] In a sixth aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the above-mentioned method for training a daily liquid production prediction model for a rod pumping well, and / or, the method for predicting the daily liquid production of a rod pumping well.

[0059] In a seventh aspect, an embodiment of the present application provides a computer program product containing instructions. When the computer program product runs on a computer device, it causes the computer device to execute the above-mentioned method for training a daily liquid production prediction model for a rod pumping well, and / or, the method for predicting the daily liquid production of a rod pumping well.

[0060] In an eighth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is configured to run a computer program or instructions to implement the above-mentioned method for training a daily liquid production prediction model for a rod pumping well, and / or, the method for predicting the daily liquid production of a rod pumping well.

[0061] The beneficial effects of the above technical solutions provided by the embodiments of the present application at least include:

[0062] The training method for the daily liquid production prediction model of a rod pump oil well provided by the embodiment of the present application extracts key points, line features of the downhole pump dynamogram, and oilfield production data to construct a basic feature library, then uses the principal component analysis method to reduce the dimension of the basic feature library to obtain a reduced-dimensional feature vector, and then uses the extreme gradient boosting tree to preliminarily establish and train the daily liquid production prediction model based on the basic feature library and the reduced-dimensional feature vector to obtain the first base model and the second base model. Finally, the particle swarm optimization algorithm is used to fuse the two base models, and finally the daily liquid production prediction model of the rod pump oil well is established. When establishing the model, this method considers many production factors, enabling the model to distinguish the subtle differences between different data, making the model have both high accuracy and strong generalization ability, and good real-time performance, which can greatly improve the accuracy of oil measurement using the dynamogram, and solve the problems of complex calculation process and time consumption of the oil measurement method using the dynamogram; the model established by this method can realize a new liquid production measurement method that integrates a variety of artificial intelligence technologies, with high calculation accuracy, effectively ensuring the need of the on-site production department to control the production volume in real time.

[0063] Other features and advantages of the present application will be described in the subsequent specification, and part of them will become obvious from the specification, or will be understood by implementing the present application. The objectives and other advantages of the present application can be achieved and obtained through the structures specifically pointed out in the written specification, claims, and drawings.

[0064] The technical solutions of the present application will be further described in detail below through the drawings and embodiments. Description of the Drawings

[0065] The drawings are used to provide a further understanding of the present application, and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application, and do not constitute a limitation to the present application; in the drawings:

[0066] Figure 1 It is a schematic diagram of the steps of the training method for the daily liquid production prediction model of a rod pump oil well provided by the embodiment of the present application;

[0067] Figure 2 It is a conversion result diagram of converting the surface dynamogram of a pumping well with a certain secondary rod string into a downhole pump dynamogram provided by the embodiment of the present application;

[0068] Figure 3 It is a schematic diagram for calculating the effective stroke of the pump of a certain pump dynamogram provided by the embodiment of the present application;

[0069] Figure 4 It is a schematic diagram of the process of the particle swarm optimization algorithm provided by the embodiment of the present application;

[0070] Figure 5 Schematic diagram for the optimization iteration of the particle swarm provided by the embodiment of the present application;

[0071] Figure 6 Schematic diagram of the comparison result between the predicted daily liquid production and the actual daily liquid production obtained by using the first base model provided by the embodiment of the present application;

[0072] Figure 7 Schematic diagram of the comparison result between the predicted daily liquid production and the actual daily liquid production obtained by using the second base model provided by the embodiment of the present application;

[0073] Figure 8 Schematic diagram of the comparison result between the predicted daily liquid production and the actual daily liquid production obtained by using the daily liquid production prediction model for rod pumped wells provided by the embodiment of the present application;

[0074] Figure 9 Schematic diagram of the steps of the daily liquid production prediction method for rod pumped wells provided by the embodiment of the present application;

[0075] Figure 10 Schematic diagram of the structure of the training device for the daily liquid production prediction model of rod pumped wells provided by the embodiment of the present application;

[0076] Figure 11 Schematic diagram of the structure of the daily liquid production prediction device for rod pumped wells provided by the embodiment of the present application. Detailed implementation manners

[0077] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are presented to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.

[0078] It should be understood that when used in the specification of the present application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.

[0079] It should also be understood that the term "and / or" used in the specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0080] As used in the specification of this application and the appended claims, the term "if" may be construed, depending on the context, as "when", "once", "in response to determining", or "in response to detecting". Similarly, the phrases "if determined" or "if [the described condition or event] is detected" may be construed, depending on the context, to mean "once determined", "in response to determining", "once [the described condition or event] is detected", or "in response to detecting [the described condition or event]".

[0081] In addition, in the description of the specification of this application and the appended claims, the terms "first", "second", "third", etc. are used only for distinguishing descriptions and cannot be construed as indicating or implying relative importance.

[0082] References to "one embodiment" or "some embodiments" or the like described in the specification of this application mean that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of this application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in another way.

[0083] It should be understood that the magnitudes of the sequence numbers of the steps in the following embodiments do not mean the order of execution is prior or posterior. The order of execution of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.

[0084] To illustrate the technical solution of this application, the following specific embodiments are used for illustration.

[0085] The inventor found that in the prior art, when predicting the daily liquid production of a rod pumping unit using the traditional dynamometer oil measurement method, it is difficult to accurately determine the opening and closing points of the pumping unit when processing the smoothing of the dynamometer card curve, resulting in inaccurate calculation of the effective stroke, low oil measurement accuracy, and the phenomenon that the theoretical reasoning of the traditional dynamometer card is too ideal and there is a large error between the variable and the true value due to unavoidable errors in the quantitative calculation process becoming an insurmountable problem in theoretical calculation. In addition, the dynamometer oil measurement method has problems such as complex calculation process and time-consuming, which do not meet the inventor's expectations. Based on this, the inventor made further research and developed this application to provide a method, a prediction method, and a device for training a daily liquid production prediction model for rod pumping wells.

[0086] Embodiment 1

[0087] The embodiment of the present application provides a method for training a daily liquid production prediction model for a rod-pumped oil well. Refer to Figure 1 As shown, the method includes:

[0088] S101: For each oil well, convert the pre-obtained ground dynamometer cards into downhole pump dynamometer cards, and construct a sample database.

[0089] S102: Based on the sample database, extract the features of each downhole pump dynamometer card, and combine with the pre-obtained production data to construct a basic feature library.

[0090] S103: Based on the principal component analysis method, reduce the dimension of the basic feature library to obtain a reduced-dimensional feature vector.

[0091] S104: Train a first prediction model according to the basic feature library to obtain a first base model.

[0092] S105: Train a second prediction model according to the reduced-dimensional feature vector to obtain a second base model.

[0093] S106: Based on the particle swarm optimization algorithm, fuse the first base model and the second base model to obtain a daily liquid production prediction model for a rod-pumped oil well.

[0094] In the embodiment of the present application, the specific implementation manner of the above step S101 is as follows:

[0095] In the embodiment of the present application, for each oil well, converting the pre-obtained ground dynamometer cards into downhole pump dynamometer cards specifically includes:

[0096] For each oil well, based on the one-dimensional wave equation, gradually convert the pre-obtained ground dynamometer cards into the next-level rod dynamometer cards until they are converted into downhole pump dynamometer cards.

[0097] In the embodiment of the present application, first, extract the dynamometer card data of all the data collected by the Internet of Things for a single well on a single day for preprocessing, and convert the ground dynamometer card measured on the ground into a downhole pump dynamometer card according to the one-dimensional wave equation. When converting the ground dynamometer card into a downhole pump dynamometer card, for an oil well with a single-stage sucker rod, the ground dynamometer card can be directly converted into a downhole pump dynamometer card; for an oil well with a multi-stage sucker rod, it is necessary to perform step-by-step conversion on the multi-stage rods until it is converted into a downhole pump dynamometer card. Among them, the ground dynamometer card can be simply referred to as the dynamometer card, and the downhole pump dynamometer card can be simply referred to as the pump dynamometer card.

[0098] During the conversion process, the displacement and load of each level of dynamometer card are calculated as follows in Formula 4 to Formula 5:

[0099] Among them, the differential equation of the sucker rod movement can be expressed by the following Formula 4:

[0100]

[0101] In the formula, t is the movement time of the sucker rod; x is the distance of the selected infinitesimal element of the sucker rod from the top of the sucker rod; u(x, t) is the displacement of the infinitesimal element at a distance x from the top of the sucker rod; a is the stress wave propagation velocity; c is the damping coefficient.

[0102] To solve the above formula 4, analyze the forces on the sucker rod, and the initial boundary conditions can be obtained as follows in formulas 5 to 6:

[0103] u(x, t)| x=0 = U(t) Formula 5;

[0104] In the formula, U(t) is the polished rod displacement; u(x, t) is the displacement of the infinitesimal element at a distance x from the top of the sucker rod;

[0105]

[0106] In the formula, D(t) is the dynamic load of the polished rod, that is, the difference between the polished rod load and the total weight of the sucker rod; Y is the elastic modulus of the sucker rod; S is the cross-sectional area of the sucker rod; u(x, t) is the displacement of the infinitesimal element at a distance x from the top of the sucker rod; x is the distance of the selected infinitesimal element of the sucker rod from the top of the sucker rod.

[0107] Using the method of separation of variables to solve the above formula 4, the general solution of the equation can be expressed in the form of a Fourier series as shown in the following formula 7:

[0108]

[0109] In the formula, u(x, t) is the displacement of the infinitesimal element at a distance x from the top of the sucker rod; O' 0 (x) is the value of the first derivative of O n (x) at x = 0; O n (x) is the Fourier coefficient; P n (x) is the Fourier coefficient;

[0110] O 0 (x) = ξ + ηx Formula 8;

[0111] In the formula, O 0 (x) is the value of the first derivative of O n (x) at x = 0; ξ is a real constant; η is a real constant; x is the distance of the selected infinitesimal element of the sucker rod from the top of the sucker rod;

[0112] O n (x) = (δ n shβ n x + κ n chβ n x)sinα n (x + (μ nshβ n x + v n chβ n x)cosα n x Formula 9;

[0113] In the formula, O n (x) is the Fourier coefficient; δ n , κ n , μ n , ν n are all integration constants; x is the distance of the taken sucker rod micro - element from the top of the sucker rod; α n is an intermediate variable; β n is an intermediate variable;

[0114] P n (x) = (δ n chβ n x + κ n shβ n x)cosα n x - (μ n chβ n x + v n shβ n x)sinα n x Formula 10;

[0115] In the formula, P n (x) is; δ n , κ n , μ n , ν n are all integration constants; x is the distance of the taken sucker rod micro - element from the top of the sucker rod; α n is an intermediate variable; β n is an intermediate variable;

[0116]

[0117] In the formula, α n is an intermediate variable; ω is the angular velocity; n is the Fourier series, taking values of 1, 2, 3...; a is the stress wave propagation velocity; c is the damping coefficient;

[0118]

[0119] In the formula, β n is an intermediate variable; ω is the angular velocity; n is the Fourier series, taking values of 1, 2, 3...; a is the stress wave propagation velocity; c is the damping coefficient.

[0120] Substitute the above Formula 7 into the initial boundary condition, that is, the above Formula 5, expand U(t) according to the Fourier series, and obtain the following Formula 13:

[0121]

[0122] In the formula, where where

[0123] Similarly, substituting the above formula (7) into the initial boundary condition, i.e., the above formula (5), and expanding D(t) in terms of Fourier series, the following formula (14) is obtained:

[0124]

[0125] In the formula,

[0126] From the above formula (13) to formula (14), the following formula (15) to formula (22) can be obtained:

[0127] ξ = N 0 Formula (15);

[0128] In the formula, ξ is a real constant; N 0 is the expression of N when n takes 0 n ;

[0129] O n (0) = N n Formula (16);

[0130] In the formula, O n (0) is the expression of O n (x) when x takes 0; N n is the Fourier coefficient;

[0131] P n (0) = Δ n Formula (17);

[0132] In the formula, P n (0) is the expression of P n (x) when x takes 0; Δ n is the Fourier coefficient;

[0133] v n = N n Formula (18);

[0134] In the formula, v n is the integration constant; N n is the Fourier coefficient;

[0135] δ n = Δ n Formula (19);

[0136] In the formula, δ n is the integration constant; Δ n is the Fourier coefficient;

[0137]

[0138] In the formula, η is a real constant; Y is the elastic modulus of the sucker rod; S is the cross-sectional area of the sucker rod; σ 0 is the expression of σ when n takes 0; n

[0139]

[0140] In the formula, O' n (0) is the value of the first derivative of O n (x) at x = 0; Y is the elastic modulus of the sucker rod; S is the cross-sectional area of the sucker rod; σ n is the expression of σ when n takes 0; n

[0141]

[0142] In the formula, P' n (0) is the value of the first derivative of P n (x) at x = 0; Y is the elastic modulus of the sucker rod; S is the cross-sectional area of the sucker rod; τ n is the Fourier coefficient.

[0143] Substitute the above formulas 15 to 22 into the identical equation, that is, the above formula 7, to obtain the force equation at any point x of the single-stage sucker rod, as shown in the following formula 23:

[0144]

[0145] In the formula, F(x, t) is the force at any point x of the single-stage sucker rod; Y is the elastic modulus of the sucker rod; S is the cross-sectional area of the sucker rod; m is the given Fourier series; O' 0 (x) is the value of the first derivative of O n (x) at x = 0; O n (x) is the Fourier coefficient; P n (x) is the Fourier coefficient.

[0146] In the above formulas 7 to 23, O n (x), O' 0 (x), P n (x), α n and β n are all intermediate variables in the process of solving the equation. For the specific calculation method, refer to the corresponding formula.

[0147] ​​For a pumping well with a multi-stage rod string, when calculating the force at any point x of the sucker rod, the displacement and dynamic load function at the end of the upper-stage rod string can be used as the initial boundary conditions for the lower-stage rod string. According to the conversion process of the above formulas 4 to 23, the conversion from the surface dynamometer card to the downhole pump dynamometer card is completed.

[0148] In a specific embodiment, the surface dynamometer card of a pumping well with a two-stage rod string is converted into a downhole pump dynamometer card, and the converted result diagram is as Figure 2 shown. From top to bottom are the interval ranges of displacement and load of the surface dynamometer card, the second-stage rod dynamometer card, and the downhole pump dynamometer card.

[0149] After converting each surface dynamometer card of a single well into a downhole pump dynamometer card, the daily liquid production rate corresponding to the data of each surface dynamometer card can be converted based on the average effective stroke of the pump per day for a single well, that is, the converted daily liquid production volume of a single well is determined. Before calculating the average effective stroke of the pump per day for a single well, the effective stroke of the pump is first determined according to the upper and lower effective strokes of the downhole pump dynamometer card.

[0150] Among them, according to the opening and closing distances of the traveling valve of the pump dynamometer card, the lower effective stroke of the downhole pump dynamometer card can be calculated by the following formula 24:

[0151] s 1 =l 12 -l 11 Formula 24;

[0152] In the formula, s 1 is the lower effective stroke of the downhole pump dynamometer card; l 12 is the opening distance of the traveling valve of the downhole pump dynamometer card; l 11 is the closing distance of the traveling valve of the downhole pump dynamometer card;

[0153] According to the opening and closing distances of the fixed valve of the pump dynamometer card, the upper effective stroke of the downhole pump dynamometer card can be calculated by the following formula 25:

[0154] s 2 =l’ 12 -l‘ 11 Formula 25;

[0155] In the formula, s 2 is the upper effective stroke of the downhole pump dynamometer card; l' 12 is the closing distance of the fixed valve of the downhole pump dynamometer card; l' 11 is the opening distance of the fixed valve of the downhole pump dynamometer card;

[0156] Based on the lower effective stroke and upper effective stroke of the downhole pump dynamometer card obtained from the above formulas 24 and 25, the effective stroke of the downhole pump dynamometer card can be determined by the following formula 26:

[0157] s pump= min{s 1 , s 2} Formula 26;

[0158] Wherein, s pump is the effective stroke of the downhole pump dynamometer card; s 1 is the lower effective stroke of the downhole pump dynamometer card; s 2 is the upper effective stroke of the downhole pump dynamometer card.

[0159] The above Formulas 24 to 26 are general algorithms for obtaining the effective stroke of the downhole pump dynamometer card, and the effective stroke of the pump corresponding to each surface dynamometer card of each pumping well on a certain day can be obtained. As Figure 3 shown in the schematic diagram of calculating the effective stroke of the pump of a certain pump dynamometer card, where l' 12 is the closing distance of the fixed valve of the downhole pump dynamometer card, l' 11 is the opening distance of the fixed valve of the downhole pump dynamometer card, l 12 is the opening distance of the traveling valve of the downhole pump dynamometer card, l 11 is the closing distance of the traveling valve of the downhole pump dynamometer card. Substituting these data into the above Formulas 24 to 26, the effective stroke of the pump of this pump dynamometer card can be determined.

[0160] After determining the effective stroke of the pump of the downhole pump dynamometer card, through the following Formula 27, calculate the mean value of the effective strokes of the pumps corresponding to all dynamometer cards of a single well on a single day, that is, the average pump effective stroke of a single well on a single day:

[0161]

[0162] Wherein, is the average pump effective stroke of the j-th well on a certain day; M is the total number of dynamometer cards recorded for the j-th well on a certain day; k is a traversal variable, taking values of 1, 2... M; s jk_pump is the effective stroke of the pump corresponding to the k-th dynamometer card of the j-th well on a certain day;

[0163] According to the obtained average pump effective stroke of a single well on a single day, through the following Formula 28, convert the daily liquid production rate corresponding to each surface dynamometer card of a single well on a single day, that is, the instantaneous daily liquid production:

[0164]

[0165] Wherein, Q jk is the daily liquid production rate corresponding to the data of the k-th surface dynamometer card of the j-th well on a certain day; Q j is the daily liquid production volume recorded by the oilfield for the j-th well on a certain day; t j_prod is the production time recorded by the oilfield for the j-th well on a certain day; s jk_pump is the effective stroke of the pump corresponding to the k-th surface dynamometer card of the j-th well on a certain day; is the average effective stroke of the pump on a certain day for the j-th well. Among them, the daily liquid production volume recorded in the oilfield for the j-th well on a certain day can obtain the true daily liquid production volume data according to the actual recording situation, and then convert the daily liquid production rate corresponding to each surface dynamometer card data for the j-th well on a certain day, which is used as the training target value for subsequent model training.

[0166] In the embodiment of the present application, the oil well data collected in the oilfield operation area is preprocessed according to the above formulas 4 to 28, and the data with different collection frequencies is unified, and then the construction of the sample database can be completed. The constructed sample database contains each surface dynamometer card data and the corresponding converted daily liquid production rate for each pumping well on a certain day.

[0167] In the embodiment of the present application, the specific implementation manner of the above step S102 is as follows:

[0168] In the above step S102, extracting the features of each downhole pump dynamometer card based on the sample database and combining the pre-obtained production data to construct a basic feature library specifically includes:

[0169] Based on the pre-constructed sample database, the area of each downhole pump dynamometer card is extracted according to the following formula 1:

[0170]

[0171] In the formula, sgts jk is the area of the k-th downhole pump dynamometer card for the j-th well on a certain day; m is a traversal variable; N is the number of data points contained in the curve data of the k-th downhole pump dynamometer card for the j-th well on a certain day; D 1 m is the value of the m-th dynamic load of the k-th downhole pump dynamometer card for the j-th well on a certain day; D 1' m is the dynamic load value calculated based on the interpolation function for the m-th displacement of the k-th downhole pump dynamometer card for the j-th well on a certain day; U 1 m is the value of the m-th displacement of the k-th downhole pump dynamometer card for the j-th well on a certain day; U 1 m+1 is the value of the (m + 1)-th displacement of the k-th downhole pump dynamometer card for the j-th well on a certain day;

[0172] Based on the pre-constructed sample database, the pump filling degree of each downhole pump dynamometer card is extracted according to the following formula 2:

[0173]

[0174] In the formula, cmcd jk is the pump filling degree corresponding to the k-th downhole pump dynamometer card for the j-th well on a certain day; s jk_1 is the effective stroke under the downhole pump dynamometer card; s jk_2is the effective stroke on the downhole pump dynamometer card;

[0175] Based on the pre - constructed sample database and according to Formula 3 below, extract the calculated daily liquid production of each downhole pump dynamometer card:

[0176]

[0177] In the formula, jspl jk is the calculated daily liquid production corresponding to the k - th downhole pump dynamometer card of the j - th well on a certain day; Φ j_pump is the diameter of the sucker rod pump used in the j - th well; S jk_pump is the effective stroke of the pump corresponding to the k - th downhole pump dynamometer card of the j - th well on a certain day; CC jk is the stroke frequency corresponding to the k - th downhole pump dynamometer card of the j - th well on a certain day; t j_prod is the production time of the j - th well on a certain day; I jk is the pump leakage coefficient corresponding to the k - th downhole pump dynamometer card of the j - th well on a certain day;

[0178] According to the area, pump filling degree, calculated daily liquid production and effective stroke of the pump of each downhole pump dynamometer card, combined with the pre - obtained production data, construct a basic feature library.

[0179] In the embodiments of the present application, for the data in the constructed sample database, select the features of the oil well dynamometer card and production data. By extracting the features of each surface dynamometer card and combining the selected production data, construct a basic feature library.

[0180] In the embodiments of the present application, according to the displacement and load of the downhole pump dynamometer card corresponding to each surface dynamometer card calculated in step S101 above, obtain the downhole pump dynamometer card curve data of the oil well. When extracting the features of each downhole pump dynamometer card, taking the calculation of the k - th downhole pump dynamometer card of the j - th well on a certain day as an example, extract the area of each downhole pump dynamometer card through Formula 1 above, extract the pump filling degree corresponding to each downhole pump dynamometer card through Formula 2 above, extract the calculated daily liquid production corresponding to each downhole pump dynamometer card through Formula 3 above, and also extract the effective stroke of the pump of each downhole pump dynamometer card through step S101 above.

[0181] In Formula 1 above, D 1 is the set of dynamic loads of the k - th pump dynamometer card of the j - th well on a certain day, arranged in the order of the load at the index of the minimum displacement point to the load at the index of the maximum displacement point, denoted as D 1 ={D|D is min ,...D m ...,D is max , m ∈ [is min, is max]}, where ismin is the index of the minimum displacement point of the pump dynamometer card and ismax is the index of the maximum displacement point of the pump dynamometer card; U 1Let \(U\) be the displacement set of the \(k\)-th pump dynamometer card of the \(j\)-th well on a certain day, arranged from the displacement at the index of the minimum displacement point to the displacement at the index of the maximum displacement point, denoted as \(U\). 1 =\(\{U|U is min ,\cdots,U m ,\cdots,U is max ,m\in[is\ min,is\ max]\}\); \(D 1' is calculated by the following formula 29:

[0182] D 1' =f(U 1 ) Formula 29;

[0183] In the formula, \(D 1' is the pump dynamometer card load sequence calculated according to the interpolation function \(f\) from the pump dynamometer card displacement sequence; \(U 1 is the displacement set of the \(k\)-th pump dynamometer card of the \(j\)-th well on a certain day; the function \(f\) is calculated by the following formula 30:

[0184] f = interp1d(D 2 ,U 2 ) Formula 30;

[0185] In the formula, interp1d is one-dimensional linear interpolation; \(D 2 is the dynamic load set of the \(k\)-th pump dynamometer card of the \(j\)-th well on a certain day, arranged from the load at the index of the maximum displacement point to the load at the index of the minimum displacement point, denoted as \(D 2 =\(\{D|D is max ,\cdots,D m \cdots,D is min ,m\in[is\ min,is\ max]\}\); \(U 2 is the displacement set of the \(k\)-th pump dynamometer card of the \(j\)-th well on a certain day, arranged from the displacement at the index of the maximum displacement point to the displacement at the index of the minimum displacement point, denoted as \(U 2 =\(\{U|U is max ,\cdots,U m \cdots,U is min ,m\in[is\ min,is\ max]\}\).

[0186] In the above formula 3, \(I jk is the pump leakage coefficient corresponding to the \(k\)-th pump dynamometer card of the \(j\)-th well on a certain day, which can be calculated by the following formula 31:

[0187]

[0188] In the formula, \(I jk is the pump leakage coefficient corresponding to the \(k\)-th pump dynamometer card of the \(j\)-th well on a certain day; \(\Upsilon jk_1is the included angle between the line connecting the minimum load point of the pump dynamometer card and the opening point of the traveling valve of the pump dynamometer card and the horizontal direction; Υ jk_2 is the slope between the minimum load point of the pump dynamometer card and the closing point of the traveling valve of the pump dynamometer card.

[0189] In the embodiments of the present application, the area, pump filling degree, calculated daily liquid production volume, and effective pump stroke of each downhole pump dynamometer card are extracted. Among them, the specific process of extracting the effective pump stroke refers to step S101. After step S101, the effective stroke s under the pump dynamometer card can be obtained 1 , the effective stroke s on the pump dynamometer card 2 , the effective stroke s of the pump dynamometer card pump , the closing distance l of the traveling valve of the pump dynamometer card 11 , the opening distance l′ of the fixed valve of the pump dynamometer card 11 , the opening distance l of the traveling valve of the pump dynamometer card 12 and the closing distance l′ of the fixed valve of the pump dynamometer card 12 .

[0190] Combining the above-extracted features with the oil pressure, casing pressure, pump diameter, stroke, pumping speed, water cut, liquid level depth, maximum current, minimum current, average active power, and average power factor to complete the construction of the basic feature library of the oil well. The basic feature library of the oil well is denoted as DBS = {F|F jk ∈well jk}, where F is the set of all sample features; jk is the kth pump dynamometer card of the jth well; well jk represents all the information of the oil well to which the kth pump dynamometer card of the jth well belongs; F jk is all the features corresponding to the kth pump dynamometer card of the jth well, as shown in the following formula 32:

[0191] F jk = {sgts jk , s jk_pump , cmcd jk , jspl jk , yy jk , ty jk , cch jk , cc jk , w jk , h jk , DDL jk , XDL jk , PJYGGL jk , PJGLYS jk} Formula 32;

[0192] In the formula, sgts j is the area of the kth pump dynamometer card of the jth well on a certain day; s jk_pump is the effective pump stroke corresponding to the kth dynamometer card of the jth well on a certain day; cmcd jkis the degree of pump filling corresponding to the k-th pump dynamometer card of the j-th well on a certain day; jspl jk is the calculated daily liquid production corresponding to the k-th pump dynamometer card of the j-th well on a certain day; yy jk is the tubing pressure corresponding to the k-th pump dynamometer card of the j-th well; ty jk is the casing pressure corresponding to the k-th pump dynamometer card of the j-th well; cch jk is the stroke corresponding to the k-th pump dynamometer card of the j-th well; cc jk is the pumping speed corresponding to the k-th pump card of the j-th well; w jk is the water cut corresponding to the k-th pump dynamometer card of the j-th well; h jk is the liquid level depth corresponding to the k-th pump dynamometer card of the j-th well; DDL jk is the maximum current corresponding to the k-th pump dynamometer card of the j-th well; XDL jk is the minimum current corresponding to the k-th pump dynamometer card of the j-th well; PJYGGL jk is the average active power corresponding to the k-th pump dynamometer card of the j-th well; PJGLYS jk is the average power factor corresponding to the k-th pump dynamometer card of the j-th well.

[0193] In the embodiment of the present application, the specific implementation manner of the above step S103 is as follows:

[0194] In the above step S103, based on the principal component analysis method, reducing the dimension of the basic feature library to obtain a reduced-dimensional feature vector specifically includes:

[0195] Converting the basic feature library into a matrix with zero-mean processing, and calculating the covariance matrix of the matrix;

[0196] According to the eigenvectors corresponding to the eigenvalues of the covariance matrix, sorting the eigenvectors according to the magnitudes of the corresponding eigenvalues, and selecting the new matrix of the first preset number of rows as the reduced-dimensional feature vector.

[0197] In the embodiment of the present application, the basic feature library is organized into a matrix X with Γ rows and 14 columns, where Γ is the total amount of basic feature library data. Then, zero-mean processing is performed on each row of the matrix X. Taking the zero-mean processing of the first row of data as an example, the processing is performed through the following method:

[0198] Calculating the mean value of all data in the first row of the matrix X through the following formula 33:

[0199]

[0200] In the formula, is the mean value of all data in the first row of the matrix X; g is a traversal variable, taking values of 1, 2... 14; X 1g is the value of the g-th column in the first row of the matrix X.

[0201] According to the mean value of all the data in the first row of matrix X, the data after zero-mean processing of all the data in the first row of matrix X is calculated through the following formula 34:

[0202]

[0203] In the formula, X' 1g is the data after zero-mean processing of X 1g ; is the mean value of all the data in the first row of matrix X; X 1g is the value of the g-th column in the first row of matrix X.

[0204] Through the calculations of the above formula 33 and formula 34, the data in each row of matrix X is subjected to zero-mean processing, and the de-meaned matrix, denoted as X', can be obtained. The covariance matrix of the matrix X' after zero-mean processing is calculated through the following formula 35:

[0205]

[0206] In the formula, cov is the covariance matrix of matrix X'; X' T is the transpose of X'; X' is the matrix after zero-mean processing.

[0207] After calculating the covariance matrix, through the following formula 36 to formula 38, the eigenvalues and the corresponding eigenvectors of the covariance matrix are calculated:

[0208] For the covariance matrix cov, there must exist a non-zero vector θ that satisfies the following formula 36:

[0209]

[0210] In the formula, θ is the eigenvector of the covariance matrix cov; is an eigenvalue of the covariance matrix cov; cov is the covariance matrix;

[0211] According to the above formula 36, the following formula 37 is further obtained:

[0212]

[0213] In the formula, cov is the covariance matrix; is an eigenvalue of the covariance matrix cov; E is the identity matrix;

[0214] By solving the value of the determinant to further determine the eigenvalue of the solution, and substituting the already calculated eigenvalue into the following formula 38:

[0215]

[0216] where cov is the covariance matrix; is an eigenvalue of the covariance matrix cov; θ is the eigenvector of the covariance matrix cov; E is the identity matrix;

[0217] The θ solved according to the above formula 38 is the eigenvector corresponding to the current eigenvalue. Then, the eigenvectors are sorted from top to bottom according to the magnitudes of their corresponding eigenvalues, and the first l rows are taken to form a new matrix X new , thus, the 14-dimensional eigenvector has been reduced to an l-dimensional eigenvector through the principal component analysis method, that is, the reduced-dimensional eigenvector is obtained.

[0218] In the embodiment of the present application, the specific implementation manner of the above step S104 is as follows:

[0219] In the above step S104, the training of the first prediction model based on the basic feature library to obtain the first base model specifically includes:

[0220] Input the basic feature library into the first prediction model for training to obtain the predicted daily liquid production result and the trained first prediction model;

[0221] Compare the predicted daily liquid production result with the actual daily liquid production result, and update the trained first prediction model;

[0222] Repeat the above training process until the accuracy of the predicted daily liquid production result meets the preset conditions to obtain the first base model.

[0223] In the embodiment of the present application, the trained first prediction model is updated in the following manner:

[0224] Based on the grid search method, set the values or value ranges of each hyperparameter to be optimized in the first prediction model to generate multiple hyperparameter combinations;

[0225] According to the hyperparameter combinations, optimize the hyperparameters of the trained first prediction model.

[0226] In the embodiment of the present application, when using the basic feature library to train the first prediction model, the specific establishment and training steps of the first prediction model, that is, the daily liquid production prediction model model_base for rod pumping wells, are as follows:

[0227] ① Determine the input and output of the first prediction model:

[0228] The input of model_base is the basic feature library, and the output of the model is the column vector composed of the converted daily liquid production corresponding to each feature data;

[0229] ② Determine the algorithm and basic parameters of the first prediction model:

[0230] The xgboost version 1.5.0 can be used to build the first prediction model based on the extreme gradient boosting algorithm (eXtreme Gradient Boosting, xgboost).

[0231] During the training process of the first prediction model, the basic parameters include the model learning rate (learning_rate ∈ (0, 1)), the maximum depth of the tree (max_depth ∈ [3, 10]), the total number of iterations (n_estimators ∈ (0, ∞)), the minimum sample weight for splitting (min_child_weight ∈ (0, ∞)), the penalty term coefficient (gamma ∈ [0, ∞)), the sample usage rate (subsample ∈ (0, 1)), and the feature usage rate (colsample_btree ∈ (0, 1)).

[0232] ③ Hyperparameter optimization of the first prediction model:

[0233] To improve the performance of the first prediction model, the grid search method is used for hyperparameter optimization of the first prediction model. By setting the values or value ranges of each hyperparameter to be optimized in the first prediction model, multiple scenarios are generated to obtain multiple hyperparameter combinations. During the model training process, according to the prediction results of the first prediction model, the trained first prediction model is updated and optimized through these hyperparameter combinations, and the optimal parameter combination scheme is determined from them. At the same time, the daily liquid production prediction model model_base is trained, that is, the first base model is obtained.

[0234] In the embodiment of the present application, the specific implementation manner of the above step S105 is as follows:

[0235] In the embodiment of the present application, the training the second prediction model according to the dimensionality-reduced feature vector to obtain the second base model specifically includes:

[0236] Input the dimensionality-reduced feature vector into the second prediction model for training to obtain the daily liquid production prediction result and the trained second prediction model;

[0237] Compare the daily liquid production prediction result with the actual daily liquid production result, and update the trained second prediction model;

[0238] Repeat the above training process until the accuracy of the daily liquid production prediction result meets the preset conditions to obtain the second base model.

[0239] In the embodiment of the present application, during the process of training the second prediction model according to the dimensionality-reduced feature vector to obtain the second base model, it further includes:

[0240] Use the hyperparameters of the first base model as the hyperparameters of the second base model.

[0241] In the embodiments of the present application, the second prediction model is trained using the principal component analysis dimensionality reduction features, i.e., the dimensionality reduction feature vectors. The establishment and training process of the second prediction model, namely the daily liquid production prediction model model_pca for rod pumping wells, are specifically as follows:

[0242] ① Determine the input and output of the second prediction model:

[0243] The input of model_pca is a 4-dimensional column vector after principal component analysis dimensionality reduction, and the model output is a column vector of the converted daily liquid production composition corresponding to each feature data;

[0244] ② Training of the second prediction model:

[0245] Input the dimensionality reduction feature vectors into the second prediction model for training to obtain the daily liquid production prediction results and the trained second prediction model. Then, based on the comparison between the prediction results and the true results, determine whether the prediction accuracy of the second prediction model meets the preset conditions. Repeat the above training process until the accuracy of the daily liquid production prediction results meets the preset conditions to obtain the second base model. When establishing model_pca, directly use the values of the optimized hyperparameters of model_base, that is, directly use the hyperparameters of the first base model as the hyperparameters of the second base model.

[0246] So far, the establishment of two daily liquid production prediction base models is completed. The hyperparameter values of these two models are the same, but the inputs of the models are different during model training. Therefore, the finally trained models are still two different models.

[0247] In the embodiments of the present application, the specific implementation manner of the above step S106 is as follows:

[0248] In the embodiments of the present application, after obtaining the first base model and the second base model, the two base models need to be fused. The particle swarm optimization algorithm can be used for fusion to obtain the final daily liquid production prediction model for rod pumping wells. Among them, the particle swarm optimization algorithm is inspired by the behavior characteristics of biological populations and is used to solve optimization problems. Each particle can be regarded as a search individual in a specific dimensional space. The current position of the particle is a candidate solution to the optimization problem, and the flight process of the particle corresponds to the search process of the individual. The flight speed of the particle is dynamically adjusted by the particle's historical optimal position and the population's historical optimal position. Each particle has two basic attributes: speed and position; speed represents how fast the particle moves, and position indicates the direction of the particle's movement. The optimal solution searched by each particle alone is called the individual extreme value, and the optimal individual extreme value in the particle swarm is the global optimal solution under the current situation. Through continuous iteration of the particles until the termination condition is met, the optimal solution is obtained. As Figure 4 shown, it is a flow chart of the particle swarm optimization algorithm. The specific steps of the particle swarm optimization in the figure are as follows:

[0249] ① Initialize the particle swarm:

[0250] When initializing the particle swarm, it is necessary to determine the maximum number of iterations, the number of independent variables of the objective function, the maximum velocity of the particles, the search space, and randomly initialize the initial velocities and positions of all particles within the velocity range and search space.

[0251] ② Calculate the fitness of each particle and update the individual historical optimal solution and the global optimal solution of the population:

[0252] Define the fitness function, calculate the fitness value corresponding to each particle, the individual extreme value is the optimal solution found by each particle, find the current-step global optimal solution from these optimal solutions, and compare it with the historical global optimal solution. If the current-step optimal solution is better than the previous-step global optimal solution, then update the global optimal solution; otherwise, the global optimal solution remains unchanged. As Figure 5 shown, it is a schematic diagram of the particle swarm performing optimization iteration.

[0253] ③ Update the particle velocity and particle position:

[0254] Calculate the particle velocity through the following formula 39:

[0255]

[0256] In the formula, is the velocity magnitude of the d-th dimension of the i-th particle at the ρ-th generation; is the acceleration constant, representing the learning factor of each particle's individual, generally taking is the acceleration constant, representing the social factor of each particle, generally taking ψ 1 , ψ 2 are two random numbers, with a value range of [0, 1], used to increase the randomness of the search; Ω is the inertia factor, non-negative. When the value is larger, the global search ability is strong and the local optimization ability is weak. When the value is smaller, the global search ability is weak and the local optimization ability is strong; ρ represents the generation of iteration; pbest id is the d-th dimension of the individual extreme value of the i-th variable; gbest d is the d-th dimension of the global optimal solution.

[0257] Calculate the particle position through the following formula 40:

[0258]

[0259] In the formula, is the position magnitude of the d-th dimension of the i-th particle at the ρ-th generation; is the position magnitude of the d-th dimension of the i-th particle at the (ρ - 1)-th generation; is the magnitude of the velocity of the $i$-th particle in the $d$-th dimension at the $\rho$-th generation.

[0260] ④ Determine whether the maximum number of iterations or global convergence is reached. If so, end the particle swarm optimization; if not, continue to calculate the fitness of each particle, and update the individual historical optimal solution and the global optimal solution.

[0261] Taking the outputs of the first base model model_base and the second base model model_pca as independent variables, and minimizing the relative error of the daily liquid production prediction as the objective function, through particle swarm optimization, the weights of model_base and model_pca can be determined, and the fusion of the two base models can be realized in the particle swarm optimization algorithm. Thus, the establishment of the daily liquid production prediction model for rod pumping wells is completed.

[0262] As Figure 6 shown, it is a schematic diagram of the comparison results between the predicted daily liquid production and the actual daily liquid production after using the first base model model_base for multiple daily liquid production predictions. The diagonal line in the figure indicates that the predicted daily liquid production is equal to the actual daily liquid production. The points closer to the diagonal line indicate higher prediction accuracy. It can be statistically obtained that the relative error of the prediction results of the first base model model_base is 12%; as Figure 7 shown, it is a schematic diagram of the comparison results between the predicted daily liquid production and the actual daily liquid production after using the second base model model_pca for multiple daily liquid production predictions. It can be statistically obtained that the relative error of the prediction results of the second base model model_pca is 18%; as Figure 8 shown, it is a schematic diagram of the comparison results between the predicted daily liquid production and the actual daily liquid production after using the fused daily liquid production prediction model for rod pumping wells for multiple daily liquid production predictions. It can be statistically obtained that the relative error of the prediction results of the daily liquid production prediction model model_pso for rod pumping wells is 8%. From Figure 6 , Figure 7 and Figure 8 it can be seen that the daily liquid production prediction model for rod pumping wells obtained by fusing the first base model and the second base model has the highest accuracy in predicting the daily liquid production. Since the daily liquid production prediction model for rod pumping wells is established by combining machine learning models and big data analysis algorithms, a non-linear mapping relationship between the learning and fitting production parameters, the geometric parameters of the pump dynamometer card, and the target is established, overcoming the limitations of poor accuracy of conventional algorithms under special working conditions and between different oil wells. The calculation results obtained through the model have a significantly higher accuracy compared to conventional methods.

[0263] In a specific embodiment, 120 rod-pumped wells with stable production were randomly selected, and the daily liquid production of rod-pumped wells was calculated using the daily liquid production model established by the method of the present invention for 30 consecutive days. By comparing the predicted values with the actual production values, it can be found that 71% of the data has an accuracy rate greater than 93%, and 95% of the data has an accuracy rate greater than 90%. That is, the comprehensive average accuracy rate of the daily liquid production model of the rod-pumped well is 93.04%. And the accurate prediction of the liquid production can improve the ability of the oilfield development site to monitor the production status of the oil well, understand the liquid production status of the oil well in real time, and realize the efficient monitoring of the oil well production.

[0264] The method for training the daily liquid production prediction model of a rod-pumped well provided by the embodiment of the present application constructs a basic feature library by extracting key points, line features of the downhole pump dynamogram and oilfield production data, then uses the principal component analysis method to reduce the dimension of the basic feature library to obtain a reduced-dimensional feature vector, and then uses the extreme gradient boosting tree to preliminarily establish and train the daily liquid production prediction model based on the basic feature library and the reduced-dimensional feature vector to obtain the first base model and the second base model. Finally, the particle swarm optimization algorithm is used to fuse the two base models, and finally the daily liquid production prediction model of the rod-pumped well is established. When establishing the model by this method, many production factors are considered, so that the model can distinguish the subtle differences between different data, and the model can have both high accuracy and strong generalization ability, and has good real-time performance, which can greatly improve the accuracy of measuring the liquid production by the dynamogram method and solve the problems such as complex calculation process and time-consuming of the dynamogram method for measuring liquid production; the model established by this method can realize a new method for measuring the liquid production by integrating a variety of artificial intelligence technologies, with high calculation accuracy, effectively ensuring the need of the on-site production department to control the production in real time.

[0265] Embodiment 2

[0266] Based on the same inventive concept, the embodiment of the present application also provides a method for predicting the daily liquid production of a rod-pumped well. Referring to Figure 9 as shown, this method includes:

[0267] S201: For the target pumping well, convert each pre-obtained surface dynamogram into each downhole pump dynamogram.

[0268] S202: Extract the features of each downhole pump dynamogram, and combine with the pre-obtained production data to construct a feature library.

[0269] S203: Input the feature library into the daily liquid production prediction model of the rod-pumped well to obtain the predicted result of the daily liquid production.

[0270] For the specific implementation manners of the above steps S201 to S202, reference may be made to the method of converting the surface dynamogram into the downhole pump dynamogram and constructing the basic feature library in Embodiment 1, which will not be elaborated here.

[0271] In the embodiments of the present application, the daily liquid production prediction model of the rod pump oil well is applied to the oil field site, and the data of the oil field site is collected in real time. By connecting to the oil field database, the real-time production data of the oil field can be obtained, and the daily liquid production of the oil well can be monitored in real time using the daily liquid production prediction model of the rod pump oil well.

[0272] Embodiment III

[0273] Based on the same inventive concept, the embodiments of the present application further provide a training device for the daily liquid production prediction model of the rod pump oil well. Referring to Figure 10 as shown, the device includes:

[0274] The first conversion module 101 is used to convert the pre-obtained surface dynamometer cards of each oil well into downhole pump dynamometer cards for each oil well, and construct a sample database;

[0275] The first extraction module 102 is used to extract the features of each downhole pump dynamometer card based on the sample database, and combine the pre-obtained production data to construct a basic feature library;

[0276] The dimensionality reduction module 103 is used to reduce the dimensionality of the basic feature library based on the principal component analysis method to obtain a dimensionality-reduced feature vector;

[0277] The first training module 104 is used to train the first prediction model according to the basic feature library to obtain the first base model;

[0278] The second training module 105 is used to train the second prediction model according to the dimensionality-reduced feature vector to obtain the second base model;

[0279] The fusion module 106 is used to fuse the first base model and the second base model based on the particle swarm optimization algorithm to obtain the daily liquid production prediction model of the rod pump oil well.

[0280] Embodiment IV

[0281] Based on the same inventive concept, the embodiments of the present application further provide a daily liquid production prediction device for the rod pump oil well. Referring to Figure 11 as shown, the device includes:

[0282] The second conversion module 201 is used to convert the pre-obtained surface dynamometer cards of each oil well into downhole pump dynamometer cards for the target oil well;

[0283] The second extraction module 202 is used to extract the features of each downhole pump dynamometer card, and combine the pre-obtained production data to construct a feature library;

[0284] The prediction module 203 is used to input the feature library into the daily liquid production prediction model of the rod pump oil well to obtain the prediction result of the daily liquid production.

[0285] Embodiment V

[0286] Based on the same inventive concept, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the method for training the daily liquid production prediction model of a rod pump oil well as described in the first embodiment above, and / or the method for predicting the daily liquid production of a rod pump oil well as described in the second embodiment above.

[0287] Embodiment Six

[0288] Based on the same inventive concept, an embodiment of the present application further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the method for training the daily liquid production prediction model of a rod pump oil well as described in the first embodiment above, and / or the method for predicting the daily liquid production of a rod pump oil well as described in the second embodiment above.

[0289] Embodiment Seven

[0290] Based on the same inventive concept, an embodiment of the present application further provides a computer program product containing instructions. When the computer program product runs on a computer device, it causes the computer device to execute the method for training the daily liquid production prediction model of a rod pump oil well as described in the first embodiment above, and / or the method for predicting the daily liquid production of a rod pump oil well as described in the second embodiment above.

[0291] Embodiment Eight

[0292] Based on the same inventive concept, an embodiment of the present application further provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run a computer program or instructions to implement the method for training the daily liquid production prediction model of a rod pump oil well as described in the first embodiment above, and / or the method for predicting the daily liquid production of a rod pump oil well as described in the second embodiment above.

[0293] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0294] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce means for implementing the functions specified in one flow Figure 1 one or more flows and / or blocks Figure 1 or in one block or more blocks.

[0295] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including instruction means that implement the functions specified in one flow Figure 1 one or more flows and / or blocks Figure 1 or in one block or more blocks.

[0296] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one or more flows and / or blocks Figure 1 or in one block or more blocks.

[0297] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these changes and modifications.

Claims

1. A method for training a daily production prediction model for a sucker rod pump well, characterized in that: include: For each pumping well, the surface performance diagrams obtained in advance are converted into downhole pump performance diagrams to construct a sample database; Based on the sample database, extract the characteristics of each downhole pump performance diagram, and build a basic characteristic library in combination with the pre-acquired production data; Based on the principal component analysis method, the basic feature library is reduced in dimension to obtain a reduced-dimensional feature vector; Training a first prediction model according to the basic feature library to obtain a first base model; Training a second prediction model according to the dimension-reduced feature vector to obtain a second base model; Based on the particle swarm optimization algorithm, the first base model and the second base model are integrated to obtain a daily liquid production prediction model for a sucker rod pump well.

2. The method according to claim 1, characterized in that For each pumping well, the pre-obtained surface performance diagrams are converted into downhole pump performance diagrams, including: For each pumping well, based on the one-dimensional wave equation, each pre-obtained surface performance diagram is converted step by step into each next-level rod performance diagram until it is converted into each downhole pump performance diagram.

3. The method according to claim 1, characterized in that Based on the sample database, the characteristics of each downhole pump performance diagram are extracted, and combined with the pre-acquired production data to construct a basic characteristic library, including: Based on the pre-built sample database, the area of ​​each downhole pump performance diagram is extracted based on the following formula 1: In the formula, sgts jk is the area of ​​the kth downhole pump performance diagram of the jth well on a certain day; m is the ergodic variable; N is the number of data points contained in the kth downhole pump performance diagram curve data of the jth well on a certain day; D 1 m is the value of the mth dynamic load of the kth downhole pump diagram of the jth well on a certain day; D 1' m is the dynamic load value calculated based on the interpolation function for the mth displacement value of the kth downhole pump performance diagram of the jth well on a certain day; U 1 m is the value of the mth displacement of the kth downhole pump performance diagram of the jth well on a certain day; U 1 m+1 is the value of the m+1th displacement of the kth downhole pump performance diagram of the jth well on a certain day; Based on the pre-built sample database, the pump fullness of each downhole pump performance diagram is extracted based on the following formula 2: Where, cmcd jk is the pump filling degree corresponding to the kth downhole pump performance diagram of the jth well on a certain day; s jk_1 is the effective stroke of the downhole pump performance diagram; s jk_2 It is the effective stroke on the downhole pump performance diagram; Based on the pre-built sample database, the calculated daily liquid production of each downhole pump performance diagram is extracted based on the following formula 3: In the formula, jspl jk is the calculated daily liquid production corresponding to the kth downhole pump performance diagram of the jth well on a certain day; Φ j_pump is the diameter of the oil pump used in the jth well; S jk_pump CC is the effective stroke of the pump corresponding to the kth downhole pump diagram of the jth well on a certain day; jk is the number of strokes corresponding to the kth downhole pump performance diagram of the jth well on a certain day; t j_prod is the production time of the jth well on a certain day; I jk is the pump leakage coefficient corresponding to the kth downhole pump performance diagram of the jth well on a certain day; According to the area of ​​each downhole pump diagram, the pump filling degree, the calculated daily fluid production and the effective pump stroke, combined with the pre-acquired production data, a basic feature library is constructed.

4. The method according to claim 1, characterized in that The basic feature library is subjected to dimension reduction based on the principal component analysis method to obtain a dimension-reduced feature vector, including: Convert the basic feature library into a zero-mean processed matrix, and calculate the covariance matrix of the matrix; According to the eigenvectors corresponding to the eigenvalues ​​of the covariance matrix, the eigenvectors are sorted according to the sizes of the corresponding eigenvalues, and a new matrix with a preset number of rows is selected as the reduced-dimensional eigenvector.

5. The method according to claim 1, characterized in that The step of training a first prediction model according to the basic feature library to obtain a first base model includes: Inputting the basic feature library into the first prediction model for training to obtain a daily liquid production prediction result and a trained first prediction model; Comparing the daily fluid production prediction result with the actual daily fluid production result, and updating the trained first prediction model; The above training process is repeated until the accuracy of the daily fluid production prediction result meets the preset conditions, and the first base model is obtained.

6. The method according to claim 5, characterized in that The trained first prediction model is updated in the following manner: Based on the grid search method, setting the value or value range of each hyperparameter to be optimized in the first prediction model to generate multiple hyperparameter combinations; According to the hyperparameter combination, the hyperparameters of the trained first prediction model are optimized.

7. The method according to claim 1, characterized in that The step of training a second prediction model according to the dimension-reduced feature vector to obtain a second base model comprises: Inputting the dimension-reduced feature vector into the second prediction model for training to obtain a daily fluid production prediction result and a trained second prediction model; Comparing the daily fluid production prediction result with the actual daily fluid production result, and updating the trained second prediction model; The above training process is repeated until the accuracy of the daily fluid production prediction result meets the preset conditions, and the second basic model is obtained.

8. The method according to claim 7, characterized in that Also includes: The hyperparameters of the first base model are used as the hyperparameters of the second base model.

9. A method for predicting daily liquid production of a sucker rod pump well, characterized in that: include: For the target pumping well, the pre-obtained surface performance diagrams are converted into the downhole pump performance diagrams; Extract the features of each downhole pump performance diagram, combine it with the previously acquired production data, and build a feature library; The feature library is input into the daily liquid production prediction model of the rod pump oil well to obtain the daily liquid production prediction result.

10. A daily production prediction model training device for a sucker rod pump oil well, characterized in that: include: The first conversion module is used to convert the pre-acquired surface performance diagrams into the downhole pump performance diagrams for each pumping well, so as to construct a sample database; A first extraction module is used to extract the characteristics of each downhole pump performance diagram based on the sample database, and to construct a basic characteristic library in combination with the pre-acquired production data; A dimension reduction module, used for reducing the dimension of the basic feature library based on principal component analysis to obtain a reduced dimension feature vector; A first training module, used for training a first prediction model according to the basic feature library to obtain a first base model; A second training module, used for training a second prediction model according to the dimension-reduced feature vector to obtain a second base model; The fusion module is used to fuse the first base model and the second base model based on the particle swarm optimization algorithm to obtain a daily liquid production prediction model for a rod pump well.

11. A device for predicting daily liquid production of a sucker rod pump oil well, characterized in that: include: The second conversion module is used to convert the pre-acquired surface performance diagrams into the downhole pump performance diagrams for the target pumping wells; The second extraction module is used to extract the characteristics of each downhole pump performance diagram and build a characteristic library in combination with the pre-acquired production data; The prediction module is used to input the feature library into the daily liquid production prediction model of the rod pump oil well to obtain the daily liquid production prediction result.

12. A computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal, the terminal executes the daily liquid production prediction model training method for a rod pump well as described in any one of claims 1 to 8, and / or the daily liquid production prediction method for a rod pump well as described in claim 9.

13. A computer device, characterized in that: It includes a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the daily liquid production prediction model training method for a rod pump well as described in any one of claims 1 to 8, and / or the daily liquid production prediction method for a rod pump well as described in claim 9.

14. A computer program product comprising instructions, which, when executed on a computer device, enables the computer device to execute the daily liquid production prediction model training method for a rod pump well as described in any one of claims 1 to 8, and / or the daily liquid production prediction method for a rod pump well as described in claim 9.

15. A chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a computer program or instruction to implement the daily liquid production prediction model training method for a rod pump well as described in any one of claims 1 to 8, and / or the daily liquid production prediction method for a rod pump well as described in claim 9.