An automatic balancing system and method for an oil pumping unit
The automatic balancing system for oil pumping units utilizes LSTM neural networks and particle swarm optimization to predict the balance of the pumping unit and enable advance adjustment. This solves the problem of the pumping unit being unable to maintain its balance range and improves its service life and working efficiency.
Patent Information
- Application Number
- CN202510634652.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2026-11-17
AI Technical Summary
Existing automatic balancing methods for oil pumping units cannot guarantee that the pumping unit is always within the balance range, nor can they achieve the best balance effect, resulting in time-consuming, labor-intensive, and inefficient operation.
The system employs historical data acquisition, real-time data acquisition, predictive model construction, pre-adjustment parameter combination acquisition, and intelligent control. It utilizes an LSTM neural network model and an improved particle swarm optimization algorithm to predict the balance of the pumping unit at future moments and obtain the optimal combination of adjustment parameters, thereby achieving advance adjustment.
By predicting and adjusting in advance, the pumping unit is kept within a balanced range and reaches its optimal balance state, thereby improving its service life and working efficiency.
Smart Images

Figure CN123109602A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oil pumping units for oilfield production, and more specifically to an automatic balancing system and method for oil pumping units. Background Technology
[0002] With the continuous development of the petroleum industry, pumping units, as key equipment for oilfield development, have a significant impact on production efficiency and energy consumption due to their working efficiency and balance. However, the balance adjustment of existing pumping units usually relies on manual operation, which is not only time-consuming and labor-intensive, but also makes it difficult to achieve the ideal balance effect.
[0003] A rapid automatic balancing method for a pumping unit is disclosed in publication CN108505975B. This method includes: Step 1, collecting data and calculating the output shaft torque of the gearbox; Step 2, calculating the balance degree based on the difference between the peak torque values of the up and down strokes; Step 3, determining whether the balance degree exceeds the range; Step 4, determining the adjustment direction; Step 5, calculating the adjustment distance based on the balance degree to bring the balance degree within the set range; Step 6, outputting control signals for the adjustment direction and distance of the counterweight. This rapid automatic balancing method for a pumping unit is based on a pumping unit with electrically adjustable counterweight positions. It detects data such as suspension load, walking beam inclination angle, and electrical parameters to achieve balancing without shutting down the unit, reducing operational risks and improving adjustment efficiency.
[0004] However, most existing methods for automatically adjusting the balance of oil pumping units involve adjusting the pumping unit when it exceeds the balance range to bring it back to the balance range. Furthermore, adjustment can only be made when the pumping unit has already exceeded the balance range. Therefore, it cannot guarantee that the pumping unit will always be within the balance range, nor can it guarantee that the pumping unit will achieve the best performance within the balance range.
[0005] In view of this, the present invention proposes an automatic balancing system and method for oil pumping units, which ensures that the oil pumping units are automatically adjusted to the balance range while achieving the best adjustment effect. Summary of the Invention
[0006] In order to overcome the above-mentioned defects of the prior art, the present invention provides an automatic balancing system and method for oil pumping units to solve the problems existing in the background art.
[0007] This invention provides the following technical solution: an automatic balancing system for an oil pumping unit, comprising a historical data acquisition module, a real-time data acquisition module, a predictive model construction module, a pre-adjustment parameter combination acquisition module, and an intelligent control module; The historical data acquisition module is used to collect historical balancing data; The real-time data acquisition module is used to collect real-time pumping unit data and set timestamps to obtain the balance at each moment. The prediction model building module is used to build a balance prediction model to predict the balance of the pumping unit and obtain the predicted balance of the pumping unit at t future times. The pre-adjustment parameter combination acquisition module performs adjustment judgment based on the predicted balance degree. If the adjustment judgment result indicates that adjustment is required, the optimal adjustment parameter combination is obtained as the pre-adjustment parameter combination, and the pumping unit is pre-adjusted. The intelligent control module is used to receive the pre-adjustment parameter combination from the pre-adjustment parameter combination acquisition module and to perform balance adjustment on the oil pumping unit.
[0008] Preferably, the historical balancing data includes the reason for each balancing adjustment of the pumping unit in history, the type of balancing adjustment, the parameter values of the balancing adjustment, the time point of the balancing adjustment, and the effect of the balancing adjustment; the parameters of the balancing adjustment include the upstroke load, upstroke displacement, downstroke load, downstroke displacement, and stroke length before and after the adjustment.
[0009] Preferably, the method for obtaining the balance is as follows: ; in, Indicates oil pumping unit The balance of time; Indicates oil pumping unit The load during the upstroke at any given moment; Indicates oil pumping unit The displacement during the upstroke at any given moment; Indicates oil pumping unit The downstroke load at any given moment; Indicates oil pumping unit The displacement during the downstroke at any given moment; Indicates the maximum theoretical load; Indicates the stroke length.
[0010] Preferably, the balance prediction model is an LSTM neural network model, consisting of an input gate, a forget gate, and an output gate; the current input is represented as... , that is, the input at time t; the hidden layer vector at time t is represented as The cell state at time t is represented as The final output will be represented as ;but: ; ; ; in, Indicates the input gate. Represents the Gate of Oblivion Indicates the output gate; This represents the weight matrix of the input gate. The weight matrix represents the forget gate. This represents the weight matrix of the output gate; This indicates the bias of the input gate. This indicates the bias of the forget gate. Indicates the bias of the output gate; This indicates the activation function, which is the Sigmoid function; express The hidden layer vector at time step; At time t, the cell state update formula is: ,in, Represents the Hadamard product. express Cell state at time t, The updated cell state is expressed by the formula: ,in, The hyperbolic tangent activation function is used. Here is the weight matrix for the cell states. The bias of the cell state; The formula for the hidden layer vector is expressed as: ; The final output formula is expressed as: ;in, This represents the weight matrix of the output layer. This indicates the bias of the output layer.
[0011] Preferably, the training method for the balance prediction model is as follows: Using pumping unit data at various time points as analysis data, multiple sets of analysis data and corresponding balance degrees are pre-collected. These data and balance degrees are then converted into a set of feature vectors. Each feature vector is used as input to the balance degree prediction model, with the predicted balance degree corresponding to each set of analysis data as the output and the actual balance degree corresponding to each set as the prediction target. The actual balance degree is the pre-collected balance degree corresponding to the multiple sets of analysis data. The training objective is to minimize the sum of prediction errors for all analysis data. The formula for calculating the prediction error is: ,in, Indicates the prediction error. This indicates the group number of the feature vector corresponding to the analyzed data. Indicates the first Predictive balance corresponding to group analysis data Indicates the first The actual balance corresponding to the group analysis data is analyzed; the balance prediction model is trained until the sum of the prediction errors converges and then training is stopped.
[0012] Preferably, the specific method by which the pre-adjustment parameter combination acquisition module performs adjustment judgment is as follows: Set balance threshold and ;in, This represents the upper threshold, i.e., the upper limit of the range of values for balance. This represents the lower threshold, i.e., the lower limit of the range of values for balance. The balance range of the oil pumping unit is then determined to be... ; When balance At this point, the judgment result is that no adjustment is needed; When balance At this point, the judgment result indicates that adjustment is needed.
[0013] Preferably, the specific method by which the pre-adjustment parameter combination acquisition module obtains the optimal adjustment parameter combination is as follows: All possible combinations of adjustment parameters are obtained, and the optimal combination of adjustment parameters is determined based on the improved particle swarm optimization algorithm. The specific process is as follows: Step 1: Initialize the population and parameters; Step 2: Calculate fitness; Step 3: Update the velocity and position of each particle; Step 4: Repeat steps 2 and 3 until the condition is met; Step 5: Output the global optimal position, and take the combination of adjustment parameters corresponding to the particle at the global optimal position as the best combination of adjustment parameters, i.e., the pre-adjustment parameter combination.
[0014] Preferably, the initialization of the population and parameters specifically includes: A set of particles, i.e., potential solutions, is randomly generated in the solution space. Each particle represents a combination of adjustment parameters. Each particle has two attributes: position and velocity. The position attribute represents a candidate solution in the solution space, i.e., a combination of adjustment parameters. The velocity attribute controls the direction and step size of the particle's movement towards a better solution. The parameters include the number of particles and the maximum number of iterations. Inertia weight and learning factors and .
[0015] Preferably, the calculation of fitness specifically includes: Calculate the fitness value for each particle's position and record each particle's historical best position. Global optimal position of the entire population The optimal position is the position corresponding to the maximum fitness value; It is all The best value in; The formula for fitness is expressed as follows: ;in, Indicates the first The fitness of the i-th particle, i.e., the th... The fitness of a combination of adjustment parameters; Indicates the first The corresponding particle Predicted balance of a combination of adjustment parameters; Indicates the center value of the balance; ; The value can be obtained by changing the first The corresponding particle A combination of adjustment parameters is input into the balance prediction model to obtain the predicted balance.
[0016] An automatic balancing method for an oil pumping unit includes the following steps: Step 1: Collect historical balancing data; Step 2: Collect real-time pumping unit data and set timestamps to obtain the balance at each time point; Step 3: Build a balance prediction model to predict the balance of the pumping unit and obtain the predicted balance of the pumping unit at t future times. Step 4: Based on the predicted balance, make an adjustment judgment. If the adjustment judgment result is that adjustment is required, obtain the optimal combination of adjustment parameters as the pre-adjustment parameter combination, and pre-adjust the pumping unit. Step 5: Receive the pre-adjustment parameter combination from Step 4 and perform balance adjustment on the pumping unit.
[0017] The technical effects and advantages of this invention are as follows: This invention, by incorporating a pre-adjustment parameter combination acquisition module, facilitates the prediction of the balance of the pumping unit at future time t, thereby anticipating potential situations exceeding the balance range and enabling timely adjustments. Through an improved particle swarm optimization algorithm, a neural network model is introduced into the fitness calculation to obtain the optimal pre-adjustment parameter combination. This allows for advance parameter adjustments to the pumping unit in case of imbalance, ensuring the pumping unit remains within the balance range while achieving optimal adjustment within that range. This not only ensures the pumping unit is in a balanced state but also in an optimal balance state, thereby extending its service life, enhancing its working effect, and improving work efficiency. Attached Figure Description
[0018] Figure 1 This is a structural diagram of the automatic balancing system for the oil pumping unit of the present invention.
[0019] Figure 2 This is a flowchart of the automatic balancing method for the oil pumping unit according to the present invention. Detailed Implementation
[0020] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. In addition, the forms of the various structures described in the following embodiments are merely illustrative. The automatic balancing system and method for oil pumping units involved in the present invention are not limited to the structures described in the following embodiments. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] like Figure 1 As shown, the present invention provides an automatic balancing system for an oil pumping unit, including a historical data acquisition module, a real-time data acquisition module, a prediction model construction module, a pre-adjustment parameter combination acquisition module, and an intelligent control module; The historical data acquisition module is used to collect historical balancing data, which includes, but is not limited to, the reasons for each balancing adjustment of the pumping unit, the type of balancing adjustment, the parameter values of the balancing adjustment, the time point of the balancing adjustment, and the effect of the balancing adjustment; the parameters of the balancing adjustment include, but are not limited to, the upstroke load, upstroke displacement, downstroke load, downstroke displacement, and stroke length before and after the adjustment; the effect of the balancing adjustment can be judged by the performance of the pumping unit before and after the balancing adjustment; the performance of the pumping unit can be judged by any of the following indicators: power consumption, production efficiency, and dynamometer card characteristics; the types of balancing adjustment include over-balancing adjustment and under-balancing adjustment. The real-time data acquisition module is used to collect real-time pumping unit data and set timestamps to obtain the balance at each moment; the pumping unit data includes, but is not limited to, the pumping unit's upstroke load, upstroke displacement, downstroke load, and downstroke displacement. The prediction model construction module is used to construct a balance prediction model to predict the balance of the pumping unit and obtain the predicted balance of the pumping unit at t future moments. Its purpose is to lay the foundation for subsequent judgment on whether the predicted balance exceeds the range value, i.e. whether there is over-balance or under-balance, so as to make balance adjustment in advance. The pre-adjustment parameter combination acquisition module performs adjustment judgment based on the predicted balance degree. If the adjustment judgment result indicates that adjustment is needed, the optimal adjustment parameter combination is obtained as the pre-adjustment parameter combination, and the pumping unit is pre-adjusted. The purpose is to determine whether adjustment is needed based on the predicted balance degree, indicating that the predicted balance degree is either over-balanced or under-balanced, requiring pre-adjustment of the pumping unit to ensure it remains in a balanced state. Simultaneously, the optimal adjustment parameter combination is obtained to ensure the pumping unit achieves optimal balance after adjustment. Since the balance degree of the pumping unit is a range value, it is in a balanced state within this range. However, even within a balanced state, different balance degrees still have different impacts on the pumping unit. Only by finding the optimal balance degree can the pumping unit's performance be guaranteed to be at its best, further improving its service life and working performance. In the process of obtaining the optimal adjustment parameter combination for the pumping unit, the balance degree prediction model of the prediction model construction module is introduced to improve the modeling capability of the data, analyze the relationships between data more deeply, improve model robustness, and enhance the correlation between data. The intelligent control module is used to receive the pre-adjustment parameter combination from the pre-adjustment parameter combination acquisition module and to balance the pumping unit. Its purpose is to ensure that the pumping unit is in a balanced state by controlling the pre-adjustment parameter combination, and to make advance adjustments for possible imbalances in the future, so as to prevent the pumping unit from reducing its working efficiency due to imbalance.
[0022] In this embodiment, it should be specifically noted that the method for obtaining the balance is as follows: ; in, Indicates oil pumping unit The balance of time; Indicates oil pumping unit The load during the upstroke at any given moment; Indicates oil pumping unit The displacement during the upstroke at any given moment; Indicates oil pumping unit The downstroke load at any given moment; Indicates oil pumping unit The displacement during the downstroke at any given moment; Indicates the maximum theoretical load; Indicates the stroke length.
[0023] In this embodiment, it should be specifically noted that the balance prediction model is an LSTM neural network model, which consists of an input gate, a forget gate, and an output gate. Using an LSTM model, the gate structure can be designed to control the information of the cell state. This structure can effectively filter out the features of long-step data, thus it can obtain information from various types of data with timestamps, and can effectively solve the problem of gradient vanishing in the original RNN. The three gates each have their own functions: the input gate determines the retention of the current information, the forget gate determines the retention of the previous information to discard useless state information, and the output gate determines the retention of the updated state information. Represent the current input as , that is, the input at time t; the hidden layer vector at time t is represented as The cell state at time t is represented as The final output will be represented as ;but: ; ; ; in, Indicates the input gate. Represents the Gate of Oblivion Indicates the output gate; This represents the weight matrix of the input gate. The weight matrix represents the forget gate. This represents the weight matrix of the output gate; This indicates the bias of the input gate. This indicates the bias of the forget gate. Indicates the bias of the output gate; This indicates the activation function, which is the Sigmoid function; express The hidden layer vector at time step; At time t, the cell state update formula is: ,in, Represents the Hadamard product. express Cell state at time t, The updated cell state is expressed by the formula: ,in, The hyperbolic tangent activation function is used. Here is the weight matrix for the cell states. The bias of the cell state; The formula for the hidden layer vector is expressed as: ; The final output formula is expressed as: ;in, This represents the weight matrix of the output layer. This indicates the bias of the output layer.
[0024] In this embodiment, it should be specifically noted that the training method of the balance prediction model is as follows: Using pumping unit data at various time points as analysis data, multiple sets of analysis data and corresponding balance degrees are pre-collected. These data and balance degrees are then converted into a set of feature vectors. Each feature vector is used as input to the balance degree prediction model, with the predicted balance degree corresponding to each set of analysis data as the output and the actual balance degree corresponding to each set as the prediction target. The actual balance degree is the pre-collected balance degree corresponding to the multiple sets of analysis data. The training objective is to minimize the sum of prediction errors for all analysis data. The formula for calculating the prediction error is: ,in, Indicates the prediction error. This indicates the group number of the feature vector corresponding to the analyzed data. Indicates the first Predictive balance corresponding to group analysis data Indicates the first The actual balance corresponding to the group analysis data is analyzed; the balance prediction model is trained until the sum of the prediction errors converges and then training is stopped.
[0025] In this embodiment, it should be specifically explained that the pre-adjustment parameter combination acquisition module performs adjustment judgment in the following way: Set balance threshold and ;in, This represents the upper threshold, i.e., the upper limit of the range of values for balance. This indicates the lower threshold, which is the lower limit of the balance range. There is a range of balance values for the oil pumping unit. When the balance of the oil pumping unit exceeds this range, the oil pumping unit is in an unbalanced state and needs to be balanced in time to ensure the normal operation of the oil pumping unit. The balance range of the oil pumping unit is then determined to be... ; When balance This indicates that the oil pumping unit The balance at any given time is within the balance range, meaning the pumping unit is... The system is in a state of equilibrium at any given time, and the judgment result is that no adjustment is needed. When balance This indicates that the oil pumping unit The pumping unit is constantly in an unbalanced state and needs to be balanced to return it to a balanced state to ensure normal operation; in this case, the judgment result is that adjustment is required. If the predicted balance value at a certain moment exceeds the balance range, pre-adjustment is required to ensure that the predicted balance value of the pumping unit at that moment is within the balance range.
[0026] In this embodiment, it should be specifically explained that the pre-adjustment parameter combination acquisition module obtains the optimal adjustment parameter combination in the following way: All combinations of adjustment parameters are obtained. These combinations consist of pumping unit data within all reasonable ranges and the parameter values for balance adjustment from historical balance adjustment data. They can also be appropriately modified based on the expertise of those skilled in the art. The adjustment parameters are those that affect the balance of the pumping unit, i.e., the pumping unit data. The reasonable ranges are the reasonable value ranges of the pumping unit data. The optimal combination of adjustment parameters is obtained based on the improved particle swarm optimization algorithm. The specific process is as follows: Step 1: Initialize the population and parameters: Randomly generate a group of particles, i.e., potential solutions, in the solution space. Each particle represents a combination of adjustment parameters. Each particle has two attributes: position and velocity. The position attribute represents a candidate solution in the solution space, i.e., a combination of adjustment parameters. The velocity attribute controls the direction and step size of the particle's movement towards a better solution. The parameters include the number of particles and the maximum number of iterations. Inertia weight and learning factors and wait; Step 2: Calculate fitness: Calculate the fitness value for each particle's position to measure the quality of the solution, and record the historical best position for each particle. Global optimal position of the entire population The optimal position is the position corresponding to the maximum fitness value; It is all The best value in; Step 3: Update the velocity and position of each particle; Step 4: Repeat steps 2 and 3 until the condition is met; the condition is reaching the maximum number of iterations or the fitness value reaching convergence; in each iteration, the particle gradually moves to a better region by tracking its own historical best and the global best of the population. Step 5: Output the global optimal position, and take the combination of adjustment parameters corresponding to the particle at the global optimal position as the best combination of adjustment parameters, i.e., the pre-adjustment parameter combination.
[0027] In this embodiment, it should be specifically noted that the formula for fitness is expressed as follows: ;in, Indicates the first The fitness of the i-th particle, i.e., the th... The fitness of a combination of adjustment parameters; Indicates the first The corresponding particle Predicted balance of a combination of adjustment parameters; Indicates the center value of the balance; ; The value can be obtained by changing the first The corresponding particle A combination of adjustment parameters is input into the balance prediction model to obtain the predicted balance. The closer the predicted balance is to the center value of the balance, the closer it is to equilibrium, and the better the balance performance of the pumping unit. When the balance of the pumping unit is within the balance range but biased towards the two ends of the balance range, it will lead to accelerated component fatigue and shortened life of key parts. When the balance of the pumping unit is within the balance range and close to the center value of the range, the pumping unit has the lowest energy consumption, the longest equipment life, and the best pump efficiency.
[0028] In this embodiment, it should be specifically noted that in step 3, updating the velocity and position of each particle, the velocity of each particle is expressed by the formula: ; in, Indicates the first The updated velocity of each particle Indicates the first The current velocity of each particle; and These represent two random numbers between 0 and 1, respectively, to increase the randomness of the search; Indicates the first The historical best position of each particle Indicates the first The global optimal position of each particle; Indicates the first The current position of each particle; inertial weight Used to balance global search and local development The value is non-negative when When the value is large, the global optimization ability is strong, but the local optimization ability is weak. When the value is small, the global optimization ability is weak, but the local optimization ability is strong; learning factor and This embodiment selects the ability to control particles to learn from their own historical best and the group's best respectively. ; The position of each particle can be updated using the following formula: ;in, Indicates the first The updated position of each particle.
[0029] In this embodiment, it should be specifically explained that the intelligent control module performs balance adjustment of the pumping unit in the following way: When the pre-adjustment parameter combination acquisition module determines that the balance of the pumping unit exceeds the balance range at a certain moment, and the determination result indicates that adjustment is needed, it acquires the pre-adjustment parameter combination for that moment. Then, intelligent control adjustment is performed according to the parameter values of the pre-adjustment parameter combination at the moment preceding that moment. Since the prediction results change in real time, adjusting at the previous moment ensures the accuracy of the adjustment. If multiple predicted moments exceed the balance range and require adjustment, the earliest predicted moment is used to acquire the pre-adjustment parameter combination. After adjustment, the balance prediction results at each moment will change due to the current adjustment operation. For example, when the pre-adjustment parameter combination acquisition module determines that the balance of the pumping unit exceeds the balance range at moment t, and the determination result indicates that adjustment is needed, then... Obtain the pre-adjustment parameter combination corresponding to time t, and adjust it at time t-1. If the balance of the pumping unit exceeds the balance range at both time t and t+1, and the determination result indicates that adjustment is needed, then obtain the pre-adjustment parameter combination corresponding to time t, and adjust it at time t-1. If the predicted balance of the pumping unit still exceeds the balance range at time t+1 after adjustment, then obtain the pre-adjustment parameter combination corresponding to time t+1, and adjust it at time t. If the predicted balance of the pumping unit is within the balance range at time t+1 after adjustment, then no adjustment is needed at time t+1. Therefore, when adjusting the predicted balance in advance, adjusting it one time before the time when adjustment is needed can avoid subsequent repeated adjustments.
[0030] like Figure 2 As shown, the present invention also provides an automatic balancing method for an oil pumping unit, comprising the following steps: Step 1: Collect historical balancing data; Step 2: Collect real-time pumping unit data and set timestamps to obtain the balance at each time point; Step 3: Build a balance prediction model to predict the balance of the pumping unit and obtain the predicted balance of the pumping unit at t future times. Step 4: Based on the predicted balance, make an adjustment judgment. If the adjustment judgment result is that adjustment is required, obtain the optimal combination of adjustment parameters as the pre-adjustment parameter combination, and pre-adjust the pumping unit. Step 5: Receive the pre-adjustment parameter combination from Step 4 and perform balance adjustment on the pumping unit.
[0031] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0032] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An automatic balancing system for an oil pumping unit, characterized in that: It includes a historical data acquisition module, a real-time data acquisition module, a predictive model construction module, a pre-adjustment parameter combination acquisition module, and an intelligent control module; The historical data acquisition module is used to collect historical balancing data; The real-time data acquisition module is used to collect real-time pumping unit data and set timestamps to obtain the balance at each moment. The prediction model building module is used to build a balance prediction model to predict the balance of the pumping unit and obtain the predicted balance of the pumping unit at t future times. The pre-adjustment parameter combination acquisition module performs adjustment judgment based on the predicted balance degree. If the adjustment judgment result indicates that adjustment is required, the optimal adjustment parameter combination is obtained as the pre-adjustment parameter combination, and the pumping unit is pre-adjusted. The intelligent control module is used to receive the pre-adjustment parameter combination from the pre-adjustment parameter combination acquisition module and to perform balance adjustment on the oil pumping unit.
2. The automatic balancing system for an oil pumping unit according to claim 1, characterized in that: The historical balancing data includes the reasons for each balancing adjustment performed on the pumping unit in history, the type of balancing adjustment, the parameter values of the balancing adjustment, the time point of the balancing adjustment, and the effect of the balancing adjustment; the parameters of the balancing adjustment include the upstroke load, upstroke displacement, downstroke load, downstroke displacement, and stroke length before and after the adjustment.
3. The automatic balancing system for an oil pumping unit according to claim 2, characterized in that: The method for obtaining the balance is as follows: ; in, Indicates oil pumping unit The balance of time; Indicates oil pumping unit The load during the upstroke at any given moment; Indicates oil pumping unit The displacement during the upstroke at any given moment; Indicates oil pumping unit The downstroke load at any given moment; Indicates oil pumping unit The displacement during the downstroke at any given moment; Indicates the maximum theoretical load; Indicates the stroke length.
4. The automatic balancing system for an oil pumping unit according to claim 3, characterized in that: The balance prediction model is specifically an LSTM neural network model, consisting of an input gate, a forget gate, and an output gate; the current input is represented as... , that is, the input at time t; the hidden layer vector at time t is represented as The cell state at time t is represented as The final output will be represented as ;but: ; ; ; in, Indicates the input gate. Represents the Gate of Oblivion Indicates the output gate; This represents the weight matrix of the input gate. The weight matrix represents the forget gate. This represents the weight matrix of the output gate; This indicates the bias of the input gate. This indicates the bias of the forget gate. Indicates the bias of the output gate; This indicates the activation function, which is the Sigmoid function; express The hidden layer vector at time step; At time t, the cell state update formula is: ,in, Represents the Hadamard product. express Cell state at time t, The updated cell state is expressed by the formula: ,in, The hyperbolic tangent activation function is used. Here is the weight matrix for the cell states. The bias of the cell state; The formula for the hidden layer vector is expressed as: ; The final output formula is expressed as: ;in, This represents the weight matrix of the output layer. This indicates the bias of the output layer.
5. The automatic balancing system for an oil pumping unit according to claim 4, characterized in that: The training method for the balance prediction model is as follows: Using pumping unit data at various time points as analysis data, multiple sets of analysis data and corresponding balance degrees are pre-collected. These data and balance degrees are then converted into a set of feature vectors. Each feature vector is used as input to the balance degree prediction model, with the predicted balance degree corresponding to each set of analysis data as the output and the actual balance degree corresponding to each set as the prediction target. The actual balance degree is the pre-collected balance degree corresponding to the multiple sets of analysis data. The training objective is to minimize the sum of prediction errors for all analysis data. The formula for calculating the prediction error is: ,in, Indicates the prediction error. This indicates the group number of the feature vector corresponding to the analyzed data. Indicates the first Predictive balance corresponding to group analysis data Indicates the first The actual balance corresponding to the group analysis data is analyzed; the balance prediction model is trained until the sum of the prediction errors converges and then training is stopped.
6. The automatic balancing system for an oil pumping unit according to claim 5, characterized in that: The specific method by which the pre-adjustment parameter combination acquisition module performs adjustment judgment is as follows: Set balance threshold and ;in, This represents the upper threshold, i.e., the upper limit of the range of values for balance. This represents the lower threshold, i.e., the lower limit of the range of values for balance. The balance range of the oil pumping unit is then determined to be... ; When balance At this point, the judgment result is that no adjustment is needed; When balance At this point, the judgment result indicates that adjustment is needed.
7. The automatic balancing system for an oil pumping unit according to claim 6, characterized in that: The specific method by which the pre-adjustment parameter combination acquisition module obtains the optimal adjustment parameter combination is as follows: All possible combinations of adjustment parameters are obtained, and the optimal combination of adjustment parameters is determined based on the improved particle swarm optimization algorithm. The specific process is as follows: Step 1: Initialize the population and parameters; Step 2: Calculate fitness; Step 3: Update the velocity and position of each particle; Step 4: Repeat steps 2 and 3 until the condition is met; Step 5: Output the global optimal position, and take the combination of adjustment parameters corresponding to the particle at the global optimal position as the best combination of adjustment parameters, i.e., the pre-adjustment parameter combination.
8. The automatic balancing system for an oil pumping unit according to claim 7, characterized in that: The initialization of the population and parameters specifically includes: A set of particles, i.e., potential solutions, is randomly generated in the solution space. Each particle represents a combination of adjustment parameters. Each particle has two attributes: position and velocity. The position attribute represents a candidate solution in the solution space, i.e., a combination of adjustment parameters. The velocity attribute controls the direction and step size of the particle's movement towards a better solution. The parameters include the number of particles and the maximum number of iterations. Inertia weight and learning factors and .
9. The automatic balancing system for an oil pumping unit according to claim 8, characterized in that: The calculation of fitness specifically includes: Calculate the fitness value for each particle's position and record each particle's historical best position. Global optimal position of the entire population The optimal position is the position corresponding to the maximum fitness value; It is all The best value in; The formula for fitness is expressed as follows: ;in, Indicates the first The fitness of the i-th particle, i.e., the th... The fitness of a combination of adjustment parameters; Indicates the first The corresponding particle Predicted balance of a combination of adjustment parameters; Indicates the center value of the balance; ; The value can be obtained by changing the first The corresponding particle A combination of adjustment parameters is input into the balance prediction model to obtain the predicted balance.
10. An automatic balancing method for an oil pumping unit, used to implement the system described in any one of claims 1-9, characterized in that: Includes the following steps: Step 1: Collect historical balancing data; Step 2: Collect real-time pumping unit data and set timestamps to obtain the balance at each time point; Step 3: Build a balance prediction model to predict the balance of the pumping unit and obtain the predicted balance of the pumping unit at t future times. Step 4: Based on the predicted balance, make an adjustment judgment. If the adjustment judgment result is that adjustment is required, obtain the optimal combination of adjustment parameters as the pre-adjustment parameter combination, and pre-adjust the pumping unit. Step 5: Receive the pre-adjustment parameter combination from Step 4 and perform balance adjustment on the pumping unit.
Citation Information
Patent Citations
Method for rapid automatic balancing of oil pumping units
CN108505975B
