Method, system and equipment for measuring key performance parameters of drilling fluid, medium and product
By combining historical sensor parameters and hydraulic physical models with machine learning models, drilling fluid density and dynamic viscosity can be predicted in real time, solving the problem that existing technologies cannot obtain drilling fluid performance parameters in real time, and improving the safety and efficiency of the drilling process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- EXPLORATION TECH RES INST OF CHINESE ACADEMY OF GEOLOGICAL SCI
- Filing Date
- 2025-05-28
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies cannot reliably obtain drilling fluid density and dynamic viscosity in real time, leading to safety hazards and low efficiency during the drilling process.
By determining the mapping relationship between historical sensor parameters and hydraulic physics models, a machine learning model is trained to predict drilling fluid density and dynamic viscosity using real-time sensor data.
It enables real-time and continuous estimation of drilling fluid density and dynamic viscosity, reducing costs and maintenance difficulty, and improving drilling efficiency and safety.
Smart Images

Figure CN122065626A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of oil and gas drilling engineering technology, and in particular to a method, system, equipment, medium and product for measuring key performance parameters of drilling fluid. Background Technology
[0002] Drilling fluid plays a crucial role in oil and gas drilling, carrying cuttings, cooling the drill bit, balancing formation pressure, and protecting the wellbore. In particular, the density and dynamic viscosity of drilling fluid are critical parameters that significantly impact drilling safety and efficiency. Accurate and real-time monitoring of drilling fluid density and viscosity is fundamental to optimizing drilling hydraulic parameters, accurately predicting equivalent circulation density, and preventing complex downhole conditions such as lost circulation and well kicks.
[0003] Currently, methods for obtaining drilling fluid density and dynamic viscosity mainly include: 1) Laboratory sampling analysis: high accuracy but severely lagging, unable to reflect real-time changes during downhole or circulation processes. 2) Online instrument measurement: such as online densitometers and viscometers; however, these are costly, complex to install and maintain, and sensors are easily contaminated and worn in harsh drilling fluid environments, leading to measurement drift or even failure; additionally, they typically only provide measurements at specific points. 3) Estimation using empirical formulas or theoretical models: based on limited parameters, these models have limited applicability, and their accuracy often fails to meet the needs of refined drilling. Therefore, there is an urgent need for a method that can economically, reliably, and in real-time obtain key performance parameters of drilling fluids to improve the level of intelligent and refined management of the drilling process. Summary of the Invention
[0004] The purpose of this application is to provide a method, system, equipment, medium, and product for measuring key performance parameters of drilling fluid, which can solve the problem in related technologies that it is impossible to obtain reliable and accurate drilling fluid density and dynamic viscosity in real time.
[0005] To achieve the above objectives, this application provides the following solution:
[0006] In a first aspect, this application provides a method for measuring key performance parameters of drilling fluid, comprising: determining the mapping relationship between historical sensor parameters and historical drilling fluid density and historical drilling fluid dynamic viscosity based on historical sensor parameters and a hydraulic physical model; wherein the historical sensor parameters include: historical drilling fluid flow rate, pump head, and multiple pressure values corresponding to each pressure measurement position in the drilling fluid circulation path collected at various times; using the mapping relationship as a training dataset, and training a machine learning model based on the training dataset to determine the trained machine learning model; outputting predicted values of drilling fluid density and dynamic viscosity based on real-time collected sensor parameters to be measured and the trained machine learning model; and using the predicted values of drilling fluid density and dynamic viscosity as key performance parameters of drilling fluid.
[0007] Secondly, this application provides a system for measuring key performance parameters of drilling fluid, including:
[0008] The physical model simulation module is used to determine the mapping relationship between historical sensor parameters and historical drilling fluid density and historical drilling fluid dynamic viscosity based on historical sensor parameters and a hydraulic physical model. The historical sensor parameters include: historical drilling fluid flow rate, pump head, and multiple pressure values corresponding to each pressure measurement position in the drilling fluid circulation path collected at each time.
[0009] The machine learning model training module is used to use the mapping relationship as a training dataset, and to train a machine learning model based on the training dataset, and to determine the trained machine learning model.
[0010] The real-time parameter estimation module is used to output predicted values of drilling fluid density and dynamic viscosity based on the real-time acquired sensor parameters and the trained machine learning model.
[0011] The result output module is used to use the predicted drilling fluid density and the predicted dynamic viscosity as key performance parameters of the drilling fluid.
[0012] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for measuring key performance parameters of drilling fluid as described above.
[0013] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for measuring key performance parameters of drilling fluid as described above.
[0014] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method for measuring key performance parameters of drilling fluid as described above.
[0015] According to the specific embodiments provided in this application, the following technical effects are disclosed:
[0016] This application provides a method, system, equipment, medium, and product for measuring key performance parameters of drilling fluid. First, it determines the mapping relationship between historical sensor parameters and historical drilling fluid density and dynamic viscosity based on historical sensor parameters and a hydraulic physical model. Then, it uses this mapping relationship as a training dataset and trains a machine learning model based on this dataset. Finally, based on real-time acquired sensor parameters and the trained machine learning model, it outputs predicted values for drilling fluid density and dynamic viscosity, which are then used as key performance parameters of the drilling fluid. This application can continuously estimate drilling fluid performance parameters based on real-time acquired sensor data, overcoming the lag in laboratory measurements. Simultaneously, it utilizes existing or easily installed and maintained conventional sensors at the drilling site, avoiding expensive and easily damaged online density / viscosity meters, thus reducing costs and maintenance difficulty. In addition, by learning from data through mapping relationships and machine learning models, it has better adaptability than the empirical formulas of traditional simplified physical models. Ultimately, it enables real-time continuous estimation of drilling fluid density and dynamics, providing key decision-making basis for drilling engineers to optimize hydraulic parameters, accurately control bottom hole pressure, and promptly detect abnormal drilling fluid performance, which helps to improve drilling efficiency and safety. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a method for measuring key performance parameters of drilling fluid provided in an embodiment of this application.
[0019] Figure 2 This is an example diagram of the drilling fluid key performance parameter measurement system of this application applied to a riserless mud circulation system.
[0020] Figure 3 This is the overall framework of a drilling fluid key performance parameter measurement system provided in the embodiments of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and 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.
[0022] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] like Figure 1 and Figure 2 As shown, this application provides a method for measuring key performance parameters of drilling fluid, including:
[0024] Step 101: Based on the historical sensor parameters and the hydraulic physical model, determine the mapping relationship between the historical sensor parameters and the historical drilling fluid density and historical drilling fluid dynamic viscosity; wherein, the historical sensor parameters include: the historical drilling fluid flow rate, pump head, and multiple pressure values corresponding to each pressure measurement position in the drilling fluid circulation path collected at each time.
[0025] Step 102: Use the mapping relationship as a training dataset, and train a machine learning model based on the training dataset to determine the trained machine learning model.
[0026] Step 103: Based on the real-time acquired sensor parameters and the trained machine learning model, output the predicted values of drilling fluid density and dynamic viscosity.
[0027] Step 104: Use the predicted drilling fluid density and the predicted dynamic viscosity as key performance parameters of the drilling fluid.
[0028] In some embodiments, before step 101, the method further includes: setting at least two pressure measurement locations in the drilling fluid circulation path; and constructing a hydraulic physical model.
[0029] In some embodiments, the hydraulic physical model is:
[0030]
[0031] Where z represents any pressure measurement location in the drilling fluid circulation path; P Z P represents the pressure value corresponding to z in the drilling fluid circulation path. atm ρgz represents the atmospheric pressure at the top outlet of the drilling fluid circulation pipeline; ρgz represents the increase in hydrostatic pressure from the top pressure of the riser to z. The pressure head loss caused by friction along the pipeline; ρgH pumpThe total pressure increment provided to the pump; H pump ρ is the drilling fluid pump head; z is the drilling fluid density; pump denoted as the height of the pump in the pipeline; L as the pipeline length; f as the Darcy friction factor; D as the pipeline diameter; v as the average flow velocity; and g as the acceleration due to gravity.
[0032] The average flow velocity v is based on the drilling fluid flow rate and the pipe cross-sectional area A (A = πD). 2 It was determined by / 4).
[0033] In some embodiments, prior to step 101, the method further includes:
[0034] The historical sensor parameters are cleaned, denoised, time-aligned, feature-engineered, and standardized.
[0035] In some embodiments, step 101 specifically includes: inputting the historical sensor parameters into the hydraulic physical model and outputting multiple simulated pressure values corresponding to each pressure measurement location; determining the mean square error based on the multiple simulated pressure values and the multiple pressure values; training the hydraulic physical model with the goal of minimizing the mean square error and determining the trained hydraulic physical model; and determining the mapping relationship between the historical sensor parameters and the historical drilling fluid density and historical drilling fluid dynamic viscosity based on the trained hydraulic physical model.
[0036] In some embodiments, after setting at least two pressure measurement locations in the drilling fluid circulation path, the method further includes: determining a preset range of values for the historical sensor parameters, specifically including: setting a preset range of values corresponding to the historical drilling fluid density as 1000 kg / m³. 3 Up to 1800 kg / m 3 The preset range for historical drilling fluid dynamic viscosity is set to 5 mPa·s to 100 mPa·s; the preset range for historical drilling fluid flow rate is set to 50 m³ / s. 3 / h to 200m 3 / h; Set the preset value range for the historical drilling fluid pump head to 500m to 1000m.
[0037] This application provides a system for measuring key performance parameters of drilling fluid, including:
[0038] The physical model simulation module is used to determine the mapping relationship between historical sensor parameters and historical drilling fluid density and historical drilling fluid dynamic viscosity based on historical sensor parameters and a hydraulic physical model. The historical sensor parameters include: historical drilling fluid flow rate, pump head, and multiple pressure values corresponding to each pressure measurement position in the drilling fluid circulation path collected at each time.
[0039] The machine learning model training module is used to use the mapping relationship as a training dataset, and to train a machine learning model based on the training dataset, and to determine the trained machine learning model.
[0040] The real-time parameter estimation module is used to output predicted values of drilling fluid density and dynamic viscosity based on the real-time acquired sensor parameters and the trained machine learning model.
[0041] The result output module is used to use the predicted drilling fluid density and the predicted dynamic viscosity as key performance parameters of the drilling fluid.
[0042] like Figure 3 As shown, this application proposes a measurement system for key performance parameters of drilling fluid, the overall framework of which mainly includes the following modules:
[0043] Data Acquisition Module: Responsible for real-time acquisition of sensor data related to the drilling site and drilling fluid circulation system. This includes at least: flow rate (e.g., obtained through pump flow, displacement, or flow meter); parameters reflecting pump output status, used to indirectly estimate or as characteristic inputs to the actual operating outlet pressure H of the pump. pump Record the main performance parameters of the drilling fluid, such as its density and dynamic viscosity. Record the pressure values at at least two (preferably three or more) pressure measuring points along the drilling fluid circulation path (e.g., riser, return line). The measuring points should be selected as key points that effectively reflect changes in hydrostatic pressure and friction, such as the top of the riser (z=0), near the pump inlet, near the pump outlet, or other specific measuring points (z=L or a specific depth). Collect the above data to form the initial database.
[0044] Data preprocessing module: Cleans, reduces noise, aligns the time, and performs feature engineering on the collected raw data (e.g., calculating H based on pump parameters). pump Estimated values and necessary feature scaling (such as standardization) are used to prepare qualified input data for machine learning models.
[0045] Physics-Based Siulation & Training Data Generation Module (Offline): This module, also known as the physical model simulation module, is a key component of this application. It is used to generate labeled training datasets covering a wide range of operating conditions.
[0046] The hydraulic physical model of the built-in drilling fluid circulation system is as follows.
[0047]
[0048] Where z represents any pressure measurement location in the drilling fluid circulation path; P ZP represents the pressure value corresponding to z in the drilling fluid circulation path. atm ρgz represents the atmospheric pressure at the top outlet of the drilling fluid circulation pipeline; ρgz represents the increase in hydrostatic pressure from the top pressure of the riser to z. The pressure head loss caused by friction along the pipeline; ρgH pump H is the total pressure increment provided by the pump. pump ρ is the drilling fluid pump head; z is the drilling fluid density; pump Let P be the height of the pump in the pipeline; L be the pipeline length; f be the Darcy friction factor; D be the pipeline diameter; v be the average flow velocity; and g be the acceleration due to gravity. In other words, P... Z P represents the pressure value (in Pa) corresponding to the target depth (at any pressure measurement location) within the drilling fluid circulation path. atm ρgz represents the atmospheric pressure at the top outlet of the drilling fluid circulation pipe (in Pa). ρgz represents the increase in hydrostatic pressure from the pressure at the top of the riser (z = 0) to z (in Pa). This refers to the head loss caused by friction along the pipeline, which is the pressure compensation required to overcome the friction loss along the pipeline from depth z upwards to the top outlet (z=0) (unit: Pa).
[0049] ρgH pump Total pressure increment provided to the pump (in Pa). This term is only applicable when the calculation point z is below the pump (i.e., z > z). pump It is only subtracted from the total pressure at the top P, because we are starting from the top P. atm It is calculated downwards.
[0050] Set reasonable variation ranges for key parameters such as drilling fluid density, dynamic viscosity, flow rate, and pump head.
[0051] A large number of virtual operating conditions are generated by combining parameters (such as random sampling and Latin hypercube sampling).
[0052] For each virtual working condition (please provide examples of what specific virtual working conditions are included), calculate the corresponding pressure measurement point P using the physical model. z1 P z2 Theoretical pressure values at different pressure measurement locations.
[0053] Construct a dataset where the input features are [Q, H]. pump ,P z1 P z2 The output labels are [ρ′, μ′]. Where ρ′ is the actual drilling fluid density; μ′ is the actual dynamic viscosity; and Q is the drilling fluid flow rate.
[0054] Machine Learning Model Training Module (Offline):
[0055] Load the training dataset generated by module 3.
[0056] Select and configure one or more machine learning models suitable for regression tasks (such as random forest, gradient boosting tree, neural network, etc.).
[0057] The model is trained using training data, and hyperparameters are tuned and the model is selected using a validation set.
[0058] The training generates a final model (which may be a multi-output model or two independent single-output models) for predicting drilling fluid density and dynamic viscosity.
[0059] Save the trained model and preprocessing parameters (such as scalers).
[0060] Real-Time Parameter Estimation Module (Online):
[0061] Load the trained machine learning model and preprocessing parameters.
[0062] Receives real-time processed sensor data from the data preprocessing module.
[0063] Real-time data is input into the loaded model for inference calculations.
[0064] Outputs real-time estimated drilling fluid density ρ est and dynamic viscosity μ est That is, the predicted value of drilling fluid density and the predicted value of dynamic viscosity.
[0065] The Result Display & Application Module is the module that displays the results.
[0066] The predicted drilling fluid density and the predicted dynamic viscosity are presented to the drilling engineer in numerical or trend curve form.
[0067] The estimated results (predicted drilling fluid density and predicted dynamic viscosity) can be used for subsequent applications such as hydraulic parameter calculation, ECD monitoring, and anomaly alarms.
[0068] System workflow: In the offline phase, a large amount of simulation data is generated using a physical model to train and optimize the machine learning model. In the online phase, the system collects on-site data in real time, preprocesses it, and then inputs it into the trained model to quickly output estimated density and viscosity values.
[0069] Taking the deep-sea riprapless mud circulation system RMR vertical circulation system as an example, the technical solution of this application is further illustrated.
[0070] Step 1: Establishment and verification of the physical model.
[0071] Select or establish a steady-state or transient hydraulic model to describe drilling fluid flow. This model should be able to calculate the pressure at any point z along the flow path based on the input fluid properties, i.e., key performance parameters, rheological modes (such as power law, Bingham), flow rate, pump characteristics, and wellbore / pipeline geometry parameters (diameter D, length L, roughness ε).
[0072] The accuracy of the model is crucial for subsequent machine learning training. The effectiveness of the physical model needs to be validated through theoretical analysis, literature comparison, or a small amount of experimental / field data.
[0073] Step 2: Generating training data.
[0074] Define the parameter space: Determine the value range of each input parameter, which should cover the main operating conditions that may be encountered during drilling operations. For example: ρ: 1000 kg / m 3 Up to 1800 kg / m 3 μ: 5 mPa·s to 100 mPa·s (units are unified in Pa·s). Q: 50 m 3 / h to 200m 3 / h. Hpump; 500m to 1000m (or outlet pump pressure Ppo).
[0075] Selection of pressure measurement points: Arrange as many pressure measurement locations as possible. In this example, three pressure measurement points are selected (i.e., ... Figure 2 Z1, Z2 and Z3 in the text are represented by the following letters.
[0076] P z1 =0, meaning the pressure at the top of the riser.
[0077] P z2 (Pressure near the pump outlet) is used to reflect the pressure after the pump.
[0078] P z3 (Pressure near the pump inlet) is used to reflect the pressure before the pump.
[0079] Data sampling: Using a suitable sampling method (such as Latin hypercube sampling), a large number of parameter combinations (e.g., N = 5000 sets) are generated within the defined parameter space.
[0080] Simulation calculation: For each set of parameter combinations [ρ i ,μ i Q i H pump_i], where i is the number of groups, and each group of parameters can be understood as the parameters acquired at each time step, i.e., ρ i ,μ i Q i H pump_i These represent the density, dynamic viscosity, flow rate, and pump head at time i, respectively. Using the physical model from step one, the pressure values [P] at each pressure measurement location at time i (pressure at the top of the riser, pressure near the pump outlet, pressure near the pump inlet, and pressure at a specific depth) are calculated. z1_i ,P z2_i ,P z3_i P z4_i ].
[0081] Dataset Construction: The input parameters (i.e., the model's input features or sensor data) and target parameters (real drilling fluid density and dynamic viscosity as labels) are organized into structured data (e.g., a CSV file). Feature columns are [Q, H]. pump ,P z1 ,P z2 ,P z3 ,P z4 The labels are [ρ′, μ′]. Where ρ′ is the actual drilling fluid density, one of the target labels, representing the mass of drilling fluid per unit volume. μ′ is the actual dynamic viscosity, one of the target labels, reflecting the internal frictional resistance during drilling fluid flow. Q: Flow rate, i.e., circulating flow rate (unit: m³ / s). 3 / h), the drilling fluid circulation flow rate value collected in real time by the sensor. H pump The actual pump head (in meters) is calculated from the difference between the pump outlet pressure and the inlet pressure, representing the energy provided by the pump. z1 The pressure at the top of the riser (pressure value at z=0) reflects the pressure state when the drilling fluid returns. z2 : Pressure near the pump outlet, used to detect pressure changes downstream of the pump. P z3 : Pressure near the pump inlet, used to detect pressure changes upstream of the pump. P z4 The pressure value at the bottom of the well (the bottom of the pipe, i.e., depth L) or a specific location is used to supplement the calculation of frictional losses. These parameters are correlated in the physical model through hydraulic formulas, and finally, the drilling fluid density and dynamic viscosity are inverted using a machine learning model.
[0082] Noise injection: To simulate real sensor errors, Gaussian white noise with an accuracy consistent with actual sensor precision (typically ±0.1% FS) can be added to the calculated pressure value. These parameters are correlated in the physical model using hydraulic formulas, and ρ and μ are ultimately retrieved using a machine learning model.
[0083] Step 3: Data preprocessing.
[0084] Data loading: Load the generated dataset using libraries such as Pandas.
[0085] Data splitting: Divide the dataset into training and test sets proportionally (e.g., 80% training, 20% test). Ensure the split is random.
[0086] Feature scaling: Due to the significant differences in the units and numerical ranges of different features (flow rate, pressure, head), scaling is necessary. The Standard Scaler (mean 0, standard deviation 1) is commonly used. When using StandardScaler for data standardization, the `fit` method must first be executed on the training set to calculate the mean and standard deviation of the features. The `fit` method is used in many machine learning libraries (such as scikit-learn) for training or calculating statistics. Standardizing all datasets by using the mean and standard deviation calculated on the training set ensures that all data are on the same scale.
[0087] Step 4: Machine learning model building and training.
[0088] Model selection: Various regression models can be tried. For predicting drilling fluid density and dynamic viscosity, two independent models can be trained, or a model that supports multi-objective output can be used.
[0089] Random Forest Regressor: Integrates multiple decision trees, exhibits good robustness, is less prone to overfitting, and provides feature importance. Key hyperparameters: number of trees, maximum tree depth, minimum number of samples required for node splitting, and minimum number of samples required for leaf nodes.
[0090] Gradient Boosting Regressor (e.g., XGBoost, LightGBM): Typically offers high performance and accuracy. Key hyperparameters: learning rate, sample ratio, and feature sampling ratio.
[0091] Neural Networks (MLP Regressors): Capable of fitting complex nonlinear relationships. Key hyperparameters: hidden layer structure, activation function, optimizer, initial learning rate, and regularization coefficient.
[0092] Support Vector Regression (SVR): Based on Support Vector Machine theory. Key hyperparameters include the kernel function, penalty coefficient, kernel coefficients, and insensitive region width.
[0093] Taking the prediction of drilling fluid density using random forest as an example, a model building algorithm based on Python is presented.
[0094] 1. Model structure and principle.
[0095] Ensemble learning mechanism: Random forest consists of N decision trees (e.g., 100 by default). Each tree is trained by randomly selecting a sub-sample from the training set based on Bootstrap sampling (sampling with replacement). The prediction results (mean or median) of all trees are integrated through the Bagging (Bootstrap Aggregating) strategy to reduce variance.
[0096] The rules for constructing decision trees include: 1. Random feature selection: When splitting each tree, m features are randomly selected from all features to enhance model diversity. 2. Splitting criterion: Mean squared error (MSE) is used as the node splitting criterion to minimize the squared error of the child nodes. 3. Termination condition: Reaching a preset maximum depth (e.g., max_depth = 20) or the number of node samples is less than min_samples_split = 5.
[0097] 2. Model Input and Output.
[0098] The input consists of real-time collected drilling fluid circulation system parameters (after standardization), including flow rate and pump head. Pressure measurement points include: pressure at the top of the riser, pressure near the pump inlet, and pressure near the pump outlet. The output consists of drilling fluid density and dynamic viscosity, where the drilling fluid circulation system parameters are the sensor data.
[0099] 3. Hyperparameter optimization process.
[0100] Key hyperparameters: number of trees (nestimators, e.g., 100–500); maximum depth (max_depth, e.g., 5–30); minimum number of samples per node split (min_samples_split, e.g., 2–10); number of features randomly selected (m).
[0101] Optimization steps: 1. Parameter space definition: Define the range of values for the above parameters. 2. Cross-validation: Use 5-fold cross-validation (K-FoldCV) to evaluate the performance of each hyperparameter set. 3. Search strategies: Grid Search (GridSearchCV): Traverses all parameter combinations, suitable for small-range searches. Randomized Search (RandomizedSearchCV): Randomly samples within a large parameter space (e.g., 50 iterations), more efficient.
[0102] Performance metrics: Mean squared error (MSE) or R0 on the validation set 2 The score is used as the optimization objective.
[0103] Optimal parameter selection: Select the parameter combination that minimizes the MSE of the validation set (e.g., nestimators = 300, max_depth = 15).
[0104] 4. Training and evaluation process.
[0105] Data preprocessing: The input features were centered using StandardScaler (mean 0, variance 1). The data was then divided into training and test sets in an 8:2 ratio.
[0106] The training process includes: loading standardized training data, initializing the random forest model using optimized hyperparameters, and calling `fit` to train the training data.
[0107] Evaluation metrics include: 1. Mean Squared Error (MSE), which measures the average squared difference between predicted and actual values. 2. Coefficient of Determination (R²): reflects the proportion of variance explained by the model (the closer to 1, the better). 3. Mean Absolute Error (MAE): directly reflects the absolute deviation between predicted and actual values.
[0108] 5. Real-time prediction module.
[0109] Load the trained random forest model and the normalizer r.
[0110] Use scaler.transform to standardize real-time sensor data.
[0111] The `predict(Xrealtime_scaled)` method outputs the density and viscosity predictions. `Xrealtime_scaled` is standardized real-time sensor data. It contains all the feature information needed for the model to make predictions, and the numerical range of these features has been adjusted to a scale suitable for the model's processing. `predict()` is a method (or function) of the Random Forest model. It operates on the `Xrealtime_scaled` data to produce the density and viscosity predictions.
[0112] Perform moving average filtering or threshold verification on the prediction results (density prediction value and viscosity prediction value).
[0113] Random forests can output feature importance scores (such as feature_importances_) to verify physical rationality (e.g., pressure measurement points contribute the most to density prediction).
[0114] Training Process: For each selected model, training is performed using standardized training data. This application supports multiple model selections in machine learning model construction, including random forests, gradient boosting trees (such as XGBoost and LightGBM), neural networks, and support vector regression. Single or ensemble models can be selected based on actual needs. The final model selection criteria include:
[0115] Offline training phase: Compare the performance of different models through cross-validation (e.g., R).2 , MAE, RMSE), select the optimal model (e.g., random forest).
[0116] Multi-output scenarios: If it is necessary to predict drilling fluid density and dynamic viscosity at the same time, a multi-objective output model (such as a multi-task random forest) can be used, or two independent models can be trained separately to improve accuracy.
[0117] If drilling fluid density and dynamic viscosity are to be predicted, a multi-objective model needs to be trained separately or used.
[0118] Hyperparameter optimization: Using validation sets and cross-validation (such as K-Fold Cross Validation) to find the optimal combination of hyperparameters. The steps of hyperparameter optimization are as follows: 1. Define the parameter search range: For example, n_estimators (100), max_depth (30), min_samples_split (2~10) in random forests. 2. Select the optimization method: Grid Search (GridSearchCV): Traverses all parameter combinations, suitable for small-range parameter optimization. Randomized Search (RandomizedSearchCV): Randomly samples in a large parameter space, which is more efficient. 3. Cross-validation: Divide the training set into K folds (such as K=5), and calculate the average error (such as RMSE) for each parameter group in K validations. Evaluation and selection: Select the optimal hyperparameter combination with the goal of minimizing the RMSE or MAE of the validation set.
[0119] Common methods: GridSearchCV or RandomizedSearchCV.
[0120] The optimization objective is to minimize a certain error metric (such as MAE or RMSE) on the validation set.
[0121] Model saving: Save the best trained model and its corresponding Scaler object to a file for later loading and use in the real-time estimation module.
[0122] Step 5: Model Evaluation.
[0123] The generalization ability of the final selected model is evaluated using a test set that has never been used in training.
[0124] Calculate and report the evaluation indicators (R) defined above. 2 MAE, RMSE).
[0125] Draw a scatter plot of "predicted value vs. actual value" to visually demonstrate the prediction effect.
[0126] Plot the residual distribution to check whether the error conforms to a normal distribution and whether there is a systematic bias.
[0127] If the model supports this (e.g., RF, GBT), analyze the importance of features, understand the model's decision-making basis, and verify whether it conforms to physical intuition (e.g., pressure readings should generally be the most important feature).
[0128] Step Six: System Integration and Deployment.
[0129] Real-time estimation module implementation: Develop a program (such as a Python script or service) that can:
[0130] Load the saved Scaler and ML models.
[0131] Receive real-time feature data [Q, H] from the data acquisition and preprocessing module. pump ,P z1 ,P z2 ].
[0132] Use the loaded Scaler to standardize the real-time data.
[0133] The standardized data is input into the loaded Machine Learning (ML) model, and the predict method is called to obtain the estimated ρ. est and μ est Specifically, the real-time estimation module uses a machine learning (ML) model, not a physical model. Details are as follows.
[0134] 1. The role of the physical model: It is only used to generate training data in the offline stage (by simulating the mapping relationship between pressure values and ρ and μ).
[0135] 2. Real-time stage model: The model is loaded with a trained ML model (such as random forest). Its input is real-time sensor data, and its output is the predicted value of drilling fluid density and dynamic viscosity.
[0136] 3. The relationship between the physical model and the ML model:
[0137] Physical models provide the foundation for data generation (simulating real-world conditions through hydraulic equations), while ML models learn the nonlinear relationship between inputs and outputs in a data-driven manner, without relying on solving physical equations.
[0138] The advantage of ML models lies in their ability to adapt to complex operating conditions and sensor noise, while physical models are only used as data augmentation tools.
[0139] Perform post-processing on the results, such as smoothing filtering and range constraint checks.
[0140] Deployment: Deploy the real-time estimation module to computing devices (such as edge computing nodes or monitoring system servers) at the drilling site.
[0141] Integration: Integrate real-time estimation results into drilling monitoring systems (such as SCADA, HMI) for engineers to view and use.
[0142] Based on steps one through six, a fully functional and reliable data-driven soft measurement system for drilling fluid performance parameters can be constructed.
[0143] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the methods described above.
[0144] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the methods described above.
[0145] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the methods described above.
[0146] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0147] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRdM), magnetic random access memory (MRdM), ferroelectric random access memory (FRdM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RdM) or external cache memory, etc. By way of illustration and not limitation, RdM can take many forms, such as static random access memory (SRdM) or dynamic random access memory (DRdM).
[0148] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0149] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0150] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for measuring key performance parameters of drilling fluid, characterized in that, include: Based on historical sensor parameters and a hydraulic physical model, the mapping relationship between historical sensor parameters and historical drilling fluid density and historical drilling fluid dynamic viscosity is determined; wherein, the historical sensor parameters include: drilling fluid flow rate, drilling fluid pump head, and multiple pressure values corresponding to each pressure measurement position in the drilling fluid circulation path collected at various historical moments. The mapping relationship is used as a training dataset, and a machine learning model is trained based on the training dataset to determine the trained machine learning model. Based on the real-time acquired sensor parameters and the trained machine learning model, the system outputs predicted values for drilling fluid density and dynamic viscosity. The predicted values of drilling fluid density and dynamic viscosity are used as key performance parameters of drilling fluid.
2. The method for measuring key performance parameters of drilling fluid according to claim 1, characterized in that, Before determining the mapping relationship between historical sensor parameters and historical drilling fluid density and dynamic viscosity based on historical sensor parameters and hydraulic physics models, the following steps are also included: At least two pressure measurement points should be set in the drilling fluid circulation path; Construct a hydraulic physical model.
3. The method for measuring key performance parameters of drilling fluid according to claim 2, characterized in that, The hydraulic physical model is as follows: Where z represents any pressure measurement location in the drilling fluid circulation path; P Z P represents the pressure value corresponding to z in the drilling fluid circulation path. atm ρgz represents the atmospheric pressure at the top outlet of the drilling fluid circulation pipeline; ρgz represents the increase in hydrostatic pressure from the top pressure of the riser to z. The pressure head loss caused by friction along the pipeline; ρgH pump H is the total pressure increment provided by the pump. pump ρ is the drilling fluid pump head; z is the drilling fluid density; pump denoted as the height of the pump in the pipeline; L as the pipeline length; f as the Darcy friction factor; D as the pipeline diameter; v as the average flow velocity; and g as the acceleration due to gravity.
4. The method for measuring key performance parameters of drilling fluid according to claim 1, characterized in that, Before determining the mapping relationship between historical sensor parameters and historical drilling fluid density and dynamic viscosity based on historical sensor parameters and hydraulic physics models, the following steps are also included: The historical sensor parameters are cleaned, denoised, time-aligned, feature-engineered, and standardized.
5. The method for measuring key performance parameters of drilling fluid according to claim 1, characterized in that, Based on historical sensor parameters and a hydraulic physics model, the mapping relationship between historical sensor parameters and historical drilling fluid density and dynamic viscosity is determined, specifically including: The historical sensor parameters are input into the hydraulic physical model, and multiple simulated pressure values corresponding to each pressure measurement location are output. Based on the multiple simulated pressure values and the multiple pressure values, the mean square error is determined; With the goal of minimizing the mean square error, the hydraulic physical model is trained, and the trained hydraulic physical model is determined. Based on the trained hydraulic physics model, the mapping relationship between historical sensor parameters and historical drilling fluid density and historical drilling fluid dynamic viscosity is determined.
6. The method for measuring key performance parameters of drilling fluid according to claim 2, characterized in that, After setting at least two pressure testing points in the drilling fluid circulation path, the following is also included: Determining the preset value range of the historical sensor parameters specifically includes: The preset value range for the historical drilling fluid density is set to 1000 kg / m³. 3 Up to 1800 kg / m 3 ; The preset range for the historical drilling fluid dynamic viscosity is set to 5 mPa·s to 100 mPa·s. The preset value range for historical drilling fluid flow rate is set to: 50m. 3 / h to 200m 3 / h; The preset range for the historical drilling fluid pump head is set to 500m to 1000m.
7. A system for measuring key performance parameters of drilling fluid, characterized in that, include: The physical model simulation module is used to determine the mapping relationship between historical sensor parameters and historical drilling fluid density and historical drilling fluid dynamic viscosity based on historical sensor parameters and a hydraulic physical model; wherein, the historical sensor parameters include: historical drilling fluid flow rate, pump head, and multiple pressure values corresponding to each pressure measurement position in the drilling fluid circulation path collected at each time. The machine learning model training module is used to use the mapping relationship as a training dataset, and to train a machine learning model based on the training dataset, and to determine the trained machine learning model. The real-time parameter estimation module is used to output the predicted values of drilling fluid density and dynamic viscosity based on the real-time acquired sensor parameters and the trained machine learning model. The result output module is used to use the predicted drilling fluid density and the predicted dynamic viscosity as key performance parameters of the drilling fluid.
8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the method for measuring key performance parameters of drilling fluid according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the method for measuring the key performance parameters of drilling fluid as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the method for measuring the key performance parameters of drilling fluid as described in any one of claims 1-6.