Separated layer water injection flow control method based on improved particle swarm optimization neural network PID
By combining neural networks and improving particle swarm algorithms and optimizing PID controllers, the problem of long flow regulation time in the water injection layer segment in traditional control methods and the neural network is prone to fall into local minimum values, realizing the precise control of water injection flow and the system self-direction Improved adaptability.
Patent Information
- Application Number
- CN202411348898.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-10
AI Technical Summary
When the traditional PID control method regulates the flow rate of the downhole water injected layer, the adjustment time is long and the overshoot is large, making it difficult to achieve the target water injected layer to achieve a smooth and rapid impact. The neural network is prone to fall into a local minimum value, and the control system Not very maintainable and reliable.
Combining neural network and improved particle swarm algorithm, optimize the PID controller, collect data through vortex flowmeter and pressure sensor, and adjust the parameters of the neural network PID controller using improved particle swarm algorithm to achieve accurate control of water injection flow and avoid local poles. Small value to improve the speed and accuracy of the control system.
It improves the accuracy and speed of water injection flow control, enhances the system's adaptability, enables the water injection volume to more accurately meet the filling requirements of the target layer section, and improves the stability and reliability of the control system.
Smart Images

Figure CN119288404A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of oil field stratified water injection, and in particular relates to a method for efficiently and stably controlling the flow rate of a downhole water injection layer. Background Art
[0002] Water injection development is the main development method of domestic oil fields, and stratified water injection is a key technical means to continuously improve oil field recovery. As water-driven development of old oil fields enters the stage of ultra-high water cut, the remaining oil is highly dispersed and the oil-water relationship is complex. In order to further improve the effect of oil field development, the development plan is required to achieve real-time and intelligent evaluation, optimization and adjustment. When controlling the flow of water injection wells, due to the increase in water injection volume, the water absorption capacity of the underground water injection layer will continue to change. The traditional PID control method has a long adjustment time and a large overshoot, which does not meet the requirements of engineering control. Therefore, how to adjust the water injection flow so that it can smoothly and quickly reach the target injection volume of the water injection layer has become an urgent problem to be solved in this field.
[0003] With the continuous development of artificial intelligence technology, neural networks are gradually being applied to oilfield development. Neural networks have certain advantages in controlling nonlinear and time-varying systems. Therefore, the present invention combines neural networks with PID and introduces an improved particle swarm algorithm to propose a stratified water injection flow control method based on improved particle swarm optimization neural network PID control, so that the advantages of neural networks can be fully utilized and the speed and accuracy of the control system can be improved. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention provides a stratified water injection flow control method based on an improved particle swarm optimization neural network PID, which avoids the neural network from falling into a local minimum, improves the accuracy of the neural network PID self-tuning results, and solves the problems of low maintainability and reliability of the stratified water injection flow control method.
[0005] To achieve the purpose of the present invention, the technical solution adopted by the present invention is a stratified water injection flow control method of improving particle swarm optimization neural network PID, which specifically includes the following steps: Step 1: The flow rate and pressure data of the water injection layer section in the well are collected by the vortex flowmeter and the pressure sensor respectively, and the collected data are uploaded to the neural network PID controller through the data processing module; Step 2: Optimize the neural network PID controller according to the improved particle swarm algorithm to improve the optimization speed and accuracy of the neural network PID controller; Step 3: The neural network PID controller sends a signal to control the DC motor to rotate forward or reverse. The DC motor drives the transmission mechanism to make the water nozzle reach a suitable opening, thereby realizing precise control of the water injection flow rate;
[0006] The improved particle swarm algorithm adjusts the inertia weight of the basic particle swarm algorithm.
[0007] The basic particle swarm algorithm is: v i (k+1)=ωv i (k)+c1r1(p best (k)-x i (k))+c2r2(g best -x i (k)) (1) x i (k+1)=x i (k)+v i (k+1) (2) Where k is the number of iterations, v i is the velocity of the ith particle, x i is the position of the ith particle, ω is the inertia weight, p best is the particle's personal optimal position, g best is the global optimal position of the particle, c1 and c2 are the cognitive acceleration coefficient and the social acceleration coefficient respectively, both of which are a constant, and r1 and r2 are two independent random numbers belonging to [0, 1].
[0008] The improved particle swarm algorithm improves the inertia weight of the basic particle swarm algorithm by proposing a group fitness variance strategy and combining the tanh function and the adaptive inertia weight. The new weight formula is: Among them, ω max ,ω min are the maximum and minimum values of the inertia weight, T and T max are the current number of iterations and the maximum number of iterations, σ 2 is the group fitness variance, and γ is a threshold set for the group fitness variance.
[0009] The population fitness variance strategy is: let the number of particles be N, and the population fitness variance σ 2 The calculation formula is: f=max(1,max|f i -f avg |) (6) Among them, f i is the fitness value of the ith particle, f avg is the average fitness value of the particle swarm, and the group fitness variance reflects the degree of convergence of the population, σ 2The smaller it is, the higher the degree of convergence of particles in the population. In this paper, σ 2 Set a threshold γ, when σ 2 When it is less than the threshold, the particle is judged to have converged prematurely, and the particle is driven to continue searching.
[0010] The tanh function is:
[0011] The improved particle swarm algorithm updates the speed and position formulas of the basic particle swarm algorithm by using the new inertia weight formula.
[0012] The pressure sensor of the downhole water injection layer section measures the change of the formation pressure, and at the same time, in combination with the requirements of the downhole water injection layer section for the water injection flow rate at different periods, the collected pressure is uploaded to the neural network PID control system.
[0013] The neural network PID controller adjusts the opening of the water tap by controlling the position of the DC motor.
[0014] The neural network PID control system takes the actual value of the water injection flow, the target injection amount and the difference between the two as inputs, and its output end is connected to a DC motor. The weights of the neural network are optimized by a particle swarm algorithm. According to the principle of the PID controller, the formula of the neural network PID control system is derived to obtain three basic parameters corresponding to the PID controller, namely, the gain coefficient, the integral time coefficient and the differential time coefficient. By adjusting these three parameters, the optimization process of the neural network on the PID parameters can be realized, and the control of the stratified water injection flow can be realized through the PID controller.
[0015] Beneficial effects of the present invention: The described stratified water injection flow control method of an improved particle swarm optimization neural network PID has the following advantages compared with the prior art: the neural network algorithm is combined with PID, and through the learning ability of the neural network, the parameters of the PID controller are adjusted more accurately by adopting a dynamic optimization method. At the same time, the use of the improved particle swarm algorithm can prevent the neural network from falling into the local optimum, improve the optimization speed and accuracy of the algorithm, effectively improve the adaptability of the water injection system, and make the water injection volume meet the injection requirements of the target layer. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a structural principle diagram of the control method system of the present invention.
[0017] Figure 2 It is a schematic diagram of the particle swarm algorithm optimized BP neural network PID control principle of the present invention.
[0018] Figure 3It is a flow chart of particle swarm algorithm optimizing BP neural network PID of the present invention. DETAILED DESCRIPTION
[0019] The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and examples.
[0020] like Figure 1 As shown, the present invention provides a technical solution, a stratified water injection flow control method of improving particle swarm optimization neural network PID, and the specific steps are as follows: Step 1: The flow rate and pressure data of the water injection layer section in the well are collected by the vortex flowmeter and the pressure sensor respectively, and the collected data are uploaded to the neural network PID control system through the data processing module; Step 2: Optimize the neural network PID controller according to the improved particle swarm algorithm to improve the optimization speed and accuracy of the neural network PID controller; Step 3: The neural network PID control system sends a signal to control the DC motor to rotate forward or reverse. The DC motor drives the transmission mechanism to make the water nozzle reach a suitable opening, thereby realizing precise control of the water injection flow rate;
[0021] In the above step 2, the improved particle swarm algorithm improves the inertia weight of the basic particle swarm algorithm by proposing a group fitness variance strategy and combining the tanh function and the adaptive inertia weight. The new weight improvement formula is: Among them, ω is the inertia weight, ω max ,ω min are the maximum and minimum values of the inertia weight, T and T max are the current iteration number and the maximum iteration number, σ 2 is the group fitness variance, and γ is a threshold set for the group fitness variance.
[0022] The population fitness variance strategy is: let the number of particles be N, and the population fitness variance σ 2 The calculation formula is: f=max(1,max|f i -f avg |) (11) Among them, f i is the fitness value of the ith particle, f avg is the average fitness value of the particle swarm, and the group fitness variance reflects the degree of convergence of the population, σ 2 The smaller it is, the higher the degree of convergence of particles in the population. In this paper, σ 2Set a threshold γ, when σ 2 When it is less than the threshold, the particle is judged to have converged prematurely. In this case, the particle is disturbed to drive it to continue searching.
[0023] The tanh function is:
[0024] The tanh function can smoothly adjust the inertia weight from one preset value to another. As the number of iterations increases, it gradually adjusts from a large weight that is beneficial to global search to a small weight that is beneficial to local search. In this way, the algorithm can widely explore the solution space at the beginning of the search process, and gradually focus on the optimal solution as the iterations deepen, improving the search efficiency and the quality of the optimal solution.
[0025] The basic particle swarm algorithm is adjusted by improving the inertia weight and acceleration factor, and then the neural network PID algorithm is optimized by the improved particle swarm algorithm.
[0026] For the neural network PID algorithm, it is necessary to determine the number of nodes in the input layer, hidden layer and output layer of the neural network, the initial value of the connection weights between the input layer and the hidden layer and between the hidden layer and the output layer, and the learning rate η;
[0027] Then initialize k=1, sample to obtain r(k) and y(k), and calculate the error e(k)=r(k)-y(k), where r(k) is the given injection volume of the injection layer section and y(k) is the actual injection volume of the injection layer section;
[0028] Then use r(k), y(k), and e(k) as the input of the neural network;
[0029] The output of each layer of the neural network is further calculated, and the output of the output layer is the three adjustable parameters K of the PID controller p , K i , K d ;
[0030] Further calculate the output u(k) of the PID controller; u(k)=u(k-1)+Δu(k) (13) Δu(k)=Kp(e(k)-e(k-1))+Kie(k)+Kd(e(k)+e(k-2)-2e(k-1)) (14)
[0031] Further study the neural network, adjust the weight coefficients, and adjust the PID control parameters;
[0032] Finally, the error e(k) between the given water injection volume and the actual water injection volume is judged; if it does not meet the requirements, set k=k+1; then return to step 2; if it meets the requirements, the output is transmitted to the DC motor to control the water nozzle opening to complete the control of the water injection flow.
[0033] In the present invention, in view of the problem that the flow rate of the injection layer section is difficult to meet the injection volume, an injection flow control method of an improved particle swarm optimization neural network PID is proposed. In view of the problem that the neural network is easy to fall into the local optimum and the optimization accuracy is not high, an improved particle swarm algorithm is proposed. By combining the improved particle swarm algorithm with the neural network, global optimization can be achieved, so that the global optimal value can be obtained, the weight and threshold are optimized, thereby improving the accuracy of PID parameter self-tuning and making the control system steady-state and dynamic performance better.
[0034] To sum up, the idea of optimizing neural network based on particle swarm algorithm is to use the macroscopic search ability and excellent global optimization ability of improved particle swarm algorithm to globally optimize the weights and thresholds of neural network when training the network, and then use neural network for precise solution, which can achieve the purpose of global optimization and fast and efficient, and can avoid falling into local minima. Therefore, a stratified water injection flow control method with improved particle swarm optimization neural network PID control is innovative.
Claims
1. A stratified water injection flow control method based on improved particle swarm optimization neural network PID, characterized in that: The specific steps include: Step 1: The flow rate and pressure data of the water injection layer section in the well are collected by the vortex flowmeter and the pressure sensor respectively, and the collected data are uploaded to the neural network PID controller through the data processing module; Step 2: Optimize the neural network PID controller according to the improved particle swarm algorithm to improve the optimization speed and accuracy of the neural network PID controller; Step 3: The neural network PID controller sends a signal to control the DC motor to rotate forward or reverse. The DC motor drives the transmission mechanism to make the water nozzle reach a suitable opening, thereby realizing precise control of the water injection flow rate.
2. The stratified water injection flow control method of the improved particle swarm optimization neural network PID according to claim 1 is characterized by: The improved particle swarm algorithm adjusts the inertia weight of the basic particle swarm algorithm.
3. The stratified water injection flow control method of the improved particle swarm optimization neural network PID according to claim 1 is characterized by: The basic particle swarm algorithm is: v i (k+1)=ωv i (k)+c1r1(p best (k)-x i (k))+c2r2(g best -x i (k)) (1) x i (k+1)=x i (k)+v i (k+1) (2) Where k is the number of iterations, v i is the velocity of the ith particle, x i is the position of the ith particle, ω is the inertia weight, p best is the particle's personal optimal position, g best is the global optimal position of the particle, c1 and c2 are the cognitive acceleration coefficient and the social acceleration coefficient respectively, both of which are a constant, and r1 and r2 are two independent random numbers belonging to [0, 1].
4. The stratified water injection flow control method of improved particle swarm optimization neural network PID according to claim 1 is characterized by: The improved particle swarm algorithm improves the inertia weight of the basic particle swarm algorithm by proposing a population fitness variance strategy and combining the tanh function and the inertia weight reduction. The new weight formula is: Among them, ω max ,ω min are the maximum and minimum values of the inertia weight, T and T max are the current number of iterations and the maximum number of iterations, σ 2 is the group fitness variance, and γ is a threshold set for the group fitness variance.
5. The improved particle swarm algorithm according to claim 4, characterized in that: The population fitness variance strategy is: let the number of particles be N, and the population fitness variance σ 2 The calculation formula is: f=max(1,max|f i -f avg |) (6) Among them, f i is the fitness value of the ith particle, f avg is the average fitness value of the particle swarm, and the group fitness variance reflects the degree of convergence of the population, σ 2 The smaller it is, the higher the degree of convergence of particles in the population. In this paper, σ 2 Set a threshold γ, when σ 2 When it is less than the threshold, the particle is judged to have converged prematurely, and the particle is driven to continue searching.
6. The improved particle swarm algorithm according to claim 4, characterized in that: The tanh function is:
7. The stratified water injection flow control method of improved particle swarm optimization neural network PID according to claim 1 is characterized by: The improved particle swarm algorithm updates the speed and position formulas of the basic particle swarm algorithm by using the new inertia weight formula.
8. The stratified water injection flow control method of improved particle swarm optimization neural network PID according to claim 1 is characterized by: The pressure sensor of the downhole water injection layer section measures the change of the formation pressure, and at the same time, in combination with the requirements of the downhole water injection layer section for the water injection flow rate at different periods, the collected pressure is uploaded to the neural network PID control system.
9. The stratified water injection flow control method of improved particle swarm optimization neural network PID according to claim 1 is characterized by: The neural network PID controller adjusts the opening of the water tap by controlling the position of the DC motor.
10. The stratified water injection flow control method of improved particle swarm optimization neural network PID according to claim 1 is characterized by: The neural network PID control system uses the actual value of the water injection flow, the target injection amount and the difference between the two as the neural network input, and the output end is connected to a DC motor. The weight and threshold of the neural network are optimized by an improved particle swarm algorithm. According to the principle of the PID controller, the formula of the neural network PID control system is derived to obtain three basic parameters corresponding to the PID controller, namely the gain coefficient, the integral time coefficient and the differential time coefficient. By adjusting these three parameters, the optimization process of the neural network on the PID parameters can be realized, and the control of the stratified water injection flow can be realized through the PID controller.
Citation Information
Cited By
Method for predicting hydrological flow based on MLP neural network model of PSO algorithm
CN120234558A