Real-time prediction method, device and system for wellhead temperature and pressure of geothermal resources

By introducing the energy balance equation and geothermal gradient feature construction method, combined with feature weighting and multi-task network, the measurement error and data inconsistency problems in the prediction of geothermal wellhead temperature and pressure are solved, and more accurate prediction results are achieved.

CN122221183BActive Publication Date: 2026-08-04SHANDONG ZHENGYUAN YEDA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG ZHENGYUAN YEDA TECH CO LTD
Filing Date
2026-05-18
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing technologies for predicting geothermal wellhead temperature and pressure suffer from problems such as large measurement errors, data inconsistency, neglect of basic physical laws such as energy conservation, and poor model generalization ability, resulting in inaccurate prediction results.

Method used

An anomaly correction mechanism based on the energy balance equation and the multi-scale depth profile feature construction of geothermal gradient are adopted. By combining feature weighting network and multi-task network, a fusion feature vector is formed through feature correction, construction, interaction and splicing, and prediction is performed using geothermal gradient attention mechanism.

Benefits of technology

It improves the accuracy of wellhead temperature and pressure prediction, enhances the model's ability to characterize complex geological conditions, and ensures that the prediction results conform to the basic physical laws of geothermal fluid flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122221183B_ABST
    Figure CN122221183B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, and system for real-time prediction of geothermal wellhead temperature and pressure. The method includes: acquiring real-time geothermal characteristics of the target geothermal well; performing feature correction, feature construction, feature interaction, and feature splicing based on the real-time geothermal characteristics to form a fused feature vector; feature correction including anomaly correction for initial reservoir temperature; feature construction including multi-scale depth profile feature construction based on geothermal gradient for the middle and deep reservoirs; inputting the fused feature vector into a pre-trained wellhead temperature and pressure prediction model; performing feature weighting processing on the fused feature vector through a feature weighting network combined with a pre-stored feature comprehensive importance vector to obtain a weighted feature vector; and performing forward propagation calculation on the weighted feature vector through a multi-task network to output the predicted wellhead temperature and pressure values ​​corresponding to the real-time geothermal characteristics, thereby improving the prediction accuracy of geothermal wellhead temperature and pressure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of geothermal technology, and in particular to a method, apparatus and system for real-time prediction of geothermal wellhead temperature and pressure. Background Technology

[0002] In the development and utilization of geothermal resources, wellhead temperature and pressure are two core parameters for measuring the production capacity and dynamic characteristics of geothermal wells. Accurate acquisition of these parameters is crucial for geothermal field production scheduling, equipment maintenance, resource evaluation, and power generation efficiency optimization. Currently, wellhead temperature and pressure are mainly obtained through direct measurement using sensors installed at the wellhead. While this method is intuitive, it has limitations in practical applications. Sensors operate in harsh environments with high temperatures, high pressures, and often corrosive gases, making them prone to drift, damage, or decreased measurement accuracy, leading to data loss or distortion and hindering production decisions. Furthermore, the fluid flow and heat transfer processes from the reservoir to the wellhead involve complex physical mechanisms, making it difficult to deeply understand the underlying causes and evolutionary patterns of parameter changes based solely on measurement data. With the rapid development of artificial intelligence technology, data-driven predictive models offer new technical pathways for geothermal parameter acquisition, and some studies have begun to explore the use of machine learning algorithms to establish a mapping relationship between reservoir characteristics and wellhead parameters.

[0003] Existing methods of using machine learning algorithms for prediction suffer from the following problems: They directly use raw measurement parameters, performing simple normalization or standardization as model input, failing to fully utilize key information such as geothermal gradients to characterize the thermal structure changes in the vertical direction of the wellbore. This results in insufficient model perception of physical processes in the depth direction, difficulty in eliminating data inconsistencies caused by measurement errors or geological anomalies, and neglect of fundamental physical laws such as the conservation of energy in geothermal fluid flow. Predictive models are often purely data-driven black-box models, and their predictions may violate fundamental physical laws such as the conservation of energy or momentum. Outside the training data coverage or in areas with complex geological conditions, the models exhibit poor generalization ability and are prone to non-physical interpretations. Summary of the Invention

[0004] The purpose of this application is to provide a method, device and system for real-time prediction of geothermal wellhead temperature and pressure, so as to improve the accuracy of geothermal wellhead temperature and pressure prediction.

[0005] Firstly, this application provides a real-time prediction method for wellhead temperature and pressure of geothermal resources. The method includes: acquiring real-time geothermal characteristics of the target geothermal well; the real-time geothermal characteristics include at least: initial reservoir temperature and reservoir depth; based on the real-time geothermal characteristics, performing feature correction, feature construction, feature interaction, and feature splicing to form a fused feature vector; feature correction includes anomaly correction based on the energy balance equation for the initial reservoir temperature; feature construction includes multi-scale depth profile feature construction based on geothermal gradient for the reservoir depth; inputting the fused feature vector into a pre-trained wellhead temperature and pressure prediction model; wherein the wellhead temperature and pressure prediction model includes: a feature weighting network and a multi-task network based on a geothermal gradient attention mechanism; by combining the feature weighting network with a pre-stored feature comprehensive importance vector, the fused feature vector is subjected to feature weighting processing to obtain a weighted feature vector; the multi-task network performs forward propagation calculation on the weighted feature vector to output the predicted wellhead temperature and predicted wellhead pressure values ​​corresponding to the real-time geothermal characteristics.

[0006] Furthermore, the aforementioned real-time geothermal features also include: measured wellhead temperature; based on the real-time geothermal features, the steps of feature correction, feature construction, feature interaction, and feature splicing to form a fused feature vector include: when the deviation between the measured wellhead temperature and the theoretical wellhead temperature exceeds a threshold, the initial reservoir temperature is corrected through an anomaly correction mechanism based on the energy balance equation to obtain the corrected reservoir temperature; based on the corrected reservoir temperature, a multi-scale depth profile feature construction based on the geothermal gradient is performed on the mid-depth reservoir to obtain structural features; for the real-time geothermal features and structural features, feature interaction processing is performed using the parameters of the variogram model to obtain interactive features; and the real-time geothermal features, corrected reservoir temperature, structural features, and interactive features are sequentially spliced ​​to form a fused feature vector.

[0007] Furthermore, the steps described above for correcting the initial reservoir temperature using an anomaly correction mechanism based on the energy balance equation to obtain the corrected reservoir temperature include: calculating the deviation between the measured wellhead temperature and the theoretical wellhead temperature; calculating the partial derivative of the theoretical wellhead temperature with respect to the initial reservoir temperature; obtaining the product of the deviation, the partial derivative, and the correction step size coefficient; and summing the product with the initial reservoir temperature to obtain the corrected reservoir temperature.

[0008] Furthermore, the steps described above, which involve constructing multi-scale depth profiles of the mid-depth reservoir based on geothermal gradients using corrected reservoir temperature to obtain structural features, include: extending upwards and downwards by a specified proportion from the mid-depth reservoir as the center to obtain virtual shallow depths and virtual deep depths; estimating the temperatures corresponding to the virtual shallow depths and virtual deep depths using geothermal gradients; superimposing the temperatures corresponding to the virtual shallow depths and virtual deep depths on the corrected reservoir temperature to obtain virtual shallow temperatures and virtual deep temperatures; determining the geothermal gradient variation coefficient by the ratio of the standard deviation to the mean of the geothermal gradient based on k-nearest neighbor samples; and using the virtual shallow temperature, virtual deep temperature, and geothermal gradient variation coefficient as structural features.

[0009] Furthermore, the steps described above, which combine a feature weighting network with a pre-stored feature importance vector to perform feature weighting on the fused feature vector to obtain a weighted feature vector, include: determining the hidden layer output vector based on the fused feature vector, the weight matrix of the first fully connected layer, the bias vector, and the geothermal correction linear unit activation function; determining the adaptive weight vector based on the hidden layer output vector, the weight matrix of the second fully connected layer, the bias vector, the feature importance vector, and the Softmax function; and multiplying the fused feature vector and the adaptive weight vector element-wise to obtain the weighted feature vector.

[0010] Furthermore, the training process of the above-mentioned wellhead temperature and pressure prediction model is as follows: A geothermal data training sample set is obtained; the samples in the sample set include: original geothermal features and corresponding labels; the original geothermal features include multiple of the following: reservoir temperature, reservoir depth, wellbore inner diameter, mass flow rate, fluid density, specific heat capacity at constant pressure, wellbore cross-sectional area, friction coefficient, overall heat transfer coefficient, heat transfer area, production time, wellbore volume, surrounding formation temperature, and geothermal gradient; the labels include: wellhead temperature and wellhead pressure; for the samples in the sample set, feature correction, feature construction, feature interaction, and feature splicing are performed to form a fused feature vector; using the fused feature vector corresponding to the sample set, a feature weighting network and a multi-task network based on the geothermal gradient attention mechanism are trained to obtain the wellhead temperature and pressure prediction model.

[0011] Furthermore, during the training of the above model, the total loss function is obtained by combining the data fitting loss, physical residual loss, and feature importance regularization term; the physical residual loss includes energy residual and momentum residual; the energy residual is used to measure the deviation between the predicted wellhead temperature and the theoretical wellhead temperature estimated based on the energy balance equation, and the momentum residual is used to measure the deviation between the predicted wellhead pressure and the theoretical wellhead pressure estimated based on the momentum balance equation.

[0012] Furthermore, the determination method for the above-mentioned feature comprehensive importance vector is as follows: For each original geothermal feature and structural feature corresponding to the training sample set, the following steps are performed: Calculate the maximum information coefficient value of the current feature with wellhead temperature and wellhead pressure respectively; Assign physical prior weights to the current feature for temperature prediction and pressure prediction respectively according to the geothermal mechanism; Perform nonlinear fusion of the maximum information coefficient value of the current feature with wellhead temperature and wellhead pressure respectively, and the physical prior weights of the current feature for temperature prediction and pressure prediction respectively, to obtain the comprehensive importance corresponding to the current feature; Determine the feature comprehensive importance vector based on the comprehensive importance corresponding to each current feature. Secondly, this application also provides a real-time prediction device for geothermal wellhead temperature and pressure. The device includes: a feature acquisition module for acquiring real-time geothermal features of a target geothermal well; the real-time geothermal features include at least: initial reservoir temperature and reservoir depth; a feature processing module for performing feature correction, feature construction, feature interaction, and feature splicing based on the real-time geothermal features to form a fused feature vector; feature correction includes anomaly correction based on the energy balance equation for the initial reservoir temperature; feature construction includes multi-scale depth profile feature construction based on geothermal gradient for the reservoir depth; and a model prediction module for inputting the fused feature vector into a pre-trained wellhead temperature and pressure prediction model; wherein the wellhead temperature and pressure prediction model includes: a feature weighting network and a multi-task network based on a geothermal gradient attention mechanism; the fused feature vector is weighted by combining the feature weighting network with a pre-stored feature comprehensive importance vector to obtain a weighted feature vector; the weighted feature vector is forward-propagated through the multi-task network to output the predicted wellhead temperature and pressure values ​​corresponding to the real-time geothermal features.

[0013] Thirdly, this application also provides a real-time prediction system for geothermal wellhead temperature and pressure, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method described in the first aspect.

[0014] The method, apparatus, and system for real-time prediction of geothermal wellhead temperature and pressure provided in this application have the following beneficial effects: 1. An anomaly correction mechanism based on the geothermal fluid energy balance equation is adopted, which can actively detect and correct anomalous samples that contradict physical laws, ensuring the physical consistency of input data. Physically meaningful feature interaction terms are generated through variograms in geostatistics, enabling the model to better capture the synergistic changes among reservoir parameters and enhancing the information content and physical interpretability of the features.

[0015] 2. By constructing multi-scale depth profile features through geothermal gradients, including virtual shallow temperature, virtual deep temperature, and geothermal gradient variation coefficient, one-dimensional point data is expanded into multi-dimensional features that can reflect vertical thermal structure and geothermal field heterogeneity. This enables the model to more comprehensively perceive the heat transfer process from deep to shallow layers and enhances its ability to characterize complex geological conditions.

[0016] 3. The maximum information coefficient is combined with the physical prior weights based on geothermal mechanisms to define the comprehensive importance. The features are then weighted and fused by dynamically generating adaptive weights through a lightweight neural network. This achieves an effective integration of data-driven and physical knowledge and can dynamically adjust the weights according to the local characteristics of the samples, so that the model focuses on key physical quantities.

[0017] 4. Construct a multi-task prediction model that integrates geothermal physical constraints. Introduce physical residual terms based on energy balance and momentum balance into the loss function, and use the geothermal gradient variation coefficient to adaptively adjust the strength of physical constraints. This ensures that the model is strongly constrained by physical laws while fitting the data, and guarantees that the prediction results conform to the basic principles of geothermal fluid flow. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating a real-time prediction method for geothermal wellhead temperature and pressure provided in this application embodiment; Figure 2 A real-time tracking effect diagram of wellhead temperature and pressure provided for an embodiment of this application; Figure 3 A schematic diagram of temperature residual provided for an embodiment of this application; Figure 4 A schematic diagram illustrating the correlation of original features provided in an embodiment of this application; Figure 5 A schematic diagram illustrating the correlation of interactive features provided in an embodiment of this application; Figure 6 A structural block diagram of a real-time prediction device for geothermal wellhead temperature and pressure provided in an embodiment of this application; Figure 7 This is a schematic diagram of a real-time prediction system for geothermal wellhead temperature and pressure provided in an embodiment of this application. Detailed Implementation

[0020] The technical solutions of this application will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] The following problems exist in the existing technology: 1. Existing technologies typically only perform simple normalization or standardization on data, which is insufficient to eliminate data inconsistencies caused by measurement errors or geological anomalies, and ignores the fundamental physical laws that geothermal fluid flow must follow, such as the law of conservation of energy.

[0022] 2. Existing technologies often directly use the original measurement parameters as model inputs, failing to fully utilize key information such as geothermal gradients to characterize the thermal structure changes in the vertical direction of the wellbore, resulting in insufficient model perception of physical processes in the depth direction.

[0023] 3. Existing technologies often rely on purely data-driven metrics for feature importance assessment, which may overlook some features that are important in physical mechanisms but not significant in the data, causing the model to fail under extreme conditions.

[0024] 4. Existing prediction models are mostly pure data-driven black box models. Their prediction results may violate basic physical laws such as energy conservation or momentum conservation. Outside the training data coverage or in areas with complex geological conditions, the model has poor generalization ability and is prone to non-physical interpretations.

[0025] This application provides a method, apparatus, and system for real-time prediction of geothermal wellhead temperature and pressure to solve the above-mentioned problems and improve the accuracy of geothermal wellhead temperature and pressure prediction.

[0026] To facilitate understanding of this embodiment, a method for real-time prediction of geothermal wellhead temperature and pressure disclosed in this application embodiment will first be described in detail. Figure 1 A flowchart illustrating a real-time prediction method for geothermal wellhead temperature and pressure provided in this application embodiment is shown. The method specifically includes the following steps: Step S102: Obtain the real-time geothermal characteristics of the target geothermal well; the real-time geothermal characteristics include at least: initial reservoir temperature and reservoir depth; In addition to initial reservoir temperature and reservoir depth, the aforementioned real-time geothermal characteristics may also include wellbore inner diameter, mass flow rate, fluid density, specific heat capacity at constant pressure, wellbore cross-sectional area, friction coefficient, overall heat transfer coefficient, heat exchange area, production time, wellbore volume, surrounding formation temperature, and geothermal gradient.

[0027] Step S104: Based on real-time geothermal characteristics, feature correction, feature construction, feature interaction, and feature splicing are performed to form a fused feature vector. Feature correction includes anomaly correction based on the energy balance equation for the initial reservoir temperature. Feature construction includes multi-scale depth profile feature construction based on geothermal gradient for the mid-deep reservoir. In the task of predicting geothermal wellhead temperature and pressure, although the original characteristic parameters can reflect the basic properties of the reservoir, there are complex nonlinear coupling relationships between the various characteristics. Furthermore, due to the influence of wellbore flow and heat exchange processes, conventional normalization or standardization processes are difficult to eliminate the inconsistencies in characteristics caused by measurement errors or geological anomalies.

[0028] This application's embodiments, taking into account the characteristics of geothermal data, introduce an anomaly correction mechanism based on the geothermal fluid energy balance equation, then utilize geothermal gradients to construct multi-scale depth profile features, and generate feature interaction terms through variograms in geostatistics, thereby constructing a physically consistent and information-rich enhanced feature set.

[0029] A single reservoir depth cannot characterize the temperature and pressure distribution at different depths along the wellbore, while the geothermal gradient provides a linear relationship between temperature and depth. In order to enhance the model's perception of physical processes in the depth direction, a set of multi-scale depth profile features is constructed, including virtual shallow temperature, virtual deep temperature, and temperature gradient variation coefficient.

[0030] There is often a synergistic regionalization phenomenon among geothermal reservoir parameters. For example, permeability and porosity are often positively correlated, and both affect fluid flow capacity. In this embodiment, the cross-variogram function from geostatistics is introduced to calculate the spatial correlation between feature pairs (here, "space" refers to feature space rather than geographic space), and based on this, physical interactive features are generated.

[0031] The original features, corrected and constructed features, and interactive features are concatenated to form a fused feature vector.

[0032] The specific processes of feature correction, feature construction, feature interaction, and feature fusion will be described in detail later.

[0033] Step S106: Input the fused feature vector into the trained wellhead temperature and pressure prediction model; wherein, the wellhead temperature and pressure prediction model includes: a feature weighting network and a multi-task network based on the geothermal gradient attention mechanism; Step S108: By combining the pre-stored feature comprehensive importance vector with the feature weighting network, the fused feature vector is subjected to feature weighting processing to obtain a weighted feature vector; The aforementioned feature importance vector is based on the feature importance evaluation results of the maximum information coefficient and physical prior. The maximum information coefficient can capture the linear and nonlinear relationship between features and targets. However, purely data-driven approaches may ignore some physically important features that are not significant in the data (such as permeability having a small impact on temperature at low flow rates, but still being theoretically important). Therefore, this application combines the maximum information coefficient with the physical prior coefficient to determine the feature importance vector that characterizes the overall importance.

[0034] Conventional feature weighting methods often use fixed weights, which cannot be dynamically adjusted according to the local characteristics of the samples. The lightweight neural network module (named feature weighting network) in this application consists of two fully connected layers. The hidden layer uses geothermal correction linear units, and the output layer generates an adaptive weight vector using Softmax based on the feature comprehensive importance vector. Then, the column vector composed of all features is multiplied element by element with the adaptive weight vector to obtain the weighted feature vector.

[0035] Step S110: The weighted feature vector is forward propagated through a multi-task network to calculate and output the predicted wellhead temperature and pressure values ​​corresponding to the real-time geothermal features.

[0036] To enhance the network's ability to represent geothermal physical processes, a multi-task network based on a geothermal gradient attention mechanism is adopted. This network introduces attention weights constructed from geothermal gradients and their variation coefficients in the hidden layers, dynamically adjusting the feature responses to focus the model on areas with strong geothermal activity and improve prediction accuracy.

[0037] This application also provides another method for real-time prediction of geothermal wellhead temperature and pressure, which is implemented based on the above embodiments; this embodiment focuses on describing the determination process of fusion features and the model prediction and training process.

[0038] The aforementioned real-time geothermal features also include: measured wellhead temperature; step S104 above, based on the real-time geothermal features, performs feature correction, feature construction, feature interaction, and feature splicing to form a fused feature vector, specifically including: (1) When the deviation between the measured wellhead temperature and the theoretical wellhead temperature exceeds the threshold, the initial reservoir temperature is corrected by an anomaly correction mechanism based on the energy balance equation to obtain the corrected reservoir temperature. In practice, the deviation between the measured wellhead temperature and the theoretical wellhead temperature is calculated; the partial derivative of the theoretical wellhead temperature with respect to the initial reservoir temperature is calculated; the product of the deviation, the partial derivative, and the correction step size coefficient is obtained; and the sum of the product and the initial reservoir temperature is calculated to obtain the corrected reservoir temperature.

[0039] In this embodiment, based on the principle of energy conservation during the flow of geothermal fluid from the reservoir to the wellhead, a simplified relationship is established between the wellhead temperature and the reservoir temperature, mass flow rate, production time, and wellbore geometric parameters. If a certain feature value deviates too much from the theoretical value estimated through other features, it indicates that the sample may have a measurement anomaly. Specifically, a theoretical wellhead temperature is constructed using all features and compared with the actual label. If the relative error exceeds a threshold, the initial reservoir temperature is adjusted using a correction factor to make it consistent with physical laws, expressed as: ; In the formula, To correct the initial reservoir temperature, measured in degrees Celsius, the deviation between the measured wellhead temperature and the theoretical wellhead temperature is introduced to adjust the original reservoir temperature, making the data more consistent with physical laws and characterizing the reservoir thermal state in accordance with physical laws. The initial reservoir temperature is expressed in degrees Celsius and is the measured or estimated initial value of the reservoir temperature. The step size coefficient is dimensionless and its value range is [value range missing]. This is used to control the correction strength, and it is adaptively determined based on the local outlier factor of the sample. The larger the local outlier factor value, the higher the degree of sample abnormality. The smaller the value (e.g.) To avoid overcorrection, where, This represents the local outlier factor of the sample; The wellhead temperature label, in degrees Celsius, is the actual measured wellhead temperature value. It serves as a reference target for calibration and is the label value in supervised learning. The theoretical wellhead temperature, calculated based on the geothermal fluid energy balance equation, is expressed in degrees Celsius. It is estimated based on reservoir temperature and heat loss terms and is used for comparison with actual wellhead temperatures. The calculation method is as follows: ; The temperature is the temperature of the surrounding strata, in degrees Celsius. If well temperature logging data is available, the temperature value at the corresponding depth can be read directly. If no actual measurement is available, the average geothermal gradient and surface temperature of adjacent boreholes or geothermal fields can be used to estimate the temperature. The partial derivative of the theoretical wellhead temperature with respect to the original initial reservoir temperature is dimensionless. is the friction coefficient, dimensionless, which characterizes the magnitude of frictional loss when fluid flows in a wellbore; This refers to the wellbore length, expressed in meters. In practical applications, it can be approximated as the length of the medium-deep reservoir. , Mid-depth of the reservoir, i.e., the depth at the midpoint of the reservoir, is expressed in meters. Mass flow rate, expressed in kilograms per second, represents the mass of fluid passing through the cross-section of the wellbore per unit time, and is directly measured by the flow meter. Fluid density, expressed in kilograms per cubic meter, is a physical property of the fluid. It can be determined through on-site sampling and analysis. If no actual measurement data is available, typical values ​​for the region can be used as a reference (e.g., for liquid water, approximate values ​​are taken as...). ); This refers to the specific heat capacity at constant pressure, measured in joules per kilogram per degree Celsius, which represents the temperature rise per unit mass of fluid. The amount of heat required to reach a temperature of 100 degrees Celsius can be determined by referring to tables or experimentally based on the properties of the fluid. This represents the cross-sectional area of ​​the well shaft, in square meters, and is a geometric parameter of the well shaft, derived from its inner diameter. Calculation, i.e. , This refers to the inner diameter of the well shaft, in meters. The overall heat transfer coefficient, measured in watts per square meter (°C), characterizes the intensity of heat exchange between the wellbore and the surrounding formation. It is calculated or determined based on the wellbore structure, formation thermal properties, and heat transfer mechanism, and is taken from empirical values. The empirical range is as follows: Watts per square meter in degrees Celsius; The heat exchange area is expressed in square meters. It is the lateral surface area of ​​the wellbore in contact with the formation and can be directly calculated as the lateral surface area of ​​the wellbore. Production time, in seconds, represents the time it takes for fluid to flow from the reservoir to the wellhead. In practice, it can be estimated based on the flow velocity and wellbore length, i.e., wellbore length divided by fluid flow velocity. The volume of the wellbore is expressed in cubic meters, and the geometric parameters of the wellbore are also given.

[0040] It should be noted that the geothermal fluid energy balance equation characterizes the energy conservation during the fluid flow from the reservoir to the wellhead, including changes in internal energy, kinetic energy, potential energy, frictional heat generation, and heat loss. The embodiments in this application simplify this to the formula for calculating the theoretical wellhead temperature. This reflects the physical process by which the reservoir temperature is reduced by friction and heat loss to obtain the wellhead temperature.

[0041] (2) Based on the corrected reservoir temperature, multi-scale depth profile features based on geothermal gradient are constructed for the mid-deep reservoir to obtain structural features; Specifically, virtual shallow depth and virtual deep depth are obtained by extending upwards and downwards by a specified proportion, centered on the middle depth of the reservoir. The temperature corresponding to the virtual shallow depth and virtual deep depth is estimated using the geothermal gradient. Based on the corrected reservoir temperature, the temperatures corresponding to the virtual shallow depth and virtual deep depth are superimposed to obtain the virtual shallow temperature and virtual deep temperature. The geothermal gradient variation coefficient is determined by the ratio of the standard deviation to the mean of the geothermal gradient based on the k-nearest neighbor samples. The virtual shallow temperature, virtual deep temperature, and geothermal gradient variation coefficient are used as structural features.

[0042] Specifically, virtual shallow and deep depths are generated by extending upwards and downwards by a certain proportion, centered on the middle depth of the reservoir. The temperature at these depths is estimated using the geothermal gradient. Simultaneously, a gradient variation coefficient is introduced to reflect local fluctuations in the geothermal gradient. This coefficient is calculated by the ratio of the standard deviation to the mean of the geothermal gradient based on the k-nearest neighbor samples, and is expressed as: ; In the formula, The virtual shallow temperature, in degrees Celsius, represents the shallow geothermal state above the reservoir, reflects the influence of the caprock or shallow heat source, and helps the model perceive the vertical thermal structure. It is a virtual deep temperature, measured in degrees Celsius, which characterizes the deep thermal state beneath the reservoir, reflects the influence of basement heat flow or deep heat sources, and enhances the understanding of deep heat transfer. The coefficient of variation of geothermal gradient is dimensionless and measures the degree of fluctuation of local geothermal gradient. It characterizes the heterogeneity of the geothermal field. The larger the value, the more drastic the change in geothermal gradient in the region. This represents the geothermal gradient, expressed in degrees Celsius per 100 meters. The temperature increase at a depth of meters is obtained by fitting well temperature logging data or by setting it according to the regional geothermal background value. If there is no measured data, the average gradient of adjacent boreholes or geothermal fields can be referenced. This is a virtual shallow depth, expressed in meters, obtained by extending the reservoir from the middle depth upwards by a certain proportion. The calculation method is expressed as follows: ; This is a virtual depth, expressed in meters, obtained by extending the reservoir from its mid-depth downwards by a certain proportion. The calculation method is as follows: ; Indicates medium to deep reservoir; To extend the proportion, it is dimensionless and is usually taken as a value based on geostatistical experience. It is used to control the degree to which the virtual depth deviates from the depth of the reservoir; Let be the number of nearest neighbors, dimensionless, with the preferred value being... , The total number of samples; For the sample In the feature space A set of nearest neighbor samples; Nearest neighbor samples The geothermal gradient, expressed in degrees Celsius per 100 meters; For the first sample index, For the second sample index; This represents the mean of the geothermal gradient in the nearest neighbor sample set, expressed in degrees Celsius per 100 meters.

[0043] In practical implementation, samples In the feature space A set of nearest neighbor samples The method is based on Euclidean distance. Specifically, first, the features of all samples are standardized, then the Euclidean distance between samples is calculated, and the sample with the smallest distance is selected. Each sample constitutes , The preferred value is .

[0044] (3) Based on the real-time geothermal features and tectonic features, the interaction features are obtained by using the parameters of the variogram model; Specifically, for any two features, first calculate their experimental cross-variogram values ​​on the sample set, then fit the theoretical variogram model to obtain the sill value and range, finally construct adaptive interaction weights, and multiply the product of the two features by these weights to obtain a weighted interaction term, emphasizing feature combinations with strong correlations, expressed as: ; In the formula, Features and The experimental crossover variability function value, dimensionless, measures the difference between the two values ​​in the lag distance. The degree of coordinated change; The lag distance is defined here as the absolute value of the difference in eigenvalues, i.e. (Before calculation, each feature needs to be standardized so that its mean is 0 and its variance is 1, thus making it dimensionless.) The dimension depends on the feature and is used to measure the difference between feature values. Lag distance The number of nearby sample pairs indicates that the eigenvalue difference is close. The number of sample pairs; Indicates the lag distance The selected number in the vicinity In a pair of samples, the features of the first sample The value of is (standardized and dimensionless). This indicates the feature of the second sample in the sample pair. The value of , This represents the feature of the first sample in the same pair. The value of , This represents the feature of the second sample in the same pair. The value of . These are adaptive interaction weights, derived from the mutation function model. They are dimensionless and their values ​​range from [value range missing]. , used to adjust the intensity of feature interactions; , is the sill value, which is the sill value obtained by fitting the spherical model. It is dimensionless and represents the total variation of the feature pair. For variable range, dimensionless, it represents the range of influence of feature correlation, that is, the correlation weakens beyond this distance; The index of the first feature. The index for the second feature; It is a natural exponential function; For interactive features, the units are: and The product of dimensions is added as a new feature to the expanded feature set; For the first One characteristic variable, For the first One characteristic variable, Features standard deviation Features The standard deviation.

[0045] In practical implementation, for continuous eigenvalue differences It needs to be discretized into multiple intervals, and tolerances need to be set. , will satisfy The sample pairs were classified into the first lag distance In, among them, It can be taken as 0.1 times the standard deviation of the eigenvalues ​​to ensure a sufficient number of sample pairs and avoid the interval being too wide.

[0046] Experimental cross-variogram value Used to fit theoretical variogram models (such as spherical models), thereby obtaining the sill values. With variable range Specifically, the calculated series of discrete experimental variogram points As observed values, the theoretical formula of the spherical model is set. ( The sill value that minimizes the sum of squared residuals between the theoretical curve and the experimental points is obtained by using the least squares method. With variable range This allows for fitting, resulting in two key parameters: the sill value. and variable range This is further used to construct adaptive interaction weights. .

[0047] (4) The real-time geothermal features, corrected reservoir temperature, structural features and interactive features are sequentially spliced ​​together to form a fused feature vector.

[0048] The original features, corrected and constructed features, and interactive features are concatenated to form a fused feature vector, which consists of the following: In this embodiment, the original features (14 in total) include: original reservoir temperature. (°C), medium-deep reservoir (m), wellbore inner diameter (m), mass flow rate (kg / s), fluid density (kg / m³), specific heat capacity at constant pressure (J / (kg·℃)), wellbore cross-sectional area (m²), coefficient of friction (Dimensionless) Overall heat transfer coefficient (W / (m²·℃)) heat exchange area (m²), Production Time (s) Wellbore volume (m³), surrounding stratum temperature (°C), geothermal gradient (℃ / hm); Correction and structural features (4 in total): Corrected reservoir temperature (°C), Virtual shallow temperature (°C), Virtual Deep Temperature (°C), coefficient of variation of geothermal gradient (dimensionless); Interaction features (number denoted as) Interactive items Its dimension is the product of the corresponding feature dimensions. In practice, all original and constructed features can be calculated pairwise, and those selected and retained can be selected based on the sill value. It depends on the screening results.

[0049] Furthermore, by combining all features column-wise, a fused feature vector is obtained. , is represented as:

[0050] Among them, the fused feature vector Dimensions ; This represents the first interactive feature, such as the weighted interaction term between reservoir temperature and mass flow rate. This indicates the second interactive feature, and so on.

[0051] Step S108 above involves using a feature weighting network to combine a pre-stored feature importance vector with the fused feature vector to perform feature weighting processing, resulting in a weighted feature vector. Specifically, this includes: (1) Determine the hidden layer output vector based on the fused feature vector, the weight matrix of the first fully connected layer, the bias vector, and the activation function of the geothermal modified linear unit; (2) Determine the adaptive weight vector based on the hidden layer output vector, the weight matrix of the second fully connected layer, the bias vector, the feature synthesis importance vector, and the Softmax function; (3) Multiply the fused feature vector and the adaptive weight vector element by element to obtain the weighted feature vector.

[0052] Conventional feature weighting methods often use fixed weights, which cannot be dynamically adjusted according to the local characteristics of the sample; This application's embodiment features a lightweight neural network module (named a feature-weighted network). The feature-weighted network consists of two fully connected layers. The hidden layer uses geothermally corrected linear units, and the output layer uses Softmax to generate an adaptive weight vector. Then, the column vector composed of all features is multiplied element-wise by the adaptive weight vector to obtain the weighted feature vector, represented as: ; In the formula, The weight matrix of the first fully connected layer of the feature-weighted network has a dimension of . , are trainable parameters; The number of neurons in the first hidden layer is preferably set to [value missing]. This is to reduce the number of parameters while retaining sufficient expressive power; The bias vector of the first fully connected layer of the feature-weighted network has a dimension of . , are trainable parameters; As a geothermal-corrected linear unit activation function, ReLU is modified based on geothermal characteristics. In one implementation, the input of the geothermal-corrected linear unit activation function is assumed to be... The geothermal modified linear unit is a modification of the ReLU activation function, taking into account the influence of the geothermal gradient, and is defined as follows: ,in, Using the Sigmoid activation function, the geothermal gradient is... Normalization to While eliminating dimensions, the activation value is amplified as the local geothermal gradient increases; The hidden layer output vector has a dimension of . By extracting complex relationships between features through nonlinear transformations, the network serves as an intermediate representation for generating adaptive weights, demonstrating the feature weighting network's ability to model feature interactions. Here is the weight matrix of the second fully connected layer of the feature-weighted network, with dimension 1. , are trainable parameters; The bias vector of the second fully connected layer of the feature-weighted network has a dimension of . , are trainable parameters; The Softmax function normalizes the input vector into a probability distribution; This is a feature importance vector used to element-wise multiply the initial weights output by Softmax. This incorporates prior physical information into the adaptive weights, ensuring that key physical features receive higher weights and achieving a fusion of data-driven approaches and physical knowledge. , dimension , used to fuse physical priors, where For the first The combined importance of these features; It is the transpose symbol; The symbol for element-wise multiplication; The adaptive weight vector has dimensions of . It is obtained by element-wise multiplication of the Softmax output with the comprehensive importance vector, which integrates data-driven and physical prior information; The weighted feature vector has a dimension of . This allows the model to focus on important features in subsequent predictions while preserving the original physical meaning of those features.

[0053] It should be noted that the geothermal modified linear unit activation function introduces the geothermal gradient. The Sigmoid activation function amplifies the activation value as the local geothermal gradient increases, thus making the model focus more on areas with strong geothermal activity, which is in line with physical laws (high geothermal gradients correspond to more significant heat transfer processes), and realizes the fusion of physical information and neural networks.

[0054] The determination of the above-mentioned feature comprehensive importance vector is as follows: For each original geothermal feature and structural feature corresponding to the training sample set, the following steps are performed: Calculate the maximum information coefficient value of the current feature with wellhead temperature and wellhead pressure respectively; assign physical prior weights to the current feature for temperature prediction and pressure prediction respectively according to the geothermal mechanism; perform nonlinear fusion of the maximum information coefficient value of the current feature with wellhead temperature and wellhead pressure respectively, and the physical prior weights of the current feature for temperature prediction and pressure prediction respectively, to obtain the comprehensive importance corresponding to the current feature; determine the feature comprehensive importance vector based on the comprehensive importance corresponding to each current feature. In this embodiment, based on the idea of ​​combining the maximum information coefficient and physical prior, an adaptive feature importance evaluation index is adopted, and a learnable weight matrix is ​​used to weight and fuse features, enabling the model to focus on key physical quantities while preserving the original meaning of the features. The maximum information coefficient can capture the linear and nonlinear relationships between features and targets, but purely data-driven approaches may overlook some physically important features that are not significant in the data (such as permeability having a small impact on temperature at low flow rates, but still being theoretically important). This embodiment combines the maximum information coefficient with physical prior coefficients to define comprehensive importance.

[0055] Specifically, firstly, the maximum information coefficient value of each feature (including original features and structural features) with wellhead temperature and wellhead pressure is calculated. Then, prior weights are assigned according to the geothermal mechanism, and the comprehensive importance is obtained through nonlinear fusion, expressed as: ; In the formula, For the first The overall importance of each feature is dimensionless, and the maximum information coefficient value driven by the fusion data and the physical prior weight are combined. The larger the value, the more important the feature is for predicting wellhead temperature and pressure, and thus receives greater attention in the weighted fusion. This is the feature index, and its value range is... arrive ; The sigmoid activation function maps the input to... An interval is used to normalize the overall importance. This is the balance coefficient for the maximum information coefficient of temperature, dimensionless, used to adjust the influence of the maximum information coefficient of temperature. An example value is 0.5. This is the balance coefficient for the maximum information coefficient of pressure, dimensionless, used to adjust the influence of the maximum information coefficient of pressure, with an example value of 0.5; This is the balance coefficient for the temperature prior weights. It is dimensionless and used to adjust the influence of the temperature prior weights. An example value is 0.3. This is the balance coefficient for the pressure prior weights. It is dimensionless and used to adjust the influence of the pressure prior weights. An example value is 0.3. For the first Features and wellhead temperature The maximum information coefficient, dimensionless, is used to measure the degree of linear and nonlinear correlation between two factors, and is calculated as follows: ; For the first Features and wellhead pressure The maximum information coefficient, dimensionless, is used to measure the degree of linear and nonlinear correlation between two factors, and is calculated as follows: ; For the first The physical prior weights of each feature for temperature prediction are dimensionless and assigned based on geothermal mechanisms to reflect the physical importance of the feature. For the first The physical prior weights of each feature for pressure prediction are assigned based on the geothermal mechanism and are used to reflect the physical importance of the feature. For the first Each feature variable is a fused feature vector. The One element; This is a wellhead temperature label, in degrees Celsius, representing the actual measured wellhead temperature value. This is a wellhead pressure label, with units of Pascals or Megapascals, representing the actual measured wellhead pressure value. To feature The number of intervals into which the range is divided, where Representation of features The grid is divided; To make the target variable The number of intervals into which the range is divided, where Represent the target variable The grid is divided; This is the upper limit for the number of grid divisions; it is dimensionless and uses the default value. , The total number of samples; To be under a given grid division, and The maximum mutual information value; To obtain and The smaller value in; It is a logarithmic function with base 2.

[0056] In one implementation, physical prior weights and The settings need to be based on expert knowledge or mechanism analysis. For temperature prediction, reservoir temperature... geothermal gradient Virtual temperature , It can be set to a higher value (e.g., 0.8-1.0) for pressure prediction and reservoir depth. Fluid density mass flow rate It can be set to a higher value (e.g., 0.8-1.0), while other features can be set to a lower value (e.g., 0.2-0.5).

[0057] It should be noted that, It is a feature With temperature The maximum mutual information under a given grid division will be calculated as follows: and The range of values ​​is divided into: and For each interval (grid), calculate the joint probability distribution, compute the mutual information, and then iterate through all intervals that satisfy the condition. The grid division is used to measure the correlation strength between features and targets by taking the maximum mutual information value.

[0058] A multi-task network integrating geothermal physical constraints is adopted to simultaneously output predicted values ​​of wellhead temperature and pressure. To improve the physical consistency of the prediction results, the model introduces a physical residual loss based on energy balance and momentum balance, and adaptively adjusts the physical constraint strength using the geothermal gradient variation coefficient. A total loss function that takes into account both data-driven and physical laws is constructed. The specific steps are as follows: 1) Output of a multi-task network based on geothermal gradient attention mechanism.

[0059] To enhance the network's ability to represent geothermal physical processes, a multi-task network based on a geothermal gradient attention mechanism is adopted. This network introduces attention weights constructed from geothermal gradients and their coefficients of variation into the hidden layers, dynamically adjusting the feature responses to focus the model on areas of intense geothermal activity. The mathematical expression is as follows:

[0060] In the formula, The predicted wellhead temperature is measured in degrees Celsius. It is the calculation result of the model output layer for the wellhead temperature task, representing the estimate of the wellhead fluid temperature. The wellhead pressure prediction value, in megapascals, is the calculation result of the model output layer for the wellhead pressure task, representing the estimate of the wellhead fluid pressure. The output layer weight matrix has dimensions of . , are trainable parameters used to linearly transform the hidden layer output vector into the output values ​​of the two predicted targets; The output layer bias vector has a dimension of . , are trainable parameters used to adjust the bias of the linear transformation result of the output layer; The activation function for the linear rectifier unit is used, and a nonlinear transformation is introduced to enhance the expressive power of the network. Here is the hidden layer weight matrix, with dimension 1. , are trainable parameters used to perform linear projection on the weighted feature vector to extract deep features; Here is the hidden layer bias vector, with dimension . , are trainable parameters used to adjust the bias of the linear transformation results of the hidden layer; The Softplus activation function ensures that the generated attention weights are positive, and that its input contains... Normalization is required to eliminate dimensions; This is the attention weight matrix, with dimension 1. , are trainable parameters used to map the geothermal gradient vector to the hidden layer dimension and control the generation of attention weights; This is a vector concatenation operation; Let be the attention bias vector, with dimension . , is a trainable parameter used to adjust the bias term in the attention mechanism; The value represents the number of neurons in the second hidden layer, which is dimensionless and preferably takes the value of [value missing]. This allows for the reduction of parameters while retaining sufficient expressive power.

[0061] In its implementation, the multi-task network based on the geothermal gradient attention mechanism includes an input layer, a hidden layer, and an output layer. The input layer receives a weighted feature vector. The hidden layer uses a weight matrix and bias vector A linear transformation is performed, and the bias term is dynamically modulated by the geothermal gradient attention mechanism. The output layer performs a linear transformation on the output of the hidden layer to obtain the wellhead temperature prediction and pressure prediction values, thereby realizing multi-task learning (predicting temperature and pressure simultaneously) and fusing geothermal physical information through the attention mechanism.

[0062] 2) Physical residual structure based on energy-momentum balance and geothermal heterogeneity.

[0063] To ensure that the prediction results conform to the basic physical laws of geothermal fluid flow, the embodiments of this application construct two physical residual terms: energy residual and momentum residual; Among them, the energy residual measures the deviation between the predicted wellhead temperature and the theoretical wellhead temperature estimated based on the energy balance equation, and the momentum residual measures the deviation between the predicted wellhead pressure and the theoretical wellhead pressure estimated based on the momentum balance equation. Considering the heterogeneity of geothermal systems, the confidence of the physical model decreases in highly heterogeneous regions. Therefore, an exponentially decaying weight constructed from the geothermal gradient variation coefficient is introduced to adaptively adjust the residual contribution. The physical residual loss is defined as: ; In the formula, The physical residual loss is dimensionless and is used to constrain the model output to conform to physical laws during training. The smaller the value, the closer the predicted value is to the estimated value of the physical equation. This represents the number of samples in the current batch. The energy residual decay coefficient is dimensionless and is a hyperparameter controlling the influence of geothermal heterogeneity on the energy residual. Its value range is [value range missing]. Example of a value: The larger the value, the stronger the attenuation effect of heterogeneity on the energy residual; For the first The coefficient of variation of the geothermal gradient for the nth sample, dimensionless, used to quantify the nth sample. Local heterogeneity of the geothermal field where each sample is located; For the first The predicted wellhead temperature value for the nth sample is the model's prediction for the nth sample. The wellhead temperature of each sample is estimated, and the unit of data collection is degrees Celsius. Normalization is required during calculation to eliminate the dimension. For the first The theoretical wellhead temperature of each sample is estimated based on the geothermal fluid energy balance equation and is used to compare with the predicted value to construct the energy residual. The unit of data collection is degrees Celsius. Normalization is required during calculation to eliminate the dimension. The momentum residual decay coefficient is dimensionless and is a hyperparameter controlling the influence of geothermal heterogeneity on the momentum residual. Its value ranges from [value missing]. Example of a value: The larger the value, the stronger the attenuation effect of heterogeneity on the momentum residual; For the first The predicted wellhead pressure value for the nth sample is the model's prediction for the nth sample. The wellhead pressure estimate for each sample needs to be normalized to eliminate dimensions during calculation. For the first The theoretical wellhead pressure for each sample is derived from the geothermal fluid momentum balance equation and is used to compare with the predicted value to construct the momentum residual. The calculation method is expressed as The unit of measurement is megapascals, and normalization is required during calculation to eliminate the dimensionless quantity. Reservoir pressure is the fluid pressure under reservoir conditions. Examples of its values ​​are as follows: Megapascals (MPa) are the unit of measurement for data acquisition. Normalization is required during calculation to eliminate the dimensionless quantity. Let gravitational acceleration be expressed in meters per second squared (m² / s), a physical constant. Examples of its values ​​are provided. Meters per second squared, the unit is not included in the calculation to eliminate the dimension; Fanning's coefficient of friction is dimensionless and derived from the coefficient of friction. The calculation method is as follows: , used to calculate frictional pressure drop; The reservoir fluid density can be approximated by taking the fluid density as... The value represents the fluid density under reservoir conditions, and the unit is not included in the calculation to eliminate the dimension. The density of the fluid at the wellhead is estimated in kilograms per cubic meter, based on the predicted wellhead temperature. and wellhead pressure prediction The fluid density is estimated using a table of thermodynamic properties of water vapor or an approximate equation of state, characterizing the fluid density under wellhead conditions. Units are not included in the calculation to eliminate dimensions.

[0064] It should be noted that, The term represents the energy residual, which measures the deviation between the predicted wellhead temperature and the theoretical temperature estimated based on the energy balance equation. It constrains the model to conform to the first law of thermodynamics (energy conservation), guiding the predicted temperature to approximate physical laws during training and reducing non-physical interpretations that may arise from purely data-driven approaches. The term represents the momentum residual, which measures the deviation between the predicted wellhead pressure and the theoretical pressure estimated based on the momentum balance equation. The constraint model conforms to the fluid dynamics momentum conservation (including hydrostatic pressure, frictional pressure drop, and acceleration pressure drop), ensuring that the pressure prediction satisfies the force balance in the flow process. Furthermore, the energy residual and momentum residual impose physical constraints from thermodynamic and hydraulic perspectives, respectively, jointly ensuring that the prediction results simultaneously satisfy the basic laws of geothermal fluid flow. Additionally, the geothermal gradient variation coefficient is used... Adaptive weight adjustment in a uniform thermal field ( In small regions, physical constraints dominate, especially in heterogeneous regions. In large-scale models, constraints are reduced to avoid forcing conformity to potentially inaccurate simplified physical models, thereby improving the robustness of the model under complex geological conditions.

[0065] 3) The total loss function that integrates data-driven and physical constraints.

[0066] The total loss function integrates data fitting loss, physical residual loss, and feature importance regularization to balance data-driven approaches with physical laws and prevent overfitting. The data fitting loss uses mean squared error to measure the deviation between predicted values ​​and true labels. The regularization term includes the overall L2 norm of the network parameters and differential weight decay based on feature importance, making the model focus more on key physical features. The total loss function is defined as follows: ; In the formula, The total loss function is dimensionless and represents the optimization objective for model training. The smaller its value, the better the model performs in terms of data fitting, conformity to physical laws, and parameter complexity control. For the first The actual wellhead temperature of each sample, used as the label value in supervised learning, is obtained by field measurement in degrees Celsius. It needs to be normalized to eliminate the dimension during calculation. For the first The actual wellhead pressure of each sample, used as the label value in supervised learning, is obtained by field measurement in megapascals. It needs to be normalized to eliminate the dimension during calculation. The balance coefficient for physical residual loss is dimensionless and is a hyperparameter controlling the overall strength of physical constraints. Examples of its values ​​are provided. This is used to adjust the proportion of physical residual loss in the total loss; The regularization coefficient is dimensionless and is a hyperparameter that controls the overall strength of the regularization term. Examples of its values ​​are shown below. This is used to suppress model overfitting; It is the L2 norm. It is the square of the L2 norm, which is the sum of the squares of all elements of a vector or matrix; It is the set of all trainable parameters in the network, used to calculate the overall parameter complexity; The feature importance regularization adjustment factor is dimensionless and is a hyperparameter that controls the degree of differential weight decay. Example values ​​are given below. This is used to balance overall regularization and feature importance regularization; For the input layer corresponding to the first The weight vector of each feature has a dimension of . , are trainable parameters The first in Column, used for the first Perform a linear transformation on each feature.

[0067] It should be noted that, The data fitting loss represents the model's ability to approximate the true observations, ensuring prediction accuracy; the physical residual loss is also included. By introducing energy and momentum constraints, the predictions are made consistent with the fundamental physical laws of geothermal fluid flow, reducing overfitting and non-physical interpretations caused by purely data-driven approaches. The term represents the regularization term, and its important characteristics are ( (Big) corresponding Small features exhibit weak regularization, while unimportant features exhibit strong regularization, enabling feature selection guided by physical knowledge by minimizing the total loss function. The model fits the data while satisfying physical laws, and controls the complexity through regularization terms, highlighting key physical quantities, thereby improving the accuracy, robustness and interpretability of predictions.

[0068] Furthermore, the training process for the above wellhead temperature and pressure prediction model is as follows: (1) Obtain a training sample set of geothermal data; the samples in the sample set include: original geothermal features and corresponding labels; the original geothermal features include multiple of the following: reservoir temperature, reservoir depth, wellbore inner diameter, mass flow rate, fluid density, specific heat capacity at constant pressure, wellbore cross-sectional area, friction coefficient, total heat transfer coefficient, heat transfer area, production time, wellbore volume, surrounding formation temperature and geothermal gradient; the labels include: wellhead temperature and wellhead pressure; A comprehensive and systematic geothermal data acquisition process was conducted to construct the original dataset for subsequent model training and validation. The data acquisition process needed to cover multiple representative production wells within the geothermal field to ensure that the acquired data could reflect the geothermal fluid behavior under different reservoir characteristics, different production conditions, and different geological conditions. Specifically, the first step is to determine the target parameter system for data acquisition. This system should include all the original features on which the subsequent prediction model depends, as well as the label values ​​to be predicted. The original features mainly include reservoir temperature, reservoir depth, wellbore inner diameter, mass flow rate, fluid density, specific heat capacity at constant pressure, wellbore cross-sectional area, friction coefficient, overall heat transfer coefficient, heat exchange area, production time, wellbore volume, surrounding formation temperature, and geothermal gradient.

[0069] Of the aforementioned primary characteristics, reservoir temperature is typically obtained directly through downhole temperature logging instruments, recording the static temperature value at the midpoint depth of the reservoir; reservoir mid-depth is determined through well depth measurement combined with geological stratification data, representing the midpoint depth location of the reservoir; wellbore inner diameter is a geometric parameter of the wellbore structure, obtainable from drilling and completion reports; mass flow rate is monitored in real-time by a flow meter installed at the wellhead, recording the mass of fluid flowing through the wellbore cross-section per unit time; thermophysical properties such as fluid density and specific volume at constant pressure are obtained by collecting fluid samples on-site and sending them to a laboratory for analysis, or by referring to tables based on fluid composition and temperature / pressure conditions; wellbore cross-sectional area is obtained geometrically from the wellbore inner diameter; friction coefficient is a dimensionless parameter characterizing the frictional loss between the fluid and the wellbore wall, estimated using empirical formulas based on wellbore roughness and fluid flow regime, or determined based on hydraulic experimental data; the overall heat transfer coefficient reflects the frictional loss between the fluid inside the wellbore and the surrounding environment. The heat exchange intensity between the surrounding strata needs to be determined through comprehensive analysis of the wellbore structure, formation lithology, and heat transfer mechanism. It can be referenced from measured data of similar geothermal fields or empirically determined ranges. The heat exchange area is the lateral area of ​​the wellbore in contact with the formation, calculated based on the wellbore's geometric dimensions. Production time represents the time it takes for fluid to flow from the reservoir to the wellhead, which can be estimated in practice based on the wellbore length and fluid velocity. The wellbore volume is the geometric volume of the wellbore, determined by the wellbore's inner diameter and length. The surrounding formation temperature refers to the temperature of the rock mass surrounding the wellbore. If well temperature logging data is available, the temperature value at the corresponding depth can be directly read. If no measured data is available, it needs to be estimated by referring to temperature records from adjacent boreholes or based on the average geothermal gradient and surface temperature of the geothermal field. The geothermal gradient reflects the linear relationship between temperature and depth, usually obtained by linearly fitting well temperature logging data or by setting it based on regional geothermal background values.

[0070] After completing the data acquisition of the original features, it is also necessary to simultaneously acquire the label data corresponding to the features, namely wellhead temperature and wellhead pressure. Both of these parameters are measured and recorded in real time by sensors installed at the wellhead. The wellhead temperature sensor outputs in degrees Celsius, and the wellhead pressure sensor outputs in megapascals. These measurements will serve as the true labels in subsequent supervised learning, used for error correction and performance evaluation of model training.

[0071] During the data acquisition process, in order to ensure data quality and representativeness, it is necessary to continuously collect multiple sets of data at certain time intervals, covering different production stages and changes in operating conditions, and at the same time record the acquisition time and well location information corresponding to each set of data.

[0072] All collected raw data underwent preliminary processing and cleaning. After removing obviously erroneous records, the data was stored in a unified format to form a raw dataset containing original features and corresponding labels.

[0073] (2) For the samples in the sample set, perform feature correction, feature construction, feature interaction and feature splicing to form a fused feature vector; The process is the same as described above, and will not be repeated here.

[0074] (3) By applying the fusion feature vectors corresponding to the sample set, a feature weighting network and a multi-task network based on the geothermal gradient attention mechanism are trained to obtain the wellhead temperature and pressure prediction model.

[0075] During the training of the above model, the total loss function is obtained by combining the data fitting loss, physical residual loss and feature importance regularization term; the physical residual loss includes energy residual and momentum residual; the energy residual is used to measure the deviation between the predicted wellhead temperature and the theoretical wellhead temperature estimated based on the energy balance equation, and the momentum residual is used to measure the deviation between the predicted wellhead pressure and the theoretical wellhead pressure estimated based on the momentum balance equation.

[0076] After completing the construction of the fused feature vector and the overall architecture design of the prediction model, the model training phase begins. Through iterative optimization, the model is able to accurately learn the complex mapping relationship between the input features and the wellhead temperature and pressure.

[0077] The model training process first requires dividing the original dataset into three parts: training set, validation set, and test set. The training set is used to update and optimize model parameters, the validation set is used to monitor the model's performance on unseen data and assist in adjusting hyperparameters, and the test set is used to finally evaluate the model's generalization ability. When dividing the dataset, it is important to maintain the consistency of the distribution of samples in each dataset to avoid training bias caused by improper data division.

[0078] Before training begins, all trainable parameters in the model need to be initialized, including the weight matrix and bias vector in the feature-weighted network, the weight matrix and bias vector in the multi-task network based on the geothermal gradient attention mechanism, and the attention weight matrix. After initialization, the samples in the training set are input into the model in batches according to the preset batch size. Each batch first undergoes feature preprocessing and enhancement steps. However, it should be noted that the statistical quantities required for the calculation of operations such as outlier detection and correction, multi-scale depth profile feature construction, and feature interaction term generation based on geostatistics (such as the calculation of the mean, the determination of the standard deviation, and the fitting of the variogram parameters) should be pre-calculated and fixed based on the training set data. Then, the same statistical quantities should be applied to the validation set and test set for transformation to avoid data leakage. For each batch of input samples, the model first calculates an adaptive weight vector through a feature weighting network, and then multiplies the weight vector element-wise with the fused feature vector to obtain a weighted feature vector. The weighted feature vector is then fed into a multi-task network based on a geothermal gradient attention mechanism. After linear transformation of the hidden layer and activation of the geothermal correction linear unit, and under the attention weight modulation constructed by the geothermal gradient and the geothermal gradient variation coefficient, the output layer finally generates the wellhead temperature prediction value and wellhead pressure prediction value corresponding to the batch of samples. After obtaining the predicted values, the model calculates the data fitting loss, physical residual loss, and regularization term for the batch of samples according to the definition of the total loss function. The data fitting loss is obtained by comparing the predicted values ​​with the actual wellhead temperature and pressure in the training labels. The physical residual loss requires calculating the theoretical wellhead temperature and pressure using the input features of the current batch and adaptively weighting them with the geothermal gradient variation coefficient. The regularization term is calculated based on the current network parameters and the feature importance vector. After the total loss function is calculated, the gradient of the loss function with respect to each trainable parameter is calculated using the backpropagation algorithm, and the model parameters are updated using an optimizer (such as the Adam optimizer or stochastic gradient descent optimizer) according to the set learning rate. After updating the parameters of one batch, the same forward propagation, loss calculation and backpropagation operations are performed using the next batch of data until the entire training set has been traversed, which completes one training cycle. After each training cycle, the performance of the current model needs to be evaluated using the validation set. The data fitting loss on the validation set and the mean absolute error or root mean square error between the predicted value and the true value are calculated to monitor whether the model is overfitting or underfitting. The model training iterative process will continue for multiple cycles until a preset stopping condition is met. The stopping condition typically includes the following: First, the loss function value on the validation set stops decreasing for several consecutive cycles, indicating early stopping. This suggests the model is close to convergence, and continued training may lead to overfitting. Second, the total number of training cycles reaches the preset maximum number of iterations to prevent indefinite training. Third, the evaluation metric on the validation set reaches a preset satisfaction threshold, indicating the model performance meets the requirements of practical applications. In actual training, the early stopping mechanism is used as the primary stopping condition. After each training cycle, the validation set loss is checked. If the validation set loss does not decrease for several consecutive cycles (e.g., ten cycles), training is terminated early, and the model parameters corresponding to the minimum validation set loss are saved as the final model.

[0079] After training is completed, the final model needs to be independently evaluated on the test set to calculate various prediction error indicators in order to objectively evaluate the model's ability to predict future unseen data. The entire training process is guided by both data-driven and physical constraints, which allows the model parameters to be gradually adjusted to the optimal state.

[0080] Once the prediction model for the temperature and pressure parameters of local thermal resource wellheads has been trained and verified by the test set to meet the performance requirements, it can be deployed to the actual production environment to achieve real-time prediction of wellhead temperature and pressure parameters, which is the content of the previous steps S102-110.

[0081] Real-time prediction requires the installation of corresponding data acquisition sensors and systems at the wellhead and downhole of the target geothermal well to ensure the real-time acquisition of various raw parameters required for model input. These sensors include flow meters for measuring mass flow rate, thermobaric sensors for monitoring wellhead temperature and pressure, and downhole monitoring equipment for acquiring downhole reservoir temperature and pressure conditions. Simultaneously, fluid samples need to be collected periodically for laboratory analysis to update thermophysical properties such as fluid density and specific heat capacity at constant pressure, ensuring they reflect current fluid composition changes. Furthermore, the latest geothermal gradient data needs to be obtained through well temperature logging or regional geothermal background data to guarantee the accuracy of multi-scale depth profile features.

[0082] All real-time acquired raw data is aggregated to the data processing center through the data acquisition and monitoring control system. The data processing center first performs real-time cleaning and preprocessing of the raw data, removing obvious measurement noise and abnormal jumps, and then performs feature preprocessing and enhancement using the same methods as in the training phase. Specifically, for each newly acquired sample, an anomaly correction mechanism based on the energy balance equation is first applied. The theoretical wellhead temperature is calculated using the current sample's reservoir temperature, mass flow rate, and wellbore geometry parameters, and compared with the measured wellhead temperature. If the deviation exceeds a set threshold, the original reservoir temperature is corrected using a correction factor to obtain the corrected reservoir temperature. Then, based on the current sample's reservoir depth, geothermal gradient, and a preset extension ratio, virtual shallow and virtual deep temperatures are constructed, and the geothermal gradient of neighboring samples is used as a reference. The process involves calculating the geothermal gradient variation coefficient; then, using the variogram model parameters determined during the training phase, calculating adaptive interaction weights for the original and constructed features of the current sample, and generating weighted interaction features; finally, concatenating the original features, corrected and constructed features, and interaction features in the exact same order as during the training phase to form the fused feature vector of the current sample; after feature construction, the fused feature vector is input into the trained prediction model. The model first calculates the adaptive weight vector corresponding to the current sample through a feature weighting network combined with pre-stored feature importance vectors, and then weights the fused feature vector; the weighted feature vector is then processed through a forward propagation calculation of a multi-task network based on the geothermal gradient attention mechanism, ultimately outputting the predicted wellhead temperature and wellhead pressure values ​​at the current moment.

[0083] After the prediction results are generated, the system will display the predicted values ​​on the monitoring interface in real time and compare them with the measured values ​​so that on-site operators can keep track of the changing trends of wellhead parameters. At the same time, the prediction results, along with the corresponding raw data and feature construction results, will be stored in the historical database for subsequent model iteration optimization and performance analysis.

[0084] In practical applications, the state of geothermal reservoirs may change slowly over time, causing the model's predictive performance to gradually decline. Therefore, it is necessary to periodically use newly collected data to incrementally train or retrain the model and update the model parameters so that it always adapts to the current production conditions.

[0085] Through the above process, real-time and accurate prediction of geothermal wellhead temperature and pressure parameters can be achieved, providing key data support for geothermal field production scheduling, equipment maintenance, and resource evaluation.

[0086] In one embodiment, the time-series tracking effect of wellhead parameters is analyzed. By selecting real-time data from the continuous production process of a geothermal well, the predictive capability of this technology under actual dynamic operating conditions is verified. See also Figure 2As shown, the experiment uses two subplots: the upper plot shows the wellhead temperature tracking effect, and the lower plot shows the wellhead pressure tracking effect. The horizontal axis represents production time (in hours), and the vertical axes represent temperature (in degrees Celsius) and pressure (in megapascals), respectively. Each subplot contains three curves: the black dotted line represents the sensor's measured value, the blue square line represents the predicted value of this technology model, and the orange triangle line represents the predicted value of the conventional neural network model. The predicted value (blue) of this technology almost coincides with the measured value (black) at most time points, accurately following the upward trend and local fluctuations of the measured value, especially showing good fitting ability at peaks and troughs. In contrast, although the predicted value of the conventional model (orange) can also reflect the general trend, it has obvious systematic bias and larger random error, with some sections deviating significantly from the measured value.

[0087] In one embodiment, the impact of physical constraint mechanisms on the reasonableness of prediction results is evaluated by using kernel density plots to illustrate the distribution of wellhead temperature prediction residuals under both physically constrained and unconstrained conditions. See also Figure 3 As shown, the horizontal axis represents the temperature residual (unit: degrees Celsius), and the vertical axis represents the probability density. The solid blue line in the figure corresponds to the distribution of the predicted residuals after introducing energy and momentum residual losses in the embodiments of this application. Its peak is near zero and the curve is relatively steep, indicating that the residuals are concentrated within a small range, and the predicted values ​​closely surround the true values. The dashed red line represents the residual distribution of the model without physical constraints (i.e., enhanced features plus a neural network without physical constraints). The curve is significantly flattened and the center is shifted to the right, indicating that the residuals are more dispersed and there is a systematic bias. Experimental results show that the embodiments of this application significantly improve the physical consistency of the results while ensuring prediction accuracy.

[0088] In another embodiment, a heatmap is used to compare the correlation structure between variables before and after feature enhancement to demonstrate the improvement effect of feature construction on information redundancy. The first heatmap (see...) Figure 4 The figure shows the Pearson correlation coefficients between the original feature subsets (including reservoir temperature, reservoir depth, mass flow rate, specific heat capacity at constant pressure, and geothermal gradient), with colors ranging from blue to red indicating a shift from negative to positive correlation. The figure reveals some weak linear correlations between certain features. A second heatmap (see...) Figure 5As shown, the original features are supplemented with enhanced features (corrected reservoir temperature, virtual shallow temperature) and interactive features (temperature and mass flow interaction term) constructed in this application embodiment, forming a richer feature set. The color changes reveal a new pattern in the correlation between the enhanced features and the original features. While retaining key physical information, the enhanced feature set introduces more dimensions and variables with clear physical meanings, helping subsequent models capture the complex behavior of geothermal systems from different perspectives and reducing the limitations of expression caused by simple linear correlations between features.

[0089] Based on the above method embodiments, this application also provides a real-time prediction device for geothermal wellhead temperature and pressure, see [link to relevant documentation]. Figure 6 As shown, the device includes: a feature acquisition module 62, used to acquire real-time geothermal features of the target geothermal well; the real-time geothermal features include at least: initial reservoir temperature and reservoir depth; a feature processing module 64, used to perform feature correction, feature construction, feature interaction, and feature splicing based on the real-time geothermal features to form a fused feature vector; feature correction includes anomaly correction based on the energy balance equation for the initial reservoir temperature; feature construction includes multi-scale depth profile feature construction based on geothermal gradient for the reservoir depth; and a model prediction module 66, used to input the fused feature vector into a pre-trained wellhead temperature and pressure prediction model; wherein the wellhead temperature and pressure prediction model includes: a feature weighting network and a multi-task network based on a geothermal gradient attention mechanism; the fused feature vector is weighted by combining the feature weighting network with a pre-stored feature comprehensive importance vector to obtain a weighted feature vector; the weighted feature vector is forward-propagated through the multi-task network to output the predicted wellhead temperature and predicted wellhead pressure values ​​corresponding to the real-time geothermal features.

[0090] Furthermore, the aforementioned real-time geothermal features also include: measured wellhead temperature; feature processing module 64, used to correct the initial reservoir temperature through an anomaly correction mechanism based on the energy balance equation when the deviation between the measured wellhead temperature and the theoretical wellhead temperature exceeds a threshold, to obtain the corrected reservoir temperature; based on the corrected reservoir temperature, to construct multi-scale depth profile features of the mid-depth reservoir based on the geothermal gradient, to obtain structural features; to perform feature interaction processing on the real-time geothermal features and structural features using the parameters of the variogram model, to obtain interactive features; and to sequentially splice the real-time geothermal features, corrected reservoir temperature, structural features, and interactive features to form a fused feature vector.

[0091] Furthermore, the aforementioned feature processing module 64 is used to calculate the deviation between the measured wellhead temperature and the theoretical wellhead temperature; calculate the partial derivative of the theoretical wellhead temperature with respect to the initial reservoir temperature; obtain the product of the deviation, the partial derivative, and the correction step size coefficient; and calculate the sum of the product and the initial reservoir temperature to obtain the corrected reservoir temperature.

[0092] Furthermore, the aforementioned feature processing module 64 is used to extend upwards and downwards by a specified proportion, centered on the reservoir's middle depth, to obtain virtual shallow depth and virtual deep depth; to estimate the temperatures corresponding to the virtual shallow depth and virtual deep depth using geothermal gradients; to superimpose the temperatures corresponding to the virtual shallow depth and virtual deep depth on the basis of corrected reservoir temperatures, to obtain virtual shallow temperature and virtual deep temperature; to determine the geothermal gradient variation coefficient by the ratio of the standard deviation to the mean of the geothermal gradient based on k-nearest neighbor samples; and to use the virtual shallow temperature, virtual deep temperature, and geothermal gradient variation coefficient as structural features.

[0093] Furthermore, the aforementioned model prediction module 66 is used to determine the hidden layer output vector based on the fused feature vector, the weight matrix and bias vector of the first fully connected layer, and the geothermal correction linear unit activation function; to determine the adaptive weight vector based on the hidden layer output vector, the weight matrix and bias vector of the second fully connected layer, the feature synthesis importance vector, and the Softmax function; and to multiply the fused feature vector and the adaptive weight vector element-wise to obtain the weighted feature vector.

[0094] Furthermore, the aforementioned device also includes: a model training module, used to perform the following training process for the wellhead temperature and pressure prediction model: acquiring a geothermal data training sample set; the samples in the sample set include: original geothermal features and corresponding labels; the original geothermal features include multiple of the following: reservoir temperature, reservoir depth, wellbore inner diameter, mass flow rate, fluid density, specific heat capacity at constant pressure, wellbore cross-sectional area, friction coefficient, overall heat transfer coefficient, heat transfer area, production time, wellbore volume, surrounding formation temperature, and geothermal gradient; the labels include: wellhead temperature and wellhead pressure; for the samples in the sample set, feature correction, feature construction, feature interaction, and feature splicing are performed to form a fused feature vector; using the fused feature vector corresponding to the sample set, a feature weighting network and a multi-task network based on the geothermal gradient attention mechanism are trained to obtain the wellhead temperature and pressure prediction model.

[0095] Furthermore, during the training of the above model, the total loss function is obtained by combining the data fitting loss, physical residual loss, and feature importance regularization term; the physical residual loss includes energy residual and momentum residual; the energy residual is used to measure the deviation between the predicted wellhead temperature and the theoretical wellhead temperature estimated based on the energy balance equation, and the momentum residual is used to measure the deviation between the predicted wellhead pressure and the theoretical wellhead pressure estimated based on the momentum balance equation.

[0096] Furthermore, the determination method for the above-mentioned feature comprehensive importance vector is as follows: For each original geothermal feature and structural feature corresponding to the training sample set, the following steps are performed: Calculate the maximum information coefficient value of the current feature with wellhead temperature and wellhead pressure respectively; Assign physical prior weights to the current feature for temperature prediction and pressure prediction respectively according to the geothermal mechanism; Perform nonlinear fusion of the maximum information coefficient value of the current feature with wellhead temperature and wellhead pressure respectively, and the physical prior weights of the current feature for temperature prediction and pressure prediction respectively, to obtain the comprehensive importance corresponding to the current feature; Determine the feature comprehensive importance vector based on the comprehensive importance corresponding to each current feature. The device provided in this application embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts of the device embodiment not mentioned can be referred to the corresponding content in the aforementioned method embodiment.

[0097] This application also provides a real-time prediction system for geothermal wellhead temperature and pressure, such as... Figure 7 The diagram shows the structure of the system, which includes a processor 71 and a memory 70. The memory 70 stores computer-executable instructions that can be executed by the processor 71, and the processor 71 executes the computer-executable instructions to implement the above-described method.

[0098] exist Figure 7 In the illustrated embodiment, the system further includes a bus 72 and a communication interface 73, wherein the processor 71, the communication interface 73, and the memory 70 are connected via the bus 72.

[0099] The memory 70 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 73 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 72 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 72 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0100] The processor 71 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 71 or by instructions in software form. The processor 71 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory, and the processor 71 reads the information in the memory and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiment.

[0101] This application also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above-described method. For specific implementation details, please refer to the foregoing method embodiments, which will not be repeated here.

[0102] The computer program products of the methods, apparatus and systems provided in the embodiments of this application include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0103] Unless otherwise specifically stated, the relative steps, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of this application.

[0104] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0105] In the description of this application, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0106] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the technical scope disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A method for real-time prediction of geothermal wellhead temperature and pressure, characterized in that, The method includes: Obtain the real-time geothermal characteristics of the target geothermal well; the real-time geothermal characteristics include at least: initial reservoir temperature, reservoir depth, and measured wellhead temperature; Based on the real-time geothermal characteristics, feature correction, feature construction, feature interaction, and feature splicing are performed to form a fused feature vector. Feature correction includes: when the deviation between the measured wellhead temperature and the theoretical wellhead temperature exceeds a threshold, correcting the initial reservoir temperature using an anomaly correction mechanism based on the energy balance equation to obtain a corrected reservoir temperature. Specifically, this includes: calculating the deviation between the measured and theoretical wellhead temperatures; calculating the partial derivative of the theoretical wellhead temperature with respect to the initial reservoir temperature; obtaining the product of the deviation, the partial derivative, and the correction step size coefficient; and summing the product with the initial reservoir temperature to obtain the corrected reservoir temperature. Feature construction includes constructing multi-scale depth profile features for the mid-depth reservoir based on geothermal gradients. The fused feature vector is input into the pre-trained wellhead temperature and pressure prediction model; wherein, the wellhead temperature and pressure prediction model includes: a feature weighting network and a multi-task network based on the geothermal gradient attention mechanism; The fused feature vector is weighted by combining the feature weighting network with a pre-stored feature comprehensive importance vector to obtain a weighted feature vector. The weighted feature vector is forward-propagated through the multi-task network to output the predicted wellhead temperature and pressure values ​​corresponding to the real-time geothermal features.

2. The method according to claim 1, characterized in that, Based on the real-time geothermal features, the steps of feature correction, feature construction, feature interaction, and feature splicing to form a fused feature vector include: Based on the corrected reservoir temperature, a multi-scale depth profile feature structure based on geothermal gradient is constructed for the mid-deep reservoir to obtain structural features. Based on real-time geothermal and tectonic features, interactive features are obtained by using variogram model parameters for feature interaction processing. The real-time geothermal features, the corrected reservoir temperature, the structural features, and the interactive features are sequentially concatenated to form a fused feature vector.

3. The method according to claim 2, characterized in that, Based on the corrected reservoir temperature, the steps of constructing multi-scale depth profile features of the mid-depth reservoir based on geothermal gradient to obtain structural features include: Using the reservoir's mid-depth as the center, extend upwards and downwards by a specified proportion to obtain virtual shallow depth and virtual deep depth; estimate the temperature corresponding to the virtual shallow depth and virtual deep depth using the geothermal gradient; based on the corrected reservoir temperature, superimpose the temperatures corresponding to the virtual shallow depth and virtual deep depth to obtain virtual shallow temperature and virtual deep temperature. The coefficient of variation of the geothermal gradient is determined by the ratio of the standard deviation to the mean of the geothermal gradient based on the k-nearest samples. The virtual shallow temperature, the virtual deep temperature, and the coefficient of variation of the geothermal gradient are used as structural features.

4. The method according to claim 1, characterized in that, The step of performing feature weighting on the fused feature vector by combining the feature weighting network with a pre-stored feature comprehensive importance vector to obtain a weighted feature vector includes: The hidden layer output vector is determined based on the fused feature vector, the weight matrix of the first fully connected layer, the bias vector, and the geothermal correction linear unit activation function. The adaptive weight vector is determined based on the hidden layer output vector, the weight matrix of the second fully connected layer, the bias vector, the feature synthesis importance vector, and the Softmax function. The fused feature vector is multiplied element-wise with the adaptive weight vector to obtain a weighted feature vector.

5. The method according to claim 1, characterized in that, The training process for the wellhead temperature and pressure prediction model is as follows: A training sample set of geothermal data is obtained; the samples in the sample set include: original geothermal features and corresponding labels; the original geothermal features include multiples of the following: reservoir temperature, reservoir depth, wellbore inner diameter, mass flow rate, fluid density, specific heat capacity at constant pressure, wellbore cross-sectional area, friction coefficient, overall heat transfer coefficient, heat transfer area, production time, wellbore volume, surrounding formation temperature, and geothermal gradient; the labels include: wellhead temperature and wellhead pressure; For the samples in the sample set, feature correction, feature construction, feature interaction, and feature concatenation are performed to form a fused feature vector; By applying the fused feature vectors corresponding to the sample set, a feature weighted network and a multi-task network based on the geothermal gradient attention mechanism are trained to obtain a wellhead temperature and pressure prediction model.

6. The method according to claim 5, characterized in that, During model training, the total loss function is obtained by combining the data fitting loss, physical residual loss, and feature importance regularization term. The physical residual loss includes energy residual and momentum residual. The energy residual is used to measure the deviation between the predicted wellhead temperature and the theoretical wellhead temperature estimated based on the energy balance equation, and the momentum residual is used to measure the deviation between the predicted wellhead pressure and the theoretical wellhead pressure estimated based on the momentum balance equation.

7. The method according to claim 1, characterized in that, The feature importance vector is determined as follows: For each original geothermal feature and structural feature corresponding to the training sample set, the following steps are performed: Calculate the maximum information coefficient values ​​of the current feature with respect to wellhead temperature and wellhead pressure, respectively; Based on the geothermal mechanism, the current features are assigned physical prior weights for temperature prediction and pressure prediction, respectively. The current feature is nonlinearly fused with the maximum information coefficient values ​​of wellhead temperature and wellhead pressure, as well as the physical prior weights of the current feature for temperature prediction and pressure prediction, to obtain the comprehensive importance of the current feature. The feature importance vector is determined based on the overall importance of each current feature.

8. A real-time prediction device for geothermal wellhead temperature and pressure, characterized in that, The device includes: The feature acquisition module is used to acquire the real-time geothermal features of the target geothermal well; the real-time geothermal features include at least: initial reservoir temperature, reservoir depth, and measured wellhead temperature; The feature processing module is used to perform feature correction, feature construction, feature interaction, and feature splicing based on the real-time geothermal features to form a fused feature vector. The feature correction includes: when the deviation between the measured wellhead temperature and the theoretical wellhead temperature exceeds a threshold, correcting the initial reservoir temperature through an anomaly correction mechanism based on the energy balance equation to obtain a corrected reservoir temperature. Specifically, this includes: calculating the deviation between the measured wellhead temperature and the theoretical wellhead temperature; calculating the partial derivative of the theoretical wellhead temperature with respect to the initial reservoir temperature; obtaining the product of the deviation value, the partial derivative, and the correction step size coefficient; and calculating the sum of the product and the initial reservoir temperature to obtain the corrected reservoir temperature. The feature construction includes constructing a multi-scale depth profile feature based on the geothermal gradient for the mid-depth reservoir. The model prediction module is used to input the fused feature vector into a pre-trained wellhead temperature and pressure prediction model. The wellhead temperature and pressure prediction model includes a feature weighting network and a multi-task network based on a geothermal gradient attention mechanism. The fused feature vector is weighted by the feature weighting network in conjunction with a pre-stored feature importance vector to obtain a weighted feature vector. The multi-task network performs forward propagation calculations on the weighted feature vector to output the predicted wellhead temperature and pressure values ​​corresponding to the real-time geothermal features.

9. A real-time prediction system for geothermal wellhead temperature and pressure, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 7.