A method and apparatus for determining wellbore flow parameters

The wellbore parameter prediction model, which employs a multi-objective joint loss function and a gradient balance adaptive weighting strategy, solves the problems of lag and large error in the calculation of wellbore flow parameters in existing technologies, and realizes accurate determination of wellbore flow parameters and real-time monitoring of downhole conditions.

CN122088231APending Publication Date: 2026-05-26CHINA UNIV OF PETROLEUM (BEIJING)
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA UNIV OF PETROLEUM (BEIJING)
Filing Date
2025-12-25
Publication Date
2026-05-26

Smart Images

  • Figure CN122088231A_ABST
    Figure CN122088231A_ABST
Patent Text Reader

Abstract

This specification provides a method and apparatus for determining wellbore flow parameters. The method utilizes a static feature extraction module of a pre-defined wellbore parameter prediction model to determine the static feature vector of the target well based on wellbore geometric parameters and fluid properties. A dynamic feature extraction module of the same model determines the dynamic feature vector based on wellbore operating data. A feature fusion module of the same model fuses the static and dynamic feature vectors to determine the fused feature vector of the target well. Finally, a data processing module of the same model determines the wellbore flow parameters based on the fused feature vector. The pre-defined wellbore parameter prediction model is trained using a multi-objective joint loss function and an adaptive weighting strategy with gradient balancing. This method achieves accurate determination of the wellbore flow parameters of the target well.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This manual belongs to the field of oil and gas field development technology, and in particular relates to a method and apparatus for determining wellbore flow parameters. Background Technology

[0002] Bottom hole pressure, liquid phase content, and drilling fluid velocity are core parameters for real-time monitoring of downhole conditions, early warning of well control risks, and optimization of drilling parameters. However, existing methods for determining well flow parameters generally rely on empirical formulas and steady-state models, which result in delayed calculations and large errors.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This specification provides a method and apparatus for determining wellbore flow parameters, which solves the technical problem that existing wellbore flow parameter determination processes rely on only a single type of input, resulting in delayed results and large errors.

[0005] This manual provides a method for determining wellbore flow parameters, including:

[0006] Acquire wellbore data of the target well; wherein, the wellbore data includes wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore;

[0007] Using the static feature extraction module of the preset wellbore parameter prediction model, the static feature vector of the target well is determined based on the wellbore geometric parameters and the fluid properties parameters inside the wellbore; using the dynamic feature extraction module of the preset wellbore parameter prediction model, the dynamic feature vector of the target well is determined based on the wellbore operating condition data.

[0008] Using the feature fusion module of the preset wellbore parameter prediction model, the static feature vector and the dynamic feature vector are fused to determine the fused feature vector of the target well;

[0009] The data processing module of the preset wellbore parameter prediction model determines the wellbore flow parameters of the target well based on the fused feature vector.

[0010] The preset wellbore parameter prediction model is a model trained based on a multi-objective joint loss function and using an adaptive weight strategy of gradient balancing.

[0011] In one embodiment, the multi-objective joint loss function includes: a data loss term calculated based on measured bottom hole pressure data, a physical loss term constructed based on the gas-liquid two-phase flow conservation equation, and a priori constraint loss term; wherein, the priori constraint loss term includes a first sub-term and a second sub-term; the first sub-term is determined based on the difference between the predicted value and the approximate value of the drilling fluid velocity in the wellbore flow parameters; the second sub-term is determined by calculating the negative value prediction results in the wellbore flow parameters using a preset penalty function, and the multi-objective joint loss function is determined according to the following formula:

[0012]

[0013]

[0014]

[0015]

[0016]

[0017] in, For multi-objective joint loss function, Here, N represents the data loss term, and N is the sample size. The predicted bottom hole pressure output by the model. The measured value of the bottom hole pressure for the sample. For physical loss items, Sampling point data used to calculate the physical loss term. Let be the spatial location and time coordinates of the j-th sampling point. The model predicts the location based on preset wellbore parameters. With time The output prediction results, The partial derivative of the output of the pre-defined wellbore parameter prediction model with respect to the time variable. For spatial control operators, As the first sub-item, The drilling fluid flow rate predicted by the model. This is an approximate value of the flow velocity calculated from the flow rate and the channel area. As the second sub-item, To correct the linear unit function, This is the predicted bottom hole pressure value. This is the predicted value of gas phase content. This is the predicted value for drilling fluid flow rate. These are the weighting coefficients for the data loss terms. The weighting coefficients for the physical loss term. The weighting coefficient for the first sub-item. This is the weighting coefficient for the second sub-item.

[0018] In one embodiment, the static feature extraction module is a module based on a feedforward neural network structure, the dynamic feature extraction module is a module based on a temporal recurrent neural network structure, the feature fusion module is a module based on a nonlinear mapping structure, and the data processing module is a module based on a fully connected layer structure.

[0019] The static feature extraction module includes at least a feedforward network layer that performs feature mapping between the wellbore geometric parameters and the fluid properties within the wellbore.

[0020] The dynamic feature extraction module includes at least a forward loop unit and a reverse loop unit for determining time state information in parallel.

[0021] In one embodiment, before the static feature extraction module using the preset wellbore parameter prediction model determines the static feature vector of the target well based on the wellbore geometric parameters and the fluid property parameters within the wellbore, the method further includes:

[0022] Obtain sample wellbore data and corresponding actual values ​​of sample wellbore flow parameters for the target well, and construct a training dataset based on the sample wellbore data;

[0023] Construct an initial wellbore parameter prediction model; wherein the initial wellbore parameter prediction model includes at least: an initial static feature extraction module based on a feedforward network layer structure, and a dynamic feature extraction module containing forward recurrent units and reverse recurrent unit structures;

[0024] Using the training dataset, the initial wellbore parameter prediction model is trained multiple times to obtain a preset wellbore parameter prediction model that meets the requirements.

[0025] The step of using the training dataset to train the initial wellbore parameter prediction model in multiple rounds includes: training the current round in the following manner:

[0026] Obtain the wellbore parameter prediction model from the previous round, as well as the multi-objective joint loss function from the previous round;

[0027] Based on the multi-objective joint loss function of the previous round, the target loss value of the current round is determined by processing the sample data of the current round using the wellbore parameter prediction model of the previous round.

[0028] Based on the adaptive weight strategy of gradient balancing, the gradient of each loss term in the multi-objective joint loss function of the previous round is calculated based on the target loss value of the current round to determine the gradient value of each loss term in the current round.

[0029] Based on the gradient values ​​of each loss term in the current round, determine the gradient norm of each loss term in the current round; and based on the gradient norm of each loss term in the current round, determine the average gradient norm of each loss term in the current round.

[0030] Calculate and determine the gradient deviation ratio of each loss term in the current round based on the deviation between the gradient norm of each loss term in the current round and the average gradient norm.

[0031] Calculate and determine the weight adjustment coefficients used for each loss term in the multi-objective joint loss function of the current training round based on the comparison results of the gradient bias ratio of each loss term in the current round with the preset balance interval;

[0032] Based on the weight adjustment coefficients used for each loss term in the multi-objective joint loss function of the current training round, adjust each loss term in the multi-objective joint loss function of the previous training round to obtain the multi-objective joint loss function of the current training round.

[0033] Based on the multi-objective joint loss function of the current training round, backpropagation calculation and gradient update are performed on the model parameters of the wellbore parameter prediction model of the previous round to obtain the updated model parameters of the current round.

[0034] Based on the updated model parameters of the current round, update the wellbore parameter prediction model of the previous round to obtain the wellbore parameter prediction model of the current round.

[0035] Check whether the current training round meets the preset training convergence condition;

[0036] If the current round meets the preset training convergence conditions, the wellbore parameter prediction model for the current round will be determined as the preset wellbore parameter prediction model that meets the requirements.

[0037] In one embodiment, the dynamic feature extraction module using a preset wellbore parameter prediction model determines the dynamic feature vector of the target well based on the wellbore operating data, including:

[0038] Based on the sampling time sequence in the wellbore operating data, determine the corresponding time series input data;

[0039] The gated recurrent unit layer in the dynamic feature extraction module is used to perform cross-temporal correlation processing on the time series input data to determine the corresponding time state vector.

[0040] Based on the time state vector, feature mapping is performed through a fully connected layer to determine the dynamic feature vector of the target well.

[0041] In one embodiment, the feature fusion module using a preset wellbore parameter prediction model fuses the static feature vector and the dynamic feature vector to determine the fused feature vector of the target well, including:

[0042] The static feature vector and the dynamic feature vector are concatenated to obtain a fused input vector;

[0043] The feature transformation unit of the feature fusion module of the preset wellbore parameter prediction model performs nonlinear mapping calculation on the fusion input vector to determine the fusion feature vector of the target well; wherein, the fusion feature vector is a joint feature vector containing wellbore spatial structure information and logging time-series evolution information.

[0044] In one embodiment, the wellbore flow parameters include bottom hole pressure, liquid phase content, and drilling fluid flow rate; the method further includes:

[0045] Based on the wellbore flow parameters of the target well, the well control safety assessment result of the target well is determined, wherein the well control safety assessment result is used to indicate whether there is a risk of well kick or blowout in the target well.

[0046] This specification provides a device for determining wellbore flow parameters, including:

[0047] The data acquisition module is used to acquire wellbore data of the target well; wherein, the wellbore data includes wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore;

[0048] The feature extraction module is used to determine the static feature vector of the target well based on the wellbore geometric parameters and fluid property parameters using the static feature extraction module of the preset wellbore parameter prediction model; and to determine the dynamic feature vector of the target well based on the wellbore operating condition data using the dynamic feature extraction module of the preset wellbore parameter prediction model.

[0049] The feature fusion module is used to perform feature fusion on the static feature vector and the dynamic feature vector using the feature fusion module of the preset wellbore parameter prediction model, and determine the fused feature vector of the target well.

[0050] The parameter determination module is used by the data processing module of the preset wellbore parameter prediction model to determine the wellbore flow parameters of the target well based on the fused feature vector.

[0051] The preset wellbore parameter prediction model is a model trained based on a multi-objective joint loss function and using an adaptive weight strategy of gradient balancing.

[0052] This specification also provides an electronic device, including a processor and a memory for storing processor-executable instructions, wherein the processor, when executing the instructions, implements a method for determining wellbore flow parameters.

[0053] This specification also provides a computer-readable storage medium having computer instructions stored thereon, which, when executed, implement a method for determining wellbore flow parameters.

[0054] Based on the wellbore flow parameter determination method provided in this specification, wellbore data of a target well is obtained; wherein, the wellbore data includes wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore; using a static feature extraction module of a preset wellbore parameter prediction model, a static feature vector of the target well is determined based on the wellbore geometric parameters and fluid property parameters within the wellbore; using a dynamic feature extraction module of the preset wellbore parameter prediction model, a dynamic feature vector of the target well is determined based on the wellbore operating condition data; using a feature fusion module of the preset wellbore parameter prediction model, the static feature vector and the dynamic feature vector are fused to determine a fused feature vector of the target well; using a data processing module of the preset wellbore parameter prediction model, the wellbore flow parameters of the target well are determined based on the fused feature vector; wherein, the preset wellbore parameter prediction model is a model trained based on a multi-objective joint loss function and employing an adaptive weight strategy of gradient balancing. In this way, by using the static feature extraction module to process wellbore geometric parameters and fluid property parameters within the wellbore, and the dynamic feature extraction module to process wellbore operating condition data, targeted feature mining can be performed based on the characteristics of different types of data. Furthermore, the feature fusion module fuses the determined static and dynamic feature vectors, ensuring that the fused feature vector used to determine wellbore flow parameters takes into account both the inherent spatial properties of the wellbore and the dynamic changes in operating conditions, thus improving the comprehensiveness of feature representation. Further, this application employs a gradient-balanced adaptive weight strategy to train a pre-defined wellbore parameter prediction model based on a multi-objective joint loss function. This strategy adaptively adjusts the distribution of different weights in the multi-objective joint loss function based on gradient feedback during training, effectively solving the optimization imbalance problem in the multi-objective joint training process. This ensures that the model can learn multi-objective constraints in a balanced manner, thereby accurately determining the wellbore flow parameters of the target well using this model. Attached Figure Description

[0055] To more clearly illustrate the embodiments of this specification, the accompanying drawings used in the embodiments will be briefly introduced below. The drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0056] Figure 1 This is a flowchart illustrating a method for determining wellbore flow parameters according to one embodiment of this specification;

[0057] Figure 2 This is a schematic diagram of the electronic device structure provided in one embodiment of this specification;

[0058] Figure 3 This is a schematic diagram of the structural composition of a wellbore flow parameter determination device provided in one embodiment of this specification;

[0059] Figure 4 This is a schematic diagram of a physical information hybrid neural network method for efficient prediction of wellbore flow characteristics provided in one embodiment of this specification;

[0060] Figure 5 This is a schematic diagram of a physical information hybrid neural network model for efficient prediction of wellbore flow characteristics, provided in one embodiment of this specification.

[0061] Figure 6 This is a schematic diagram illustrating the comparison of model effects provided in one embodiment of this specification;

[0062] Figure 7 This is a schematic diagram of a gradient balancing adaptive weight process provided in one embodiment of this specification. Detailed Implementation

[0063] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0064] See Figure 1 As shown in the embodiments of this specification, a method for determining wellbore flow parameters is provided, wherein the method is specifically applied to the server side. In specific implementation, the method may include the following:

[0065] S101: Obtain wellbore data of the target well; wherein, the wellbore data includes wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore;

[0066] S102: Using the static feature extraction module of the preset wellbore parameter prediction model, determine the static feature vector of the target well based on the wellbore geometric parameters and fluid property parameters inside the wellbore; using the dynamic feature extraction module of the preset wellbore parameter prediction model, determine the dynamic feature vector of the target well based on the wellbore operating condition data.

[0067] S103: Using the feature fusion module of the preset wellbore parameter prediction model, the static feature vector and the dynamic feature vector are fused to determine the fused feature vector of the target well;

[0068] S104: The data processing module using the preset wellbore parameter prediction model determines the wellbore flow parameters of the target well based on the fused feature vector;

[0069] The preset wellbore parameter prediction model is a model trained based on a multi-objective joint loss function and using an adaptive weight strategy of gradient balancing.

[0070] The above wellbore operating data includes data such as drilling pressure, rotation speed, displacement, mud density, mud viscosity, standpipe pressure, drilling speed, mud temperature, and mud pit volume.

[0071] The aforementioned wellbore geometric parameters include well depth and wellbore diameter, while the fluid physical property parameters include fluid density and other data.

[0072] The aforementioned fluid properties parameters within the wellbore include data reflecting fluid density, fluid viscosity, and their variations with well depth.

[0073] The aforementioned static feature vector is a feature expression determined by the static feature extraction module based on the wellbore geometric parameters and fluid property parameters within the wellbore. It is used to reflect the wellbore morphology information and fluid property state of the target well under fixed structural conditions and belongs to time-independent feature representation.

[0074] The aforementioned dynamic feature vector is a feature expression determined by the dynamic feature extraction module based on wellbore operating condition data. It is used to describe the dynamic response characteristics of the target well during wellbore operations that change over time, reflecting the changing pattern of wellbore operating conditions in the time dimension.

[0075] The aforementioned fused feature vector is a comprehensive feature expression obtained by the feature fusion module after fusing static and dynamic feature vectors. It is used to simultaneously reflect the structural attributes and operating condition change attributes of the wellbore in the same vector space, providing joint feature input for determining the wellbore flow parameters.

[0076] The aforementioned wellbore flow parameters are target output parameters determined by the data processing module based on the fused feature vector. They typically include bottom hole pressure, liquid phase content, and drilling fluid velocity, used to characterize the real-time flow conditions inside the wellbore.

[0077] The aforementioned multi-objective joint loss function is a composite loss structure used to constrain the update of model parameters during the training process of the preset wellbore parameter prediction model. It consists of a data loss term that reflects the difference in measured bottom hole pressure data, a physical loss term that reflects the conservation relationship of gas-liquid two-phase flow, and other prior constraint terms, in order to simultaneously take into account the influence of different constraint sources on the model training process.

[0078] The aforementioned adaptive weighting strategy using gradient balancing refers to automatically adjusting the weights of corresponding loss terms during model training based on the gradient norm of each loss term in the multi-objective joint loss function and its deviation from the average gradient norm. This ensures that different loss terms maintain a relatively balanced gradient contribution across training rounds, thereby avoiding excessive influence of a single loss term on model training.

[0079] In some embodiments, after acquiring the wellbore data of the target well, the specific implementation may include:

[0080] The wellbore data is preprocessed; the preprocessing specifically includes: filling in missing values ​​in the wellbore data in a manner consistent with the previous data acquisition results; and using the interquartile range method to detect outliers in the wellbore data and removing the detected outliers.

[0081] The dimensional variables in the wellbore data are transformed into dimensionless values ​​to determine the wellbore data used to input the preset wellbore parameter prediction model.

[0082] In some embodiments, the static feature extraction module using a preset wellbore parameter prediction model determines the static feature vector of the target well based on the wellbore geometric parameters and the fluid property parameters within the wellbore. Specifically, this may include:

[0083] The wellbore geometric parameters and the fluid properties within the wellbore are constructed into a static input vector;

[0084] The static input vector is subjected to feature mapping calculation to obtain the static feature vector of the target well.

[0085] Specifically, firstly, the acquired wellbore geometric parameters and fluid property parameters within the wellbore are aligned to organize the parameters within the same data structure. Then, the wellbore geometric parameters and fluid property parameters are constructed into a unified static input vector. Next, feature mapping calculation is performed on the static input vector to extract discriminative information from the wellbore structural features and fluid state features. Finally, the static feature vector of the target well is determined based on the feature mapping calculation results, and the static feature vector is output to the feature fusion module for subsequent feature fusion processing.

[0086] In some embodiments, the data processing module utilizing the preset wellbore parameter prediction model determines the wellbore flow parameters of the target well based on the fused feature vector. Specifically, this may include:

[0087] The fused feature vector is input into the fully connected layer structure of the data processing module, and after linear mapping calculation, dimensionless predicted values ​​corresponding to the wellbore flow parameters are output synchronously; wherein, the dimensionless predicted values ​​include dimensionless bottom hole pressure, dimensionless liquid phase content and dimensionless drilling fluid velocity.

[0088] Obtain pre-stored data scaling parameters, which are statistical characteristic parameters determined when performing dimensionless processing on sample data;

[0089] The dimensionless predicted values ​​are reversed and reduced to dimensionless values ​​using the data scaling parameters to determine the bottom hole pressure, liquid phase content, and drilling fluid flow rate of the target well with physical dimensions.

[0090] By utilizing the data processing module to solve the fusion feature vector that integrates the static properties of the wellbore space and the dynamic evolution information of the operating conditions over time, the combined influence of different dimensional features on the flow state can be accurately explored. This enables the coordinated determination of multiple physical field parameters such as bottom hole pressure, liquid content, and flow velocity, ensuring that the final determined wellbore flow parameters not only conform to the geometric boundary constraints of the wellbore but also have the ability to respond in real time to transient changes in complex operating conditions.

[0091] In some embodiments, the method may further include the following:

[0092] The multi-objective joint loss function includes: a data loss term calculated based on measured bottom hole pressure data, a physical loss term constructed based on the gas-liquid two-phase flow conservation equation, and a priori constraint loss term; wherein, the priori constraint loss term includes a first sub-term and a second sub-term; the first sub-term is determined based on the difference between the predicted value and the approximate value of the drilling fluid velocity in the wellbore flow parameters; the second sub-term is determined by calculating the negative value prediction results in the wellbore flow parameters using a preset penalty function, and the multi-objective joint loss function is determined according to the following formula:

[0093]

[0094]

[0095]

[0096]

[0097]

[0098] in, For multi-objective joint loss function, Here, N represents the data loss term, and N is the sample size. The predicted bottom hole pressure output by the model. The measured value of the bottom hole pressure for the sample. For physical loss items, Sampling point data used to calculate the physical loss term. Let be the spatial location and time coordinates of the j-th sampling point. The model predicts the location based on preset wellbore parameters. With time The output prediction results, The partial derivative of the output of the pre-defined wellbore parameter prediction model with respect to the time variable. For spatial control operators, As the first sub-item, The drilling fluid flow rate predicted by the model. This is an approximate value of the flow velocity calculated from the flow rate and the channel area. As the second sub-item, To correct the linear unit function, This is the predicted bottom hole pressure value. This is the predicted value of gas phase content. This is the predicted value for drilling fluid flow rate. These are the weighting coefficients for the data loss terms. The weighting coefficients for the physical loss term. The weighting coefficient for the first sub-item. This is the weighting coefficient for the second sub-item.

[0099] In some embodiments, the data loss term is calculated from the difference between the actual values ​​and predicted values ​​of the sample wellbore flow parameters, wherein the actual values ​​of the sample wellbore flow parameters include measured bottom hole pressure data. The measured bottom hole pressure data is compared with the predicted bottom hole pressure output by the model to calculate the difference between the two, and this difference is used as the basis for calculating the data loss term, reflecting the degree of deviation between the model output and the measured data in the current training epoch.

[0100] Specifically, the data loss term is calculated based on the mean square error between the predicted and actual bottom hole pressure values, and can be determined according to the following formula:

[0101]

[0102] in, Here, N represents the data loss term, and N is the sample size. The predicted bottom hole pressure output by the model. The measured value of the bottom hole pressure for the sample.

[0103] In some embodiments, the physical loss term is constructed based on the gas-liquid two-phase flow conservation equation. Specifically, firstly, based on the wellbore structure and fluid state within the target well, the gas-liquid two-phase flow conservation equation is constructed; then, partial derivatives are calculated for the time variables corresponding to the wellbore operating conditions and the spatial variables corresponding to the wellbore geometric parameters; subsequently, the wellbore flow parameters and their partial derivatives are substituted into the gas-liquid two-phase flow conservation equation to calculate the equation residuals; the physical loss term is determined based on the magnitude of the residuals, ensuring that the model output satisfies both data constraints and the conservation relationship of the gas-liquid two-phase flow.

[0104] Specifically, the dimensional variables of the original partial differential equation are transformed into dimensionless variables, and then the predicted values ​​are substituted into the equation to calculate the absolute value of the residual. This can be determined using the following formula:

[0105]

[0106] in, For physical loss items, Sampling point data used to calculate the physical loss term. Let be the spatial location and time coordinates corresponding to the j-th sampling point. The model predicts the location based on preset wellbore parameters. With time The output prediction results, The partial derivative of the output of the pre-defined wellbore parameter prediction model with respect to the time variable. For spatial control operators.

[0107] In some embodiments, the prior constraint loss term includes a first sub-term and a second sub-term, used to impose prior constraints on the model output. Specifically, the first sub-term is constructed by calculating the difference between the predicted drilling fluid velocity value in the wellbore flow parameters output by the model and the approximate velocity value obtained from wellbore operating condition data. This first sub-term reflects the degree of deviation between the predicted drilling fluid velocity and the approximate velocity value. Specifically, the second sub-term is constructed by numerically detecting each predicted result in the wellbore flow parameters output by the model. When a negative predicted result is detected, the negative predicted result is input into a preset penalty function for calculation. The second sub-term is then determined based on the calculation result of the penalty function to impose constraints on the negative predicted result.

[0108] Specifically, the second term is determined according to the following formula:

[0109]

[0110] in, As the second sub-item, To correct the linear unit function, This is the predicted bottom hole pressure value. This is the predicted value of gas phase content. This is the predicted value for drilling fluid flow rate.

[0111] In some embodiments, the data loss term, physical loss term, and prior constraint loss term are summarized and a multi-objective joint loss function is constructed; the multi-objective joint loss function is used to uniformly constrain the update process of model parameters in the current training round.

[0112]

[0113] in, For multi-objective joint loss function, As the first sub-item, These are the weighting coefficients for the data loss terms. The weighting coefficients for the physical loss term. The weighting coefficient for the first sub-item. This is the weighting coefficient for the second sub-item.

[0114] In some embodiments, the method may further include the following:

[0115] The static feature extraction module is based on a feedforward neural network structure, the dynamic feature extraction module is based on a temporal recurrent neural network structure, the feature fusion module is based on a nonlinear mapping structure, and the data processing module is based on a fully connected layer structure.

[0116] The static feature extraction module includes at least a feedforward network layer that performs feature mapping between the wellbore geometric parameters and the fluid properties within the wellbore.

[0117] The dynamic feature extraction module includes at least a forward loop unit and a reverse loop unit for determining time state information in parallel.

[0118] In some embodiments, the static feature extraction module can be a module based on a feedforward neural network structure, such as a multilayer fully connected neural network (FCNN). Specifically, the wellbore geometric parameters and fluid property parameters within the wellbore are combined to construct a static input vector, which is then input into the feedforward network. The feedforward network performs feature transformation processing on the static input vector through multilayer linear transformations and nonlinear mappings to extract feature information related to wellbore structural properties and fluid property states. Finally, the static feature vector of the target well is determined based on the output of the feedforward network and output to the feature fusion module.

[0119] Specifically, the static physical feature extraction module: the preprocessed spatial static variables such as well depth, well diameter, and fluid density are input into this pathway. This pathway adopts a fully connected neural network (FCNN) structure, and performs feature mapping through three fully connected layers and a BatchNormalization layer. Combined with local connections, irrelevant feature interference is avoided. Finally, static physical features such as well geometry and basic fluid properties are extracted, and a static feature vector with a dimension of 256 is output.

[0120] The dynamic feature extraction module can be a module based on a temporal recurrent neural network structure, such as a bidirectional GRU structure composed of a forward-gated recurrent unit and a reverse-gated recurrent unit. In specific implementation, time-series input data is constructed according to the sampling time sequence of the wellbore operating data, and this time-series input data is respectively input into the forward GRU unit and the reverse GRU unit to perform forward and reverse time-series feature extraction in parallel. Then, the output states of the forward and reverse GRU units are combined to obtain the corresponding time state vector. Finally, the dynamic feature vector of the target well is determined based on the time state vector and output to the feature fusion module.

[0121] Specifically, the time-series dynamic feature extraction module: The pre-processed time-series logging data such as drilling pressure, rotation speed, and displacement are input into this channel. This channel adopts a gated cyclic unit (GRU) structure, which adaptively filters historical time-series information through reset gates and update gates in two hidden layers. It focuses on capturing the long-term time correlation of parameters under key operating conditions such as displacement mutation and drilling pressure fluctuation, and explores dynamic dependencies. Finally, it outputs a high-dimensional time-series feature vector with a dimension of 128.

[0122] The feature fusion module can be constructed using a multilayer perceptron (MLP) structure or as a nonlinear mapping structure based on attention mapping. Specifically, static and dynamic feature vectors are concatenated to form a fused input vector; this fused input vector is then input into the feature fusion module to perform a nonlinear mapping operation, projecting features from different sources onto a unified feature space to generate a fused feature vector; the fused feature vector is then output to the data processing module.

[0123] The data processing module can employ a regression calculation module based on a fully connected layer structure. In specific implementation, the fused feature vector is input into the fully connected layer, a linear combination operation is performed on each feature component of the fused feature vector, and the wellbore flow parameters corresponding to the target well are output. When the wellbore flow parameters contain multiple parameter items, multiple output results can be generated simultaneously through the same fully connected layer structure.

[0124] In the above embodiments, the static feature extraction module and the dynamic feature extraction module perform feature extraction processing on different types of wellbore data, and pass the output static feature vectors and dynamic feature vectors to the feature fusion module; the feature fusion module performs fusion mapping processing on the static feature vectors and dynamic feature vectors to form a fused feature vector; the data processing module receives the fused feature vector and generates wellbore flow parameters. The above modules constitute the complete structure of the same preset wellbore parameter prediction model.

[0125] In other embodiments, the static feature extraction module is constructed using a multi-branch feedforward neural network structure, wherein a first sub-network is set up for processing wellbore geometric parameters, and a second sub-network is set up for processing fluid property parameters within the wellbore. The first sub-network performs feature mapping on parameters such as well depth and wellbore diameter, and the second sub-network performs feature mapping on parameters such as fluid density. After completing the feature transformation respectively, the output results of each sub-network are concatenated and input into a shared mapping layer to generate the static feature vector.

[0126] Correspondingly, the dynamic feature extraction module adopts a hierarchical time-series recurrent neural network structure. The bottom recurrent unit is used to extract the short-term variation features of the wellbore operating parameters, and the upper recurrent unit is used to extract the long-term trend features of the wellbore operating parameters. By weighted aggregation of the multi-layer time state vectors, a dynamic feature vector that simultaneously represents local changes and overall trends is formed.

[0127] In this embodiment, the feature fusion module further introduces a feature gating mechanism. Based on the importance coefficients of each dimension of the static feature vector and the dynamic feature vector, different feature components are weighted and combined, thereby dynamically adjusting the influence ratio of different types of features on the fusion result during the fusion process and generating a fused feature vector.

[0128] The data processing module constructs a multi-output regression network structure based on the fused feature vector. In the final output layer, parameter channels corresponding to bottom hole pressure, liquid phase content, and drilling fluid flow rate are set respectively. Each channel shares the feature representation of the previous stage, but is configured with independent weight parameters in the output layer, thereby realizing parallel regression calculation of multiple wellbore flow parameters.

[0129] Through the above implementation method, this embodiment, while maintaining consistency with the technical solution described in the claims, has modified the organization of the model structure, making the wellbore parameter prediction model more flexible in structural configuration and able to adapt to the application needs of different well types, different working conditions and different data scales.

[0130] In other embodiments, the pre-defined wellbore parameter prediction model first includes a dedicated static feature extraction module for processing spatially inherent property data. This module is constructed using a feedforward neural network (PFNN) structure. Specifically, this module mainly consists of an input layer, several stacked fully connected layers, and a batch normalization layer. When preprocessed wellbore geometric parameters (such as well diameter data at different well depths) and fluid properties within the wellbore (such as fluid density and viscosity) are input into this module, the feedforward network layer performs high-dimensional feature mapping on these low-dimensional physical parameters using matrix multiplication and a nonlinear activation function. In this process, the batch normalization layer plays a crucial role, standardizing the distribution of features in intermediate layers and preventing the gradient vanishing problem caused by differences in the magnitude of physical parameters. Through progressive feature transformations, the module ultimately outputs a static feature vector that implicitly contains wellbore geometric boundary constraints and fundamental fluid properties.

[0131] Secondly, to accurately capture rapidly changing operating condition information over time, the model incorporates a dynamic feature extraction module based on a temporal recurrent neural network (RNN) structure. Preferably, this module employs a bidirectional gated recurrent unit (Bi-GRU) architecture, internally containing forward and reverse recurrent units for parallel computation. During operation, this module receives logging data arranged in a time series (such as drilling pressure, rotational speed, and displacement sequences). The forward recurrent unit processes the data from past to future along the time step, capturing the cumulative effect of historical operating conditions on the current flow state; simultaneously, the reverse recurrent unit processes the same set of data in reverse along the time step from future to past, utilizing contextual information to smooth high-frequency noise and capture the overall evolution trend. These two units work in parallel, generating forward and reverse hidden states respectively, and combining them to determine a dynamic feature vector containing complete temporal state information.

[0132] Next, to achieve an organic integration of spatiotemporal information, the model utilizes a feature fusion module to process the aforementioned static and dynamic feature vectors. This module does not perform a simple linear concatenation but is constructed as a structure based on nonlinear mapping. In its implementation, the module first concatenates the static and dynamic features, and then performs deep interactive computation through a mapping layer with a nonlinear activation function (such as Tanh or Sigmoid). This nonlinear mapping mechanism can learn the complex coupling relationship between static geometric boundaries and dynamic flow conditions, such as identifying the differences in nonlinear pressure response caused by the same displacement mutation at different wellbore diameters, thereby generating a fused feature vector.

[0133] Finally, the model utilizes a data processing module to decode the fused feature vector, which is constructed based on a fully connected layer. As the model's output, this module contains parallel output branches corresponding to the number of parameters to be predicted. After the fused feature vector is input into this module, it undergoes linear weighted summation via the weight matrix of the fully connected layer, mapping the high-dimensional feature space back to the physical parameter space. To ensure the physical plausibility of the output, this module is configured with specific activation mechanisms for different physical quantities, ultimately simultaneously outputting dimensionless predictions of bottomhole pressure, liquid phase content, and drilling fluid velocity. The entire model architecture described above is determined within a training framework based on a multi-objective joint loss function (including data loss, physical equation residual loss, and prior constraint loss) and a gradient balancing adaptive weight strategy, thus ensuring that the prediction results possess both high accuracy and physical consistency.

[0134] In other embodiments, multi-channel parallel static extraction, attention-based long short-term memory (LSTM) networks, and cascade decoding structures are employed.

[0135] In order to more precisely decouple the different effects of wellbore geometry and fluid properties on flow, the static feature extraction module based on the parallel sub-channel structure is internally divided into two parallel feedforward sub-channels, rather than a single FCNN path.

[0136] First sub-channel (geometric feature channel): Used to receive geometric parameters such as well depth, well diameter, and eccentricity. This channel consists of two fully connected layers and is used to extract "flow channel boundary features".

[0137] The second sub-channel (physical property characteristic channel) is used to receive physical property parameters such as fluid density, viscosity, and yield value. This channel also consists of two fully connected layers and is used to extract "fluid medium characteristics".

[0138] Connection Relationship: The outputs of the two sub-channels mentioned above are first concatenated within the module, and then fused through a feature interaction layer. This feature interaction layer adopts a fully connected structure, aiming to learn the coupling effect between boundary features and medium features (e.g., the flow resistance characteristics of high-viscosity fluids in narrow well diameters), and finally outputs a high-dimensional static feature vector.

[0139] The Long Short-Term Memory (LSTM) network dynamic feature extraction module based on the attention mechanism adopts a composite structure of LSTM + Temporal Attention as an alternative to the GRU structure in order to more accurately locate key operating moments (such as the moment of pump start-up or displacement step point) in long sequences.

[0140] Main structure: Employs a multi-layered stacked Long Short-Term Memory (LSTM) network. Compared to GRU, LSTM adds independent "cell states," resulting in superior gradient preservation capabilities when processing ultra-long well sections (such as thousands of meters of logging data).

[0141] Temporal Attention Layer: Connected after the hidden output of the LSTM. This layer does not directly take the output of the last time step, but instead calculates a weighted sum of the hidden states of all time steps. The weight coefficients are automatically learned by the attention mechanism based on the relevance of the current time step.

[0142] Connection relationship: The time series data of well logging is input into the LSTM layer, the full sequence output of the LSTM enters the attention layer, and after weighted aggregation, the output focuses on the dynamic feature vector of key working condition segments.

[0143] To capture the higher-order interactions between static environments and dynamic conditions, this embodiment uses tensor product operations instead of simple vector concatenation in its feature fusion module based on tensor products. Specific structure: This module includes a dimension alignment layer and a dot product interaction layer.

[0144] Connection Relationship and Working Principle: First, a dimension alignment layer (linear mapping) maps the static and dynamic feature vectors to the same dimensional space. Then, element-wise multiplication (Hadamard Product) is performed. This operation forces the model to focus on the feature dimensions that are simultaneously activated in both vectors (e.g., when the "large displacement" feature and the "small diameter" feature appear simultaneously, the product signal is significantly enhanced, simulating a strong throttling effect in physics). The result is output as a fused feature vector.

[0145] The cascade data processing module based on physical causality takes into account the physical causal dependence between bottom hole pressure, liquid cut, and flow rate (e.g., flow rate changes cause pressure fluctuations). This module abandons the fully parallel output method and adopts a cascade decoding structure.

[0146] First-level decoder (flow rate prediction): Receives the fused feature vector and predicts the drilling fluid flow rate preferentially through the fully connected layer.

[0147] The second-level decoder (liquid content prediction) concatenates the fused feature vector with the "predicted flow velocity" output from the first level, using this as input to predict the liquid phase content. This simulates the effect of flow velocity on the gas-liquid slippage rate.

[0148] The third-level decoder (pressure prediction) concatenates the fused feature vector, flow velocity prediction, and liquid phase content prediction as input to predict bottom hole pressure. This simulates the physical process by which flow velocity and mixing density jointly determine cyclic pressure loss.

[0149] Connection relationship: The decoders at each stage are connected in series, and the output of the previous stage serves as the additional input feature of the next stage, forming a step-by-step transmission and correction of physical information.

[0150] By employing a dual-channel feature extraction architecture combining static and dynamic methods, the decoupled mining and deep fusion of the inherent boundary properties of the wellbore space and the temporal evolution of operating conditions are achieved. This effectively overcomes the technical bottleneck that a single network structure cannot simultaneously accommodate static geometric constraints and dynamic transient responses. Furthermore, by combining an adaptive weight adjustment strategy based on gradient balancing to optimize the multi-objective joint loss function, gradient conflicts between data fitting, physical equation constraints, and prior rules are dynamically coordinated. This solves the problems of training imbalance and convergence difficulties in traditional methods under multi-physics constraints. Thus, while achieving millisecond-level real-time computation, the physical consistency, accuracy, and generalization ability of the predicted bottom hole pressure and flow characteristics are significantly improved.

[0151] In some embodiments, before the static feature extraction module using the preset wellbore parameter prediction model determines the static feature vector of the target well based on the wellbore geometric parameters and the fluid properties within the wellbore, the method may further include the following:

[0152] S1: Obtain the sample wellbore data of the target well and the actual values ​​of the corresponding sample wellbore flow parameters, and construct a training dataset based on the sample wellbore data;

[0153] S2: Construct an initial wellbore parameter prediction model; wherein, the initial wellbore parameter prediction model includes at least: an initial static feature extraction module based on a feedforward network layer structure, and a dynamic feature extraction module containing forward recurrent units and reverse recurrent unit structures;

[0154] S3: Using the training dataset, the initial wellbore parameter prediction model is trained multiple times to obtain a preset wellbore parameter prediction model that meets the requirements.

[0155] The step of using the training dataset to train the initial wellbore parameter prediction model in multiple rounds includes: training the current round in the following manner:

[0156] S3-1: Obtain the wellbore parameter prediction model from the previous round, and the multi-objective joint loss function from the previous round;

[0157] S3-2: Based on the multi-objective joint loss function of the previous round, the target loss value of the current round is determined by processing the sample data of the current round using the wellbore parameter prediction model of the previous round.

[0158] S3-3: Based on the adaptive weight strategy of gradient balancing, and based on the target loss value of the current round, perform gradient calculation on each loss term in the multi-objective joint loss function of the previous round to determine the gradient value of each loss term in the current round.

[0159] S3-4: Based on the gradient values ​​of each loss term in the current round, determine the gradient norm of each loss term in the current round; and based on the gradient norm of each loss term in the current round, determine the average gradient norm of each loss term in the current round.

[0160] S3-5: Calculate and determine the gradient deviation ratio of each loss term in the current round based on the deviation between the gradient norm of each loss term in the current round and the average gradient norm.

[0161] S3-6: Calculate and determine the weight adjustment coefficients used for each loss term in the multi-objective joint loss function of the current training round based on the comparison results of the gradient deviation ratio of each loss term in the current round with the preset balance interval.

[0162] S3-7: Based on the weight adjustment coefficients used for each loss term in the multi-objective joint loss function of the current training round, adjust each loss term in the multi-objective joint loss function of the previous training round to obtain the multi-objective joint loss function of the current training round.

[0163] S3-8: Based on the multi-objective joint loss function of the current training round, backpropagation calculation and gradient update are performed on the model parameters of the wellbore parameter prediction model of the previous round to obtain the updated model parameters of the current round;

[0164] S3-9: Based on the updated model parameters of the current round, update the wellbore parameter prediction model of the previous round to obtain the wellbore parameter prediction model of the current round;

[0165] S3-10: Check whether the current training round meets the preset training convergence condition;

[0166] S3-11: If the current round meets the preset training convergence conditions, the wellbore parameter prediction model of the current round is determined as the preset wellbore parameter prediction model that meets the requirements.

[0167] In some embodiments, the preset wellbore parameter prediction model employs an adaptive weight strategy of gradient balancing during training to dynamically adjust the weights of each loss term in the multi-objective joint loss function. The specific implementation process may include the following steps: In each training epoch, backpropagation is performed on the data loss term, physical loss term, and empirical loss term respectively, calculating the gradient vector corresponding to each loss term, and further calculating the L2 norm of each gradient vector to quantify the influence of each loss term on model parameter updates in the current training epoch; based on this, the average value of the gradient norms of each loss term is taken as a reference benchmark, and the ratio between the gradient norm of each loss term and the reference benchmark is compared with a preset tolerance interval, wherein the tolerance interval is [0.8, 1.2]. When the gradient norm corresponding to a certain loss term exceeds the tolerance interval, the loss term is determined to be a gradient imbalance term; subsequently, for loss terms determined to have excessively large gradients, their weights are reduced by 10%, and for loss terms determined to have excessively small gradients, their weights are reduced by 10%. The ratio is increased, and upper and lower limits are set for the weights of each loss term. The lower limit of the weight is set to 0.1 and the upper limit of the weight is set to 10 to avoid the weights becoming extreme during training. The gradient monitoring, balance judgment and weight update process is repeated in several subsequent training rounds until the model training process meets the preset convergence conditions and the final preset wellbore parameter prediction model is determined.

[0168] By calculating the gradient norm of each loss term in the multi-objective joint loss function during training, and using the deviation between the gradient norm of each loss term and the average gradient norm as the basis for weight adjustment, the influence intensity of each loss term in the multi-objective joint loss function during backpropagation is kept within a relatively balanced range, thereby avoiding a single loss term from dominating the weight during training.

[0169] Furthermore, by dynamically adjusting the weight coefficients of each loss term based on the gradient bias ratio in each training round, the multi-objective joint loss function is updated as the model state changes during training, thereby achieving adaptive adjustment of weights during training and making the model parameter update process jointly constrained by each loss term.

[0170] Based on the above method, the preset wellbore parameter prediction model can maintain a joint response mechanism to each component loss term in the multi-objective joint loss function during the training process, avoiding bias towards a single source of constraint due to differences in gradient magnitude, thereby maintaining the stability and consistency of the training process.

[0171] In other embodiments, the construction and preparation of training data requires data preparation before iterative training. The system acquires historical sample wellbore data of the target well or similar neighboring wells, along with the corresponding actual values ​​of sample wellbore flow parameters. Specifically, the sample wellbore data includes dynamic operating condition data such as drilling pressure, rotational speed, and displacement arranged in time series, as well as static attribute data such as well depth, well diameter, and fluid density; while the actual values ​​of sample wellbore flow parameters serve as supervision labels, primarily including measured bottom hole pressure values ​​obtained through measurement-while-drilling tools. Subsequently, the system constructs a training dataset based on the sample wellbore data, typically dividing the data into several batches to facilitate small-batch gradient descent training.

[0172] Forward propagation and prediction generation: In each training epoch, the input data is processed using the current initial wellbore parameter prediction model. First, the static feature extraction module receives the geometric and physical property parameters from the sample wellbore data, while the dynamic feature extraction module receives the time-series operating condition data. After features are extracted from both, the feature fusion module performs nonlinear interaction and concatenation to determine the sample fused feature vector. Next, the data processing module receives this sample fused feature vector, decodes it through a fully connected layer, and synchronously outputs the predicted wellbore flow parameters for the current epoch. These predicted values ​​include the predicted bottomhole pressure, liquid phase content, and drilling fluid velocity.

[0173] The multi-objective loss and gradient calculation involves the model calculating the error based on the prediction results and physical constraints. Specifically, based on the actual and predicted values ​​of the sample wellbore flow parameters, and combined with the gas-liquid two-phase flow conservation equation and prior rules, the target loss value for the current training round is calculated using a multi-objective joint loss function. This target loss value consists of a data loss term, a physical loss term, and a prior constraint loss term. Subsequently, using an automatic differentiation mechanism, the gradients of each of the above loss terms are calculated for the model parameters to determine the gradient value corresponding to each loss term. Furthermore, to quantify the learning intensity of each task, the norm of the gradient value of each loss term is calculated, i.e., the gradient norm, and the arithmetic mean is calculated based on the gradient norms of all loss terms to determine the average gradient norm.

[0174] Based on gradient bias, adaptive weight adjustment is implemented to balance the optimization rate of each task. The system determines the gradient bias ratio for each loss term based on the deviation between its gradient norm and the average gradient norm. This ratio reflects whether a particular loss term is overly dominant or under-learned in the current training state. Subsequently, this gradient bias ratio is compared with a preset balance interval: if the ratio of a loss term exceeds the upper limit of the balance interval, it indicates that its gradient is too large, and its weight adjustment coefficient is reduced; if the ratio is below the lower limit of the balance interval, it indicates that its gradient is too small, and its weight adjustment coefficient is increased; if it is within the interval, it remains unchanged. This determines the weight adjustment coefficient to be used for each loss term in the next training round.

[0175] The parameter update and convergence iterations are performed. Finally, based on the determined weight adjustment coefficients, the data loss term, physical loss term, and prior constraint loss term in the multi-objective joint loss function are weighted and combined to determine the update loss function for the next training round. Based on this update loss function, the model parameters of the initial wellbore parameter prediction model are backpropagated and gradients are updated to obtain the updated model parameters. After the update is completed, the system checks whether the current training round meets the preset training convergence conditions, such as whether the change in the total loss value is less than a threshold or whether the maximum number of iterations has been reached. If not, the current updated model state is retained, and the above forward propagation, loss calculation, weight adjustment, and parameter update steps are repeated until the convergence conditions are met, and the preset wellbore parameter prediction model is finally determined.

[0176] In other embodiments, the core mechanism of the adaptive weight strategy for gradient balancing lies in establishing a "real-time monitoring and dynamic intervention" mechanism for the multi-objective optimization process. During training, the data fitting loss and the physical equation residual loss are often on different orders of magnitude, and their gradient directions may conflict (i.e., the so-called "ill-conditioned gradient problem"). This strategy does not rely on manually set fixed weights, but instead calculates the gradient norm (L2 Norm) of each loss term relative to the model parameters in real time, thereby quantifying the "dominance strength" of each task in the current training step. The gradient norm of each individual term is compared with the average gradient norm. If the gradient norm of a certain loss (such as data loss) is significantly higher than the average level (e.g., exceeding the upper limit of the preset balance interval), it indicates that the task is dominating the parameter update direction of the model, and its weight coefficient will be automatically decayed; conversely, if a certain gradient is too small, its weight will be increased. This mechanism forces the model to find a balanced descent direction in the parameter space that can simultaneously satisfy data constraints and physical constraints, rather than being "hijacked" by a single objective.

[0177] The greatest technical advantage of the gradient-balancing adaptive weight strategy lies in effectively solving the "optimization imbalance" problem commonly encountered by Physical Information Neural Networks (PINNs) in complex fluid computation. In traditional fixed-weight methods, excessive weights can disrupt data fitting, while insufficient weights can lead to the invalidation of physical constraints. Furthermore, finding the optimal weight combination requires extremely high manual trial-and-error costs. The adaptive strategy proposed in this application can automatically balance the contributions of data-driven and physical rules: in the early stages of training, the model can quickly converge using data gradients; in the later stages of training, by dynamically increasing the relative weight of the physical loss, the model is forced to output a solution that precisely conforms to the conservation law of gas-liquid two-phase flow. This not only eliminates the oscillating non-convergence phenomenon during training but also significantly improves the model's generalization ability and physical interpretability in unlabeled data regions (i.e., regions constrained only by physical equations), avoiding the generation of non-physical solutions.

[0178] The main aspect of the adaptive weight strategy for gradient balancing lies in the technological leap from "static empirical setting" to "dynamic adaptive optimization." Existing technologies often employ fixed weights or simple annealing strategies, which cannot handle the drastic gradient fluctuations in complex scenarios like wellbore multiphase flow, which involves high nonlinearity and multi-physics coupling. This specification creatively proposes using the "gradient norm ratio" as an adjustment trigger to construct an adaptive algorithm where weight coefficients evolve in real-time with the training state. This effectively provides an automatic regularization method for multi-objective deep learning, eliminating the need to know in advance which task is more important; instead, it allows the model to self-adjust its attention based on the learning difficulty. This design cleverly overcomes the common technical bottleneck of PINN's limited accuracy in industrial applications due to gradient conflicts, constituting a significant and substantial feature that distinguishes this specification from existing conventional intelligent prediction methods.

[0179] In some embodiments, the dynamic feature extraction module using a preset wellbore parameter prediction model determines the dynamic feature vector of the target well based on the wellbore operating data. In specific implementations, the method may further include the following:

[0180] S1: Determine the corresponding time series input data based on the sampling time sequence in the wellbore operating data;

[0181] S2: Using the gated loop unit layer in the dynamic feature extraction module, perform cross-temporal correlation processing on the time series input data to determine the corresponding time state vector;

[0182] S3: Based on the time state vector, perform feature mapping through a fully connected layer to determine the dynamic feature vector of the target well.

[0183] Specifically, wellbore operating data is obtained from the acquisition system corresponding to the target well. The wellbore operating data includes data sequences formed by continuous sampling over time, such as drilling pressure, rotation speed, displacement, and riser pressure.

[0184] The wellbore operating condition data is sorted according to the sampling time order, and time series input data is constructed with multiple consecutive sampling times.

[0185] The time series input data is organized into a multidimensional data sequence arranged along the time dimension to form an input structure for subsequent processing.

[0186] The time series input data is input into the gated loop unit layer in the dynamic feature extraction module;

[0187] The gated loop unit layer performs state update operations sequentially on the time-series input data, and performs joint calculations on the current input data and the hidden state of the previous time step in chronological order.

[0188] During implementation, the gated loop unit layer continuously processes the state at each moment in the time series and uses the hidden state at the final moment as a time state vector to characterize the dynamic features formed by the change of wellbore conditions over time.

[0189] The time state vector is input into the fully connected layer;

[0190] A linear combination operation is performed on the time state vector through a fully connected layer to form a dynamic feature vector; the dynamic feature vector serves as a representation of the time correlation result of the wellbore operating data and is used for subsequent feature fusion with the static feature vector.

[0191] In some embodiments, the feature fusion module using the preset wellbore parameter prediction model performs feature fusion on the static feature vector and the dynamic feature vector to determine the fused feature vector of the target well. In specific implementations, the method may further include the following:

[0192] S1: The static feature vector and the dynamic feature vector are concatenated to obtain a fused input vector;

[0193] S2: Using the feature transformation unit of the feature fusion module of the preset wellbore parameter prediction model, perform nonlinear mapping calculation on the fusion input vector to determine the fusion feature vector of the target well; wherein, the fusion feature vector is a joint feature vector containing wellbore spatial structure information and logging time-series evolution information.

[0194] Specifically, the static feature vector output by the static feature extraction module and the dynamic feature vector output by the dynamic feature extraction module are concatenated according to the feature dimension to form a fused input vector;

[0195] The splicing process involves sequentially connecting the components of each dimension of the static feature vector with the components of each dimension of the dynamic feature vector according to the feature arrangement order, so that the fused input vector simultaneously contains information from wellbore geometric parameters and fluid property parameters within the wellbore, as well as time-related information from wellbore operating condition data.

[0196] The concatenated fused input vector is input into the feature transformation unit in the feature fusion module;

[0197] The feature transformation unit performs nonlinear mapping calculation on the fused input vector based on a preset mapping relationship, and projects the fused input vector onto a preset feature space to obtain a fused feature vector;

[0198] The fused feature vector, as the result of a unified transformation between static and dynamic feature vectors, is used to simultaneously characterize wellbore spatial structure information and logging time-series evolution information.

[0199] The fused feature vector is output to the data processing module of the preset wellbore parameter prediction model for subsequent wellbore flow parameter determination.

[0200] In some embodiments, the wellbore flow parameters include bottom hole pressure, liquid phase content, and drilling fluid flow rate. In specific implementations, the method may also include the following:

[0201] Based on the wellbore flow parameters of the target well, the well control safety assessment result of the target well is determined, wherein the well control safety assessment result is used to indicate whether there is a risk of well kick or blowout in the target well.

[0202] Specifically, based on the predicted bottom hole pressure in the wellbore flow parameters, it is compared with the formation pressure or safe pressure range of the corresponding well section of the target well to determine whether the bottom hole pressure is within the preset safe range; when the bottom hole pressure is lower than the lower safe limit, it is determined that there is a risk of well kick; when the bottom hole pressure is higher than the upper safe limit, it is determined that there is a risk of well blowout.

[0203] Simultaneously, based on the predicted liquid content, the fluid state inside the wellbore is judged. When the liquid content shows a continuous decreasing trend over time, it is determined that the gas content inside the wellbore is increasing, and this serves as an auxiliary basis for judging abnormal fluid intrusion into the well.

[0204] Furthermore, based on the predicted drilling fluid flow rate, it is compared with the theoretical flow rate range corresponding to the current drilling conditions. When the drilling fluid flow rate increases or decreases abnormally in a short period of time, it serves as a supplementary judgment condition for well control anomalies.

[0205] After comprehensively considering the judgment results of bottom hole pressure, liquid phase content and drilling fluid flow rate, a well control safety evaluation result for the target well is generated to indicate whether there is a risk of well kick or blowout in the current wellbore operation.

[0206] As can be seen from the above, the embodiments of this specification provide a method for determining wellbore flow parameters, which acquires wellbore data of a target well; wherein, the wellbore data includes wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore; using a static feature extraction module of a preset wellbore parameter prediction model, the static feature vector of the target well is determined based on the wellbore geometric parameters and fluid property parameters within the wellbore; using a dynamic feature extraction module of the preset wellbore parameter prediction model, the dynamic feature vector of the target well is determined based on the wellbore operating condition data; using a feature fusion module of the preset wellbore parameter prediction model, the static feature vector and the dynamic feature vector are fused to determine a fused feature vector of the target well; using a data processing module of the preset wellbore parameter prediction model, the wellbore flow parameters of the target well are determined based on the fused feature vector; wherein, the preset wellbore parameter prediction model is a model trained based on a multi-objective joint loss function and using an adaptive weight strategy of gradient balancing. In this way, by using the static feature extraction module to process wellbore geometric parameters and fluid property parameters within the wellbore, and the dynamic feature extraction module to process wellbore operating condition data, targeted feature mining can be performed based on the characteristics of different types of data. Furthermore, the feature fusion module fuses the determined static and dynamic feature vectors, ensuring that the fused feature vector used to determine wellbore flow parameters takes into account both the inherent spatial properties of the wellbore and the dynamic changes in operating conditions, thus improving the comprehensiveness of feature representation. Further, this application employs a gradient-balanced adaptive weight strategy to train a pre-defined wellbore parameter prediction model based on a multi-objective joint loss function. This strategy adaptively adjusts the distribution of different weights in the multi-objective joint loss function based on gradient feedback during training, effectively solving the optimization imbalance problem in the multi-objective joint training process. This ensures that the model can learn multi-objective constraints in a balanced manner, thereby accurately determining the wellbore flow parameters of the target well using this model.

[0207] See Figure 2 As shown in the embodiments of this specification, a specific electronic device is also provided, wherein the electronic device includes a network communication port 201, a processor 202 and a memory 203, and the above structures are connected by internal cables so that the various structures can perform specific data interaction.

[0208] Specifically, the network communication port 201 can be used to acquire wellbore data of the target well; wherein, the wellbore data includes wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore.

[0209] The processor 202 can specifically be used to: utilize a static feature extraction module of a preset wellbore parameter prediction model to determine the static feature vector of the target well based on the wellbore geometric parameters and fluid property parameters within the wellbore; utilize a dynamic feature extraction module of the preset wellbore parameter prediction model to determine the dynamic feature vector of the target well based on the wellbore operating condition data; utilize a feature fusion module of the preset wellbore parameter prediction model to fuse the static and dynamic feature vectors to determine the fused feature vector of the target well; and utilize a data processing module of the preset wellbore parameter prediction model to determine the wellbore flow parameters of the target well based on the fused feature vector. The preset wellbore parameter prediction model is a model trained based on a multi-objective joint loss function and employing an adaptive weighting strategy with gradient balancing.

[0210] The memory 203 can be used to store the corresponding instruction program.

[0211] Based on the above method, the relevant structural performance of electronic equipment can be effectively utilized to improve the data processing speed of electronic equipment and efficiently realize a method for determining wellbore flow parameters.

[0212] In this embodiment, the network communication port 201 can be a virtual port bound to different communication protocols, thereby enabling the sending or receiving of different data. For example, the network communication port can be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for email data communication. Furthermore, the network communication port can also be a physical communication interface or communication chip. For example, it can be a wireless mobile network communication chip, such as GSM or CDMA; it can also be a Wi-Fi chip; or it can be a Bluetooth chip.

[0213] In this embodiment, the processor 202 can be implemented in any suitable manner. For example, the processor can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers, etc. This specification is not limiting.

[0214] In this embodiment, the memory 203 may include a hierarchy. In a digital system, anything that can store binary data can be a memory. In an integrated circuit, a circuit with storage function but no physical form is also called a memory, such as RAM, FIFO, etc. In a system, a storage device with a physical form is also called a memory, such as a memory stick, TF card, etc.

[0215] This specification also provides a computer-readable storage medium based on the above-described method for determining wellbore flow parameters, for acquiring wellbore data of a target well; wherein the wellbore data includes wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore; using a static feature extraction module of a preset wellbore parameter prediction model, a static feature vector of the target well is determined based on the wellbore geometric parameters and fluid property parameters within the wellbore; using a dynamic feature extraction module of the preset wellbore parameter prediction model, a dynamic feature vector of the target well is determined based on the wellbore operating condition data; using a feature fusion module of the preset wellbore parameter prediction model, the static feature vector and the dynamic feature vector are fused to determine a fused feature vector of the target well; using a data processing module of the preset wellbore parameter prediction model, the wellbore flow parameters of the target well are determined based on the fused feature vector; wherein the preset wellbore parameter prediction model is a model trained based on a multi-objective joint loss function and employing an adaptive weight strategy of gradient balancing.

[0216] In this embodiment, the storage medium includes, but is not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), Cache, Hard Disk Drive (HDD), or Memory Card. The memory can be used to store computer program instructions. The network communication unit can be an interface configured according to standards specified in the communication protocol for network connection communication.

[0217] In this embodiment, the specific functions and effects implemented by the program instructions stored in the computer-readable storage medium can be explained in comparison with other embodiments, and will not be repeated here.

[0218] See Figure 3 At the software level, embodiments of this specification also provide a wellbore flow parameter determination device, which may specifically include the following structural modules:

[0219] The data acquisition module 301 is used to acquire wellbore data of the target well; wherein, the wellbore data includes wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore;

[0220] The feature extraction module 302 is used to determine the static feature vector of the target well based on the wellbore geometric parameters and fluid property parameters using the static feature extraction module of the preset wellbore parameter prediction model; and to determine the dynamic feature vector of the target well based on the wellbore operating condition data using the dynamic feature extraction module of the preset wellbore parameter prediction model.

[0221] The feature fusion module 303 is used to perform feature fusion on the static feature vector and the dynamic feature vector using the feature fusion module of the preset wellbore parameter prediction model, and determine the fused feature vector of the target well.

[0222] The parameter determination module 304 is used by the data processing module of the preset wellbore parameter prediction model to determine the wellbore flow parameters of the target well based on the fused feature vector.

[0223] The preset wellbore parameter prediction model is a model trained based on a multi-objective joint loss function and using an adaptive weight strategy of gradient balancing.

[0224] In some embodiments, when the above-described device is specifically implemented, the multi-objective joint loss function includes: a data loss term calculated based on measured bottom hole pressure data, a physical loss term constructed based on the gas-liquid two-phase flow conservation equation, and a priori constraint loss term; wherein, the priori constraint loss term includes a first sub-term and a second sub-term; the first sub-term is determined based on the difference between the predicted value and the approximate value of the drilling fluid velocity in the wellbore flow parameters; the second sub-term is determined by calculating the negative value prediction result in the wellbore flow parameters using a preset penalty function, and the multi-objective joint loss function is determined according to the following formula:

[0225]

[0226]

[0227]

[0228]

[0229]

[0230] in, For multi-objective joint loss function, Here, N represents the data loss term, and N is the sample size. The predicted bottom hole pressure output by the model. The measured value of the bottom hole pressure for the sample. For physical loss items, Sampling point data used to calculate the physical loss term. Let be the spatial location and time coordinates of the j-th sampling point. The model predicts the location based on preset wellbore parameters. With time The output prediction results, The partial derivative of the output of the pre-defined wellbore parameter prediction model with respect to the time variable. For spatial control operators, As the first sub-item, The drilling fluid flow rate predicted by the model. This is an approximate value of the flow velocity calculated from the flow rate and the channel area. As the second sub-item, To correct the linear unit function, This is the predicted bottom hole pressure value. This is the predicted value of gas phase content. This is the predicted value for drilling fluid flow rate. These are the weighting coefficients for the data loss terms. The weighting coefficients for the physical loss term. The weighting coefficient for the first sub-item. This is the weighting coefficient for the second sub-item.

[0231] In some embodiments, when the above-described device is specifically implemented, the static feature extraction module is a module based on a feedforward neural network structure, the dynamic feature extraction module is a module based on a temporal recurrent neural network structure, the feature fusion module is a module based on a nonlinear mapping structure, and the data processing module is a module based on a fully connected layer structure; wherein, the static feature extraction module includes at least a feedforward network layer for feature mapping of the wellbore geometric parameters and the fluid property parameters inside the wellbore; the dynamic feature extraction module includes at least a forward recurrent unit and a reverse recurrent unit for parallel determination of time state information.

[0232] In some embodiments, before determining the feature vector, the feature extraction module 302 specifically acquires sample wellbore data of the target well and the corresponding actual values ​​of sample wellbore flow parameters, and constructs a training dataset based on the sample wellbore data; constructs an initial wellbore parameter prediction model; wherein the initial wellbore parameter prediction model includes at least: an initial static feature extraction module based on a feedforward network layer structure, and a dynamic feature extraction module containing forward recurrent units and backward recurrent units; using the training dataset, the initial wellbore parameter prediction model is trained multiple times to obtain a preset wellbore parameter prediction model that meets the requirements; wherein, the use of the training dataset... The training dataset is used to train the initial wellbore parameter prediction model in multiple rounds, including: training the current round in the following manner: obtaining the wellbore parameter prediction model and the multi-objective joint loss function of the previous round; based on the multi-objective joint loss function of the previous round, processing the sample data of the current round using the wellbore parameter prediction model of the previous round to determine the target loss value of the current round; according to the adaptive weight strategy of gradient balancing, calculating the gradient of each loss term in the multi-objective joint loss function of the previous round based on the target loss value of the current round to determine the gradient value of each loss term in the current round; and training the current round based on the gradient of each loss term in the multi-objective joint loss function of the previous round. The gradient values ​​of the terms are used to determine the gradient norm of each loss term in the current round; and based on the gradient norm of each loss term in the current round, the average gradient norm of each loss term in the current round is determined; the gradient deviation ratio of each loss term in the current round is calculated and determined according to the deviation between the gradient norm of each loss term in the current round and the average gradient norm; the gradient deviation ratio of each loss term in the current round is calculated and determined according to the comparison result of the gradient deviation ratio of each loss term in the current round and the preset balance interval, and the weight adjustment coefficients used for each loss term in the multi-objective joint loss function of the current training round are determined; based on the weight adjustment coefficients used for each loss term in the multi-objective joint loss function of the current training round, the weight adjustment coefficients of the multi-objective joint loss function of the previous training round are adjusted. The loss terms in the joint loss function are adjusted to obtain the multi-objective joint loss function for the current training round. Based on the multi-objective joint loss function for the current training round, backpropagation calculation and gradient update are performed on the model parameters of the previous round's wellbore parameter prediction model to obtain the updated model parameters for the current round. Based on the updated model parameters for the current round, the wellbore parameter prediction model for the previous round is updated to obtain the wellbore parameter prediction model for the current round. It is then checked whether the current training round meets the preset training convergence condition. If the current round meets the preset training convergence condition, the wellbore parameter prediction model for the current round is determined as the preset wellbore parameter prediction model that meets the requirements.

[0233] In some embodiments, the feature extraction module 302, when specifically implemented, determines the corresponding time series input data according to the sampling time order in the wellbore operating condition data; uses the gated recurrent unit layer in the dynamic feature extraction module to perform cross-time series correlation processing on the time series input data to determine the corresponding time state vector; and performs feature mapping through a fully connected layer based on the time state vector to determine the dynamic feature vector of the target well. In some embodiments, the feature fusion module 303, when specifically implemented, concatenates the static feature vector and the dynamic feature vector to obtain a fused input vector; uses the feature transformation unit of the feature fusion module of the preset wellbore parameter prediction model to perform nonlinear mapping calculation on the fused input vector to determine the fused feature vector of the target well; wherein, the fused feature vector is a joint feature vector containing wellbore spatial structure information and logging time series evolution information.

[0234] In some embodiments, the data acquisition module 301, in its specific implementation, determines the well control safety evaluation result of the target well based on the bottom hole pressure of the target well, wherein the well control safety evaluation result is used to indicate whether there is a risk of well kick or blowout in the target well; determines the cuttings carrying capacity evaluation result of the target well based on the liquid phase content and drilling fluid flow rate of the target well, and adjusts the drilling displacement parameters of the target well based on the cuttings carrying capacity evaluation result.

[0235] It should be noted that the units, devices, or modules described in the above embodiments can be implemented by computer chips or physical entities, or by products with certain functions. For ease of description, the above devices are described by dividing them into various modules according to their functions. Of course, in implementing this specification, the functions of each module can be implemented in the same software and / or hardware, or modules that implement the same function can be implemented by a combination of sub-modules or sub-units, etc. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection between the devices or units shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0236] As can be seen from the above, based on the wellbore flow parameter determination device provided in the embodiments of this specification, wellbore data of a target well is acquired; wherein, the wellbore data includes wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore; using a static feature extraction module of a preset wellbore parameter prediction model, a static feature vector of the target well is determined based on the wellbore geometric parameters and fluid property parameters within the wellbore; using a dynamic feature extraction module of the preset wellbore parameter prediction model, a dynamic feature vector of the target well is determined based on the wellbore operating condition data; using a feature fusion module of the preset wellbore parameter prediction model, the static feature vector and the dynamic feature vector are fused to determine a fused feature vector of the target well; using a data processing module of the preset wellbore parameter prediction model, the wellbore flow parameters of the target well are determined based on the fused feature vector; wherein, the preset wellbore parameter prediction model is a model trained based on a multi-objective joint loss function and using an adaptive weight strategy of gradient balancing.

[0237] In a specific scenario example, the wellbore flow parameter determination method and apparatus provided in this specification can be applied, solving the technical problem of delayed results and large errors in existing wellbore flow parameter determination processes due to reliance on only a single type of input. The specific implementation process may include the following:

[0238] In some embodiments, data preparation involves collecting wellbore operating data from a specific section (depth between 4400 meters and 6000 meters) of a vertical well in a certain sea area, including 12 logging parameters such as drilling pressure, rotation speed, displacement, mud density, mud viscosity, standpipe pressure, mud temperature, and mud pit volume; calculating time parameters using the formula t = Δx / ROP, where Δx represents the difference between adjacent depths and ROP represents the drilling speed; performing outlier detection (using the interquartile range method), missing value completion (maintaining consistency with the previous data acquisition results), and standardization / normalization on the data; and converting the original output parameters (pressure p≈80MPa, αg≈10) into the data. -3 The parameters (p≈80, αg≈1, vl≈1 m / s) are converted into dimensionless form (p≈80, αg≈1, vl≈1) to solve the problem of interference from different orders of magnitude on model training.

[0239] The static physical feature extraction process inputs the processed spatiotemporal variables such as well depth, wellbore diameter, and fluid density into the static physical feature extraction pathway. This pathway adopts a fully connected neural network (FCNN) structure, which includes three fully connected layers (using ReLU activation function) and a batch normalization layer. Through local connectivity and parameter sharing mechanisms, it avoids interference from irrelevant features, ensures the effective representation of static physical information, and finally outputs a 256-dimensional static physical feature vector.

[0240] The time-series dynamic feature extraction inputs the processed time-series logging data (sampling frequency 1Hz) such as drilling pressure, rotation speed, and displacement into the time-series dynamic feature extraction path. This path adopts a gated cyclic unit (GRU) structure, which contains gated cyclic units with two hidden layers. It adaptively filters historical time-series information through reset gate and update gate, focusing on capturing the long-range time correlation of parameters under key operating conditions such as displacement mutation and drilling pressure fluctuation, and finally outputs a 128-dimensional time-series feature vector.

[0241] To ensure that the model's predictions conform to the fundamental physical laws of gas-liquid two-phase flow, a multi-objective joint loss function is constructed, including: a data loss term (calculating the mean square error between the predicted and actual values ​​of the bottom-hole pressure p); a physical loss term (performing dimensionless transformations on the dimensional variables of the original partial differential equations, then substituting the predicted values ​​to calculate the absolute value of the equation residuals); and finally, minimizing the equation using a gradient descent algorithm (such as Adam or L-BFGS). The PDE residual term acts as a regularizer, improving the model's generalization ability in sparse data regions. The forward problem is solved directly; the inverse problem can simultaneously identify the unknown equation parameter γ. This also avoids mesh generation and supports computation in complex geometric domains.

[0242] The adaptive weight adjustment strategy for gradient balancing simplifies the total loss to L_total = αL_data + βL_pde. Weights are dynamically adjusted based on gradient norm comparison: if ||▽L_data|| > 1.5||▽L_pde||, then α decreases by 10% and β increases by 10% to prioritize fitting; conversely, α increases and β decreases to strengthen physical constraints. The training process includes: initializing network parameters and α and β using a He normal distribution; inputting training data and outputting predicted values, calculating L_data, L_pde, and the total loss; updating parameters via backpropagation using the Adam optimizer (initial learning rate 1e-4, decreasing to 0.8 times every 50 epochs); adjusting α and β according to the gradient norm, and repeating training until 500 epochs or loss convergence (change < 1e-6).

[0243] In some embodiments, an adaptive weight adjustment strategy based on gradient balancing is employed, dynamically adjusting the weights according to the gradient norm of each loss term during training. The model is trained and validated using a pre-constructed dataset, and the Adam optimizer is used to select the model with the smallest evaluation error.

[0244] The model trained using this method can output the prediction results of three core flow parameters—bottom hole pressure, liquid phase content, and drilling fluid velocity—end-to-end and synchronously upon receiving new real-time downhole data, providing timely and comprehensive decision support for field engineers.

[0245] In some embodiments, the experiment was divided into fixed-weight reorganization and gradient-balanced-weight reorganization. A total of 8 control experiments were conducted. The experiments are shown in Table 1.

[0246] Table 1

[0247]

[0248] Experiments A through G all involve fixed-weight reassembly. To determine the merits of these methods, it is necessary to consider the following: lower prediction accuracy (MAE) and lower R... 2 Higher is better; shorter training efficiency and fewer convergence epochs are also better, requiring comprehensive analysis across multiple dimensions. For example, the effects are comparable. Figure 3 As shown, Experiment A only has a data loss term, making it a purely data-driven model, without physical or empirical loss terms. MAE achieved the best performance, R... 2 The results were moderate, with relatively long training time and slow convergence. Used only as a data loss, its prediction accuracy and efficiency were both average. Compared to experiment A, introducing partial differential equation loss (experiment B) and empirical loss (experiment C) significantly improved model performance. The addition of partial differential equation loss in experiment B fundamentally regularized and normalized the model's weights. In experiment C, empirical loss provided a standard for the absolute value of the liquid phase velocity, resulting in better overall optimization.

[0249] Using Scheme C as an example, this study further explores the independent regulatory effect on model performance by adjusting the weights of the PDE loss term and the empirical loss term in the partial differential equation. To achieve a direct and comparable analysis of the impact of each loss term, the weights of λ1, λ2, and λ3 are set to 1, 10, and 3, respectively. The study finds that only for the PDE loss, such as in experiments C and E, weight enhancement results in a slight improvement in model performance. This is because case C already possesses the ability to generate the required derivatives, resulting in relatively small coefficient values ​​in the formula. However, enhancing the empirical loss weights (from case C to D, and from E to F) significantly improves performance. This is mainly because the amplified loss term drives a substantial improvement in the model's prediction accuracy for parameters, thereby efficiently meeting the constraints of the partial differential equation (PDE).

[0250] In some embodiments, see Figure 4 As shown, the pre-defined wellbore parameter prediction model includes an input layer, a static feature extraction module, a dynamic feature extraction module, a feature fusion layer module, an output layer, and a loss function construction module. Spatial location variable X and time variable T are used as continuous input parameters to the model. These continuous input parameters are processed through multiple layers to generate intermediate feature representations. Simultaneously, wellbore operating condition data X... t As a gated loop unit module in the sequence input access dynamic feature extraction path, it processes time-related information to generate time state features.

[0251] Simultaneously, the bottom hole pressure, drilling fluid velocity, and gas content are generated as predicted wellbore flow parameters at the output layer. These predicted results are then fed into a loss function construction module to construct data loss terms, physical loss terms, and prior loss terms. Specifically, an automatic differentiation module differentiates the bottom hole pressure, drilling fluid velocity, and gas content with respect to spatial variable X and time variable T to generate partial derivative information in the physical loss term.

[0252] In some embodiments, see Figure 5 As shown, the preset wellbore parameter prediction model includes a feature input module, a static feature extraction module, a temporal feature extraction module, a feature fusion module, a prediction output module, and a loss function construction module.

[0253] The feature input module is used to receive wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore, and input the wellbore data to the static feature extraction module and the time-series feature extraction module respectively; the static feature extraction module is used to perform feature mapping on the wellbore geometric parameters and fluid property parameters within the wellbore to generate static features; the time-series feature extraction module is used to extract time-series features from the wellbore operating condition data to generate time-series features.

[0254] The hybrid feature fusion module is used to perform feature splicing and nonlinear transformation processing on the static features and the time-series features to form fused features; the prediction output module performs regression calculation on the fused features to obtain the wellbore annular pressure, liquid phase content and drilling fluid flow velocity as wellbore flow parameter prediction results for the target well.

[0255] The loss function construction module includes a data loss term, a physical loss term, and an empirical loss term (i.e., a priori loss term); wherein, the data loss term is constructed based on the above-mentioned wellbore flow parameter prediction results and measured data; the physical loss term is constructed based on the gas-liquid two-phase flow conservation equation; and the empirical loss term is used to apply numerical constraints to the prediction results.

[0256] The data loss term, the physical loss term, and the empirical loss term constitute a multi-objective joint loss function, and the parameters of the preset wellbore parameter prediction model are updated through the backpropagation module.

[0257] During model training, the model hyperparameters are automatically tuned through the gradient search module, and the results are compared and optimized based on the preset evaluation index. Logical constraints are introduced into the candidate models for constraint optimization, thereby obtaining the Pinns bottom hole pressure prediction model (i.e., the preset wellbore parameter prediction model) that meets the preset accuracy requirements.

[0258] The data loss term, physical loss term, and prior loss term are weighted and summed to form the total loss function. The total loss function is fed back to the preset wellbore parameter prediction model through the backpropagation module to update the model parameters.

[0259] In some embodiments, see Figure 6 As shown, Figure 6 The results show the performance comparison of different methods in the bottom hole pressure prediction task. The horizontal axis “Methods” represents the different prediction methods being compared, the vertical axis “MAE” represents the mean absolute error, reflecting the level of absolute deviation between the prediction results and the true values; the vertical axis “R²” represents the coefficient of determination, which is used to measure the degree of fit of the prediction results to the trend of the actual data; “Training Time (s)” represents the training time of the model, in seconds, and the method performance comparison.

[0260] Figure 6 The medium bar chart is used to display the mean absolute error (MAE) and coefficient of determination (R²) for each method. 2 The line graph is used to display the training time for each method. A smaller "MAE" value indicates a lower prediction error; "R" indicates a lower prediction error. 2 The closer the value is to 1, the higher the consistency between the prediction result and the actual data; the smaller the value of "Training Time (s)", the higher the model training efficiency.

[0261] Figure 6 Methods A through G and method GB represent various prediction model schemes with different structures or parameter configurations. Methods D, F, and GB show superior performance in terms of mean absolute error and coefficient of determination, indicating that under the conditions described in the embodiments, their prediction results for bottom hole pressure are closer to the actual measured values. Meanwhile, the training time of method G is significantly lower than that of other methods, indicating that it has higher training efficiency under the current comparison conditions, but the corresponding error and fitting effect are weaker. Method GB maintains a low mean absolute error while achieving the highest coefficient of determination, indicating that this method has more consistent performance in terms of prediction accuracy and fitting ability.

[0262] pass Figure 6 It can be seen that there are significant differences in prediction accuracy, fitting ability and training efficiency among different prediction schemes. The physical information fusion model achieved relatively balanced results in multiple indicators, which verifies the technical effect of combining wellbore operating data, wellbore geometric parameters and fluid property information for joint modeling to improve the prediction stability of wellbore flow parameters.

[0263] In some embodiments, see Figure 7As shown, the specific implementation process of the adaptive weight training process based on gradient balancing is given, which includes the following steps:

[0264] First, model training is initiated, and network parameters and weights for each loss term are initialized. Then, in each training epoch, data loss, physical loss, and empirical loss terms are calculated, resulting in multiple loss components. Independent backpropagation is performed on each loss component to obtain the gradient corresponding to the model parameters, and the gradient norm of each loss term is calculated. Based on this, the average of all gradient norms is calculated, and this average is used as a benchmark to determine whether the gradient proportion corresponding to each loss term is within a preset target range. When the gradient proportion of a certain loss term exceeds the target range, the weight corresponding to that loss term is adaptively adjusted: the weight of a loss term with an excessively large gradient is reduced, and the weight of a loss term with an excessively small gradient is increased, while upper and lower limits are set for the weights. When all gradient proportions meet the preset conditions, multiple loss terms are weighted and summed based on the updated weights to obtain a weighted total loss function. Then, backpropagation is performed using the weighted total loss function as the optimization objective to update the model parameters. Finally, the convergence status of the current training epoch is judged. If the preset convergence condition is met, training ends; otherwise, the next training epoch is restarted.

[0265] Through the above process, the weights of each loss term in the multi-objective joint loss function are dynamically and adaptively adjusted during model training, so that different constraint objectives maintain a balance in gradient magnitude during the training phase, thereby avoiding a single loss term dominating the model optimization process and improving the overall training stability and convergence reliability of the model.

[0266] While this specification provides the steps of operation for the methods described in the embodiments or flowcharts, more or fewer steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible order of execution among many steps and does not represent the only possible order. In actual device or client product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in a process, method, product, or apparatus that includes said elements is not excluded. The terms "first," "second," etc., are used to denote names and do not indicate any particular order.

[0267] Those skilled in the art will also know that, besides implementing the controller using purely computer-readable program code, the same functions can be achieved by logically programming the method steps, making the controller function as logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers (PLCs), and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the devices within it used to implement various functions can also be considered structures within that hardware component. Alternatively, the devices used to implement various functions can be considered as both software modules implementing the method and structures within a hardware component.

[0268] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this specification can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions of this specification can essentially be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments of this specification.

[0269] Although this specification has been described by way of examples, those skilled in the art will recognize that many variations and modifications are possible without departing from the spirit of this specification, and it is intended that the appended claims cover such variations and modifications without departing from the spirit of this specification.

Claims

1. A method for determining wellbore flow parameters, characterized in that, include: Acquire wellbore data of the target well; wherein, the wellbore data includes wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore; Using the static feature extraction module of the preset wellbore parameter prediction model, the static feature vector of the target well is determined based on the wellbore geometric parameters and the fluid properties parameters inside the wellbore; using the dynamic feature extraction module of the preset wellbore parameter prediction model, the dynamic feature vector of the target well is determined based on the wellbore operating condition data. Using the feature fusion module of the preset wellbore parameter prediction model, the static feature vector and the dynamic feature vector are fused to determine the fused feature vector of the target well; The data processing module of the preset wellbore parameter prediction model determines the wellbore flow parameters of the target well based on the fused feature vector. The preset wellbore parameter prediction model is a model trained based on a multi-objective joint loss function and using an adaptive weight strategy of gradient balancing.

2. The method according to claim 1, characterized in that, The multi-objective joint loss function includes: a data loss term calculated based on measured bottom hole pressure data, a physical loss term constructed based on the gas-liquid two-phase flow conservation equation, and a priori constraint loss term; wherein, the priori constraint loss term includes a first sub-term and a second sub-term; the first sub-term is determined based on the difference between the predicted value and the approximate value of the drilling fluid velocity in the wellbore flow parameters; the second sub-term is determined by calculating the negative value prediction results in the wellbore flow parameters using a preset penalty function, and the multi-objective joint loss function is determined according to the following formula: in, For multi-objective joint loss function, Here, N represents the data loss term, and N is the sample size. The predicted bottom hole pressure output by the model. The measured value of the bottom hole pressure for the sample. For physical loss items, Sampling point data used to calculate the physical loss term. Let be the spatial location and time coordinates of the j-th sampling point. The model predicts the location based on preset wellbore parameters. With time The output prediction results, The partial derivative of the output of the pre-defined wellbore parameter prediction model with respect to the time variable. For spatial control operators, As the first sub-item, The drilling fluid flow rate predicted by the model. This is an approximate value of the flow velocity calculated from the flow rate and the channel area. As the second sub-item, To correct the linear unit function, This is the predicted bottom hole pressure value. This is the predicted value of gas phase content. This is the predicted value for drilling fluid flow rate. These are the weighting coefficients for the data loss terms. The weighting coefficients for the physical loss term. The weighting coefficient for the first sub-item. This is the weighting coefficient for the second sub-item.

3. The method according to claim 2, characterized in that, The static feature extraction module is based on a feedforward neural network structure, the dynamic feature extraction module is based on a temporal recurrent neural network structure, the feature fusion module is based on a nonlinear mapping structure, and the data processing module is based on a fully connected layer structure. The static feature extraction module includes at least a feedforward network layer that performs feature mapping between the wellbore geometric parameters and the fluid properties within the wellbore. The dynamic feature extraction module includes at least a forward loop unit and a reverse loop unit for determining time state information in parallel.

4. The method according to claim 3, characterized in that, Before the static feature extraction module using the preset wellbore parameter prediction model determines the static feature vector of the target well based on the wellbore geometric parameters and the fluid properties within the wellbore, the method further includes: Obtain sample wellbore data and corresponding actual values ​​of sample wellbore flow parameters for the target well, and construct a training dataset based on the sample wellbore data; Construct an initial wellbore parameter prediction model; wherein the initial wellbore parameter prediction model includes at least: an initial static feature extraction module based on a feedforward network layer structure, and a dynamic feature extraction module containing forward recurrent units and reverse recurrent unit structures; Using the training dataset, the initial wellbore parameter prediction model is trained multiple times to obtain a preset wellbore parameter prediction model that meets the requirements. The step of using the training dataset to train the initial wellbore parameter prediction model in multiple rounds includes: training the current round in the following manner: Obtain the wellbore parameter prediction model from the previous round, as well as the multi-objective joint loss function from the previous round; Based on the multi-objective joint loss function of the previous round, the target loss value of the current round is determined by processing the sample data of the current round using the wellbore parameter prediction model of the previous round. Based on the adaptive weight strategy of gradient balancing, the gradient of each loss term in the multi-objective joint loss function of the previous round is calculated based on the target loss value of the current round to determine the gradient value of each loss term in the current round. Based on the gradient values ​​of each loss term in the current round, determine the gradient norm of each loss term in the current round; and based on the gradient norm of each loss term in the current round, determine the average gradient norm of each loss term in the current round. Calculate and determine the gradient deviation ratio of each loss term in the current round based on the deviation between the gradient norm of each loss term in the current round and the average gradient norm. Calculate and determine the weight adjustment coefficients used for each loss term in the multi-objective joint loss function of the current training round based on the comparison results of the gradient bias ratio of each loss term in the current round with the preset balance interval; Based on the weight adjustment coefficients used for each loss term in the multi-objective joint loss function of the current training round, adjust each loss term in the multi-objective joint loss function of the previous training round to obtain the multi-objective joint loss function of the current training round. Based on the multi-objective joint loss function of the current training round, backpropagation calculation and gradient update are performed on the model parameters of the wellbore parameter prediction model of the previous round to obtain the updated model parameters of the current round. Based on the updated model parameters of the current round, update the wellbore parameter prediction model of the previous round to obtain the wellbore parameter prediction model of the current round. Check whether the current training round meets the preset training convergence condition; If the current round meets the preset training convergence conditions, the wellbore parameter prediction model for the current round will be determined as the preset wellbore parameter prediction model that meets the requirements.

5. The method according to claim 4, characterized in that, The dynamic feature extraction module using a preset wellbore parameter prediction model determines the dynamic feature vector of the target well based on the wellbore operating data, including: Based on the sampling time sequence in the wellbore operating data, determine the corresponding time series input data; The gated recurrent unit layer in the dynamic feature extraction module is used to perform cross-temporal correlation processing on the time series input data to determine the corresponding time state vector. Based on the time state vector, feature mapping is performed through a fully connected layer to determine the dynamic feature vector of the target well.

6. The method according to claim 5, characterized in that, The feature fusion module using the preset wellbore parameter prediction model fuses the static feature vector and the dynamic feature vector to determine the fused feature vector of the target well, including: The static feature vector and the dynamic feature vector are concatenated to obtain a fused input vector; The feature transformation unit of the feature fusion module of the preset wellbore parameter prediction model performs nonlinear mapping calculation on the fusion input vector to determine the fusion feature vector of the target well; wherein, the fusion feature vector is a joint feature vector containing wellbore spatial structure information and logging time-series evolution information.

7. The method according to claim 1, characterized in that, The wellbore flow parameters include bottom hole pressure, liquid phase content, and drilling fluid flow rate; the method further includes: Based on the wellbore flow parameters of the target well, the well control safety assessment result of the target well is determined, wherein the well control safety assessment result is used to indicate whether there is a risk of well kick or blowout in the target well.

8. A device for determining wellbore flow parameters, characterized in that, include: The data acquisition module is used to acquire wellbore data of the target well; wherein, the wellbore data includes wellbore operating condition data, wellbore geometric parameters, and fluid property parameters within the wellbore; The feature extraction module is used to determine the static feature vector of the target well based on the wellbore geometric parameters and fluid property parameters using the static feature extraction module of the preset wellbore parameter prediction model; and to determine the dynamic feature vector of the target well based on the wellbore operating condition data using the dynamic feature extraction module of the preset wellbore parameter prediction model. The feature fusion module is used to perform feature fusion on the static feature vector and the dynamic feature vector using the feature fusion module of the preset wellbore parameter prediction model, and determine the fused feature vector of the target well. The parameter determination module is used by the data processing module of the preset wellbore parameter prediction model to determine the wellbore flow parameters of the target well based on the fused feature vector. The preset wellbore parameter prediction model is a model trained based on a multi-objective joint loss function and using an adaptive weight strategy of gradient balancing.

9. An electronic device, characterized in that, It includes a processor and a memory for storing processor-executable instructions, wherein the processor, when executing the instructions, implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores computer instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 7.