Method for calculating working fluid level based on energy of oil well indicator diagram
By collecting and processing dynamic data of the oil well display diagram and calculating the dynamic fluid level depth, the problem of insufficient accuracy and real-time in traditional methods is solved, and more accurate dynamic fluid level monitoring and production optimization is achieved.
Patent Information
- Application Number
- CN202510366520.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-07-04
AI Technical Summary
Traditional measurement methods cannot effectively combine the energy information in the oil well display diagram, resulting in insufficient accuracy and real-time performance of dynamic fluid level measurement, making it difficult to adapt to the requirements of dynamic fluid level depth monitoring under complex working conditions.
By collecting real-time dynamic data of the oil well power diagram, adaptive noise suppression and segmented baseline calibration are performed, real-time energy accumulation value of the pump column is calculated, effective work cycles are divided, energy characteristic parameters are extracted, and dynamic liquid level depth is calculated using a nonlinear liquid level mapping model combined with the pump effect attenuation coefficient.
The accuracy and real-time monitoring capabilities of dynamic fluid level depth measurement are improved, the production parameters of oil wells are optimized, the recovery rate is improved, and the production costs are reduced.
Smart Images

Figure CN120257435A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of oil extraction, and more specifically, the present invention relates to a method for calculating the dynamic liquid level based on the energy of the oil well indicator diagram. Background Art
[0002] During the oil extraction process, the accurate measurement of the dynamic liquid level depth is of great significance for optimizing the production parameters of oil wells and improving the recovery rate. Traditional measurement methods mainly rely on technologies such as acoustic wave method and liquid level gauge measurement. Although these methods can provide certain measurement results, there are some limitations in practical applications. For example, the acoustic wave method is greatly affected by the wellbore environment, and the measurement accuracy is easily interfered; the liquid level gauge measurement requires regular maintenance and calibration, and has poor adaptability under complex well conditions. These traditional methods often cannot reflect the changes of the dynamic liquid level in real time and accurately, and cannot meet the requirements of refined management in modern oil extraction.
[0003] In the process of implementing the embodiments of the present invention, the inventors found that there are at least the following problems or defects in the prior art: the traditional measurement methods cannot effectively combine the energy information in the oil well indicator diagram, resulting in insufficient measurement accuracy and real-time performance, and it is difficult to meet the requirements of monitoring the dynamic liquid level depth under complex working conditions. Summary of the Invention
[0004] The present invention provides a method for calculating the dynamic liquid level based on the energy of the oil well indicator diagram, including: S1. Collect the real-time dynamic data of the oil well indicator diagram, and the dynamic data includes polished rod load , displacement , time series t and motor power ; S2. Preprocess the dynamic data to generate standardized indicator diagram data; S3. Based on the standardized indicator diagram data, calculate the real-time energy accumulation value of the pump string through the dynamic energy accumulation algorithm ; S4. According to the real-time energy accumulation value , use the periodic energy segmentation algorithm to divide the effective work period and the non-effective period; S5. Extract the energy characteristic parameters within the effective work period, including the maximum energy gradient , effective period duration and energy fluctuation amplitude ; S6. Input the energy characteristic parameters into the non-linear liquid level mapping model, and combine with the pump efficiency attenuation coefficient , and output the calculation result H of the dynamic liquid level depth.
[0005] Further, the preprocessing in S2 includes: S21. Perform adaptive noise suppression algorithm on the polished rod load The filtering formula is as follows:
[0006] Wherein, is the filtered load value, N is the radius of the sliding window, is the attenuation constant, is the original polished rod load value; S22. Perform piecewise baseline calibration algorithm on the displacement data The calibration formula is as follows:
[0007] Wherein, is the calibrated displacement value, is the baseline calibration window length, is the impulse function, is the original displacement value.
[0008] Furthermore, the dynamic energy accumulation algorithm in S3 includes: S31. Calculate the instantaneous power of the pump string according to the filtered load and the calibrated displacement , and the formula is:
[0009] Wherein, is the displacement change rate; S32. Perform energy fusion on the instantaneous power and the motor power to obtain the real-time energy accumulation value , and the formula is:
[0010] Wherein, is the motor energy coupling coefficient, is the system power loss, is the real-time motor power.
[0011] Furthermore, the periodic energy segmentation algorithm in S4 includes: S41. Identify the maximum point and the minimum point of the real-time energy accumulation value through the energy extreme value detection algorithm, where is the maximum energy value within the period, is the minimum energy value within the period; S42. Calculate the energy difference , and compared with the dynamic energy threshold The judgment condition is:
[0012] where, is the period sensitivity factor, is the reference period duration, is the current period duration; S43. If the condition is satisfied, mark the current period as an effective work period, otherwise mark it as a non-effective period.
[0013] Furthermore, the motor energy coupling coefficient in S32 has the following calculation formula:
[0014] where, is the calibration constant, is the fluid density, is the reference displacement, is the acceleration due to gravity, is the rated power of the motor.
[0015] Furthermore, the dynamic energy threshold is updated through the following steps: S61. Calculate the energy threshold baseline based on the historical dynamic liquid level data, and the formula is:
[0016] where K is the number of historical effective period samples, is the maximum energy value of the kth sample, is the minimum energy value of the kth sample; S62. The dynamic energy threshold
[0017] where, is the attenuation weight, is the attenuation rate, is the dynamic liquid level depth at the previous moment.
[0018] Furthermore, the extraction of the energy characteristic parameters in S5 includes: S71. The calculation formula of the maximum energy gradient is:
[0019] where, and are the start and end times of the effective period, is Moment energy accumulation value; S72. Effective cycle duration ; S73. Energy fluctuation amplitude , where is the time corresponding to the maximum energy value within the cycle, is the time corresponding to the minimum energy value.
[0020] Furthermore, the non-linear liquid level mapping model in S6 is:
[0021] where, is the liquid level calibration coefficient, is the historical depth influence factor, is the dynamic liquid level depth at the previous moment, is the reference displacement.
[0022] Furthermore, the calculation of the historical depth influence factor includes: S91. Generate a dynamic weight based on the change rate of the dynamic liquid level depth , and the formula is:
[0023] where, is the sensitivity coefficient, is the change rate of the dynamic liquid level depth with respect to time; S92. The historical depth influence factor , where is the dynamic liquid level depth at the previous moment.
[0024] Furthermore, the pump efficiency attenuation coefficient is generated through the following steps: S101. Real-time collect the data of the opening and closing states of the pump valves, and calculate the pump efficiency attenuation rate , and the formula is:
[0025] where, is the closing duration of the pump valves, is the complete cycle duration; S102. Update the dynamic compensation coefficient according to the pump efficiency attenuation rate, and the formula is:
[0026] where, is the initial pump efficiency coefficient.
[0027] The above embodiments of the present invention have at least the following beneficial effects: The method of the present invention can effectively improve the measurement accuracy of the dynamic liquid level depth. By collecting the real-time dynamic data of the oil well indicator diagram and combining the dynamic energy accumulation algorithm and the periodic energy segmentation algorithm, it is possible to accurately identify the effective working cycle and extract the energy characteristic parameters, thereby providing a more accurate basis for the calculation of the dynamic liquid level depth. In addition, the introduction of the non-linear liquid level mapping model and the dynamic compensation mechanism of the pump efficiency attenuation coefficient can further enhance the reliability and adaptability of the calculation results, enabling it to better cope with the oil well production environment under different working conditions.
[0028] At the same time, this method can realize the real-time monitoring of the dynamic liquid level depth. Based on the real-time collected dynamic data, it is possible to quickly calculate the dynamic liquid level depth, providing timely information support for the production management of oil wells. This helps to optimize the production parameters of oil wells, improve the recovery rate, reduce the production cost, and is of great significance for enhancing the oil extraction efficiency and economic benefits. Brief Description of the Drawings
[0029] By referring to the following detailed description with reference to the accompanying drawings, the above and other objects, features, and advantages of the exemplary embodiments of the present invention will become readily understood. In the drawings, several embodiments of the present invention are shown in an exemplary rather than restrictive manner, wherein: Figure 1 It is a schematic flow chart of a method for calculating the dynamic liquid level based on energy of an oil well indicator diagram provided by an embodiment of the present invention. Detailed Embodiments
[0030] The principles and spirit of the present invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and do not limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to convey the scope of the present invention fully to those skilled in the art.
[0031] Those skilled in the art know that the embodiments of the present invention can be implemented as a system, device, equipment, method, or computer program product. Therefore, the present invention can be specifically implemented in the following forms: completely hardware, completely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0032] It should be noted that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction and does not have any limiting meaning.
[0033] The following refers to Figure 1 , Figure 1Schematic flow chart of the method for calculating the dynamic liquid level based on the dynamometer card of an oil well provided by an embodiment of the present invention. As Figure 1 shown, a method 100 for calculating the dynamic liquid level based on the dynamometer card of an oil well includes: S1. Collect real-time dynamic data of the dynamometer card of the oil well, and the dynamic data includes polished rod load , displacement , time series t, and motor power ; S2. Preprocess the dynamic data to generate standardized dynamometer card data; S3. Based on the standardized dynamometer card data, calculate the real-time energy accumulation value of the pump string through a dynamic energy accumulation algorithm ; S4. According to the real-time energy accumulation value , use a periodic energy segmentation algorithm to divide the effective work period and the non-effective period; S5. Extract the energy characteristic parameters within the effective work period, including the maximum energy gradient , the effective period duration , and the energy fluctuation amplitude ; S6. Input the energy characteristic parameters into a non-linear liquid level mapping model, and combine with the pump efficiency attenuation coefficient , and output the calculation result H of the dynamic liquid level depth.
[0034] It should be noted that the core of this method is to calculate the dynamic liquid level depth by collecting the real-time dynamic data of the dynamometer card of the oil well. Among them, the dynamic data includes polished rod load, displacement, time series, motor power, etc. These data are key parameters during the operation of the oil well and directly reflect the production status of the oil well. The polished rod load refers to the force borne by the polished rod during the up and down movement, the displacement represents the movement distance of the polished rod, the time series is used to record the time points of data collection, and the motor power reflects the power output of the motor driving the operation of the oil well. Through the collection and processing of these data, precise monitoring and analysis of the production process of the oil well can be achieved.
[0035] Specifically, the collection of dynamic data is achieved through sensors installed at the oil well site. The polished rod load sensor can measure the force on the polished rod during its reciprocating up and down movement, while the displacement sensor is used to record the movement trajectory of the polished rod. The collection of time series data can be realized through a high-precision clock module to ensure the accuracy of the data timestamp. The motor power data can be obtained from the motor control system through a power sensor. The data collected by these sensors will be transmitted to the data processing system for subsequent preprocessing and analysis. In the preprocessing stage, noise suppression processing will be performed on the polished rod load data to eliminate the noise introduced by factors such as sensor accuracy and environmental interference. The displacement data needs to be baseline calibrated to correct the baseline shift caused by sensor installation position deviation or measurement error.
[0036] Preferably, when collecting the polished rod load data, an adaptive noise suppression algorithm can be adopted. By setting appropriate sliding window radius and attenuation constant, the original load data is filtered to obtain a smoother and more accurate load curve. For the calibration of displacement data, a reasonable baseline calibration window length can be set, and the displacement data is calibrated point by point using the impulse function to ensure the accuracy of the displacement data. When calculating the instantaneous power of the pump column, it is necessary to calculate based on the filtered polished rod load and calibrated displacement data, combined with the displacement change rate. In addition, the calculation accuracy of the energy accumulation value can be further optimized by adjusting the calculation parameters of the motor energy coupling coefficient, such as calibration constant, fluid density, reference displacement, etc.
[0037] In some embodiments, the preprocessing in S2 includes: S21. Perform an adaptive noise suppression algorithm on the polished rod load The filtering formula is:
[0038] where, is the filtered load value, N is the sliding window radius, is the attenuation constant, is the original polished rod load value; S22. Perform a segmented baseline calibration algorithm on the displacement data The calibration formula is:
[0039] where, is the calibrated displacement value, is the baseline calibration window length, is the impulse function, is the original displacement value.
[0040] It should be noted that the preprocessing step in this method processes the collected dynamic data to generate standardized dynamometer card data. Among them, the adaptive noise suppression algorithm is used to filter the noise in the polished rod load data, while the segmented baseline calibration algorithm is used to calibrate the displacement data. The polished rod load refers to the force borne by the polished rod during its up and down movement, which is usually affected by factors such as downhole pressure and oil viscosity. Therefore, a filtering algorithm is needed to reduce noise interference. The displacement data reflects the movement position of the polished rod. Due to sensor installation errors or environmental factors, baseline offset may occur, so calibration is required to ensure the accuracy of the data.
[0041] Specifically, the adaptive noise suppression algorithm filters the polished rod load data through a sliding window and an attenuation constant. The radius N of the sliding window determines the filtering range. A larger window radius can smooth more noise, but may cause signal delay; the attenuation constant controls the attenuation speed of the noise. A larger attenuation constant can suppress the noise faster, but may oversmooth the signal. The segmented baseline calibration algorithm calibrates the displacement data through the baseline calibration window length and the impulse function. The baseline calibration window length determines the calibration range. A reasonable window length can effectively correct the baseline offset. The impulse function is used to mark the key points in the displacement data for point-by-point calibration.
[0042] Preferably, when implementing the adaptive noise suppression algorithm, appropriate values of the sliding window radius N and the attenuation constant can be selected according to the actual working conditions. For example, in a working condition with large noise, the sliding window radius N and the attenuation constant can be appropriately increased to better suppress the noise. For the segmented baseline calibration algorithm, an appropriate baseline calibration window length can be selected according to the fluctuation of the displacement data. If the fluctuation of the displacement data is small, the window length can be appropriately reduced to improve the calibration accuracy. In addition, an adaptive adjustment mechanism can be introduced to dynamically adjust the sliding window radius N, the attenuation constant and the baseline calibration window length according to the noise level and baseline offset of the real-time data, thereby further optimizing the preprocessing effect.
[0043] In some embodiments, the dynamic energy accumulation algorithm in S3 includes: S31. Calculate the instantaneous power of the pump string according to the filtered load and the calibrated displacement , and the formula is:
[0044] wherein, is the displacement change rate; S32. Fuse the instantaneous power with the motor power to obtain a real-time energy accumulation value , and the formula is:
[0045] wherein, is the motor energy coupling coefficient, is the system power loss, is the real-time motor power.
[0046] It should be noted that the dynamic energy accumulation algorithm is a key step in this method for calculating the real-time energy accumulation value of the pump string. This algorithm is based on the filtered polished rod load and calibrated displacement data. By calculating the instantaneous power of the pump string and combining it with the motor power for energy fusion, the real-time energy accumulation value can be obtained. Among them, the instantaneous power reflects the power output of the pump string at a certain moment, while the motor power represents the actual power of the motor driving the oil well operation. Through energy fusion, the operation state of the oil well can be more comprehensively reflected, providing accurate energy data for the subsequent calculation of the dynamic liquid level depth.
[0047] Specifically, when calculating the instantaneous power of the pump string, it is necessary to use the filtered polished rod load and calibrated displacement data, and calculate in combination with the displacement change rate. The displacement change rate refers to the change amount of displacement per unit time, which directly affects the magnitude of the instantaneous power. During the energy fusion process, the motor power is combined with the instantaneous power of the pump string and adjusted through the motor energy coupling coefficient. The motor energy coupling coefficient is an important parameter, which takes into account factors such as the actual operating efficiency and energy loss of the motor to ensure the accuracy of the calculation of the energy accumulation value. The system power loss refers to the inevitable energy loss during the energy conversion process, and this part of the loss needs to be deducted from the total energy to obtain the true energy accumulation value Preferably, when calculating the instantaneous power of the pump string, high-precision sensors can be used to measure the polished rod load and displacement data to ensure the accuracy of the data. The displacement change rate can be calculated by taking the time difference of the displacement data. In order to improve the calculation accuracy, methods such as moving average can be used to smooth the differential result. During the energy fusion process, the motor energy coupling coefficient can be dynamically adjusted according to parameters such as the rated power of the motor, fluid density, and reference displacement. For example, under different oil well working conditions, the fluid density and reference displacement may change. At this time, by real-time monitoring these parameters and updating the motor energy coupling coefficient, the calculation accuracy of the energy accumulation value can be improved. In addition, machine learning algorithms can be introduced to automatically adjust the motor energy coupling coefficient through learning and analysis of a large amount of historical data, further optimizing the calculation result of the energy accumulation value.
[0048] In some embodiments, the periodic energy segmentation algorithm in S4 includes: S41. Identifying the maximum point and minimum point of the real-time energy accumulation value through the energy extreme value detection algorithm, where is the maximum energy value within a period, and is the minimum energy value within a period; S42. Calculating the energy difference between adjacent maximum and minimum values, and comparing it with the dynamic energy threshold . The judgment condition is:
[0049] where is the period sensitivity factor, is the reference period duration, and is the current period duration; S43. If the condition is met, mark the current period as an effective work period; otherwise, mark it as a non-effective period.
[0050] It should be noted that the periodic energy segmentation algorithm is a key step in this method for distinguishing effective work periods and non-effective periods. This algorithm identifies the maximum and minimum points of the real-time energy accumulation value, calculates the energy difference between adjacent extreme points, and compares it with the dynamic energy threshold to determine whether a period is an effective work period. An effective work period refers to a period in which the actual work done by the pump column has a significant impact on the depth of the moving liquid level, while a non-effective period may result in unsatisfactory work due to equipment failures, changes in fluid properties, etc. By making this distinction, periods that actually contribute to the calculation of the moving liquid level depth can be screened out, improving the accuracy and reliability of the calculation.
[0051] Specifically, the energy extreme value detection algorithm is used to identify the maximum and minimum points of the real-time energy accumulation value. The maximum point represents the moment when the energy accumulation reaches the peak within a period, while the minimum point represents the moment when the energy accumulation reaches the trough. Calculating the energy difference between adjacent maximum and minimum values can reflect the energy change amplitude within a period. The dynamic energy threshold is an important parameter that is dynamically adjusted based on historical data and the characteristics of the current period and is used to determine whether a period is an effective work period. The period sensitivity factor and the reference period duration are key parameters affecting the dynamic energy threshold, and they can be set according to the actual operating conditions and historical data of the oil well. For example, the reference period duration can be determined based on the average operating period of the oil well, and the period sensitivity factor can be adjusted according to the operating stability of the oil well.
[0052] Preferably, when implementing the cycle energy segmentation algorithm, a high-precision energy sensor can be used to monitor the energy accumulation value in real time to ensure more accurate identification of extreme points. For the setting of the dynamic energy threshold, a reasonable baseline value can be determined according to the energy change range of historical valid cycles, and dynamically adjusted in combination with the characteristics of the current cycle. For example, if the energy change amplitude of the current cycle is significantly higher than the historical average, the dynamic energy threshold can be appropriately increased to avoid misjudgment. In addition, an adaptive adjustment mechanism can be introduced to dynamically update the cycle sensitivity factor and the reference cycle duration according to the real-time monitored energy change trend, thereby further improving the accuracy and adaptability of the cycle energy segmentation algorithm.
[0053] In some embodiments, the motor energy coupling coefficient in S32 is calculated by the formula:
[0054] where, is a calibration constant, is the fluid density, is the reference displacement, is the acceleration due to gravity, is the rated power of the motor.
[0055] It should be noted that the motor energy coupling coefficient is a key parameter in this method for fusing the motor power and the instantaneous power of the pump string. This coefficient is calculated by comprehensively considering physical parameters such as the rated power of the motor, fluid density, reference displacement, and acceleration due to gravity, and can reflect the energy conversion efficiency of the motor during actual operation. The introduction of the motor energy coupling coefficient can effectively compensate for system power losses and improve the accuracy of energy accumulation value calculation. By reasonably setting this coefficient, it can be ensured that the energy fusion process more conforms to the actual working conditions, thereby providing more reliable energy data for the calculation of the dynamic liquid level depth.
[0056] Specifically, the calculation of the motor energy coupling coefficient involves multiple physical parameters. The calibration constant is a fixed value calibrated through experiments and is used to calibrate the proportional relationship in the calculation process. The fluid density reflects the mass characteristics of the fluid in the oil well, and the fluid densities of different oil wells may be different, so it needs to be measured or estimated according to the actual situation. The reference displacement refers to the displacement of the pump string under standard working conditions, which directly affects the energy conversion efficiency. The acceleration due to gravity is a constant used to calculate the energy conversion related to gravity. The rated power of the motor is the maximum output power of the motor under the designed working conditions and reflects the performance index of the motor. Through the reasonable combination of these parameters, the motor energy coupling coefficient can be calculated, and then the effective fusion of the motor power and the instantaneous power of the pump string can be achieved. In practical applications, these parameters can be adjusted and optimized according to the specific conditions of the oil well to ensure the accuracy of the calculation results.
[0057] Preferably, when calculating the motor energy coupling coefficient, high-precision sensors can be used to measure parameters such as fluid density and motor power in real time. For example, through density sensors and power sensors installed at the oil well site, accurate data of fluid density and motor power can be obtained in real time. For the calibration constant, a suitable value can be determined through laboratory calibration or on-site experiments. During the calculation process, a dynamic adjustment mechanism can be introduced to dynamically update the motor energy coupling coefficient according to changes in parameters such as real-time monitored fluid density and reference displacement. For example, if the fluid density changes, the calibration constant or reference displacement can be adjusted in a timely manner to ensure the accuracy of the coupling coefficient. In addition, historical data and machine learning algorithms can be combined to optimize and adjust the motor energy coupling coefficient, further improving the accuracy and reliability of energy fusion.
[0058] In some embodiments, the dynamic energy threshold is updated through the following steps: S61. Calculate the energy threshold baseline based on historical fluid level data , and the formula is:
[0059] where K is the number of historical effective period samples, is the maximum energy value of the k-th sample, is the minimum energy value of the k-th sample; S62. The dynamic energy threshold
[0060] where, is the attenuation weight, is the attenuation rate, is the fluid level depth at the previous moment.
[0061] It should be noted that the update mechanism of the dynamic energy threshold is a key step in this method for optimizing the periodic energy segmentation algorithm. By calculating the energy threshold baseline based on historical fluid level data and dynamically adjusting the threshold in combination with the attenuation weight and attenuation rate, it can be ensured that the periodic energy segmentation algorithm can adapt to the dynamic changes during the operation of the oil well. The update mechanism of the dynamic energy threshold takes into account the statistical characteristics of historical data and the change trend of the fluid level depth, thereby improving the accuracy and adaptability of the period division.
[0062] Specifically, the energy threshold baseline is obtained by statistically calculating the energy extreme values of historical effective cycle samples. The number of historical effective cycle samples K represents the number of historical data points used for calculating the baseline, and these data points reflect the energy change range of the oil well under different operating conditions. The maximum energy value and the minimum energy value represent the energy peak and valley within each sample cycle respectively. By calculating the average difference of these extreme values, an energy threshold baseline reflecting the normal operating state of the oil well can be obtained. The attenuation weight and the attenuation rate are key parameters for dynamically adjusting the threshold. The attenuation weight is used to control the amplitude of the threshold adjustment, while the attenuation rate determines the speed at which the threshold changes over time. By reasonably setting these parameters, it can be ensured that the dynamic energy threshold can promptly reflect the change trend of the fluid level depth, thereby improving the accuracy of cycle division.
[0063] Preferably, when updating the dynamic energy threshold, an appropriate number of historical effective cycle samples K can be selected according to the actual operating conditions of the oil well. For example, when the oil well is operating relatively stably, more historical samples can be selected to obtain a more stable baseline; while when the operating state of the oil well changes rapidly, fewer historical samples can be selected to improve the dynamic response ability of the threshold. For the settings of the attenuation weight and the attenuation rate, they can be dynamically adjusted according to the change rate of the fluid level depth. For example, if the fluid level depth changes rapidly, the attenuation weight can be appropriately increased and the attenuation rate can be increased to quickly adapt to the new operating state. In addition, an adaptive learning mechanism can be introduced to analyze the historical data through machine learning algorithms and automatically adjust the attenuation weight and the attenuation rate, thereby further optimizing the update effect of the dynamic energy threshold.
[0064] In some embodiments, the extraction of the energy characteristic parameters in S5 includes: S71. Maximum energy gradient The calculation formula is:
[0065] Where and are the start and end times of the effective cycle, is the energy accumulation value at time S72. Effective cycle duration ; S73. Energy fluctuation amplitude where is the time corresponding to the maximum energy value within the cycle, is the time corresponding to the minimum energy value.
[0066] It should be noted that the extraction of energy characteristic parameters is a key step in this method for characterizing the energy characteristics of the effective work cycle. These parameters include the maximum energy gradient, the effective cycle duration, and the energy fluctuation amplitude, which can reflect the energy change of the pump column during the effective work cycle from different perspectives. The maximum energy gradient represents the maximum change rate of the energy accumulation value per unit time, the effective cycle duration reflects the duration of the effective work cycle, and the energy fluctuation amplitude represents the maximum change range of the energy accumulation value within the cycle. By extracting these parameters, important energy characteristic information can be provided for the subsequent calculation of the dynamic liquid level depth.
[0067] Specifically, the calculation of the maximum energy gradient is achieved by taking the difference of the energy accumulation value within the effective cycle and then taking the maximum value. The start and end times of the effective cycle define the calculation range, ensuring that the calculation result only reflects the energy change during the effective work cycle. The calculation of the effective cycle duration directly reflects the duration of this cycle and provides a time reference for the calculation of the dynamic liquid level depth. The calculation of the energy fluctuation amplitude is based on the maximum and minimum energy values within the cycle, and is obtained by calculating the difference between the two. The extraction of these parameters depends on accurate energy accumulation values and cycle division results, so it is necessary to ensure the accuracy of the pre-data collection and processing. In practical applications, the start and end times of the effective cycle can be determined according to the specific working conditions and operation data of the oil well, and an appropriate time resolution can be selected for the calculation of the energy gradient.
[0068] Preferably, when extracting the maximum energy gradient, a high-precision time synchronization technology can be adopted to ensure the accuracy of the time stamps of the energy accumulation values, thereby improving the accuracy of the gradient calculation. For the calculation of the effective cycle duration, the time window sliding technology can be introduced to smooth the cycle boundary and reduce the fluctuation of the cycle duration caused by data noise or measurement errors. When calculating the energy fluctuation amplitude, the maximum and minimum energy values can be filtered to remove possible abnormal points. In addition, machine learning algorithms can be combined to analyze and optimize the extracted energy characteristic parameters. For example, different types of work cycles can be identified through clustering analysis, thereby further improving the accuracy and reliability of the dynamic liquid level depth calculation.
[0069] In some embodiments, the non-linear liquid level mapping model in S6 is:
[0070] Wherein, is the liquid level calibration coefficient, is the historical depth influence factor, is the dynamic liquid level depth at the previous moment, is the reference displacement.
[0071] It should be noted that the non - linear liquid level mapping model is the core model in this method for correlating energy characteristic parameters with the depth of the moving liquid level. By comprehensively considering factors such as energy characteristic parameters, historical moving liquid level depth, and pump efficiency decay coefficient, this model can accurately output the calculation result of the moving liquid level depth. The liquid level calibration coefficient and the historical depth influence factor are key parameters in the model, which are used to calibrate the initial output of the model and reflect the influence of the historical moving liquid level depth on the current depth respectively. Through this non - linear mapping relationship, accurate calculation of the moving liquid level depth can be achieved, improving the accuracy of optimizing oil well production parameters.
[0072] Specifically, the liquid level calibration coefficient is a parameter used to calibrate the model output, which can be adjusted according to the deviation between the actually measured moving liquid level depth and the model output. The historical depth influence factor reflects the influence of the moving liquid level depth at the previous moment on the current depth. By considering this historical information, the model's prediction ability for the changing trend of the moving liquid level depth can be improved. The reference displacement is the displacement of the oil well under standard operating conditions, which directly affects the calculation result of the moving liquid level depth. In practical applications, these parameters need to be set and adjusted according to the specific situation of the oil well. For example, the liquid level calibration coefficient can be calibrated by comparing the model output with the actual measurement value, the historical depth influence factor can be dynamically adjusted according to the change rate of the moving liquid level depth, and the reference displacement can be determined according to the design parameters or actual operation data of the oil well.
[0073] Preferably, when implementing the non - linear liquid level mapping model, high - precision sensors can be used to monitor the moving liquid level depth in real time for calibrating the model output. For example, by installing a liquid level sensor at the oil well site, the actual moving liquid level depth data can be obtained to accurately adjust the liquid level calibration coefficient. For the calculation of the historical depth influence factor, a dynamic weight mechanism can be introduced to dynamically adjust the weight value according to the change rate of the moving liquid level depth, so as to more accurately reflect the influence of the historical depth. In addition, machine learning algorithms can be combined to optimize the non - linear liquid level mapping model. For example, by training a neural network model to learn the complex non - linear relationship between energy characteristic parameters and the moving liquid level depth, the prediction accuracy and adaptability of the model can be further improved.
[0074] In some embodiments, the calculation of the historical depth influence factor includes: S91. Generate a dynamic weight according to the change rate of the moving liquid level depth , and the formula is:
[0075] where is the sensitivity coefficient, is the change rate of the moving liquid level depth with time; S92. Historical depth impact factor ,in It is the liquid level depth at the previous moment.
[0076] It should be noted that the calculation of the historical depth impact factor is an important step in this method to reflect the changing trend of the dynamic liquid surface depth. This factor dynamically adjusts its influence on the current dynamic liquid surface depth calculation by considering the rate of change of the dynamic liquid surface depth over time. The sensitivity coefficient is a key parameter that determines the intensity of regulation of the dynamic liquid surface depth change rate on the historical depth impact factor. In this way, it can be ensured that the model can fully consider the changing trend of historical data when calculating the current dynamic liquid surface depth, thereby improving the accuracy and reliability of the calculation results.
[0077] Specifically, the rate of change of the dynamic liquid level depth is obtained by calculating the ratio of the difference of the dynamic liquid level depth at adjacent time points to the time interval. It reflects the speed of change of the dynamic liquid level depth per unit time and is an important indicator for measuring the change in the production status of the oil well. The sensitivity coefficient is used to adjust the degree of influence of the dynamic liquid level depth change rate on the historical depth influencing factor. A higher sensitivity coefficient means that a small change in the dynamic liquid level depth will have a greater impact on the historical depth influencing factor. The dynamic weight is an adjustment factor calculated based on the rate of change of the dynamic liquid level depth. It is normalized by the hyperbolic tangent function (tanh) to ensure that its value is between 0 and 1. The historical depth influencing factor is obtained by multiplying the dynamic weight with the dynamic liquid level depth at the previous moment. It reflects the weight of the historical dynamic liquid level depth in the current calculation. In practical applications, the sensitivity coefficient can be adjusted according to the production characteristics and historical data of the oil well to ensure that the model can accurately reflect the changing trend of the dynamic liquid level depth.
[0078] Preferably, when calculating the historical depth impact factor, a suitable sensitivity coefficient can be selected according to the actual operation of the oil well. For example, in oil wells where the dynamic liquid level depth changes more dramatically, the sensitivity coefficient can be appropriately increased to respond more quickly to changes in the dynamic liquid level depth; and in oil wells where the dynamic liquid level depth changes more smoothly, the sensitivity coefficient can be appropriately reduced to reduce the impact of noise. For the calculation of dynamic weights, other normalization functions can be used instead of the hyperbolic tangent function, such as the Sigmoid function, to achieve a similar normalization effect. In addition, a time attenuation factor can be introduced to gradually reduce the historical depth impact factor over time, thereby further improving the model's adaptability to the dynamic liquid level depth change trend.
[0079] In some embodiments, the pump efficiency attenuation coefficient Generate it by following these steps: S101. Collect pump valve opening and closing status data in real time and calculate pump efficiency attenuation rate , the formula is:
[0080] where is the pump valve closing duration, is the full cycle duration; S102. Update the dynamic compensation coefficient according to the pump efficiency decay rate , the formula is:
[0081] where is the initial pump efficiency coefficient.
[0082] It should be noted that the generation of the pump efficiency decay coefficient is a key step in this method for compensating the influence of pump efficiency changes on the calculation of the dynamic liquid level depth. By real-time collecting the pump valve opening and closing state data, calculating the pump efficiency decay rate, and updating the dynamic compensation coefficient accordingly, the efficiency change of the pump during operation can be effectively reflected. The pump efficiency decay rate is calculated by comparing the pump valve closing duration with the full cycle duration, which reflects the degree of efficiency decline of the pump during operation due to reasons such as valve disc wear. The dynamic compensation coefficient is adjusted according to the pump efficiency decay rate to correct the error in the calculation of the dynamic liquid level depth, thereby improving the accuracy of the calculation result.
[0083] Specifically, the pump valve opening and closing state data is real-time collected by sensors installed on the pump valve, and these data reflect the opening and closing times of the pump valve in each working cycle. The pump valve closing duration refers to the time length during which the pump valve remains closed within a full cycle, while the full cycle duration refers to the time required for the pump to complete a full working cycle. By calculating the ratio of the pump valve closing duration to the full cycle duration, the pump efficiency decay rate can be obtained, thereby reflecting the efficiency change of the pump. The initial pump efficiency coefficient is a calibrated value used to represent the efficiency of the pump under ideal conditions. By combining the pump efficiency decay rate with the initial pump efficiency coefficient, the compensation coefficient can be dynamically updated, so as to consider the change of pump efficiency in the calculation of the dynamic liquid level depth. In practical applications, it is necessary to ensure the accuracy and reliability of the sensors to accurately collect the pump valve opening and closing state data. At the same time, the initial pump efficiency coefficient can be adjusted and optimized according to the actual operation situation and historical data of the pump.
[0084] Preferably, when generating the pump efficiency attenuation coefficient, a high-precision time sensor can be used to monitor the opening and closing time of the pump valve in real time to ensure the accuracy of the data. For the calculation of the pump efficiency attenuation rate, a smoothing processing technique such as the moving average method can be introduced to reduce the fluctuations caused by data noise or measurement errors. When updating the dynamic compensation coefficient, the update strategy of the compensation coefficient can be dynamically adjusted according to the change trend of the pump efficiency attenuation rate. For example, if the pump efficiency attenuation rate shows a gradually increasing trend, the update frequency of the compensation coefficient can be appropriately increased to reflect the change of the pump efficiency in a timely manner. In addition, machine learning algorithms can be combined to predict and optimize the pump efficiency attenuation coefficient. By analyzing a large amount of historical data, the change trend of the pump efficiency can be predicted in advance, thereby further improving the accuracy and reliability of the dynamic liquid level depth calculation.
[0085] The above-mentioned various embodiments of the present invention have the following beneficial effects: By collecting and preprocessing the real-time dynamic data of the oil well indicator diagram, the present invention can generate standardized indicator diagram data, providing a reliable basis for subsequent calculations. Calculating the real-time energy accumulation value of the pump column based on the standardized data can accurately reflect the energy state of the pump column at different time points. By using the periodic energy segmentation algorithm to divide the effective work cycle and the non-effective cycle, the cycles that actually contribute to the dynamic liquid level depth calculation can be accurately screened out, avoiding interference from invalid data. Extracting the energy characteristic parameters within the effective work cycle can further refine and quantify the energy performance of the pump column, providing a key basis for the dynamic liquid level depth calculation. Inputting the energy characteristic parameters into the non-linear liquid level mapping model and combining with the pump efficiency attenuation coefficient can comprehensively consider the influence of various factors on the dynamic liquid level depth, improving the accuracy and reliability of the calculation results.
[0086] In addition, the adaptive noise suppression algorithm and the segmented baseline calibration algorithm adopted by the present invention can effectively filter out the noise and deviation in the polished rod load and displacement data, improving the data quality. The dynamic energy accumulation algorithm combines the instantaneous power and the motor power, which can more comprehensively reflect the energy accumulation of the pump column. The periodic energy segmentation algorithm can flexibly adapt to the periodic division requirements under different working conditions through energy extreme value detection and dynamic energy threshold comparison. The calculation formula of the motor energy coupling coefficient takes into account various physical parameters, enabling more accurate energy fusion. The update mechanism of the dynamic energy threshold can dynamically adjust the threshold according to historical data, improving the adaptability and accuracy of the cycle division. The extraction formula of the energy characteristic parameters is simple and clear, facilitating calculation and application. The non-linear liquid level mapping model combines the historical depth influence factor and the reference displacement, which can better reflect the change law of the dynamic liquid level depth. The calculation of the historical depth influence factor takes into account the change rate of the dynamic liquid level depth, dynamically reflecting the influence of the historical depth on the current depth. The generation method of the pump efficiency attenuation coefficient can be updated in real time according to the opening and closing state of the pump valve, providing dynamic compensation for the dynamic liquid level depth calculation and further improving the calculation accuracy.
[0087] Furthermore, the storage medium according to the embodiments of the present application stores program instructions capable of implementing all the above methods. Among them, the program instructions can be stored in the above storage medium in the form of a software product, including several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs, or terminal devices such as computers, servers, mobile phones, and tablets.
[0088] The above description is only some preferred embodiments of the present invention and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present invention is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features with similar functions disclosed in the embodiments of the present invention.
Claims
1. A method for calculating the fluid level of a well based on the dynamometer card of an oil well, characterized in that, Including the following steps: S1. Collect the real-time dynamic data of the dynamometer card of the oil well, where the dynamic data includes polished rod load , displacement , time series t and motor power ; S2. Preprocess the dynamic data to generate standardized indicator diagram data; S3. Calculate the real-time energy accumulation value of the pump string through the dynamic energy accumulation algorithm based on the standardized indicator diagram data ; S4. According to the real-time energy accumulation value , divide the effective working cycle and the non-effective cycle by using the periodic energy segmentation algorithm; S5. Extract the energy characteristic parameters during the effective work cycle, including the maximum energy gradient , the duration of the effective cycle and the amplitude of energy fluctuation ; S6. Input the energy characteristic parameters into the non-linear liquid level mapping model, and combine with the pump efficiency attenuation coefficient , and output the calculated result H of the dynamic liquid level depth.
2. The method for calculating the fluid level based on the dynamometer card of an oil well according to claim 1, wherein The preprocessing in S2 includes: S21. Perform adaptive noise suppression algorithm on polished rod load The filtering formula is as follows: Among them, is the filtered load value, N is the sliding window radius, is the attenuation constant, is the original polished rod load value, is the time variable, is the sliding window cable hidden variable; S22. For the displacement data Execute the piecewise baseline calibration algorithm, and the calibration formula is: Among them, is the calibrated displacement value, is the baseline calibration window length, is the pulse function, is the original displacement value.
3. The method for calculating the dynamic liquid level based on the dynamometer card of an oil well according to claim 2, wherein The dynamic energy accumulation algorithm in S3 includes: S31. Calculate the instantaneous power of the pump string based on the filtered load and the calibrated displacement , with the formula as follows: Among them, is the displacement change rate; S32. Fuse the instantaneous power and the motor power to obtain a real-time energy accumulation value , and the formula is: Among them, is the motor energy coupling coefficient, is the system power loss, is the real-time motor power.
4. The method for calculating the fluid level based on the dynamometer card of an oil well according to claim 1, characterized in that, The cycle energy segmentation algorithm in S4 includes: S41. Identify the maximum and minimum points of the real-time energy accumulation value through the energy extreme value detection algorithm of the maximum value point and the minimum value point , where is the maximum energy value within the period, is the minimum energy value within the period; S42. Calculate the energy difference between adjacent maxima and minima , and compare it with the dynamic energy threshold . The judgment condition is as follows: Among them, is a period-sensitive factor, is the reference cycle duration, is the current cycle duration; S43. If the condition is satisfied, mark the current cycle as an effective work cycle; otherwise, mark it as a non-effective cycle.
5. The method for calculating the dynamic liquid level based on the dynamometer card of an oil well according to claim 3, wherein The motor energy coupling coefficient in S32 has the following calculation formula: Among them, is a calibration constant, is the fluid density, is the reference displacement, is the acceleration due to gravity, is the rated power of the motor.
6. The method for calculating the dynamic liquid level based on the dynamometer card of an oil well according to claim 4, characterized in that, The dynamic energy threshold is updated by the following steps: S61. Calculate the energy threshold baseline based on historical flowing fluid level data , and the formula is as follows: where K is the number of historical valid period samples, is the maximum energy value of the k-th sample, is the minimum energy value of the k-th sample; S62. Update the dynamic energy threshold as shown in the following formula Among them, is the attenuation weight, is the attenuation rate, is the fluid level depth at the previous moment, is the energy threshold baseline.
7. The method for calculating the dynamic liquid level based on the dynamometer card of an oil well according to claim 1, wherein In the extraction of energy characteristic parameters in S5: Maximum energy gradient The calculation formula is as follows: Among them, and are the start and end times of the effective period, is the cumulative energy value at a moment.
8. The method for calculating the fluid level based on the dynamometer card of an oil well according to claim 7, characterized in that, The non-linear liquid level mapping model in S6 is: Among them, is the liquid level calibration coefficient, is the historical depth influence factor, is the dynamic liquid level depth at the previous moment, is the reference displacement, is the energy fluctuation amplitude, is the pump efficiency attenuation coefficient, is the current cycle duration.
9. The method for calculating the fluid level based on the dynamometer card of an oil well according to claim 8, wherein The historical depth influence factor is calculated as follows: S91. Generate a dynamic weight according to the change rate of the fluid level depth The formula is as follows: Among them, is the sensitivity coefficient, is the change rate of the fluid level depth with time; S92. Generate a historical depth influence factor based on the dynamic weight, as shown in the following formula; , where is the fluid level depth at the previous moment.
10. The method for calculating the fluid level based on the dynamometer card of an oil well according to claim 9, characterized in that, The pump efficiency attenuation coefficient is generated through the following steps: S101. Collect the data of the opening and closing states of the pump valve in real time and calculate the pump efficiency attenuation rate , and the formula is: Among them, is the closing duration of the pump valve, is the duration of a complete cycle; S102. Update the dynamic compensation coefficient according to the pump efficiency attenuation rate , and the formula is: Among them, is the initial pump efficiency coefficient.