Horizontal well intelligent segmented production method based on geological perception and nested optimization

By combining geological sensing and nested optimization methods with static geological features and dynamic production features, a multi-scale feature fusion proxy network and nested optimization architecture are constructed to optimize the segment location and production configuration of horizontal wells. This solves the problems of poor adaptability and low computational efficiency in existing technologies, and improves the reservoir development effect and economic benefits.

CN122347243APending Publication Date: 2026-07-07CHINA NAT OFFSHORE OIL CORP +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA NAT OFFSHORE OIL CORP
Filing Date
2026-04-01
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing horizontal well segment optimization methods suffer from poor adaptability, low computational efficiency, local optima in optimization results, and insufficient prediction accuracy of surrogate models when facing reservoir heterogeneity and water drive development. They are difficult to achieve coordinated global optimization of segment schemes and production systems.

Method used

A geological sensing and nested optimization approach is adopted. By constructing a multi-scale feature fusion proxy network and a nested optimization architecture, combined with geological static features and production dynamic features, genetic algorithms and sequential quadratic programming algorithms are used to optimize the segment location and production configuration of horizontal wells, and a proxy model is constructed for rapid evaluation.

Benefits of technology

It has achieved joint autonomous optimization of horizontal well segment location and production configuration, which has improved reservoir development effect and economic benefits, increased oil and gas recovery rate, and solved the problems of mixed variable optimization and high calculation cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122347243A_ABST
    Figure CN122347243A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on geology perception and nested optimization horizontal well intelligent segmented production method, comprising: determining optimization target and decision variable, geology and production dynamic characteristic extraction, agent model construction and training, nested optimization solution, scheme verification and deployment etc.Step.The application is based on the construction of multi-scale feature fusion agent network and nested optimization architecture, introduces reservoir heterogeneity representation, fluid seepage dynamic and wellbore productivity constraint etc.Oil reservoir geology and engineering mechanism, and uses economic-geology collaborative reward mechanism, realizes the joint independent optimization of horizontal well segmented position and production allocation strategy;The application has significant advantages in solving mixed variable optimization, reducing calculation cost and improving scheme implementability, thereby effectively improving oil and gas recovery, and providing reliable technical means for intelligent production of oil field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of reservoir production optimization, specifically relating to an intelligent segmented production method for horizontal wells based on geological perception and nested optimization. Background Technology

[0002] Horizontal well technology, as a key means to improve single-well production and recovery rate in oilfields, has been widely used in major oilfields in my country. However, due to the strong heterogeneity of the reservoir and the inherent heel-toe effect in waterflooding development, horizontal wells generally face the severe challenge of premature water breakthrough and rapid water flooding in local sections after production. This leads to a sharp increase in overall well water cut and a rapid decline in oil production, severely restricting the development effect and economic life of horizontal wells. To address this problem, intelligent segmented water control technology for horizontal wells has developed rapidly in recent years. This technology divides long horizontal well sections into several independent and controllable production units using packers, and uses downhole control valves to regulate the production of each section in real time. The aim is to suppress ineffective water production in high water-cut sections, promote the effective utilization of low water-cut sections, and ultimately achieve the goal of controlling water and increasing oil production.

[0003] However, existing horizontal well segmentation optimization methods have significant shortcomings in practical applications. First, conventional segmentation methods based on static geological models and initial logging interpretation results mainly rely on the distribution of original permeability or oil saturation. They cannot effectively characterize and respond to the dynamic evolution of reservoir properties and fluid distribution caused by oil-water migration and pressure field changes during waterflooding development. Consequently, their segmentation schemes have poor adaptability, and water control effects are difficult to sustain. Second, while numerical simulation-based optimization methods can consider development dynamics, their optimization process heavily relies on repeated calls to the numerical simulator. Faced with a high-dimensional mixed decision space composed of horizontal well segment locations and production configurations for each segment, traditional optimization algorithms often fall into the trap of low computational efficiency and locally optimal results, making it difficult to achieve coordinated global optimization of segmentation schemes and production regimes.

[0004] To reduce computational costs in the optimization process, surrogate modeling techniques have been introduced into the field of reservoir production optimization. By establishing approximate mathematical relationships between key decision variables and development indicators, surrogate models can replace computationally expensive numerical simulators for rapid evaluation, thereby significantly improving optimization efficiency. However, existing surrogate modeling methods mostly employ traditional multinomial regression or simple neural network structures, which have limited ability to characterize complex geological features and nonlinear production dynamics, resulting in insufficient prediction accuracy, especially extrapolation reliability. More importantly, these purely data-driven models lack the embedding of reservoir engineering physics, which may lead to prediction results that violate physical principles, rendering the optimization scheme unapplicable to actual production. Summary of the Invention

[0005] This invention addresses the core problems in the existing technologies, such as insufficient dynamic geological feature perception, difficulty in co-optimization of mixed variables, lack of physical consistency of surrogate models, and low overall optimization efficiency. Its purpose is to provide a method for intelligent segmented production of horizontal wells based on geological perception and nested optimization.

[0006] This invention is achieved through the following technical solution: A method for intelligent segmented production of horizontal wells based on geological sensing and nested optimization includes the following steps: S1. Determine the optimization objective and decision variables; S2. Based on the reservoir numerical simulation model, extract the geological static features and production dynamic features of each candidate segment of the horizontal well, and construct feature vectors that characterize the geological attributes and production dynamics of each candidate segment of the horizontal well. S3. Based on the feature vectors and decision variables from step S2, construct and train a surrogate model to predict cumulative oil production and overall water content. S4. A nested optimization algorithm architecture is adopted. The outer layer uses a genetic algorithm to optimize the discrete segmented position variables S. For each segmented position S evaluated by the outer algorithm, the inner layer uses a sequential quadratic programming algorithm to optimize the continuous output configuration variable Q. The surrogate model trained in step S3 is used for fast performance evaluation. S5. Obtain the optimal solution from step S4. Input the solution into the reservoir numerical simulator for verification. If the verification is successful, output the solution to guide actual production; otherwise, repeat step S4.

[0007] In the above technical solution, the optimization objectives include primary economic objectives and key technical objectives; the primary economic objective is to maximize the cumulative oil production of horizontal well segmented production within a preset production cycle. The expression for the primary economic objective is: In the formula: The primary economic objective is dimensionless. In order to meet the preset production cycle Cumulative oil production within the region, in m³ 3 ; For a moment The instantaneous oil production rate is dimensionless; This is the production time step, expressed in days. This is the moment production begins; Production end time; The key technical objective is to minimize the overall moisture content; The expression for the key technology objective is as follows: In the formula: For key technological objectives, dimensionless; The average overall moisture content within the preset production cycle is dimensionless. Let be the instantaneous water production rate at time t, which is dimensionless; For a moment The instantaneous oil production rate is dimensionless; This is the production time step, expressed in days. This is the moment production begins; Production end time; The decision variables include the segment location and segment production configuration of the horizontal well.

[0008] In the above technical solution, step S1 specifically includes the following steps: S11. Employ a weighted comprehensive objective function to collaboratively address primary economic objectives and key technological objectives: The primary economic and key technological objectives are transformed into a single objective, the expression of which is: In the formula: The weighting coefficients are dimensionless, and ; In order to meet the preset production cycle Cumulative oil production within the region, in m³ 3 ; The average overall moisture content within the preset production cycle is dimensionless. In order to meet the preset production cycle Reference value for cumulative oil production within the region, in m³ 3 ; This is a reference value for the average overall moisture content within a preset production cycle, and is dimensionless. S12, Divide the horizontal well of length L into... Section, determined -1 segment point positions constitute the segment position vector of the horizontal well. The constraint condition is 0 < < <...< <L; The segmented production allocation is the production proportion of each segment, forming a segmented production allocation vector. The constraints are and .

[0009] In the above technical solution, step S2 specifically includes the following steps: S21. Extracting static geological features: The geological static characteristics include average permeability, permeability variation coefficient, and cumulative mudstone thickness; For the segment position S i For the i-th well segment, a cuboid buffer zone is defined around it. The average permeability, permeability variation coefficient and cumulative mudstone thickness within the buffer zone are calculated. The formula for calculating the average permeability is as follows: In the formula: It is the first in the buffer The absolute permeability value of each grid, in mD; It represents the total number of grid cells within the buffer, and is dimensionless. The average permeability of the i-th well section is expressed in mD. The formula for calculating the coefficient of variation of permeability is: In the formula: Let be the permeability variation coefficient of the i-th well section, which is dimensionless; It is the first in the buffer The absolute permeability value of each grid, in mD; It is the average permeability of the buffer zone. ; The formula for calculating the cumulative mudstone thickness is as follows: In the formula: The cumulative mudstone thickness in the i-th well section is expressed in meters. For the first in the buffer Porosity of each grid, dimensionless; The porosity threshold for determining whether a rock is mudstone is dimensionless. The thickness of the j-th grid in the vertical direction is expressed in meters (m). S22. Extracting dynamic production characteristics: The production dynamics include recent average water cut and production decline rate based on historical production data or pilot simulation tests for the well section; The formula for calculating the recent average moisture content is as follows: In the formula: Let be the recent average water cut of the i-th well section, dimensionless; Let be the instantaneous water production rate at time t in the i-th well section, which is dimensionless; For the i-th well segment time The instantaneous oil production rate is dimensionless; This is the production time step, expressed in days. The formula for calculating the production decline rate is: In the formula: Let be the production decline rate of the i-th well section, which is dimensionless; The instantaneous oil production rate at the current time step is dimensionless. The instantaneous oil production rate at the previous time step is dimensionless. This is the production time step, expressed in days. S23. Constructing feature vectors: The geological static features and production dynamic features extracted for the i-th well section in steps S21 and S22 are combined into a feature vector. ; The feature vector of the i-th well section The expression is: In the formula: The average permeability of the i-th well section is expressed in mD. Let be the permeability variation coefficient of the i-th well section, which is dimensionless; The cumulative mudstone thickness in the i-th well section is expressed in meters. Let be the recent average water cut of the i-th well section, dimensionless; Let be the production decline rate of the i-th well section, which is dimensionless; For a mouth was divided into The complete feature description of a horizontal well segment is a feature matrix composed of the feature vectors of all segments. , characteristic matrix The expression is: .

[0010] In the above technical solution, step S3 specifically includes the following steps: S31. Define the model input and output: The input is the feature matrix constructed in step S2. ,in It is the number of segments. It is the number of features in each segment; The output is the macroscopic development index of the entire horizontal well. Forecast cumulative oil production and Predicted overall moisture content; S32. Define a multi-scale feature fusion-attention network: The core architecture of the multi-scale feature fusion-attention network consists of a feature embedding layer, a multi-head self-attention layer, and a global aggregation and multi-task prediction head. The feature embedding layer projects the original features into a high-dimensional space. The input feature matrix is ​​processed using a fully connected layer. : In the formula: It is a weight matrix. It is a bias vector. It is an activation function. It is the embedded feature matrix, and H is the embedding dimension; Multi-head self-attention layers are used to enable the model to automatically learn and quantify the interactions and dependencies between different well sections. The learnable weight matrices are respectively converted into a query matrix Q, a key matrix K, and a value matrix V: , Calculate attention weights ; The above process is executed in parallel N times, and the results are concatenated and then passed through a linear layer to capture the feature relationships of different subspaces. The output is ; The global aggregation and multi-task prediction head first uses global average pooling: Will A global feature vector is obtained by averaging along the dimensions of the segment. This vector encodes global information for the entire horizontal well and is predicted using two independent fully connected networks. Cumulative oil production and Overall moisture content: S33. Define the training strategy and loss function: The training of the surrogate model is accomplished by minimizing a composite loss function, the expression of which is: Defined as: In the formula: N is the number of training samples. The true label for the i-th sample is calculated by the numerical simulator; This is used to ensure that the model's predictions conform to basic physical laws. Defined as: In the formula: N is the number of training samples. The true label for the i-th sample is calculated by the numerical simulator; S32. Generate M different schemes through Latin hypercube sampling, and run a numerical simulator to obtain the corresponding training sets. Minimize using the Adam optimizer Stop training when the loss stops decreasing.

[0011] In the above technical solution, step S4 specifically includes the following steps: S41. Construct the outer layer optimization algorithm: For each candidate segmentation scheme generated by the outer algorithm, the inner algorithm is immediately invoked to solve for the current optimal output configuration, and the performance under this configuration is used as the basis for evaluating the merits of the segmentation scheme. The outer layer optimization is implemented in detail using a genetic algorithm (GA). The genetic algorithm is responsible for global exploration in a discrete segmented location space. The outer optimization variable is a piecewise position vector. Each individual is composed of Composed of -1 coordinate values, randomly generated. Individuals; for each individual, randomly generated within the constraint range (0, L). -1 numbers, then sort them to ensure ; Individual fitness The target value is determined by the optimal value returned by the inner optimizer. , segment position Passed to the inner SQP optimizer; SQP at fixed segment positions Under the premise of optimizing output Q and returning the optimal output configuration, this value is the position of that segment. fitness ; The selection part of the genetic algorithm uses tournament selection, randomly selecting k individuals from the population, and then selecting the individuals with the best fitness. The tallest individual serves as the parent generation; Repeat this process until a sufficient number of parent individuals are selected; The crossover part of the genetic algorithm uses simulated binary crossover (SBX), which simulates the behavior of single-point crossover but is applicable to real number encoding, and pairs the selected parent individuals. For each gene, with probability Perform crossover, offspring gene values From paternal genes The value was calculated. S42. Construct the inner layer optimization algorithm: Given the outer state segmentation position S i Under these conditions, the inner layer optimization uses a sequential quadratic programming method to solve the following constrained optimization problem: Under the conditions of satisfying the quality fraction constraint and the lower bound constraint, maximize the objective function Q. o (Q), thus obtaining the optimal injection configuration vector Q; Where Q represents the variable vector to be optimized. , Indicates the number of segments. These represent the injection-production flow rate allocation ratio for each segment; Q o (Q) represents the objective function value; Constraints include summation constraints and lower bound constraints ,in This represents the minimum proportion allocated to each segment; definition Constraint functions include equality constraints. and inequality constraints .

[0012] In the above technical solution, the method for calculating the offspring gene value is specifically as follows: S411. First, obtain a random variable, and calculate the expansion factor based on the value of the random variable. The formula for calculating the expansion factor β is as follows: In the formula: β is the expansion factor, which is dimensionless; The cross-distribution index; For random variables, ; S412. Calculate the gene values ​​of two offspring individuals using the expansion factor β. : In the formula: and It is the gene value of the parent individual; β represents the gene value of the offspring; β is the expansion factor, which is dimensionless. S413. The mutation employs multinomial mutation, applying a small probability to each gene of the offspring individual. If the gene undergoes mutation, When a mutation is selected, a random variable is first obtained. Then calculate the disturbance term. ; The disturbance term The calculation formula is: In the formula: For disturbance terms; The cross-distribution index; For random variables, ; The final determined gene value after the mutation is: ; In the formula: This represents the new gene value after the mutation; This represents the original offspring gene values ​​before the mutation. The value range of the variable is the length of the interval, i.e., the total length of the horizontal well, in meters.

[0013] In the above technical solution, the iteration of the inner layer optimization algorithm specifically includes the following steps: S421. Initialization: Set the initial point. Let λ be the initial Lagrange multiplier, serving as a feasible starting point for satisfying the constraints. 0 and ν 0 , corresponding to equality constraints and inequality constraints respectively; let the initial Hessian approximation matrix H0 = I, where I represents the identity matrix; let the iteration counter k = 0; S422, Gradient and Jacobian Calculation: In each iteration, the objective function is calculated using the automatic differentiation function of the surrogate model. gradient ; Calculate equality constraints and inequality constraints in Q. k Jacobian matrix at the location; For this problem, the equality constraint Jacobian matrix is: The inequality constraint Jacobian matrix is ; S423, Construction of Quadratic Programming (QP) Subproblems: At the current iteration point Q k Given linearization constraints and a second-order approximate objective, construct the search direction. The subproblem of quadratic programming: Objective function: Minimize Constraints: in: This represents the search direction vector for this iteration; This represents the current Hessian approximation matrix; Since the equality constraints are linear and the initial point is feasible, the linearized equality constraints can be written as follows: Inequality constraints can be written as ; Solving S424 and QP subproblems: The above QP subproblem is solved using the effective set method to obtain the search direction. and the corresponding Laplace multiplier estimates and ; S425, Line Search: Along Direction Perform a line search to find a suitable step size. So that the penalty function Reduce sufficiently; The expression for the penalty function is: In the formula: μ is the penalty factor; determined using the Armijo criterion. ; S426, Iteration Point Update: Update variables ; S427, Hessian approximate update: calculate , calculate , in: It is a Lagrange function; If the curvature condition is satisfied Then the Hessian approximation matrix is ​​updated using the BFGS formula: If the curvature condition is not met, then the matrix is ​​reset to the identity matrix. S428. Convergence Criterion: Calculate KKT residuals, including standing residuals. Equality-constrained residuals Inequality residuals and complementary residuals ; The iteration terminates when all residuals are less than the preset tolerance, and the optimal solution for Q and the corresponding objective function value are output. .

[0014] The beneficial effects of this invention are: This invention provides a method for intelligent segmented production of horizontal wells based on geological perception and nested optimization. On the basis of constructing a multi-scale feature fusion agent network and a nested optimization architecture, it introduces reservoir geological and engineering mechanisms such as reservoir heterogeneity characterization, fluid seepage dynamics and wellbore production capacity constraints, and adopts an economic-geological synergistic reward mechanism to achieve joint autonomous optimization of horizontal well segment location and production configuration strategy.

[0015] This invention innovatively combines geological engineering feature-driven modeling with a mixed-variable hierarchical optimization strategy. It aims to jointly optimize key decision variables in horizontal well development: the segmentation location of horizontal sections and the production configuration of each independent production section, thereby significantly improving reservoir development effectiveness and economic benefits. The method first extracts feature vectors representing the geological attributes and production dynamics of each well section based on a numerical simulation model, constructing a multi-scale feature fusion proxy network. Secondly, through a nested optimization architecture, the outer layer uses a genetic algorithm to globally search for the optimal segmentation location scheme, while the inner layer uses a sequential quadratic programming algorithm to quickly solve for the optimal production configuration under a given segment. The proxy network is then used to rapidly evaluate the objective function. This method enables automatic optimization of segmentation location and production configuration while ensuring the scheme conforms to reservoir engineering principles. Compared to traditional methods, this invention has significant advantages in solving mixed-variable optimization, reducing computational costs, and improving scheme feasibility, thereby effectively improving oil and gas recovery and providing a reliable technical means for intelligent oilfield production. Attached Figure Description

[0016] Figure 1 This is a flowchart of the intelligent segmented production method for horizontal wells based on geological sensing and nested optimization, as described in this invention. Figure 2 This is a comparison of the net present value convergence curves of the intelligent segmented production method for horizontal wells based on geological perception and nested optimization in Embodiment 1 of the present invention with those of conventional methods; Figure 3 This is a comparison chart of cumulative oil production between the intelligent segmented production method for horizontal wells based on geological perception and nested optimization in Embodiment 1 of the present invention and the conventional method; Figure 4 This is a comparison chart of cumulative water production between the intelligent segmented production method for horizontal wells based on geological perception and nested optimization in Embodiment 1 of the present invention and the conventional method.

[0017] For those skilled in the art, other related figures can be obtained from the above figures without any creative effort. Detailed Implementation

[0018] To enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments. Example 1

[0019] This embodiment uses a reservoir model as an example. The model is 25*25*3 mm in size, with a porosity of 0.2, an initial pressure of 6000 psi, and an initial water saturation of 0.2. It contains three production wells (numbered P1 to P3), all of which are horizontal wells. Production well P1 has 6 possible segmentation points, P2 has 8 possible segmentation points, and P3 has 10 possible segmentation points. The upper limit of the production rate of the production wells is 178.61. The lower limit is 0 .

[0020] like Figure 1 As shown, a method for intelligent segmented production of horizontal wells based on geological sensing and nested optimization includes the following steps: S1. Determine the optimization objective and decision variables: The optimization objectives include primary economic objectives and key technological objectives; The primary economic objective is to maximize the cumulative oil production of horizontal well segmented production within a preset production cycle. The key technical objective is to minimize the overall moisture content; The decision variables include the segment location and segment production configuration of the horizontal well; Step S1 specifically includes the following steps: S11. Employ a weighted comprehensive objective function to collaboratively handle interrelated and sometimes conflicting primary economic objectives and key technological objectives; The expression for the primary economic objective is: In the formula: The primary economic objective is dimensionless. In order to meet the preset production cycle Cumulative oil production within the region, in units of ; For a moment The instantaneous oil production rate is dimensionless; This is the production time step, expressed in days. This is the moment production begins; Production end time; The expression for the key technology objective is as follows: In the formula: For key technological objectives, dimensionless; The average overall moisture content within the preset production cycle is dimensionless. Let be the instantaneous water production rate at time t, which is dimensionless; For a moment The instantaneous oil production rate is dimensionless; This is the production time step, expressed in days. This is the moment production begins; Production end time; To facilitate the optimization algorithm, the primary economic objective and key technological objective are transformed into a single objective. The expression for the transformed single objective is as follows: In the formula: The weighting coefficients are dimensionless, and ; In order to meet the preset production cycle Cumulative oil production within the region, in units of ; The average overall moisture content within the preset production cycle is dimensionless. In order to meet the preset production cycle Reference value for cumulative oil production within the region, in units of ; This is a reference value for the average overall moisture content within a preset production cycle, and is dimensionless. Used as a reference value for unifying dimensions and eliminating differences in magnitude; In this embodiment, The value is 0.5. The value is 0.5. The value is 9000. The value is 0.95; S12, Divide the horizontal well of length L into... Section, determined -1 segment point positions constitute the segment position vector of the horizontal well. The constraint condition is 0 < < <...< <L; The segmented production allocation is the production proportion of each segment, forming a segmented production allocation vector. The constraints are and ; In this embodiment, The value is 3; S2, Geological and Production Dynamics Feature Extraction and Feature Vector Construction; Based on the reservoir numerical simulation model, the geological static characteristics and production dynamic characteristics of each candidate segment of the horizontal well are extracted, and feature vectors representing the geological attributes and production dynamics of each candidate segment of the horizontal well are constructed. Step 2 specifically includes the following steps: S21. Extracting static geological features: The geological static characteristics include average permeability, permeability variation coefficient, and cumulative mudstone thickness; For the segment position S i For the i-th well segment, a cuboid buffer zone is defined around it. The average permeability, permeability variation coefficient and cumulative mudstone thickness within the buffer zone are calculated. The average permeability is used to reflect the average seepage capacity of the reservoir surrounding the well section. The formula for calculating the average permeability is as follows: In the formula: It is the first in the buffer The absolute permeability value of each grid, in mD; It represents the total number of grid cells within the buffer, and is dimensionless. The average permeability of the i-th well section is expressed in mD. In this embodiment, The value is 8; The permeability variation coefficient is used to characterize the degree of heterogeneity of reservoir permeability. The formula for calculating the permeability variation coefficient is as follows: In the formula: Let be the permeability variation coefficient of the i-th well section, which is dimensionless; It is the first in the buffer The absolute permeability value of each grid, in mD; It is the average permeability of the buffer zone. ; The cumulative mudstone thickness is used to quantify the scale of the flow barrier within this section. The formula for calculating the cumulative mudstone thickness is as follows: In the formula: The cumulative mudstone thickness in the i-th well section is expressed in meters. For the first in the buffer Porosity of each grid, dimensionless; The porosity threshold for determining whether a rock is mudstone is dimensionless. The thickness of the j-th grid in the vertical direction is expressed in meters (m). S22. Extracting dynamic production characteristics: The production dynamics include recent average water cut and production decline rate based on historical production data or pilot simulation tests for the well section; The recent average water cut is used to reflect the recent water production status of this well section. The formula for calculating the recent average water cut is as follows: In the formula: Let be the recent average water cut of the i-th well section, dimensionless; Let be the instantaneous water production rate at time t in the i-th well section, which is dimensionless; For the i-th well segment time The instantaneous oil production rate is dimensionless; This is the production time step, expressed in days. The production decline rate is used to characterize the rate of decrease in the oil production capacity of this well section. The formula for calculating the production decline rate is: In the formula: Let be the production decline rate of the i-th well section, which is dimensionless; The instantaneous oil production rate at the current time step is dimensionless. The instantaneous oil production rate at the previous time step is dimensionless. This is the production time step, expressed in days. S23. Constructing feature vectors: The geological static features and production dynamic features extracted from the i-th well segment are combined into a feature vector. The feature vector of the i-th well segment The expression is: In the formula: The average permeability of the i-th well section is expressed in mD. Let be the permeability variation coefficient of the i-th well section, which is dimensionless; The cumulative mudstone thickness in the i-th well section is expressed in meters. Let be the recent average water cut of the i-th well section, dimensionless; Let be the production decline rate of the i-th well section, which is dimensionless; For a mouth was divided into The complete feature description of a horizontal well segment is a feature matrix composed of the feature vectors of all segments. , characteristic matrix The expression is: S3, Agent Model Construction and Training; Based on the feature vectors and decision variables from step S2, a surrogate model for predicting cumulative oil production and overall water content is constructed and trained. Step S3 specifically includes the following steps: S31. Define the model input and output: The input is the feature matrix constructed in step S2. ,in It is the number of segments. It is the number of features in each segment; The output is the macroscopic development index of the entire horizontal well. Forecast cumulative oil production and Predicted overall moisture content; In this embodiment, The value of is 5; S32. Define a multi-scale feature fusion-attention network: Traditional fully connected networks cannot effectively handle the spatial correlation between segments and the differences in the importance of different features. This application proposes a novel multi-scale feature fusion-attention network. Its core architecture consists of a feature embedding layer, a multi-head self-attention layer, and a global aggregation and multi-task prediction head. The feature embedding layer projects the original features into a high-dimensional space to improve the model's expressive power. The input feature matrix is ​​processed using a fully connected layer. : In the formula: It is a weight matrix. It is a bias vector. It is an activation function. It is the embedded feature matrix, and H is the embedding dimension; Multi-head self-attention layers are used to enable the model to automatically learn and quantify the interactions and dependencies between different well sections. The learnable weight matrices are converted into query matrix (Q), key matrix (K), and value matrix (V), respectively: , Calculate attention weights ; The above process is executed in parallel N times, and the results are concatenated and then passed through a linear layer to capture the feature relationships of different subspaces; The output is This is a context-aware feature matrix, where each segment's new features contain information about its relationship with all other segments; The global aggregation and multi-task prediction head first uses global average pooling: Will A global feature vector is obtained by averaging along the dimensions of the "segment". This vector encodes global information for the entire horizontal well and is predicted using two independent fully connected networks. Cumulative oil production and Overall moisture content: S33. Define the training strategy and loss function: The training of the surrogate model is accomplished by minimizing a composite loss function, the expression of which is: Defined as: In the formula: N is the number of training samples. The true label for the i-th sample is calculated by the numerical simulator; This is used to ensure that the model's predictions conform to basic physical laws. Defined as: In the formula: N is the number of training samples. The true label for the i-th sample is calculated by the numerical simulator; S32. Generate M different schemes through Latin hypercube sampling, and run a numerical simulator to obtain the corresponding training sets. Minimize using the Adam optimizer Stop training early when the loss stops decreasing to prevent overfitting. S4. Nested optimization solution: A nested optimization algorithm architecture is adopted. The outer layer uses a genetic algorithm to optimize the discrete segmented position variables S. For each segmented position S evaluated by the outer algorithm, the inner layer uses a sequential quadratic programming algorithm to optimize the continuous output configuration variable Q. The surrogate model trained in step S3 is used for fast performance evaluation. Step S4 specifically includes the following steps: S41. Construct the outer layer optimization algorithm: For each candidate segmentation scheme generated by the outer algorithm, the inner algorithm is immediately invoked to solve for the current optimal output configuration, and the performance under this configuration is used as the basis for evaluating the merits of the segmentation scheme. The outer layer optimization is implemented in detail using a genetic algorithm (GA). The genetic algorithm is responsible for global exploration in a discrete segmented location space. The outer optimization variable is a piecewise position vector. Each individual is composed of Composed of -1 coordinate values, randomly generated. Individuals; for each individual, randomly generated within the constraint range (0, L). -1 numbers, then sort them to ensure ; Individual fitness The target value is determined by the optimal value returned by the inner optimizer. , segment position Passed to the inner SQP optimizer; SQP at fixed segment positions Under the premise of optimizing output Q and returning the optimal output configuration, this value is the position of that segment. fitness ; The selection part of the genetic algorithm uses tournament selection, randomly selecting k individuals from the population, and then selecting the individuals with the best fitness. The tallest individual serves as the parent generation; Repeat this process until a sufficient number of parent individuals are selected; The crossover part of the genetic algorithm uses simulated binary crossover (SBX), which simulates the behavior of single-point crossover but is applicable to real number encoding, and pairs the selected parent individuals. For each gene, with probability Perform crossover, offspring gene values From paternal genes The value is calculated, and the specific method for calculating the offspring gene value is as follows: S411. First, obtain a random variable, and calculate the expansion factor based on the value of the random variable. The formula for calculating the expansion factor β is as follows: In the formula: β is the expansion factor, which is dimensionless; The cross-distribution index is used in this embodiment. The value is 20; For random variables, ; S412. Calculate the gene values ​​of two offspring individuals using the expansion factor β. : In the formula: and It is the gene value of the parent individual; β represents the gene value of the offspring; β is the expansion factor, which is dimensionless. S413. The mutation employs multinomial mutation, applying a small probability to each gene of the offspring individual. If the gene undergoes mutation, When a mutation is selected, a random variable is first obtained. Then calculate the disturbance term. ; The disturbance term The calculation formula is: In the formula: For disturbance terms; The cross-distribution index is used in this embodiment. The value is 20; For random variables, ; The final determined gene value after the mutation is: ; In the formula: This represents the new offspring gene value after the mutation; This represents the original offspring gene values ​​before the mutation. The value range of the variable is the length of the interval, i.e., the total length of the horizontal well, in meters; S42. Construct the inner layer optimization algorithm: Given the outer state segmentation position S i Under these conditions, the inner optimization uses Sequential Quadratic Programming (SQP) to solve the following constrained optimization problem: Under the conditions of satisfying the quality fraction constraint and the lower bound constraint, maximize the objective function Q. o (Q), thus obtaining the optimal injection configuration vector Q; Where Q represents the variable vector to be optimized. , Indicates the number of segments. These represent the injection-production flow rate allocation ratio for each segment; Q o (Q) represents the objective function value; Constraints include summation constraints and lower bound constraints ,in This represents the minimum proportion allocated to each segment; To facilitate the use of the SQP method, the original maximization problem is transformed into a minimization problem, and the following definition is made: Constraint functions include equality constraints. and inequality constraints ; The iterative steps of the inner optimization algorithm are as follows: S421. Initialization: Set the initial point. Let λ be the initial Lagrange multiplier, serving as a feasible starting point for satisfying the constraints. 0 and ν 0, corresponding to equality constraints and inequality constraints respectively; let the initial Hessian approximation matrix H0 = I, where I represents the identity matrix; let the iteration counter k = 0; S422, Gradient and Jacobian Calculation: In each iteration, the objective function is calculated using the automatic differentiation function of the surrogate model. gradient ; Calculate equality constraints and inequality constraints in Q. k Jacobian matrix at the location; For this problem, the equality constraint Jacobian matrix is: The inequality constraint Jacobian matrix is ; S423, Construction of Quadratic Programming (QP) Subproblems: At the current iteration point Q k Given linearization constraints and a second-order approximate objective, construct the search direction. The subproblem of quadratic programming: Objective function: Minimize Constraints: in: This represents the search direction vector for this iteration; This represents the current Hessian approximation matrix; Since the equality constraints are linear and the initial point is feasible, the linearized equality constraints can be written as follows: Inequality constraints can be written as ; Solving S424 and QP subproblems: The above QP subproblem is solved using the effective set method to obtain the search direction. and the corresponding Laplace multiplier estimates and .

[0021] S425, Line Search: Along the search direction Perform a line search to find a suitable step size. So that the penalty function Reduce sufficiently; The expression for the penalty function is: In the formula: μ is the penalty factor, and in this embodiment, μ is 5; the Armijo criterion is used to determine it. To ensure algorithm stability; S426, Iteration Point Update: Update variables ; S427, Hessian approximate update: calculate , calculate , in: It is a Lagrange function; If the curvature condition is satisfied Then the Hessian approximation matrix is ​​updated using the BFGS formula: If the curvature condition is not met, the matrix is ​​reset to the identity matrix to maintain positive definiteness. S428. Convergence Criterion: Calculate KKT residuals, including standing residuals. Equality-constrained residuals Inequality residuals and complementary residuals ; The iteration terminates when all residuals are less than the preset tolerance, and the optimal solution for Q and the corresponding objective function value are output. In this embodiment, the preset tolerance is 0.01; S5. Solution Verification and Deployment: The optimal solution obtained in step S4 Input the solution into the reservoir numerical simulator for verification. If the verification is successful, output the solution to guide actual production; otherwise, repeat step S4.

[0022] The final optimization results of this embodiment are compared and analyzed as follows: Figures 2-4 As shown: Figure 2 This is a comparison of the economic net present value convergence curves of the intelligent segmented production method for horizontal wells based on geological perception and nested optimization of the present invention with other optimization methods. According to the convergence of the curves, it can be seen that the method proposed in this invention can obtain a higher economic net present value within the same control time step. Figure 3 This is a comparison chart of cumulative oil production between the intelligent segmented production method for horizontal wells based on geological sensing and nested optimization, as proposed in this invention, and conventional methods. The vertical axis represents cumulative oil production, and the horizontal axis represents reservoir development time. It can be seen that the method proposed in this invention has a higher cumulative oil production, effectively increasing oil production. Figure 4 This is a comparison chart of cumulative water production between the intelligent segmented production method for horizontal wells based on geological sensing and nested optimization, as proposed in this invention, and conventional methods. The vertical axis represents cumulative water production, and the horizontal axis represents reservoir development time. It can be seen that the method proposed in this invention produces less cumulative water, effectively achieving water control.

[0023] Compared with traditional optimization methods that rely solely on machine learning, this invention designs a physical constraint embedding mechanism, geological sensing feature engineering, and a nested collaborative optimization architecture. This solves the core problems faced by traditional pure data-driven methods in oil and gas production optimization, such as the lack of physical consistency, multi-objective conflicts, and high computational costs. First, this invention constructs a feature engineering system that integrates static geological attributes and dynamic production responses, enabling the optimization model to "sense" the dynamics of reservoir development and providing accurate basis for decision-making. Then, a nested optimization architecture is designed. The outer layer uses a genetic algorithm to globally search for the optimal segment position, while the inner layer uses a sequential quadratic programming algorithm to efficiently solve the optimal production configuration under a given segment, solving the problem of mixed variable collaborative optimization.

[0024] The applicant declares that the above description is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Those skilled in the art should understand that any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention fall within the protection and disclosure scope of the present invention.

Claims

1. A method for intelligent segmented production of horizontal wells based on geological sensing and nested optimization, characterized in that: Includes the following steps: S1. Determine the optimization objective and decision variables; S2. Based on the reservoir numerical simulation model, extract the geological static features and production dynamic features of each candidate segment of the horizontal well, and construct feature vectors that characterize the geological attributes and production dynamics of each candidate segment of the horizontal well. S3. Based on the feature vectors and decision variables from step S2, construct and train a surrogate model to predict cumulative oil production and overall water content. S4. A nested optimization algorithm architecture is adopted. The outer layer uses a genetic algorithm to optimize the discrete segmented position variables S. For each segmented position S evaluated by the outer algorithm, the inner layer uses a sequential quadratic programming algorithm to optimize the continuous output configuration variable Q. The surrogate model trained in step S3 is used for fast performance evaluation. S5. Obtain the optimal solution from step S4. Input the solution into the reservoir numerical simulator for verification. If the verification is successful, output the solution to guide actual production; otherwise, repeat step S4.

2. The intelligent segmented production method for horizontal wells based on geological sensing and nested optimization according to claim 1, characterized in that: The optimization objectives include primary economic objectives and key technological objectives; the primary economic objective is to maximize the cumulative oil production of horizontal well segmented production within a preset production cycle. The expression for the primary economic objective is: In the formula: The primary economic objective is dimensionless. In order to meet the preset production cycle Cumulative oil production within the region, in m³ 3 ; For a moment The instantaneous oil production rate is dimensionless; This is the production time step, expressed in days. This is the moment production begins; Production end time; The key technical objective is to minimize the overall moisture content; The expression for the key technology objective is: In the formula: For key technological objectives, dimensionless; The average overall moisture content within the preset production cycle is dimensionless. Let be the instantaneous water production rate at time t, which is dimensionless; For a moment The instantaneous oil production rate is dimensionless; This is the production time step, expressed in days. This is the moment production begins; Production end time; The decision variables include the segment location and segment production configuration of the horizontal well.

3. The intelligent segmented production method for horizontal wells based on geological sensing and nested optimization according to claim 1, characterized in that: Step S1 specifically includes the following steps: S11. Employ a weighted comprehensive objective function to collaboratively address primary economic objectives and key technological objectives: The primary economic and key technological objectives are transformed into a single objective, the expression of which is: In the formula: The weighting coefficients are dimensionless, and ; In order to meet the preset production cycle Cumulative oil production within the region, in m³ 3 ; The average overall moisture content within the preset production cycle is dimensionless. In order to meet the preset production cycle Reference value for cumulative oil production within the region, in m³ 3 ; This is a reference value for the average overall moisture content within a preset production cycle, and is dimensionless. S12, Divide the horizontal well of length L into... Section, determined -1 segment point positions constitute the segment position vector of the horizontal well. The constraint condition is 0 < < <...< <L; The segmented production allocation is the production proportion of each segment, forming a segmented production allocation vector. The constraints are and .

4. The intelligent segmented production method for horizontal wells based on geological sensing and nested optimization according to claim 1, characterized in that: Step S2 specifically includes the following steps: S21. Extracting static geological features: The geological static characteristics include average permeability, permeability variation coefficient, and cumulative mudstone thickness; For the segment position S i For the i-th well segment, a cuboid buffer zone is defined around it. The average permeability, permeability variation coefficient and cumulative mudstone thickness within the buffer zone are calculated. The formula for calculating the average permeability is as follows: In the formula: It is the first in the buffer The absolute permeability value of each grid, in mD; It represents the total number of grid cells within the buffer, and is dimensionless. The average permeability of the i-th well section is expressed in mD. The formula for calculating the coefficient of variation of permeability is: In the formula: Let be the permeability variation coefficient of the i-th well section, which is dimensionless; It is the first in the buffer The absolute permeability value of each grid, in mD; It is the average permeability of the buffer zone. ; The formula for calculating the cumulative mudstone thickness is as follows: In the formula: The cumulative mudstone thickness in the i-th well section is expressed in meters. For the first in the buffer Porosity of each grid, dimensionless; The porosity threshold for determining whether a rock is mudstone is dimensionless. The thickness of the j-th grid in the vertical direction is expressed in meters (m). S22. Extracting dynamic production characteristics: The production dynamics include recent average water cut and production decline rate based on historical production data or pilot simulation tests for the well section; The formula for calculating the recent average moisture content is as follows: In the formula: Let be the recent average water cut of the i-th well section, dimensionless; Let be the instantaneous water production rate at time t in the i-th well section, which is dimensionless; For the i-th well segment time The instantaneous oil production rate is dimensionless; This is the production time step, expressed in days. The formula for calculating the production decline rate is: In the formula: Let be the production decline rate of the i-th well section, which is dimensionless; The instantaneous oil production rate at the current time step is dimensionless. The instantaneous oil production rate at the previous time step is dimensionless. This is the production time step, expressed in days. S23. Constructing feature vectors: The geological static features and production dynamic features extracted for the i-th well section in steps S21 and S22 are combined into a feature vector. ; The feature vector of the i-th well section The expression is: In the formula: The average permeability of the i-th well section is expressed in mD. Let be the permeability variation coefficient of the i-th well section, which is dimensionless; The cumulative mudstone thickness in the i-th well section is expressed in meters. Let be the recent average water cut of the i-th well section, dimensionless; Let be the production decline rate of the i-th well section, which is dimensionless; For a mouth was divided into The complete feature description of a horizontal well segment is a feature matrix composed of the feature vectors of all segments. , characteristic matrix The expression is: 。 5. The intelligent segmented production method for horizontal wells based on geological sensing and nested optimization according to claim 1, characterized in that: Step S3 specifically includes the following steps: S31. Define the model input and output: The input is the feature matrix constructed in step S2. ,in It is the number of segments. It is the number of features in each segment; The output is the macroscopic development index of the entire horizontal well. Forecast cumulative oil production and Predicted overall moisture content; S32. Define a multi-scale feature fusion-attention network: The core architecture of the multi-scale feature fusion-attention network consists of a feature embedding layer, a multi-head self-attention layer, and a global aggregation and multi-task prediction head. The feature embedding layer projects the original features into a high-dimensional space. The input feature matrix is ​​processed using a fully connected layer. : In the formula: It is a weight matrix. It is a bias vector. It is an activation function. It is the embedded feature matrix, and H is the embedding dimension; Multi-head self-attention layers are used to enable the model to automatically learn and quantify the interactions and dependencies between different well sections. The learnable weight matrices are respectively converted into a query matrix Q, a key matrix K, and a value matrix V: , Calculate attention weights ; The above process is executed in parallel N times, and the results are concatenated and then passed through a linear layer to capture the feature relationships of different subspaces. The output is ; The global aggregation and multi-task prediction head first uses global average pooling: Will A global feature vector is obtained by averaging along the dimensions of the segment. This vector encodes global information for the entire horizontal well and is predicted using two independent fully connected networks. Cumulative oil production and Overall moisture content: S33. Define the training strategy and loss function: The training of the surrogate model is accomplished by minimizing a composite loss function, the expression of which is: Defined as: In the formula: N is the number of training samples. The true label for the i-th sample is calculated by the numerical simulator; This is used to ensure that the model's predictions conform to basic physical laws. Defined as: In the formula: N is the number of training samples. The true label for the i-th sample is calculated by the numerical simulator; S32. Generate M different schemes through Latin hypercube sampling, and run a numerical simulator to obtain the corresponding training sets. Minimize using the Adam optimizer Stop training when the loss stops decreasing.

6. The intelligent segmented production method for horizontal wells based on geological sensing and nested optimization according to claim 1, characterized in that: Step S4 Specifically, the following steps are included: S41. Construct the outer layer optimization algorithm: For each candidate segmentation scheme generated by the outer algorithm, the inner algorithm is immediately invoked to solve for the current optimal output configuration, and the performance under this configuration is used as the basis for evaluating the merits of the segmentation scheme. The outer layer optimization is implemented in detail using a genetic algorithm (GA). The genetic algorithm is responsible for global exploration in a discrete segmented location space. The outer optimization variable is a piecewise position vector. Each individual is composed of Composed of -1 coordinate values, randomly generated. Individuals; for each individual, randomly generated within the constraint range (0, L). -1 numbers, then sort them to ensure ; Individual fitness The target value is determined by the optimal value returned by the inner optimizer. , segment position Passed to the inner SQP optimizer; SQP at fixed segment positions Under the premise of optimizing output Q and returning the optimal output configuration, this value is the position of that segment. fitness ; The selection part of the genetic algorithm uses tournament selection, randomly selecting k individuals from the population, and then selecting the individuals with the best fitness. The tallest individual serves as the parent generation; Repeat this process until a sufficient number of parent individuals are selected; The crossover part of the genetic algorithm uses simulated binary crossover (SBX), which simulates the behavior of single-point crossover but is applicable to real number encoding, and pairs the selected parent individuals. For each gene, with probability Perform crossover, offspring gene values From paternal genes The value was calculated; S42. Construct the inner layer optimization algorithm: Given the outer state segmentation position S i Under these conditions, the inner layer optimization uses a sequential quadratic programming method to solve the following constrained optimization problem: Under the conditions of satisfying the quality fraction constraint and the lower bound constraint, maximize the objective function Q. o (Q), thus obtaining the optimal injection configuration vector Q; Where Q represents the variable vector to be optimized. , Indicates the number of segments. These represent the injection-production flow rate allocation ratio for each segment; Q o (Q) represents the objective function value; Constraints include summation constraints and lower bound constraints ,in This represents the minimum proportion allocated to each segment; definition Constraint functions include equality constraints. and inequality constraints .

7. The intelligent segmented production method for horizontal wells based on geological sensing and nested optimization according to claim 6, characterized in that: The specific method for calculating the offspring gene value is as follows: S411. First, obtain a random variable, and calculate the expansion factor based on the value of the random variable. The formula for calculating the expansion factor β is as follows: In the formula: β is the expansion factor, which is dimensionless; The cross-distribution index; For random variables, ; S412. Calculate the gene values ​​of two offspring individuals using the expansion factor β. : In the formula: and It is the gene value of the parent individual; β represents the gene value of the offspring; β is the expansion factor, which is dimensionless. S413. The mutation employs multinomial mutation, applying a small probability to each gene of the offspring individual. If the gene undergoes mutation, When a mutation is selected, a random variable is first obtained. Then calculate the disturbance term. ; The disturbance term The calculation formula is: In the formula: For disturbance terms; The cross-distribution index; For random variables, ; The final determined gene value after the mutation is: ; In the formula: This represents the new gene value after the mutation; This represents the original offspring gene values ​​before the mutation. The value range of the variable is the length of the interval, i.e., the total length of the horizontal well, in meters.

8. The intelligent segmented production method for horizontal wells based on geological sensing and nested optimization according to claim 6, characterized in that: The iteration of the inner optimization algorithm specifically includes the following steps: S421. Initialization: Set the initial point. Let λ be the initial Lagrange multiplier, serving as a feasible starting point for satisfying the constraints. 0 and ν 0 , corresponding to equality constraints and inequality constraints respectively; let the initial Hessian approximation matrix H0 = I, where I represents the identity matrix; let the iteration counter k = 0; S422, Gradient and Jacobian Calculation: In each iteration, the objective function is calculated using the automatic differentiation function of the surrogate model. gradient ; Calculate equality constraints and inequality constraints in Q. k Jacobian matrix at the location; For this problem, the equality constraint Jacobian matrix is: The inequality constraint Jacobian matrix is ; S423, Construction of Quadratic Programming (QP) Subproblems: At the current iteration point Q k Given linearization constraints and a second-order approximate objective, construct the search direction. The subproblem of quadratic programming: Objective function: Minimize Constraints: in: This represents the search direction vector for this iteration; This represents the current Hessian approximation matrix; Since the equality constraints are linear and the initial point is feasible, the linearized equality constraints can be written as follows: Inequality constraints can be written as ; Solving S424 and QP subproblems: The above QP subproblem is solved using the effective set method to obtain the search direction. and the corresponding Larange multiplier estimates and ; S425, Line Search: Along Direction Perform a line search to find a suitable step size. So that the penalty function Minimize sufficiently; The expression for the penalty function is: In the formula: μ is the penalty factor; determined using the Armijo criterion. ; S426, Iteration Point Update: Update variables ; S427, Hessian approximate update: calculate , calculate , in: It is a Lagrange function; If the curvature condition is satisfied Then the Hessian approximation matrix is ​​updated using the BFGS formula: If the curvature condition is not met, the matrix is ​​reset to the identity matrix. S428. Convergence Criterion: Calculate KKT residuals, including standing residuals. Equality-constrained residuals Inequality residuals and complementary residuals ; The iteration terminates when all residuals are less than the preset tolerance, and the optimal solution for Q and the corresponding objective function value are output. .