Automatic regulation and control dosing method and system for oil well

By deploying temperature sensors on the oil well pipeline and performing clustering processing, the pipeline is divided into multiple chemical dosing sections. The required concentration of wax inhibitor is calculated in real time, which solves the problem of uneven wax inhibitor dosing in the existing technology. This achieves a precise control and resource-saving dosing method, improving the safety and efficiency of oil transportation.

CN120867685AActive Publication Date: 2025-10-31XIAN ANT PETROLEUM TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511395429.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2025-10-31
Estimated Expiration
2045-09-28

AI Technical Summary

Technical Problem

Existing methods for chemical dosing in oil wells ignore the nonlinear fluctuation characteristics of temperature along the transport direction within the pipeline, resulting in uneven application of wax inhibitors. This can easily lead to insufficient or excessive application in certain areas, affecting the safety and efficiency of oil transportation.

Method used

Temperature sensors are deployed along the oil pipeline. The pipeline is divided into multiple dosing sections through clustering and spatial connectivity processing. Wax deposition characteristic parameters are collected in real time, input into a pre-constructed wax inhibitor concentration demand prediction model, calculate the wax inhibitor concentration demand for each section, and generate dosing instructions by combining the actual dosing rate of the upstream dosing section.

Benefits of technology

It enables precise control of the wax inhibitor dosage based on the actual flow state and temperature distribution of the oil, avoiding insufficient or wasteful local application, improving the wax prevention effect and the economy of chemical use, and ensuring the safety and continuity of pipeline oil transportation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120867685A_ABST
    Figure CN120867685A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of oil exploitation, in particular to an oil well automatic regulation and control dosing method and system, and the method comprises the steps: arranging a plurality of temperature sensors on an oil pipeline in an oil well, and collecting data points; clustering all the data points to obtain category labels of all the data points, communicating according to a spatial sequence based on an obtained category label sequence, and outputting M spatially continuous dosing segments; and acquiring wax precipitation characteristic parameters of the first dosing section, inputting the acquired wax precipitation characteristic parameters into a pre-constructed wax inhibitor concentration demand prediction model, and outputting the wax inhibitor concentration demand of the first dosing section. According to the invention, the addition amount of the wax inhibitor is accurately controlled according to the actual flowing state and temperature distribution of the oil body, so that the agent is fully mixed in the pipeline and reaches the target concentration, insufficient or waste of local agent addition is avoided, and the wax inhibition effect and the drug use economy are obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of petroleum extraction technology, specifically to an automatic controlled chemical dosing method and system for oil wells. Background Technology

[0002] Chinese patent application CN107939340A discloses a method for optimizing oil well wax removal processes, comprising: establishing a comprehensive evaluation coefficient for wax deposition parameters related to wax deposition; classifying the comprehensive evaluation coefficient for wax deposition; selecting oilfields from the classified comprehensive evaluation coefficients; determining the wax deposition rate and wax removal rate of wax removal agents for oil wells with different production rates and different water cut levels in the oilfields; calculating the wax removal cycle for different oil wells in the oilfields based on the wax deposition rate, with the critical point being that the wax deposition thickness in the tubing cannot meet production requirements; and obtaining the wax removal rate and the amount of wax removal agent required for oil wells with different production rates in the oilfields.

[0003] As mentioned in the above application, in the prior art, during the oil well production process, the paraffin component in crude oil will gradually precipitate as the wellhead temperature decreases and adhere to the inner wall of the oil pipe, resulting in a decrease in oil transportation capacity or even blockage. The existing chemical dosing method generally adopts a fixed time interval and fixed dosage of wax-reducing agent addition mode. This method ignores the nonlinear fluctuation characteristics of the temperature in the pipeline along the transportation direction, and does not consider the changes in comprehensive factors such as flow rate, pressure, oil temperature and wax content, resulting in uneven wax-inhibiting agent addition, which is prone to local insufficient or excessive addition. This not only wastes the agent, but may also fail to effectively inhibit local wax deposition, thereby affecting the oil transportation safety and efficiency of the pipeline. Summary of the Invention

[0004] To address the aforementioned problems, this invention provides an automatic controlled chemical dosing method and system for oil wells.

[0005] This invention adopts the following technical solution: an automatic controlled chemical dosing method for oil wells, comprising:

[0006] Multiple temperature sensors are installed along the oil pipeline at preset intervals along the pipeline's transport direction inside the oil well. Data points are collected based on a preset period T. , ; For the first The spatial coordinates of each sensor For the first Each sensor's data acquisition time, For the first Each sensor collects temperature values;

[0007] For all data points Clustering yields all data points The category labels are obtained, and the spatial order of the obtained category label sequence is connected to output M consecutive drug delivery segments in space;

[0008] Along the transport direction of the oil pipeline, wax deposition characteristic parameters of the first dosing section are collected. The obtained wax deposition characteristic parameters are input into the pre-constructed wax inhibitor concentration demand prediction model, and the wax inhibitor concentration demand of the first dosing section is output. Based on the output wax inhibitor concentration demand of the first dosing section, the wax inhibitor dosing rate of the dosing device is controlled.

[0009] Obtain the wax deposition characteristic parameters of the Sth dosing segment, S∈M, input the wax deposition characteristic parameters of the Sth dosing segment into the pre-constructed wax inhibitor concentration requirement prediction model, and output the wax inhibitor concentration requirement of the Sth dosing segment;

[0010] Obtain the wax inhibitor dosage rate for the first to the (S-1)th dosing segments, and based on the actual wax inhibitor dosage rate for the first to the (S-1)th dosing segments, obtain its comprehensive natural contribution concentration to the (S)th dosing segment.

[0011] By comparing and analyzing the overall natural contribution concentration with the wax inhibitor concentration requirement of the Sth dosing segment, the dosing instruction for the Sth dosing segment is generated.

[0012] As a further description of the above technical solution: the method for M consecutive dosing segments in the output space includes:

[0013] Based on the length of the oil pipeline, the number of chemical dosing sections is preset to P. K-means clustering is used, with the cluster number set to k=P, to cluster all data points. Input k-means clustering, perform iterative training, and obtain each data point. The cluster label is represented as ; Representing data points The cluster to which it belongs;

[0014] For each cluster in the clustering results, obtain the spatial coordinates of the corresponding data points and determine whether they are continuous in space. If the data points with the same cluster label are discontinuous in space, divide the discontinuity into multiple sub-dosing segments, so that each sub-dosing segment is a continuous interval along the transport direction of the oil pipeline.

[0015] A preset length threshold is set. When the length of the sub-dosing segment is less than the preset length threshold and the sub-dosing segment has the same cluster label as the adjacent segments on both sides, it is directly merged. When the cluster labels of the adjacent segments on both sides are different, it is merged into the adjacent segment with the closest temperature value.

[0016] When the length of a sub-dosing section is greater than or equal to the length threshold, the sub-dosing section is directly marked as a dosing section, thus obtaining M consecutive dosing sections, which are then sequentially marked as the first dosing section, the second dosing section, ..., the Mth dosing section according to the transport direction of the oil pipeline.

[0017] As a further description of the above technical solution: the waxing characteristic parameters include the flow rate, pressure, oil temperature and crude oil wax content of the first dosing section.

[0018] As a further description of the above technical solution: the training method of the wax inhibitor concentration demand prediction model includes:

[0019] Under the experimental conditions, H sets of training data were collected in advance, where H is a positive integer greater than 1. The H sets of training data include wax deposition characteristic parameters and the wax inhibitor concentration requirements corresponding to the wax deposition characteristic parameters.

[0020] A gradient boosting regression tree model was adopted as the prediction model for wax inhibitor concentration demand, and initial hyperparameters were set.

[0021] The collected training data is divided into training set, validation set and test set according to a preset ratio;

[0022] The model is trained using the training set, with mean squared error as the loss function. The weights of the leaf nodes are optimized using gradient descent. The model parameters are updated based on the negative gradient of the training set loss. The hyperparameters are tuned using Bayesian optimization.

[0023] An early stopping mechanism is introduced: when the mean squared error of the validation set decreases by less than a preset value for 20 consecutive rounds, training is stopped and the model parameters with the best performance on the validation set are retained.

[0024] The trained model is evaluated using a test set. The root mean square error and mean absolute percentage error are calculated to assess the model's performance. Once the model's performance meets the evaluation criteria, it is deployed and applied.

[0025] As a further description of the above technical solution: the method for obtaining the comprehensive natural contribution concentration of the wax inhibitor to the Sth dosing segment based on the actual wax inhibitor dosing rate of the first to the (S-1)th dosing segments includes:

[0026] Collect the wax inhibitor dosing rate and corresponding comprehensive parameters of the dosing sections from the first to the (S-1)th dosing section; the comprehensive parameters include the pipe inner diameter and inter-section length, flow velocity and pressure;

[0027] The wax inhibitor dosing rates of the first to the (S-1)th dosing segments and the comprehensive parameters of the corresponding dosing segments are sequentially input into the pre-constructed contribution concentration prediction model to obtain the contribution concentration of each dosing segment in the Sth dosing segment.

[0028] The contribution concentrations of the first to the (S-1)th dosing segments in the Sth dosing segment are summed to obtain the comprehensive natural contribution concentration to the Sth dosing segment.

[0029] As a further description of the above technical solution: the training method of the contribution concentration prediction model includes:

[0030] In the experimental case, the first training data is obtained using a segmented isolation test method. The method for obtaining the first training data includes:

[0031] Only turn on the dosing pump of the Gth dosing segment, where G∈(1,S-1) and S>2, and turn off the other dosing segments from 1 to S-1. Install an online ultraviolet spectrophotometer in the Sth dosing segment to collect concentration data.

[0032] Record the time Ts when the drug first reaches the S-th dosing segment after the start of the G-th dosing segment. Starting from Ts, continuously collect concentration data for 2 minutes and take the average value as the contribution concentration.

[0033] Obtain the wax inhibitor dosing rate and the corresponding comprehensive parameters of the dosing segment in the Gth dosing segment, as well as the corresponding contribution concentration, as a first set of training data. Collect Q sets of first training data in advance, where Q is a positive integer greater than 1.

[0034] A long short-term memory network (LSTM) was used as the contribution concentration prediction model. The model was trained using the first training data. The combined parameters of the wax inhibitor dosing rate and the corresponding dosing stage were used as the input to the model, and the contribution concentration was used as the output. The stochastic gradient descent method was used, and the weights and biases of the model were adjusted through backpropagation to minimize the error between the prediction and the actual results. A loss function, which is the mean squared error, was set. When the loss function value converged, the training of the model was stopped, and the model corresponding to the convergence of the loss function value was used as the trained model.

[0035] As a further description of the above technical solution: the method for controlling the wax inhibitor dosing rate of the dosing device based on the wax inhibitor concentration requirement of the first dosing stage includes:

[0036] Obtain the wax inhibitor concentration requirement, pipe section parameters, and oil parameters for the first dosing stage. The pipe section parameters include pipe length and inner diameter, and the oil parameters include oil flow rate, oil temperature, and pressure.

[0037] Based on the pipe section parameters and oil parameters of the first dosing section, and combined with the concentration requirements, the required wax inhibitor dosing rate is calculated so that the added agent can be fully mixed in the pipeline and reach the target concentration.

[0038] The calculated wax inhibitor dosage rate is used as a control command to drive the dosing device of the first dosing section, including an injection pump and a metering valve, to adjust the wax inhibitor dosage rate.

[0039] As a further description of the above technical solution: the method for calculating the required wax inhibitor dosage rate based on concentration requirements includes:

[0040] Based on the length of the pipe section of the first dosing section and inner diameter Calculate the volume of the first dosing section pipe. ;

[0041] Calculate the total amount of agent required based on the wax inhibitor concentration requirement and the pipe section volume.

[0042] Obtain the average residence time of the oil in the pipe section of the first dosing section;

[0043] The wax inhibitor dosage rate is calculated based on the required total dosage and average residence time.

[0044] As a further description of the above technical solution: the method for generating the dosing instruction for the Sth dosing segment includes:

[0045] A preset difference threshold is set, and the concentration difference between the required wax inhibitor concentration for the Sth dosing segment and the comprehensive natural contribution concentration is obtained. The concentration difference is compared with the difference threshold. When the concentration difference is less than the difference threshold, no dosing instruction is generated. When the concentration difference is greater than or equal to the difference threshold, the dosing instruction for the Sth dosing segment is generated, the concentration difference is obtained, and the concentration difference is marked as the wax inhibitor concentration correction requirement for the Sth dosing segment. Based on the output wax inhibitor concentration correction requirement for the Sth dosing segment, the wax inhibitor dosing rate of the dosing device is controlled.

[0046] An automatic controlled chemical dosing system for oil wells, used to implement an automatic controlled chemical dosing method for oil wells, the dosing system comprising:

[0047] The data acquisition module deploys multiple temperature sensors along the oil pipeline at preset intervals L within the oil well, following the pipeline's transport direction, and collects data points based on a preset period T. , ; For the first The spatial coordinates of each sensor For the first Each sensor's data acquisition time, For the first Each sensor collects temperature values;

[0048] The dosing segmentation module divides all data points. Clustering yields all data points The category labels are obtained, and the spatial order of the obtained category label sequence is connected to output M consecutive drug delivery segments in space;

[0049] The first dosing module collects wax deposition characteristic parameters of the first dosing section along the transport direction of the oil pipeline, inputs the acquired wax deposition characteristic parameters into the pre-constructed wax inhibitor concentration demand prediction model, outputs the wax inhibitor concentration demand of the first dosing section, and controls the wax inhibitor dosing rate of the dosing device based on the output wax inhibitor concentration demand of the first dosing section.

[0050] The data processing module obtains the wax deposition characteristic parameters of the Sth dosing segment, S∈M, and inputs the wax deposition characteristic parameters of the Sth dosing segment into the pre-constructed wax inhibitor concentration requirement prediction model, and outputs the wax inhibitor concentration requirement of the Sth dosing segment.

[0051] The data analysis module obtains the wax inhibitor dosage rate from the first to the (S-1)th dosing segment, and based on the actual wax inhibitor dosage rate from the first to the (S-1)th dosing segment, obtains its comprehensive natural contribution concentration to the (S)th dosing segment.

[0052] The second dosing module compares and analyzes the overall natural contribution concentration with the wax inhibitor concentration requirement of the Sth dosing segment, and generates the dosing instruction for the Sth dosing segment.

[0053] Beneficial effects:

[0054] This invention provides an automatic controlled chemical dosing method and system for oil wells. By deploying temperature sensors along the oil pipeline, and performing clustering and spatial connectivity processing on the collected spatial-temporal temperature data, the pipeline is divided into M continuous dosing sections. For each dosing section, wax deposition characteristic parameters are collected in real time and input into a pre-constructed wax inhibitor concentration demand prediction model to calculate the wax inhibitor concentration requirement for each section. Simultaneously, the actual dosing rate of the upstream dosing section is combined to calculate the natural contribution concentration to the downstream section, generating scientific dosing instructions and achieving automatic adjustment of the dosing device. This invention can precisely control the wax inhibitor dosage according to the actual oil flow state and temperature distribution, ensuring thorough mixing of the agent within the pipeline and achieving the target concentration. It avoids localized insufficient or wasteful dosing, significantly improving the wax prevention effect and the economic efficiency of chemical use, while ensuring the safety and continuity of pipeline oil transportation. Attached Figure Description

[0055] The present invention will be further explained below with reference to the accompanying drawings and embodiments:

[0056] Figure 1 This is a flowchart of an automatic controlled chemical dosing method for oil wells provided in Embodiment 1 of the present invention;

[0057] Figure 2 This is a flowchart of a method for M consecutive dosing segments in the output space provided in Embodiment 1 of the present invention;

[0058] Figure 3 The flowchart of the method for obtaining the comprehensive natural contribution concentration of the wax inhibitor to the Sth dosing segment based on the actual wax inhibitor dosing rate of the first to the (S-1)th dosing segments provided in Embodiment 1 of the present invention is as follows:

[0059] Figure 4 This is a flowchart of a method for controlling the dosing rate of a wax inhibitor in a dosing device according to Embodiment 1 of the present invention;

[0060] Figure 5 This is a module connection diagram of an automatic controlled chemical dosing system for oil wells provided in Embodiment 2 of the present invention. Detailed Implementation

[0061] To make the technical means, creative features, objectives, and effects of this invention readily understandable, the invention is further described below with reference to specific illustrations. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0062] Example 1

[0063] Please see Figures 1-4 This invention provides a technical solution: an automatic controlled chemical dosing method for oil wells, comprising:

[0064] Along the oil pipeline's transport direction, multiple temperature sensors are installed on the pipeline within the oil well at preset intervals (optionally 3-5m). Data points are collected based on a preset period T (optionally, one month). , ; For the first The spatial coordinates of each sensor For the first Each sensor's data acquisition time, For the first Each sensor collects temperature values;

[0065] For all data points Clustering yields all data points The category labels are obtained, and the spatial order of the obtained category label sequence is connected to output M consecutive drug delivery segments in space.

[0066] Methods for outputting M consecutive dosing segments in the output space include:

[0067] Based on the length of the oil pipeline, the number of chemical dosing sections is preset to P. K-means clustering is used, with the cluster number set to k=P, to cluster all data points. Input k-means clustering, perform iterative training, and obtain each data point. The cluster label is represented as ; Representing data points The cluster to which it belongs;

[0068] For each cluster in the clustering results, obtain the spatial coordinates of the corresponding data points and determine whether they are continuous in space. If the data points with the same cluster label are discontinuous in space, divide the discontinuity into multiple sub-dosing segments, so that each sub-dosing segment is a continuous interval along the transport direction of the oil pipeline.

[0069] It should be noted that there are spatial discontinuities, meaning that the spatial coordinates of the data points indicate that two data points are not continuous and there are data points in between, making them impossible to merge directly.

[0070] A preset length threshold is set. When the length of the sub-dosing segment is less than the preset length threshold and the sub-dosing segment has the same cluster label as the adjacent segments on both sides, it is directly merged. When the cluster labels of the adjacent segments on both sides are different, it is merged into the adjacent segment with the closest temperature value.

[0071] When the length of a sub-dosing section is greater than or equal to the length threshold, the sub-dosing section is directly marked as a dosing section, thus obtaining M consecutive dosing sections, which are then sequentially marked as the first dosing section, the second dosing section, ..., the Mth dosing section according to the transport direction of the oil pipeline.

[0072] In this embodiment, the method of dividing the oil pipeline into M continuous dosing sections based on the temperature change along the pipeline achieves relatively uniform temperature in each dosing section by clustering the spatial-temporal distribution of pipeline temperature, breaking discontinuous segments, and processing isolated small segments. This allows for precise control of the drug dosage based on the temperature characteristics of each section. This segmented control method avoids the problem of waxing caused by fixed dosage in local low-temperature sections, while reducing drug waste, improving the efficiency of dosing resource utilization, and adapting to nonlinear fluctuations in pipeline temperature along the delivery direction, ensuring that the anti-waxing effect is maintained throughout the entire pipeline.

[0073] Secondly, by merging the continuous dosing sections as necessary, the section length and dosing strategy can be optimized, ensuring that each section maintains spatial continuity while meeting the operability requirements of engineering control. This not only facilitates online monitoring and remote control but also enhances the stability and safety of the system, reduces the risks of localized wax buildup, equipment blockage, and production stoppages, and achieves a comprehensive effect of precise wax prevention, resource conservation, and stable production.

[0074] Along the transport direction of the oil pipeline, wax deposition characteristic parameters of the first dosing section are collected. The obtained wax deposition characteristic parameters are input into the pre-constructed wax inhibitor concentration demand prediction model, and the wax inhibitor concentration demand of the first dosing section is output. Based on the output wax inhibitor concentration demand of the first dosing section, the wax inhibitor dosing rate of the dosing device is controlled.

[0075] It should be noted that each dosing section is equipped with a dosing device, including an injection pump and a metering valve, to automatically add wax inhibitors based on calculations.

[0076] The wax deposition characteristic parameters include the flow rate, pressure, oil temperature, and crude oil wax content in the first dosing section;

[0077] It should be noted that flow rate, pressure, and oil temperature are acquired through a set of sensors, including an ultrasonic flow meter, a pressure transmitter, and a temperature sensor; the wax content of crude oil is detected online using near-infrared (NIR) spectroscopy and Fourier transform infrared (FTIR).

[0078] Among these factors, flow velocity determines the wall shear stress and mixing degree. High flow velocity can inhibit wax crystal deposition on the wall and remove thin layers. At low flow velocities, wax colloids settle, crystals aggregate and adhere to the wall. Pressure affects the dissolved gas content. High pressure is beneficial for dissolved gas and reduces temperature / volume changes caused by gas evolution. Sudden pressure drops or instability can cause gas release, accompanied by local temperature changes and turbulence changes, which promotes wax precipitation. Temperature directly determines wax solubility. The lower the temperature and the greater the supercooling, the higher the wax deposition rate. The higher the concentration of soluble wax in crude oil, the greater the amount of solid phase that can be precipitated.

[0079] Based on the required wax inhibitor concentration in the first dosing stage, methods for controlling the wax inhibitor dosing rate of the dosing device include:

[0080] Obtain the wax inhibitor concentration requirement, pipe section parameters, and oil parameters for the first dosing section. The pipe section parameters include pipe length L1 and inner diameter D1, and the oil parameters include oil flow rate Q1, oil temperature T1, and pressure P1.

[0081] Based on the pipe section parameters and oil parameters of the first dosing section, and combined with the concentration requirements, the required wax inhibitor dosing rate is calculated so that the added agent can be fully mixed in the pipeline and reach the target concentration.

[0082] The calculated wax inhibitor dosage rate is used as a control command to drive the dosing device of the first dosing section, including an injection pump and a metering valve, to adjust the wax inhibitor dosage rate.

[0083] It should be noted that the methods for calculating the required wax inhibitor dosage rate based on concentration requirements include:

[0084] Based on the length of the pipe section of the first dosing section and inner diameter Calculate the volume of the first dosing section pipe. The calculation formula is as follows: ;

[0085] The total dosage required is calculated based on the wax inhibitor concentration requirement and the pipe section volume. The calculation formula is as follows: 1; In the formula, This is the total dosage. To meet the wax inhibitor concentration requirements;

[0086] The average residence time of the oil in the pipe section of the first dosing stage is obtained by the following calculation formula: 1; In the formula, This represents the average stay time. 1 represents the oil flow rate;

[0087] The wax inhibitor dosage rate is calculated based on the required total dosage and average residence time, using the following formula: In the formula, The rate of wax inhibitor dosage, This represents the average stay time. This represents the total amount of medicine administered.

[0088] The training method for the wax inhibitor concentration demand prediction model includes:

[0089] Under the experimental conditions, H sets of training data were collected in advance, where H is a positive integer greater than 1. The H sets of training data include wax deposition characteristic parameters and the wax inhibitor concentration requirements corresponding to the wax deposition characteristic parameters.

[0090] It should be noted that by conducting a gradient dosing experiment and measuring the labels, we can ensure that the labels accurately reflect the "minimum effective concentration for inhibiting wax deposition," that is, the minimum effective concentration corresponding to the wax deposition characteristic parameters, which can effectively inhibit wax deposition.

[0091] The gradient boosting regression tree model was adopted as the wax inhibitor concentration demand prediction model. The initial hyperparameters were set as follows: number of trees: 31, learning rate: 0.05, maximum depth: -1 (automatically adjusted), regularization coefficient: 0.1, and feature sampling ratio: 0.8.

[0092] The collected training data is divided into training set, validation set and test set according to a preset ratio; optionally, the ratio is 6:3:1.

[0093] The model is trained using a training set, with mean squared error as the loss function. The weights of the leaf nodes are optimized using gradient descent. The model parameters are updated based on the negative gradient of the training set loss. The hyperparameters are tuned using Bayesian optimization. The optimization range includes: 20-50 trees, a learning rate of 0.01-0.1, and a regularization coefficient of 0.05-0.2.

[0094] An early stopping mechanism is introduced: when the mean squared error of the validation set decreases by less than a preset value for 20 consecutive rounds, training is stopped and the model parameters with the best performance on the validation set are retained.

[0095] The trained model is evaluated using a test set, and the root mean square error is calculated. When the root mean square error is ≤1.0mm and the mean absolute percentage error is ≤2%, the model performance evaluation is satisfactory, and it can be deployed and applied.

[0096] Obtain the wax deposition characteristic parameters of the Sth dosing segment, S∈M, input the wax deposition characteristic parameters of the Sth dosing segment into the pre-constructed wax inhibitor concentration requirement prediction model, and output the wax inhibitor concentration requirement of the Sth dosing segment;

[0097] It should be noted that the wax inhibitor concentration requirement for the Sth dosing stage is the wax inhibitor concentration requirement for the Sth dosing stage without considering upstream contributions.

[0098] Obtain the wax inhibitor dosage rate for the first to the (S-1)th dosing segments, and based on the actual wax inhibitor dosage rate for the first to the (S-1)th dosing segments, obtain its comprehensive natural contribution concentration to the (S)th dosing segment.

[0099] By comparing and analyzing the overall natural contribution concentration with the wax inhibitor concentration requirement of the Sth dosing segment, the dosing instruction for the Sth dosing segment is generated.

[0100] The method for obtaining the comprehensive natural contribution concentration of the wax inhibitor to the Sth dosing segment based on the actual wax inhibitor dosing rate from the first to the (S-1)th dosing segments includes:

[0101] Collect the wax inhibitor dosing rate and corresponding comprehensive parameters of the dosing sections from the first to the (S-1)th dosing section; the comprehensive parameters include the pipe inner diameter and inter-section length, flow velocity and pressure;

[0102] Wherein, the inter-segment length is the length from the current dosing segment to the Sth dosing segment;

[0103] The wax inhibitor dosing rates of the first to the (S-1)th dosing segments and the comprehensive parameters of the corresponding dosing segments are sequentially input into the pre-constructed contribution concentration prediction model to obtain the contribution concentration of each segment in the Sth dosing segment.

[0104] The contribution concentrations of the first to the (S-1)th dosing segments in the Sth dosing segment are summed to obtain the comprehensive natural contribution concentration to the Sth dosing segment.

[0105] The training method for the contribution concentration prediction model includes:

[0106] In the experimental case, the first training data is obtained using a segmented isolation test method. The method for obtaining the first training data includes:

[0107] Only turn on the dosing pump of the Gth dosing section, G∈(1,S-1)S>2, and turn off the other dosing sections from 1 to S-1. Install an online ultraviolet spectrophotometer (the wax inhibitor contains ultraviolet absorption groups, detection accuracy, ±0.1mg / L) in the Sth dosing section to collect concentration data.

[0108] Record the time Ts when the drug first reaches the S-th dosing segment after the start of the G-th dosing segment. Starting from Ts, continuously collect concentration data for 2 minutes and take the average value as the contribution concentration.

[0109] Obtain the wax inhibitor dosing rate and the corresponding comprehensive parameters of the dosing segment in the Gth dosing segment, as well as the corresponding contribution concentration, as a first set of training data. Collect Q sets of first training data in advance, where Q is a positive integer greater than 1.

[0110] A long short-term memory network (LSTM) was used as the contribution concentration prediction model. The model was trained using the first training data. The combined parameters of the wax inhibitor dosing rate and the corresponding dosing stage were used as the input to the model, and the contribution concentration was used as the output. The stochastic gradient descent method was used, and the weights and biases of the model were adjusted through backpropagation to minimize the error between the prediction and the actual results. A loss function, which is the mean squared error, was set. When the loss function value converged, the training of the model was stopped, and the model corresponding to the convergence of the loss function value was used as the trained model.

[0111] The model structure includes:

[0112] Input layer: The features of the first S-1 dosing sections are organized into sequential data. The feature vector of each dosing section is [wax inhibitor dosing rate, pipe inner diameter, inter-section length, flow velocity, pressure], with a dimension of 5.

[0113] It should be noted that the specific method for organizing the features of the first S-1 dosing segments into sequential data is as follows: the first S-1 dosing segments are arranged in the pipeline spatial order, from segment 1 to segment S-1, along the crude oil flow direction to construct sequential data, ensuring that the LSTM layer can capture the "distance decay" law. For example, segment S-1 is closest to the target segment and usually contributes the most.

[0114] LSTM layer: Set up 1-2 LSTM units, such as 64 neurons, and capture sequence dependencies through gating mechanism, such as the difference in contribution between near and far segments, to avoid the gradient vanishing problem of traditional RNN;

[0115] Fully connected layer: The sequence features output by LSTM are mapped to the contribution concentration of each drug delivery segment through a fully connected layer;

[0116] Output layer: Outputs the predicted contribution concentration.

[0117] Loss function: Mean squared error (MSE) is used, and a total contribution concentration constraint can be added. The total contribution concentration constraint is to minimize the error between the sum of the contributions of each segment and the measured total concentration of the Sth segment, thereby improving the consistency of prediction.

[0118] Specifically, when constructing the sequence data for the contribution concentration prediction model, the above data organization method closely aligns with the actual patterns of chemical transport within oil pipelines, especially the key characteristic that "the closer the distance, the greater the contribution of the chemical to the target segment." Specifically, taking the S-th dosing segment as a reference, the preceding S-1 dosing segments are arranged in order of proximity to the target segment. For example, the S-1 segment, being closest to the target segment, is placed at the beginning of the sequence, followed by the S-2 segment, and so on, until the furthest segment, the first segment. This arrangement is not arbitrary; rather, it's because as crude oil flows in the pipeline, the chemical injected from the dosing segment is gradually diluted and absorbed as the transport distance increases. Chemicals injected closer to the target segment reach the target segment faster, retaining a higher concentration and thus contributing more; chemicals from farther away segments suffer greater losses after long-distance transport, resulting in a relatively smaller contribution.

[0119] This organizational method allows the model to learn according to actual physical laws. Long Short-Term Memory (LSTM) networks excel at capturing dependencies in sequences, placing closer segments first and farther segments later. During processing, the model assigns higher weight to earlier segments (closer segments), aligning with the reality that closer drug segments contribute a larger proportion. Furthermore, guided by distance features, the model can more quickly understand the decay pattern where closer segments contribute more. For example, after training, it was found that the model's prediction error for segment S-1 can be controlled within 1 mg / L, far lower than the 2.5 mg / L of random arrangement. Moreover, the model performs stably with varying numbers of drug segments, without prediction bias arising from changes in sequence length.

[0120] In this embodiment, by predicting the independent contribution concentration through segmented input model, the contribution share of each segment can be accurately located. The comprehensive natural contribution concentration obtained after superposition can truly reflect the actual impact of each upstream segment. When the comprehensive natural contribution concentration is close to the wax inhibition requirement concentration of the Sth dosing segment, the Sth dosing segment only needs to be supplemented with wax inhibitor corresponding to the concentration difference. This avoids overdosing due to misjudgment of insufficient upstream contribution, saves reagent costs, and overcomes the shortcomings of the prior art, which usually regards the total concentration of the Sth dosing segment as the mixed result of all upstream dosing segments, cannot separate the contribution of individual dosing segments, and is prone to overdosing in a certain segment without being noticed or underdosing in a certain segment but misjudging the total concentration as meeting the standard.

[0121] Secondly, the first training data acquisition method uses segmented isolation experiments, only activating a single dosing segment for drug administration, and installing a high-precision online ultraviolet spectrophotometer in the S-th dosing segment to collect the drug concentration. Combined with recording the first arrival time of the drug and continuously collecting the average value, it can accurately obtain the contribution data of a single segment to the downstream dosing segment. At the same time, multiple sets of data are collected through different dosing rates and pipe segment parameters, covering various operating conditions, providing high-quality training samples for the gradient boosting regression tree model. This enables the prediction model to accurately reflect the actual contribution of the upstream dosing segment to the downstream dosing segment, providing a reliable basis for automatic dosing control.

[0122] Methods for generating dosing instructions include:

[0123] A preset difference threshold is set, and the concentration difference between the required wax inhibitor concentration for the Sth dosing segment and the comprehensive natural contribution concentration is obtained. The concentration difference is compared with the difference threshold. When the concentration difference is less than the difference threshold, no dosing instruction is generated. When the concentration difference is greater than or equal to the difference threshold, the dosing instruction for the Sth dosing segment is generated, the concentration difference is obtained, and the concentration difference is marked as the wax inhibitor concentration correction requirement for the Sth dosing segment. Based on the output wax inhibitor concentration correction requirement for the Sth dosing segment, the wax inhibitor dosing rate of the dosing device is controlled.

[0124] It should be noted that the method for controlling the wax inhibitor dosing rate of the dosing device based on the wax inhibitor concentration requirement of the Sth dosing segment is the same as the method for controlling the wax inhibitor dosing rate of the dosing device based on the wax inhibitor concentration requirement of the first dosing segment, and will not be repeated here.

[0125] In this embodiment, temperature sensors are deployed along the oil pipeline. Based on the collected space-time temperature data, clustering and spatial connectivity processing are performed to divide the pipeline into M continuous dosing sections. Waxing characteristic parameters are collected in real time for each dosing section. The pre-constructed wax inhibitor concentration requirement prediction model is input to calculate the wax inhibitor concentration requirement for each section. At the same time, the natural contribution concentration to the downstream section is calculated by combining the actual dosing rate of the upstream dosing section, generating scientific dosing instructions and realizing automatic adjustment of the dosing device. This method can accurately control the wax inhibitor dosage according to the actual flow state and temperature distribution of the oil, so that the agent is fully mixed in the pipeline and reaches the target concentration, avoiding local insufficient dosing or waste, significantly improving the wax prevention effect and the economy of drug use, while ensuring the safety and continuity of pipeline oil transportation.

[0126] Example 2

[0127] Please see Figure 5 This invention provides a technical solution: an automatic controlled chemical dosing system for oil wells, used to implement the aforementioned automatic controlled chemical dosing method for oil wells, the dosing system comprising:

[0128] The data acquisition module deploys multiple temperature sensors along the oil pipeline at preset intervals L within the oil well, following the pipeline's transport direction, and collects data points based on a preset period T. , ; For the first The spatial coordinates of each sensor For the first Each sensor's data acquisition time, For the first Each sensor collects temperature values;

[0129] The dosing segmentation module divides all data points. Clustering yields all data points The category labels are obtained, and the spatial order of the obtained category label sequence is connected to output M consecutive drug delivery segments in space.

[0130] The first dosing module collects wax deposition characteristic parameters of the first dosing section along the transport direction of the oil pipeline, inputs the acquired wax deposition characteristic parameters into the pre-constructed wax inhibitor concentration demand prediction model, outputs the wax inhibitor concentration demand of the first dosing section, and controls the wax inhibitor dosing rate of the dosing device based on the output wax inhibitor concentration demand of the first dosing section.

[0131] The data processing module obtains the wax deposition characteristic parameters of the Sth dosing segment, S∈M, and inputs the wax deposition characteristic parameters of the Sth dosing segment into the pre-constructed wax inhibitor concentration requirement prediction model, and outputs the wax inhibitor concentration requirement of the Sth dosing segment.

[0132] The data analysis module obtains the wax inhibitor dosage rate from the first to the (S-1)th dosing segment, and based on the actual wax inhibitor dosage rate from the first to the (S-1)th dosing segment, obtains its comprehensive natural contribution concentration to the (S)th dosing segment.

[0133] The second dosing module compares and analyzes the overall natural contribution concentration with the wax inhibitor concentration requirement of the Sth dosing segment, and generates the dosing instruction for the Sth dosing segment.

[0134] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. An automatic controlled chemical dosing method for oil wells, characterized in that, include: Multiple temperature sensors are installed along the oil pipeline at preset intervals along the pipeline's transport direction inside the oil well. Data points are collected based on a preset cycle. , ; For the first The spatial coordinates of each sensor For the first Each sensor's data acquisition time, For the first Each sensor collects temperature values; For all data points Clustering yields all data points The category labels are obtained, and the spatial order of the obtained category label sequence is connected to output M consecutive drug delivery segments in space; Along the transport direction of the oil pipeline, wax deposition characteristic parameters of the first dosing section are collected. The obtained wax deposition characteristic parameters are input into the pre-constructed wax inhibitor concentration demand prediction model, and the wax inhibitor concentration demand of the first dosing section is output. Based on the output wax inhibitor concentration demand of the first dosing section, the wax inhibitor dosing rate of the dosing device is controlled. Obtain the wax deposition characteristic parameters of the Sth dosing segment, S∈M, input the wax deposition characteristic parameters of the Sth dosing segment into the pre-constructed wax inhibitor concentration requirement prediction model, and output the wax inhibitor concentration requirement of the Sth dosing segment; Obtain the wax inhibitor dosage rate for the first to the (S-1)th dosing segments, and based on the actual wax inhibitor dosage rate for the first to the (S-1)th dosing segments, obtain its comprehensive natural contribution concentration to the (S)th dosing segment. By comparing and analyzing the overall natural contribution concentration with the wax inhibitor concentration requirement of the Sth dosing segment, the dosing instruction for the Sth dosing segment is generated.

2. The automatic controlled chemical dosing method for oil wells according to claim 1, characterized in that, The method for M consecutive dosing segments in the output space includes: Based on the length of the oil pipeline, the number of chemical dosing sections is preset to P. K-means clustering is used, with the cluster number set to k=P, to cluster all data points. Input k-means clustering, perform iterative training, and obtain each data point. The cluster label is represented as ; Representing data points The cluster to which it belongs; For each cluster in the clustering results, obtain the spatial coordinates of the corresponding data points and determine whether they are continuous in space. If the data points with the same cluster label are discontinuous in space, divide the discontinuity into multiple sub-dosing segments, so that each sub-dosing segment is a continuous interval along the transport direction of the oil pipeline. A preset length threshold is set. When the length of the sub-dosing segment is less than the preset length threshold and the sub-dosing segment has the same cluster label as the adjacent segments on both sides, it is directly merged. When the cluster labels of the adjacent segments on both sides are different, it is merged into the adjacent segment with the closest temperature value. When the length of a sub-dosing section is greater than or equal to the length threshold, the sub-dosing section is directly marked as a dosing section, thus obtaining M consecutive dosing sections, which are then sequentially marked as the first dosing section, the second dosing section, ..., the Mth dosing section according to the transport direction of the oil pipeline.

3. The automatic controlled chemical dosing method for oil wells according to claim 1, characterized in that, The wax deposition characteristic parameters include the flow rate, pressure, oil temperature, and crude oil wax content in the first dosing section.

4. The automatic controlled chemical dosing method for oil wells according to claim 1, characterized in that, The training method for the wax inhibitor concentration demand prediction model includes: H sets of training data are collected in advance, where H is a positive integer greater than 1. The H sets of training data include wax deposition characteristic parameters and the wax inhibitor concentration requirements corresponding to the wax deposition characteristic parameters. A gradient boosting regression tree model was adopted as the prediction model for wax inhibitor concentration demand, and initial hyperparameters were set. The collected training data is divided into training set, validation set and test set according to a preset ratio; The model is trained using the training set, with mean squared error as the loss function. The weights of the leaf nodes are optimized using gradient descent. The model parameters are updated based on the negative gradient of the training set loss. The hyperparameters are tuned using Bayesian optimization. An early stopping mechanism is introduced: when the mean squared error of the validation set decreases by less than a preset value for 20 consecutive rounds, training is stopped and the model parameters with the best performance on the validation set are retained. The trained model is evaluated using a test set. The root mean square error and mean absolute percentage error are calculated to assess the model's performance. Once the model's performance meets the evaluation criteria, it is deployed and applied.

5. The automatic controlled chemical dosing method for oil wells according to claim 1, characterized in that, The method for obtaining the comprehensive natural contribution concentration of the wax inhibitor to the Sth dosing segment based on the actual wax inhibitor dosing rate from the first to the (S-1)th dosing segments includes: Collect the wax inhibitor dosing rate and corresponding comprehensive parameters of the dosing sections from the first to the (S-1)th dosing section; the comprehensive parameters include the pipe inner diameter and inter-section length, flow velocity and pressure; The wax inhibitor dosing rates of the first to the (S-1)th dosing segments and the comprehensive parameters of the corresponding dosing segments are sequentially input into the pre-constructed contribution concentration prediction model to obtain the contribution concentration of each dosing segment in the Sth dosing segment. The contribution concentrations of the first to the (S-1)th dosing segments in the Sth dosing segment are summed to obtain the comprehensive natural contribution concentration to the Sth dosing segment.

6. The automatic controlled chemical dosing method for oil wells according to claim 5, characterized in that, The training method for the contribution concentration prediction model includes: In the experimental case, the first training data is obtained using a segmented isolation test method. The method for obtaining the first training data includes: Only turn on the dosing pump of the Gth dosing segment, G∈(1,S-1)S>2, and turn off the other dosing segments from 1 to S-1. Install an online ultraviolet spectrophotometer in the Sth dosing segment to collect concentration data. Record the time Ts when the drug first reaches the S-th dosing segment after the start of the G-th dosing segment. Starting from Ts, continuously collect concentration data for 2 minutes and take the average value as the contribution concentration. Obtain the wax inhibitor dosing rate and the corresponding comprehensive parameters of the dosing segment in the Gth dosing segment, as well as the corresponding contribution concentration, as a first set of training data. Collect Q sets of first training data in advance, where Q is a positive integer greater than 1. A long short-term memory network (LSTM) was used as the contribution concentration prediction model. The model was trained using the first training data. The combined parameters of the wax inhibitor dosing rate and the corresponding dosing stage were used as the input to the contribution concentration prediction model, and the contribution concentration was used as the output. The stochastic gradient descent method was used, and the weights and biases of the contribution concentration prediction model were adjusted through backpropagation to minimize the error between the prediction results and the actual results. A loss function, which is the mean squared error, was set. When the loss function value converged, the training of the contribution concentration prediction model was stopped, and the contribution concentration prediction model corresponding to the convergence of the loss function value was used as the trained contribution concentration prediction model.

7. The automatic controlled chemical dosing method for oil wells according to claim 1, characterized in that, The method for controlling the wax inhibitor dosing rate of the dosing device based on the wax inhibitor concentration requirement of the first dosing stage includes: Obtain the wax inhibitor concentration requirement, pipe section parameters, and oil parameters for the first dosing stage. The pipe section parameters include pipe length and inner diameter, and the oil parameters include oil flow rate, oil temperature, and pressure. Based on the pipe section parameters and oil parameters of the first dosing section, and combined with the concentration requirements, the required wax inhibitor dosing rate is calculated so that the added agent can be fully mixed in the pipeline and reach the target concentration. The calculated wax inhibitor dosage rate is used as a control command to drive the dosing device of the first dosing section, including an injection pump and a metering valve, to adjust the wax inhibitor dosage rate.

8. The automatic controlled chemical dosing method for oil wells according to claim 7, characterized in that, The method for calculating the required wax inhibitor dosage rate based on concentration requirements includes: Based on the length of the pipe section of the first dosing section and inner diameter Calculate the volume of the first dosing section pipe. ; Calculate the total amount of agent required based on the wax inhibitor concentration requirement and the pipe section volume. Obtain the average residence time of the oil in the pipe section of the first dosing section; The wax inhibitor dosage rate is calculated based on the required total dosage and average residence time.

9. The automatic controlled chemical dosing method for oil wells according to claim 1, characterized in that, The method for generating the dosing instruction for the Sth dosing segment includes: A preset difference threshold is set, and the concentration difference between the required wax inhibitor concentration for the Sth dosing segment and the comprehensive natural contribution concentration is obtained. The concentration difference is compared with the difference threshold. When the concentration difference is less than the difference threshold, no dosing instruction is generated. When the concentration difference is greater than or equal to the difference threshold, the dosing instruction for the Sth dosing segment is generated, the concentration difference is obtained, and the concentration difference is marked as the wax inhibitor concentration correction requirement for the Sth dosing segment. Based on the output wax inhibitor concentration correction requirement for the Sth dosing segment, the wax inhibitor dosing rate of the dosing device is controlled.

10. An automatic controlled chemical dosing system for oil wells, used to implement the automatic controlled chemical dosing method for oil wells according to any one of claims 1-9, characterized in that, The dosing system includes: The data acquisition module deploys multiple temperature sensors along the oil pipeline at preset intervals L within the oil well, following the pipeline's transport direction, and collects data points based on a preset period T. , ; For the first The spatial coordinates of each sensor For the first Each sensor's data acquisition time, For the first Each sensor collects temperature values; The dosing segmentation module divides all data points. Clustering yields all data points The category labels are obtained, and the spatial order of the obtained category label sequence is connected to output M consecutive drug delivery segments in space; The first dosing module collects wax deposition characteristic parameters of the first dosing section along the transport direction of the oil pipeline, inputs the acquired wax deposition characteristic parameters into the pre-constructed wax inhibitor concentration demand prediction model, outputs the wax inhibitor concentration demand of the first dosing section, and controls the wax inhibitor dosing rate of the dosing device based on the output wax inhibitor concentration demand of the first dosing section. The data processing module obtains the wax deposition characteristic parameters of the Sth dosing segment, S∈M, and inputs the wax deposition characteristic parameters of the Sth dosing segment into the pre-constructed wax inhibitor concentration requirement prediction model, and outputs the wax inhibitor concentration requirement of the Sth dosing segment. The data analysis module obtains the wax inhibitor dosage rate from the first to the (S-1)th dosing segment, and based on the actual wax inhibitor dosage rate from the first to the (S-1)th dosing segment, obtains its comprehensive natural contribution concentration to the (S)th dosing segment. The second dosing module compares and analyzes the overall natural contribution concentration with the wax inhibitor concentration requirement of the Sth dosing segment, and generates the dosing instruction for the Sth dosing segment.

Citation Information

Patent Citations

  • Method, device and dosing control charts for optimizing paraffin removal system of oil wells

    CN107939340A

  • Method for accurately predicting double coagulants in waterworks based on automatic machine learning

    CN119626387A

  • An intelligent control method for concentrating and dosing coal sludge water

    CN119781379A

  • Intensity extraction and crosstalk attenuation using interpolation and adaptation for base calling

    US11455487B1

  • Adaptive systems and methods for delivery of a medicament

    US11633554B1