A method for building an offline machine learning model for production optimization based on historical experience

By using the population-based genetic algorithm to train reinforcement learning agents in oil and gas production optimization, combined with the deep reinforcement learning framework, the problem of insufficient strong nonlinear decision variables and exploration strategies in oil and gas production optimization is solved, and the efficiency and stability of oil and gas production are improved. sexual effect.

CN115222140BActive Publication Date: 2024-09-27CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210902133.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2024-09-27
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

Existing technologies face the challenge of strongly nonlinear decision variables and objective functions in oil and gas production optimization, and reinforcement learning lacks effective exploration strategies in large state spaces and action spaces, and has fragile convergence properties, making it difficult to effectively improve oil and gas production efficiency.

Method used

The population-based genetic algorithm is used to train reinforcement learning agents to provide diversified exploration experience. It combines the deep reinforcement learning framework and the proximal strategy optimization algorithm to update the strategy network through the genetic algorithm to improve stability and robustness and meet the needs of the reservoir model. physical and operational constraints.

Benefits of technology

It improves the efficiency and stability of oil and gas production optimization, reduces calculation time, and can directly provide the optimal production system during re-optimization without repeating the expensive optimization process to meet the needs of the oil field site.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115222140B
    Figure CN115222140B
Patent Text Reader

Abstract

The present invention discloses a method for constructing a production optimization machine learning offline model that inherits historical experience, and belongs to the field of petroleum technology. The present invention utilizes a reinforcement learning proximal strategy optimization algorithm and a genetic algorithm, and can distribute calculations to multiple CPUs to complete parallel calculations, share data pools between processes, improve sampling efficiency, and train reinforcement learning agents by providing diverse exploration experiences to improve stability and robustness; at the same time, the trained strategy network can directly give the optimal production system when optimizing again, without repeating the expensive optimization process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of petroleum technology, and in particular relates to a method for constructing a production optimization machine learning offline model that inherits historical experience. Background Art

[0002] Over the past few decades, the oil and gas industry has played an incredible role in the international economy and will continue to be the backbone of global energy in the coming years. At present, quite a number of oil fields in my country have entered the mature stage. Therefore, in the context of continued fluctuations in international oil prices, it is crucial to strive to improve the oil and gas production efficiency of existing oil and gas reservoirs. With the technological development of digital oil fields and smart oil fields, production optimization, as a systematic workflow, has attracted more and more attention from reservoir workers. The purpose of production optimization is to obtain the best development plan (such as flow rate, location, and pressure) for each well to achieve economic benefits or maximize cumulative oil and gas production. However, the optimization problem in actual production is not a simple task and is challenged by strong nonlinearities between decision variables and objective functions. In addition, the optimized solution must meet the required physical and operational constraints to ensure its feasibility. Unfortunately, a simulation run can take a relatively long time, and a complete optimization generally requires thousands of simulation runs. Therefore, there is a rush to develop algorithms with high efficiency to meet these challenges.

[0003] Although reinforcement learning has successfully improved the performance of real-time production optimization, there are still two shortcomings that hinder its performance. First, reinforcement learning lacks effective and diverse exploration strategies when faced with large state spaces and action spaces. Generally speaking, actual reservoir models contain a large number of grids and involve a large number of decision variables, making it difficult to learn a strategy that can well establish the mapping relationship between reservoir states and well control. Second, reinforcement learning has fragile convergence characteristics, especially when the rewards are uneven during the interaction process. The main innovation of the proposed method is the introduction of a population-based genetic algorithm to provide diverse exploration experiences to train the reinforcement learning agent and improve stability and robustness. Summary of the invention

[0004] In view of the above-mentioned technical problems existing in the prior art, the present invention proposes a method for constructing a production optimization machine learning offline model that inherits historical experience. The method has a reasonable design, overcomes the shortcomings of the prior art, and has good results.

[0005] In order to achieve the above object, the present invention adopts the following technical solution:

[0006] A method for constructing a production optimization machine learning offline model that inherits historical experience includes the following steps:

[0007] Step 1: Establish a numerical model of the reservoir in the area to be optimized, and obtain the injection wells and their injection volume constraints, production wells and their production constraints, and the water content or formation pressure constraints of the reservoir in the model;

[0008] Step 2: Initialize the population G and the experience storage data pool Ω; the population G includes N e a strategic network;

[0009] Step 3: Use the proximal strategy optimization algorithm to build a deep reinforcement learning framework and initialize N r an agent;

[0010] Step 4: Initialize training parameters and reservoir status information, including reservoir formation pressure and remaining oil saturation information;

[0011] Step 5: The current state S generated by different strategy networks in population G t The action space a t , interact with the environment model numerical simulator and get reward r t and the next state S t+1 , calculate the total revenue of the entire production cycle as the individual fitness value in the population G, and the reinforcement learning strategy calculates the total revenue of the entire production cycle in the same way;

[0012] Step 6: Use genetic algorithm to update parameters in the population;

[0013] Step 7: Perform strategy update of the proximal strategy optimization algorithm;

[0014] When the number of samples in the shared experience pool is large enough, a certain number of samples {S t ,A,r t ,S t+1}Update the strategy network and action value network;

[0015] Step 8: Regularly copy the policy network trained by the proximal policy optimization algorithm to the genetic algorithm population G to replace the weakest individuals;

[0016] Step 9: Repeat steps 4 to 8 until the iterative convergence condition is met;

[0017] Step 10: According to the saved optimal strategy network, the reservoir status information is input, and the complete production system can be output.

[0018] Preferably, the specific steps of obtaining the model constraint variables in step 1 are:

[0019] Step 1.1: The injection well is a linear constraint and flow control is used for the injection well:

[0020] Daily injection volume of a single well∈[x,y];

[0021] Among them, x is the lower boundary; y is the upper boundary set to the maximum water injection rate;

[0022] Step 1.2: The production well is linearly constrained and bottom hole pressure is used for control:

[0023] Bottom hole pressure ∈ [m,n];

[0024] Among them, the lower boundary of m is the reservoir bubble point pressure, and the upper boundary of n is set to the average reservoir pressure;

[0025] Step 1.3: Also consider nonlinear constraints including reservoir water content or formation pressure.

[0026] Preferably, in step 3, the following steps are specifically included:

[0027] Step 3.1: Reinforcement learning is a process in which the agent learns in a trial-and-error manner, and the reward obtained by interacting with the environment guides the behavior, with the goal of enabling the agent to obtain the maximum reward. The proximal strategy optimization algorithm is used to model the injection-production optimization problem as a Markov decision, and the following key elements are defined: strategy, state, action, and reward function.

[0028] Step 3.2: Neural network π parameterized by θ θ (a t |s t ) represents the policy network, the input of which is the state s t , the output is action a t ; Use the neural network V parameterized by ω ω (s t ) represents the action value network, the tourist becomes the Q network, and the input of the action value network is the state s t , the output is value.

[0029] Preferably, in step 5, the following steps are specifically included:

[0030] Step 5.1: Read the RSM output file of reservoir numerical simulation and use it as grid input in matrix form;

[0031] s t ={s o,1 ,···,s o,n ;p1,···,p n} (1);

[0032] In the formula, s t represents the state at time t, p i Represents the pressure value of each grid point in the reservoir model, s o,i Indicates the oil saturation value;

[0033] Step 5.2: Action a t Set as the well control plan for each well in the tth time step, as shown in formula (2):

[0034]

[0035] Where W prd,i represents the liquid production of the i-th production well, W inj,i represents the injection rate of the i-th injection well;

[0036] Step 5.3: Reward r t The economic net present value NPV of the current time step is used as shown in formula (3):

[0037]

[0038] In the formula, q o,j ,q w,j and q wi,i are the daily oil production of the jth production well, the daily water production of the jth production well, and the daily injection volume of the i-th injection well, in units of m 3 / d,r o is the crude oil price, r w and r i They are water treatment cost and water injection cost, in yuan / m 3 ;

[0039] Step 5.4: Repeat the following steps 5.4.1-5.4.2 until the numerical simulation process of the entire production cycle is completed.

[0040] Step 5.4.1: Read the reservoir formation pressure and saturation information in the current state, input the reservoir state information into the strategy network, and output the control variable a of the well at the current time t. t , and written into the production system documents;

[0041] Step 5.4.2: According to the production system obtained by the strategy network, call the reservoir numerical simulator to simulate the production process under the system, obtain the production dynamics such as oil production and liquid production under the system, as well as the reservoir pressure and reservoir status information at the next moment s t+1 .

[0042] Preferably, step 6 specifically includes the following steps:

[0043] Step 6.1: Each individual strategy network in the population is evaluated through interaction with the reservoir numerical simulator throughout the production cycle, and its fitness value is the cumulative net present value, that is, the net present value of the entire production cycle, calculated as follows:

[0044]

[0045] Where NPV is the net present value, n is the number of control time steps; Q o,t , Q w,t and Q i,t are the oil production rate, water production rate and water injection rate at time step t, respectively, m 3 / d;r o is the crude oil price, r w and r i They are water treatment cost price and water injection cost price, RMB / m 3 ; b is the average annual interest rate; p t is the annual interest rate;

[0046] Step 6.2: Keep some individuals as elites;

[0047] Step 6.3: Probabilistically perturb the weights of the policy network through selection, crossover, and mutation operations to generate new individuals as offspring;

[0048] Step 6.4: Regularly replace the policy network updated by reinforcement learning using gradient information with individuals from the genetic algorithm population. The genetic algorithm is optimized as the outer loop, and the gradient information is used for training in the inner loop.

[0049] Preferably, step 7 specifically includes the following steps:

[0050] Step 7.1: Based on the current state information s of the reservoir t , decision variable a t , reward value r t+1 And the reservoir status information s at the next moment t+1 , evaluate the quality of the current policy network's execution strategyδ t And update the parameters ω of the action-value network:

[0051] δ t ←r t+1 +γV ω (s t+1 ,a t+1 )-V ω (s t ,a t ) (5);

[0052]

[0053] Among them, δ t It is called TD error, which measures the current moment s t The estimated value of and the better estimate of r t+1 +γV ω (s t+1 ,a t+1 ) It means to find the gradient of ω;

[0054] Step 7.2: According to the current reservoir state s t , decision variable a t and the δ returned by the action-value network t Update the parameters θ of the policy network:

[0055]

[0056] in, It means to find the gradient of θ;

[0057] Step 7.3: During the optimization process, each agent is initially assigned the same number of CPU cores to interact with the reservoir environment. The allocation of CPU cores takes into account not only the current estimated value of the agent but also the number of times they have been selected, ensuring a balance between exploration and exploitation and avoiding time-consuming hyperparameter optimization.

[0058] Preferably, the iterative convergence condition in step 9 is: the total number of numerical simulator runs reaches a set upper limit; if the preset stop criterion is met, the calculation is terminated and the process goes to step 10; if not, steps 4 to 8 are repeated.

[0059] Preferably, in step 10, the optimal strategy network, that is, the optimal strategy, is saved; the reservoir state at the current moment is input to obtain the corresponding production plan at that moment, all decision time steps are looped, and the decision variables of each production well and water injection well are saved to form a complete production system. The optimal production plan includes the injection and production volume of oil and water wells or the bottom hole pressure; at the same time, the trained strategy network can directly give the optimal production system when optimizing again, without repeating the expensive optimization process.

[0060] Beneficial technical effects brought by the present invention:

[0061] The present invention utilizes the reinforcement learning proximal strategy optimization algorithm and the genetic algorithm to distribute the calculation to multiple CPUs to complete parallel calculation, share the data pool between processes, improve sampling efficiency, and train the reinforcement learning agent by providing diverse exploration experience to improve stability and robustness. At the same time, the trained strategy network can directly give the optimal production system when optimizing again, without repeating the expensive optimization process; this process does not rely on any supplementary structure or manually designed complex rules, and can better meet the needs of oil field sites and actual development. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is the overall design flow chart of the present invention;

[0063] Figure 2 It is a high-performance and data-efficient architecture diagram for training optimal strategies;

[0064] Figure 3 It is a schematic diagram of the net present value optimization curve of the iterative process;

[0065] Figure 4 It is a schematic diagram of the control time steps after optimization of some production wells;

[0066] Figure 5 It is a schematic diagram of the time steps of some water injection wells after optimization;

[0067] Figure 6 This is a comparison chart of cumulative oil production before and after optimization. DETAILED DESCRIPTION

[0068] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0069] The present invention specifically includes the following Figure 1 The steps shown are further described in conjunction with the following examples.

[0070] The proposed technology was tested by taking a certain reservoir model as an example, and compared with the traditional optimization algorithm. The reservoir model is a heterogeneous reservoir model under water drive production, with a model size of 163*88*163, and the main layer was selected for optimization. The production system of 58 wells in the model was selected for regulation. The upper limit of the injection rate allowed for each injection well was set to the maximum injection rate, and the lower limit was 0.5 times the current injection amount. The upper limit of the production well is similarly set to the maximum liquid production rate, and the lower limit is 0.5 times the current liquid production; the model has been in production for 6971 days. At the current stage of production, the cumulative oil production is 4259038 cubic meters, the cumulative water injection is 49521.45 cubic meters, and the water content of the oil field is 0.965. The crude oil price is 80.0 yuan / m 3 ; Water injection cost 5.0 yuan / m 3 ; Water treatment cost is 19.0 yuan / m 3 The average annual interest rate is 0%. The regulation is carried out once a quarter, and the number of training steps in a production cycle is set to 20. The total optimization variable dimension is: 20*58=1160, which is a complex ultra-high-dimensional optimization problem.

[0071] Table 1 Examples of production system constraints

[0072]

[0073] Step 1: Establish a numerical model of the reservoir in the area to be optimized. The upper limit of the injection rate allowed for each injection well is set to the maximum injection rate, and the lower limit is 0.5 times the current injection rate. The upper limit of the production well is similarly set to the maximum liquid production rate, and the lower limit is 0.5 times the current liquid production. Specific constraint examples are shown in Table 1.

[0074] Step 2: Initialize the population G, which includes 25 policy networks, whose network parameters are randomly initialized; initialize the experience storage data pool Ω;

[0075] Step 3: Build a proximal strategy optimization framework for deep reinforcement learning algorithms and initialize a set of N r The learning rates of the policy network and action value network are both λ θ = 0.004 and λ ω =0.004, the strategy network is a 3D convolutional neural network, which is used to extract multi-layer state information of the reservoir;

[0076] Step 4: Initialize training parameters and reservoir status information, state s t Set to the pressure value p at each grid point of the reservoir model i and oil saturation value s o,i , as the input of the model in the following form.

[0077] s t ={s o,1 ,···,s o,n ;p1,···,p n} (8);

[0078] Step 5: The current state S generated by different strategy networks in population G t The action space a t Modify the reservoir production system, call the reservoir numerical simulation software through parallel computing to perform real numerical simulation to obtain the response set, that is, the reward R and the next state S t+1 , {S t , a t ,r,S t+1} Add the experience pool, calculate the total revenue of the entire production cycle as the fitness value of each individual in the population G, sort the individuals in the population according to the fitness value, get the maximum fitness value in the genetic algorithm, and save the corresponding optimal strategy; the reinforcement learning strategy calculates the total revenue of the entire production cycle in the same way;

[0079] Step 6: Use genetic algorithm to update parameters in the population.

[0080] Each individual strategy network in the population is evaluated through interaction with the reservoir numerical simulator throughout the production cycle, and its fitness value adopts the cumulative net present value. A portion of individuals with higher fitness are retained as elites, and then the weights of the strategy network are probabilistically perturbed through selection, crossover and mutation operations to generate new individuals as offspring.

[0081] Step 7: Update the strategy of reinforcement learning method.

[0082] When the number of samples in the experience pool is large enough, a certain number of samples are selected from the experience pool {S t ,A,r,S t+1}Update the strategy network and action value network.

[0083] Step 8: Regularly copy the policy network trained by reinforcement learning to the genetic algorithm population G to replace the weakest individuals.

[0084] Step 9: Repeat steps (4) to (8) until the maximum number of iterations is reached;

[0085] Step 10: Output the complete production system based on the saved optimal strategy network and implement it on site.

[0086] Comparison of the final optimization results shows that the production system of the relevant wells in the initial plan was carried out according to the production before the well was shut in. The initial plan produced a total of 4,998,261 cubic meters of oil. The final optimized plan produced a total of 5,137,461 cubic meters of oil, an increase of 139,200, 2.78% compared to the original plan.

[0087] The method of the present invention can provide high-quality basic data for reasonable production configuration and injection-production strategy adjustment, and provide technical support for dynamic analysis, intelligent injection-production, and layer optimization.

[0088] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. A method for constructing a production optimization machine learning offline model that inherits historical experience, characterized by: The following steps are involved: Step 1: Establish a numerical model of the reservoir in the area to be optimized, and obtain the injection wells and their injection volume constraints, production wells and their production constraints, and the water content or formation pressure constraints of the reservoir in the model; Step 2: Initialize the population G and the experience storage data pool Ω; the population G includes N e a strategic network; Step 3: Use the proximal strategy optimization algorithm to build a deep reinforcement learning framework and initialize N r an agent; Step 4: Initialize training parameters and reservoir status information, including reservoir formation pressure and remaining oil saturation information; Step 5: The current state S generated by different strategy networks in population G t The action space a t , interact with the environment model numerical simulator and get reward r t and the next state S t+1 , calculate the total revenue of the entire production cycle as the individual fitness value in the population G, and the reinforcement learning strategy calculates the total revenue of the entire production cycle in the same way; Step 6: Use genetic algorithm to update parameters in the population; Step 7: Perform strategy update of the proximal strategy optimization algorithm; When the number of samples in the shared experience pool is large enough, a certain number of samples {S t ,A,r t ,S t+1 }Update the strategy network and action value network; Step 8: Regularly copy the policy network trained by the proximal policy optimization algorithm to the genetic algorithm population G to replace the weakest individuals; Step 9: Repeat steps 4 to 8 until the iterative convergence condition is met; Step 10: According to the saved optimal strategy network, the reservoir status information is input, and the complete production system can be output; The specific steps for obtaining model constraint variables in step 1 are: Step 1.1: The injection well is a linear constraint and flow control is used for the injection well: Daily injection volume of a single well∈[x,y]; Among them, x is the lower boundary; y is the upper boundary set to the maximum water injection rate; Step 1.2: The production well is linearly constrained and bottom hole pressure is used for control: Bottom hole pressure ∈ [m,n]; Among them, the lower boundary of m is the reservoir bubble point pressure, and the upper boundary of n is set to the average reservoir pressure; Step 1.3: Consider nonlinear constraints including reservoir water content or formation pressure; In step 3, the following steps are specifically included: Step 3.1: Reinforcement learning is a process in which the agent learns in a trial-and-error manner, and the reward obtained through interaction with the environment guides the behavior, with the goal of enabling the agent to obtain the maximum reward. The proximal strategy optimization algorithm is used to model the injection-production optimization problem as a Markov decision, and the following key elements are defined: strategy, state, action, and reward function. Step 3.2: Neural network π parameterized by θ θ (a t |s t ) represents the policy network, the input of which is the state s t , the output is action a t ; Use the neural network V parameterized by ω ω (s t ) represents the action value network, and the input of the action value network is the state s t , the output is value; In step 5, the following steps are specifically included: Step 5.1: Read the RSM output file of reservoir numerical simulation and use it as grid input in matrix form; with t ={with o,1 ,···,with o,i ,···,with o,n ;p1,···,p i ,···,p n } (1); In the formula, s t represents the state at time t, p i Represents the pressure value of each grid point in the reservoir model, s o,i Indicates the oil saturation value; Step 5.2: Action a t Set as the well control plan for each well in the tth time step, as shown in formula (2): Where W prd,i represents the liquid production of the i-th production well, W inj,i represents the injection rate of the i-th injection well; Step 5.3: Reward r t The economic net present value NPV of the current time step is used as shown in formula (3): In the formula, q o,j ,q w,j and q wi,i are the daily oil production of the jth production well, the daily water production of the jth production well, and the daily injection volume of the i-th injection well, in units of m 3 / d,r o is the crude oil price, r w and r i They are water treatment cost and water injection cost, in yuan / m 3 ; Step 5.4: Repeat the following steps 5.4.1-5.4.2 until the numerical simulation process of the entire production cycle is completed. Step 5.4.1: Read the reservoir formation pressure and saturation information in the current state, input the reservoir state information into the strategy network, and output the control variable a of the well at the current time t. t , and written into the production system documents; Step 5.4.2: According to the production system obtained by the strategy network, call the reservoir numerical simulator to simulate the production process under the system, and obtain the production dynamics including oil production and liquid production under the system, as well as the reservoir pressure and reservoir status information at the next moment s t+1 ; Step 6 specifically includes the following steps: Step 6.1: Each individual strategy network in the population is evaluated through interaction with the reservoir numerical simulator throughout the production cycle, and its fitness value is the cumulative net present value, that is, the net present value of the entire production cycle, calculated as follows: Where NPV is the net present value, n is the number of control time steps; Q o,t , Q w,t and Q i,t are the oil production rate, water production rate and water injection rate at time step t, respectively, m 3 / d;r o is the crude oil price, r w and r i They are water treatment cost price and water injection cost price, RMB / m 3 ; b is the average annual interest rate; p t is the annual interest rate; Step 6.2: Keep some individuals as elites; Step 6.3: Probabilistically perturb the weights of the policy network through selection, crossover, and mutation operations to generate new individuals as offspring; Step 6.4: Regularly replace the strategy network updated by reinforcement learning using gradient information with individuals in the genetic algorithm population. The genetic algorithm is optimized as the outer loop, and the gradient information is used for training in the inner loop. Step 7 specifically includes the following steps: Step 7.1: Based on the current state information s of the reservoir t , decision variable a t , reward value r t+1 And the reservoir status information s at the next moment t+1 , evaluate the quality of the current policy network's execution strategyδ t And update the parameters ω of the action-value network: Among them, δ t It is called TD error, which measures the current moment s t The estimated value of and the better estimate of r t+1 +γV ω (s t+1 ,a t+1 ) It means to find the gradient of ω; Step 7.2: According to the current reservoir state s t , decision variable a t and the δ returned by the action-value network t Update the parameters θ of the policy network: in, It means to find the gradient of θ; Step 7.3: During the optimization process, each agent is initially assigned the same number of CPU cores to interact with the reservoir environment. The allocation of CPU cores takes into account not only the current estimated value of the agent but also the number of times they have been selected, ensuring a balance between exploration and exploitation and avoiding time-consuming hyperparameter optimization.

2. The method for constructing a production optimization machine learning offline model based on historical experience according to claim 1, characterized in that: The iterative convergence condition in step 9 is: the total number of numerical simulator runs reaches the set upper limit; if the preset stop criterion is met, the calculation is terminated and the process goes to step 10; if not, steps 4 to 8 are repeated.

3. The method for constructing a production optimization machine learning offline model based on historical experience according to claim 1, characterized in that: In step 10, the optimal strategy network, that is, the optimal strategy, is saved; the reservoir state at the current moment is input to obtain the corresponding production plan at that moment, all decision time steps are looped, and the decision variables of each production well and injection well are saved to form a complete production system. The optimal production plan includes the injection and production volume of oil and water wells or the bottom hole pressure; at the same time, the trained strategy network can directly give the optimal production system when optimizing again, without repeating the expensive optimization process.