An oil well automatic control method and system for adding chemicals
By deploying temperature sensors on the oil well pipeline and performing clustering processing, the dosage of chemical additives can be controlled in stages, solving the problem of uneven wax inhibitor addition in existing technologies. This achieves precise anti-wax deposition and resource conservation, ensuring the safe and stable production of oil wells.
Patent Information
- Application Number
- CN202511395429.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2045-09-28
Smart Images

Figure CN120867685B_ABST
Abstract
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 a category label, based on the obtained category label sequence, the M medicating sections that are continuous in space order are connected, and the M medicating sections that are continuous in space are output;
[0008] In the conveying direction of the oil pipeline, the wax deposition characteristic parameters of the first medicating 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 medicating section is output; based on the output wax inhibitor concentration demand of the first medicating section, the wax inhibitor dosing rate of the medicating device is controlled;
[0009] The wax deposition characteristic parameters of the Sth medicating section are obtained, S is an element of M, the wax deposition characteristic parameters of the Sth medicating section are input into the pre-constructed wax inhibitor concentration demand prediction model, and the wax inhibitor concentration demand of the Sth medicating section is output;
[0010] The wax inhibitor dosing rates of the first to S-1th medicating sections are obtained, and based on the actual wax inhibitor dosing rates of the first to S-1th medicating sections, the comprehensive natural contribution concentration of the Sth medicating section is obtained;
[0011] The comprehensive natural contribution concentration is compared and analyzed with the wax inhibitor concentration demand of the Sth medicating section, and the medicating instruction of the Sth medicating section is generated.
[0012] As a further description of the above technical solution: the method for outputting the M medicating sections that are continuous in space includes:
[0013] Based on the length of the oil pipeline, the number of medicating sections is preset to P, k-means clustering is adopted, the cluster number k is set to P, and all data points are input into k-means clustering, iterative training is performed, the cluster label of each data point is obtained, and is represented as ; represents the cluster to which the data point belongs;
[0014] For each cluster in the clustering result, the spatial position coordinates of the corresponding data points are obtained, it is judged whether they are continuous in space, if the data points with the same cluster label have discontinuity in space, then the breakpoint is divided into multiple sub-medication sections, so that each sub-medication section is a continuous interval in the conveying direction of the oil pipeline;
[0015] A length threshold is preset, when the length of the sub-medication section is less than the preset length threshold, and the cluster labels of the adjacent sections on both sides are consistent, the sub-medication section is directly merged, and when the cluster labels of the adjacent sections on both sides are different, the sub-medication section is merged into the adjacent section with the closest temperature value;
[0016] When the length of the sub-dosing section is greater than or equal to the length threshold, the sub-dosing section is directly marked as a dosing section, so as to obtain M continuous dosing sections, and the dosing sections are sequentially marked as a first dosing section, a second dosing section,..., and an Mth dosing section according to the conveying direction of the oil pipeline.
[0017] As a further description of the above technical solution: the wax deposition characteristic parameters include the flow rate, pressure, oil body 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 requirement prediction model comprises:
[0019] Under the condition of the experiment, H sets of training data are collected in advance, H is a positive integer greater than 1, the H sets of training data include wax deposition characteristic parameters and wax inhibitor concentration requirements corresponding to the wax deposition characteristic parameters;
[0020] The gradient boosting regression tree model is used as the wax inhibitor concentration requirement prediction model, and initial hyperparameters are set;
[0021] The collected training data are divided into a training set, a validation set and a test set according to a preset proportion;
[0022] The training set is used to train the model, the mean square error is used as a loss function, the leaf node weight is optimized by the gradient descent method, the model parameters are updated based on the negative gradient of the training set loss, and the hyperparameters are optimized by the Bayesian optimization method;
[0023] The early stopping mechanism is introduced, the training is stopped when the mean square error of the validation set is continuously reduced by less than a preset value for 20 rounds, and the model parameters with the optimal performance of the validation set are reserved;
[0024] The trained model is evaluated using the test set, the root mean square error and the mean absolute percentage error are calculated, the model performance is evaluated, the model performance evaluation meets the standard, and the model 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 Sth dosing section based on the actual wax inhibitor dosing rate of the first to S-1th dosing sections comprises:
[0026] The wax inhibitor dosing rate of the first to S-1th dosing sections and the comprehensive parameters of the corresponding dosing sections are collected; the comprehensive parameters include the pipe diameter and the length between sections, the flow rate and the pressure;
[0027] The wax inhibitor dosing rate of the first to S-1th dosing sections and the comprehensive parameters of the corresponding dosing sections are sequentially input into the pre-constructed contribution concentration prediction model, so as to obtain the contribution concentration of each dosing section in the Sth dosing section;
[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 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.
[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 injection rate is taken as a control instruction to drive the dosing device of the first dosing section, including an injection pump and a metering valve, to adjust the wax inhibitor injection rate.
[0039] As a further description of the above technical solution: the method for calculating the required wax inhibitor injection rate based on the concentration requirement includes:
[0040] According to the length of the pipe section of the first dosing section and the inner diameter , the volume of the pipe section of the first dosing section is calculated .
[0041] The total required injection amount is calculated based on the wax inhibitor concentration requirement and the pipe section volume;
[0042] The average residence time of the oil in the pipe section of the first dosing section is obtained;
[0043] The wax inhibitor injection rate is calculated based on the total required injection amount and the average residence time.
[0044] As a further description of the above technical solution: the method for generating the dosing instruction of the Sth dosing section includes:
[0045] A difference threshold value is preset, the concentration difference between the wax inhibitor concentration requirement of the Sth dosing section and the comprehensive natural contribution concentration is obtained, and the concentration difference is compared with the difference threshold value. When the concentration difference is less than the difference threshold value, no dosing instruction is generated. When the concentration difference is greater than or equal to the difference threshold value, the dosing instruction of the Sth dosing section is generated, the concentration difference is obtained, the concentration difference is marked as the wax inhibitor concentration correction requirement of the Sth dosing section, and the wax inhibitor injection rate of the dosing device is controlled based on the output wax inhibitor concentration correction requirement of the Sth dosing section.
[0046] An automatic oil well control and dosing system for implementing an automatic oil well control and dosing method, the dosing system includes:
[0047] A data acquisition module, a plurality of temperature sensors are arranged on the oil pipeline in the oil well at a preset interval L along the conveying direction of the oil pipeline, and data points are acquired based on a preset period T . The spatial position coordinates of the first sensor, the acquisition time of the first sensor, and the corresponding acquisition temperature value of the first sensor;
[0048] A dosing section division module, all data points are clustered to obtain all data points a category label, based on the obtained category label sequence, the space sequence is connected, and M continuous dosing sections in space are output;
[0049] The first dosing module collects the wax deposition characteristic parameters of the first dosing section along the conveying direction of the oil pipeline, inputs the obtained wax deposition characteristic parameters into the pre-constructed wax inhibitor concentration demand prediction model, and outputs the wax inhibitor concentration demand of the first dosing section. Based on the output wax inhibitor concentration demand of the first dosing section, the wax inhibitor dosing rate of the dosing device is controlled.
[0050] The data processing module obtains the wax deposition characteristic parameters of the Sth dosing section, S ∈ M, inputs the wax deposition characteristic parameters of the Sth dosing section into the pre-constructed wax inhibitor concentration demand prediction model, and outputs the wax inhibitor concentration demand of the Sth dosing section.
[0051] The data analysis module obtains the wax inhibitor dosing rates of the first to (S-1)th dosing sections, and based on the actual wax inhibitor dosing rates of the first to (S-1)th dosing sections, obtains the comprehensive natural contribution concentration to the Sth dosing section.
[0052] The second dosing module compares and analyzes the comprehensive natural contribution concentration and the wax inhibitor concentration demand of the Sth dosing section, and generates a dosing instruction for the Sth dosing section.
[0053] Beneficial effects:
[0054] The oil well automatic regulation and control dosing method and system provided by the application can accurately control the wax inhibitor dosing amount according to the actual flow state and temperature distribution of the oil body, make the medicament fully mixed in the pipeline and reach the target concentration, avoid local insufficient dosing or waste, significantly improve the wax prevention effect and drug economy, and ensure the safety and continuity of pipeline oil transportation. BRIEF DESCRIPTION OF DRAWINGS
[0055] The application will be further explained below in combination with the drawings and examples:
[0056] Figure 1 The flowchart of the oil well automatic regulation and control dosing method provided for the first embodiment of the application;
[0057] Figure 2 The flowchart of the method for outputting M continuous dosing sections in space provided for the first embodiment of the application;
[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. cluster label, denoted as data points belonging to the cluster;
[0068] For each cluster in the clustering result, the spatial position coordinates of the corresponding data points are obtained, and it is judged whether they are continuous in the spatial position. If the data points with the same cluster label exist discontinuously in space, the breakpoint is divided into multiple sub-dosing sections, so that each sub-dosing section is a continuous interval along the conveying direction of the oil pipeline.
[0069] It should be noted that there is a discontinuity in space, that is, through the spatial position coordinates on the data points, it is judged that two data points are not continuous, and there are data points in between, which cannot be directly merged.
[0070] A preset length threshold is set. When the length of the sub-dosing section is less than the preset length threshold, and the cluster labels of the sub-dosing section and the adjacent sections on both sides are consistent, the sub-dosing section is directly merged. When the cluster labels of the adjacent sections on both sides are different, the sub-dosing section is merged into the adjacent section with the closest temperature value.
[0071] When the length of the sub-dosing section is greater than or equal to the length threshold, the sub-dosing section is directly marked as a dosing section, so that M continuous dosing sections are obtained, and are sequentially marked as a first dosing section, a second dosing section, …, an Mth dosing section according to the conveying 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 realizes the relative uniformity of the temperature in each dosing section, and can accurately control the drug dosage according to the temperature characteristics of each section. This segmented control method avoids the problem of fixed dosage addition in local low-temperature sections leading to wax deposition, reduces drug waste, improves the utilization efficiency of dosing resources, and can adapt to the nonlinear fluctuation of the pipeline temperature along the conveying direction, ensuring that the anti-wax effect is maintained throughout the pipeline range.
[0073] Secondly, by performing necessary merging processing on the continuous dosing sections, the length of each section can be optimized and the dosing strategy can be optimized, so that each section not only maintains spatial continuity but also meets the operability of engineering control. This not only facilitates online monitoring and remote control, but also enhances the stability and safety of the system, reduces the risk of local wax deposition, equipment blockage and production stoppage, and realizes the comprehensive effect of precise anti-wax, resource saving and stable production.
[0074] The wax deposition characteristic parameters of the first dosing section are collected in the conveying direction of the oil pipeline, the obtained wax deposition characteristic parameters are input into a pre-constructed wax inhibitor concentration demand prediction model, and the wax inhibitor concentration demand of the first dosing section is output; and the wax inhibitor dosing rate of the dosing device is controlled based on the output wax inhibitor concentration demand of the first dosing section.
[0075] It should be noted that each dosing section is provided with a dosing device, including an injection pump and a metering valve, and the calculated automatic addition of the wax inhibitor.
[0076] The wax deposition characteristic parameters include the flow rate, pressure, oil body temperature and crude oil wax content of the first dosing section.
[0077] It should be noted that the flow rate, pressure and oil body temperature are collected and obtained by a sensor group, which includes an ultrasonic flowmeter, a pressure transmitter and a temperature sensor; and the crude oil wax content is detected online by near-infrared (NIR) spectroscopy and Fourier transform infrared (FTIR).
[0078] Among them, the flow rate determines the wall shear stress and mixing degree, high flow rate can inhibit the deposition of wax crystals on the wall and remove the thin layer; when the flow rate is low, the wax colloid settles, the crystals aggregate and adhere to the wall, the pressure affects the dissolved gas content, high pressure is beneficial to the dissolved gas and reduces the temperature / volume change caused by gas precipitation; pressure drop or instability can cause gas release, accompanied by local temperature change and turbulence change, which promotes wax precipitation, the temperature directly determines the wax solubility, the lower the temperature and the greater the supercooling degree, the higher the wax deposition rate, and the higher the soluble wax concentration in the crude oil, the greater the amount of precipitated solid phase.
[0079] The method for controlling the wax inhibitor dosing rate of the dosing device based on the output wax inhibitor concentration demand of the first dosing section includes:
[0080] The wax inhibitor concentration demand of the first dosing section, the pipe section parameters and the oil body parameters are obtained, the pipe section parameters include the pipe section length L1 and the inner diameter D1, and the oil body parameters include the oil body flow rate Q1, the oil body temperature T1 and the pressure P1;
[0081] The required wax inhibitor dosing rate is calculated according to the pipe section parameters and the oil body parameters of the first dosing section in combination with the concentration demand, so that the added medicament can be fully mixed in the pipeline and reach the target concentration;
[0082] The calculated wax inhibitor dosing rate is used as a control instruction to drive the dosing device of the first dosing section, including an injection pump and a metering valve, to adjust the wax inhibitor dosing rate.
[0083] It should be noted that the method for calculating the required wax inhibitor dosing rate in combination with the concentration demand includes:
[0084] The required wax inhibitor dosing rate is calculated according to the pipe section length and inner diameter Calculating the volume of the first dosing section pipe section , the calculation formula is: ;
[0085] According to the wax inhibitor concentration requirement and the pipe section volume, the required total dosage is calculated, and the calculation formula is: 1; in the formula, is the total dosage, is the wax inhibitor concentration requirement;
[0086] Obtain the average residence time of the oil body in the first dosing section pipe section, and the calculation formula is: 1; in the formula, is the average residence time, 1 is the oil body flow rate;
[0087] Based on the required total dosage and the average residence time, the wax inhibitor dosage rate is calculated, and the calculation formula is: ; in the formula, is the wax inhibitor dosage rate, is the average residence time, is the total dosage.
[0088] The training method of the wax inhibitor concentration requirement prediction model comprises:
[0089] Under the conditions of the experiment, H sets of training data are collected in advance, H is a positive integer greater than 1, the H sets of training data include waxing characteristic parameters and waxing characteristic parameter corresponding wax inhibitor concentration requirements;
[0090] It should be noted that the label is measured by gradient dosing experiment to ensure that the label truly reflects the "minimum effective concentration for inhibiting waxing", that is, the minimum effective concentration corresponding to the waxing characteristic parameter, which can effectively inhibit waxing.
[0091] The gradient boosting regression tree model is used as the wax inhibitor concentration requirement prediction model, and the initial hyperparameters are set: the initial hyperparameters include: tree number: 31, learning rate: 0.05, maximum depth: -1 (automatic adjustment), regularization coefficient: 0.1 and feature sampling ratio: 0.8;
[0092] The collected training data is divided into a training set, a validation set and a test set according to a predetermined ratio; optionally, the division ratio is 6:3:1.
[0093] The model is trained using the training set, the mean square error is used as the loss function, the leaf node weight is optimized by gradient descent method, the model parameters are updated based on the negative gradient of the training set loss, and the hyperparameters are optimized by Bayesian optimization method; the optimization range includes: the number of trees is 20-50, the learning rate is 0-0.1, and the regularization coefficient is 0.05-0.2;
[0094] An early stop mechanism is introduced, and when the verification set mean square error decreases by less than a preset value for 20 consecutive rounds, the training is stopped, and the model parameters with the optimal verification set performance are retained;
[0095] The trained model is evaluated using the test set, the root mean square error is calculated, and when the root mean square error is less than or equal to 1.0 mm and the average absolute percentage error is less than or equal to 2%, the model performance evaluation meets the requirements and is deployed for application.
[0096] Obtain the wax deposition characteristic parameter of the Sth drug addition section, S∈M, input the wax deposition characteristic parameter of the Sth drug addition section into the pre-constructed wax inhibitor concentration requirement prediction model, and output the wax inhibitor concentration requirement of the Sth drug addition section;
[0097] It should be noted that the output of the wax inhibitor concentration requirement of the Sth drug addition section is the wax inhibitor concentration requirement of the Sth drug addition section without considering the upstream contribution.
[0098] Obtain the wax inhibitor injection rate of the first to S-1th drug addition sections, and obtain the comprehensive natural contribution concentration of the first to S-1th drug addition sections to the Sth drug addition section based on the actual wax inhibitor injection rate of the first to S-1th drug addition sections.
[0099] Compare and analyze the comprehensive natural contribution concentration and the wax inhibitor concentration requirement of the Sth drug addition section to generate a drug addition instruction for the Sth drug addition section.
[0100] The method for obtaining the comprehensive natural contribution concentration of the first to S-1th drug addition sections to the Sth drug addition section based on the actual wax inhibitor injection rate of the first to S-1th drug addition sections includes:
[0101] Collect the wax inhibitor injection rate of the first to S-1th drug addition sections and the comprehensive parameters of the corresponding drug addition sections; the comprehensive parameters include the pipe diameter and the length between sections, the flow rate and the pressure;
[0102] Wherein, the length between sections is the length from the current drug addition section to the Sth drug addition section;
[0103] Input the wax inhibitor injection rate of the first to S-1th drug addition sections and the comprehensive parameters of the corresponding drug addition sections into the pre-constructed contribution concentration prediction model in turn to obtain the contribution concentration of each section at the Sth drug addition section.
[0104] The contribution concentration of the first to the S-1th dosing sections is accumulated to obtain a comprehensive natural contribution concentration of the Sth dosing section.
[0105] The training method of the contribution concentration prediction model comprises:
[0106] In the case of experiments, the first training data is obtained by using the segmented isolation measurement method, and the method for obtaining the first training data comprises:
[0107] Only the dosing pump of the Gth dosing section is turned on, G∈(1, S-1), S>2, the other dosing sections from 1 to S-1 are closed, and an online ultraviolet spectrophotometer (the wax inhibitor contains ultraviolet absorption groups, the detection accuracy is ±0.1 mg / L) is installed in the Sth dosing section to collect and obtain the concentration data;
[0108] The time Ts at which the medicament first reaches the Sth dosing section after the dosing of the Gth dosing section is recorded, and the concentration data for 2 min is continuously collected from Ts, and the average value is taken as the contribution concentration;
[0109] The wax inhibitor dosing rate of the Gth dosing section and the comprehensive parameters of the corresponding dosing section, and the corresponding contribution concentration are taken as a group of first training data, Q groups of first training data are collected in advance, and Q is a positive integer greater than 1;
[0110] The long short-term memory network is used as the contribution concentration prediction model, the first training data is used to train the contribution concentration prediction model, the wax inhibitor dosing rate and the comprehensive parameters of the corresponding dosing section are taken as the input of the contribution concentration prediction model, and the contribution concentration is taken as the output of the contribution concentration prediction model, the random gradient descent method is used, the weights and biases of the contribution concentration prediction model are adjusted through the back propagation algorithm, so that the error between the prediction result of the contribution concentration prediction model and the actual result is minimized, the loss function is set, the loss function is the mean square error, when the loss function value reaches convergence, the training of the contribution concentration prediction model is stopped, and the contribution concentration prediction model corresponding to the loss function value reaching convergence is taken as the trained contribution concentration prediction model.
[0111] The model structure comprises:
[0112] The input layer: the features of the first to the S-1th dosing sections are sequentially organized into sequence data, and the feature vector of each dosing section is [wax inhibitor dosing rate, pipe inner diameter, inter-section length, flow rate, pressure], and the dimension is 5;
[0113] It should be noted that the specific method of organizing the characteristics of the first S-1 dosing sections into sequence data in the order is to arrange the first S-1 dosing sections in the order of pipeline space from the first section to the S-1 section along the direction of crude oil flow, construct sequence data, and ensure that the LSTM layer can capture the "distance decay" law, such as the S-1 section being closest to the target section, and the contribution usually being the largest.
[0114] LSTM layer: set 1-2 layers of LSTM units, such as 64 neurons, capture sequence dependence through gating mechanism, such as the difference in contribution of near and far sections, avoid gradient disappearance problem of traditional RNN;
[0115] Fully connected layer: map the sequence features output by the LSTM to the contribution concentration of each dosing section through the fully connected layer;
[0116] Output layer: output the predicted contribution concentration.
[0117] Loss function: use mean square error (MSE), and can also add total contribution concentration constraint, which is the minimization of the error between the sum of the contributions of each section and the measured total concentration of the S section, to improve the prediction consistency.
[0118] Specifically, when constructing the sequence data of the contribution concentration prediction model, the above data organization method conforms to the actual law of the transmission of the medicament in the oil pipeline, especially the key characteristic that "the closer the distance, the greater the contribution of the medicament to the target section", specifically, taking the Sth dosing section as a reference, arranging the first S-1 dosing sections in the order of "from near to far" from the target section, for example, the S-1 section is closest to the target section, so it is placed at the beginning of the sequence, the S-2 section is next, and so on, until the farthest 1st section. This arrangement is not random, but because when crude oil flows in the pipeline, the medicament injected from the dosing section will be diluted and adsorbed as the transmission distance increases, the medicament injected from the near section can reach the target section faster and has a higher concentration, so its contribution is naturally greater; the medicament from the far section has more loss after long-distance transmission, so its contribution is relatively small;
[0119] The above organization method allows the model to learn according to the actual physical law, and the long short-term memory network model is good at capturing the dependence in the sequence. By placing the near section in front and the far section in back, the model will give higher attention weight to the sequence at the front (near section) when processing, which conforms to the actual situation that the contribution of the near section medicament is higher; in addition, the distance feature guides the model to understand the decay law that the closer the distance, the greater the contribution.
[0120] In this embodiment, by inputting the model prediction independent contribution concentration piece by piece, the contribution share of each section can be accurately located, and the comprehensive natural contribution concentration obtained after superposition can truly reflect the actual influence of each section in the upstream. When the comprehensive natural contribution concentration has approached the wax inhibition demand concentration of the Sth dosing section, the Sth dosing section only needs to supplement the wax inhibitor corresponding to the concentration difference, thereby avoiding excessive dosing due to misjudgment of insufficient contribution of the upstream, saving the cost of the reagent, and overcoming the defects in the prior art that the total concentration of the Sth dosing section is generally regarded as the mixed result of all dosing sections in the upstream, the contribution of a single dosing section cannot be split, and it is easy to cause excessive dosing of a section without being detected or misjudgment of the total concentration meeting the requirement due to insufficient dosing of a section.
[0121] Secondly, the first training data acquisition method can accurately acquire the contribution data of a single section to the downstream dosing section by segmenting and isolating the experiment, opening only a single dosing section for dosing, and installing a high-precision online ultraviolet spectrophotometer in the Sth dosing section to collect the concentration of the reagent. In combination with the method of recording the first arrival time of the reagent and continuously collecting the average value, the contribution data of a single section to the downstream dosing section can be accurately acquired. At the same time, by collecting multiple groups of data under different dosing rates and pipe section parameters, multiple working conditions are covered, high-quality training samples are provided for the gradient boosting regression tree model, and the prediction model can accurately reflect the actual contribution of the upstream dosing section to the downstream dosing section, thereby providing a reliable basis for automatic control of dosing.
[0122] The method for generating the dosing instruction comprises:
[0123] A difference threshold is preset, the concentration difference between the wax inhibitor concentration demand of the Sth dosing section and the comprehensive natural contribution concentration is acquired, 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 of the Sth dosing section is generated, the concentration difference is acquired, the concentration difference is marked as the wax inhibitor concentration correction demand of the Sth dosing section, and the wax inhibitor dosing rate of the dosing device is controlled based on the output wax inhibitor concentration correction demand of the Sth dosing section.
[0124] It should be noted that the method for controlling the wax inhibitor dosing rate of the dosing device based on the output wax inhibitor concentration demand of the Sth dosing section is the same as the method for controlling the wax inhibitor dosing rate of the dosing device based on the output wax inhibitor concentration demand of the first dosing section, and will not be described 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 dosing rates of the first to the S-1th dosing sections, and obtains the comprehensive natural contribution concentration of the Sth dosing section based on the actual wax inhibitor dosing rates of the first to the S-1th dosing sections.
[0133] The second dosing module compares and analyzes the comprehensive natural contribution concentration with the wax inhibitor concentration requirement of the Sth dosing section, and generates the dosing instruction of the Sth dosing section.
[0134] The basic principles, main features and advantages of the present application are shown and described above. It should be understood by those skilled in the art that the present application is not limited by the above examples, and the above examples and descriptions in the specification are only to illustrate the principles of the present application. Without departing from the spirit and scope of the present application, various changes and improvements can be made to the present application, and these changes and improvements all fall within the scope of the present application. The scope of protection of the present application is defined by the appended claims and their equivalents.
Claims
1. An oil well automatic control method for dosing, characterized by, The method comprises the following steps: 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 all data points to get the category label of all data points Based on the obtained category label sequence, the M continuous dosing sections in space are outputted. In the conveying direction of the oil pipeline, the wax deposition characteristic parameters of the first dosing section are collected, the obtained wax deposition characteristic parameters are input into a 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; The wax deposition characteristic parameters of the Sth dosing section are obtained, S ∈ M, the wax deposition characteristic parameters of the Sth dosing section are input into the pre-constructed wax inhibitor concentration demand prediction model, and the wax inhibitor concentration demand of the Sth dosing section is output; The wax inhibitor dosing rates of the first to S-1th dosing sections are obtained, and based on the actual wax inhibitor dosing rates of the first to S-1th dosing sections, the comprehensive natural contribution concentration of the Sth dosing section is obtained; The comprehensive natural contribution concentration is compared with the wax inhibitor concentration demand of the Sth dosing section, and the dosing instruction of the Sth dosing section is generated; The training method of the wax inhibitor concentration demand prediction model comprises the following steps: H groups of training data are collected in advance, H is a positive integer greater than 1, the H groups of training data comprise wax deposition characteristic parameters and wax inhibitor concentration demands corresponding to the wax deposition characteristic parameters; A gradient boosting regression tree model is used as the wax inhibitor concentration demand prediction model, and initial hyperparameters are set; The collected training data are divided into a training set, a validation set and a test set according to a preset proportion; The model is trained using the training set, the mean square error is used as a loss function, the leaf node weight is optimized by a gradient descent method, the model parameters are updated based on the negative gradient of the training set loss, the hyperparameters are optimized by a Bayesian optimization method; An early stopping mechanism is introduced, the training is stopped when the mean square error of the validation set is continuously reduced by less than a preset value for 20 rounds, and the model parameters with the optimal performance of the validation set are retained; The trained model is evaluated using the test set, the root mean square error and the mean absolute percentage error are calculated, the model performance is evaluated, the model performance evaluation meets the standard, and the model is deployed and applied; The method for obtaining the comprehensive natural contribution concentration of the Sth dosing section based on the actual wax inhibitor dosing rates of the first to S-1th dosing sections comprises the following steps: The wax inhibitor dosing rates of the first to S-1th dosing sections and the comprehensive parameters of the corresponding dosing sections are collected; the comprehensive parameters comprise the pipe diameter and the length between sections, the flow rate and the pressure; The wax inhibitor dosing rates of the first to S-1th dosing sections and the comprehensive parameters of the corresponding dosing sections are sequentially input into a pre-constructed contribution concentration prediction model, and the contribution concentration of each dosing section in the Sth dosing section is obtained; The contribution concentrations of the first to S-1th dosing sections in the Sth dosing section are accumulated, and the comprehensive natural contribution concentration of the Sth dosing section is obtained; The training method of the contribution concentration prediction model comprises the following steps: In the experimental case, the first training data are obtained by using a segmented isolation measurement method, and the method for obtaining the first training data comprises the following steps: Only the dosing pump of the Gth dosing section is started, G ∈ (1, S-1), S > 2, the dosing sections from 1 to S-1 are closed, and an online ultraviolet spectrophotometer is installed in the Sth dosing section to collect and obtain concentration data. Record the time Ts when the medicament first reaches the Sth dosing section after the Gth dosing section starts to dose the medicament, and continuously collect concentration data for 2 minutes from Ts, and take the average value as the contribution concentration; Obtain the wax inhibitor dosing rate of the Gth dosing section and the comprehensive parameters of the corresponding dosing section, and the corresponding contribution concentration as a first training data, and pre-collect Q groups of first training data, Q being a positive integer greater than 1; Use the long short-term memory network as the contribution concentration prediction model, use the first training data to train the contribution concentration prediction model, take the wax inhibitor dosing rate and the comprehensive parameters of the corresponding dosing section as the input of the contribution concentration prediction model, and take the contribution concentration as the output of the contribution concentration prediction model, use the stochastic gradient descent method, adjust the weight and bias of the contribution concentration prediction model through the back propagation algorithm, so as to minimize the error between the prediction result of the contribution concentration prediction model and the actual result, set the loss function, the loss function is mean square error, when the loss function value reaches convergence, stop training the contribution concentration prediction model, and take the contribution concentration prediction model corresponding to the loss function value reaching convergence as the trained contribution concentration prediction model.
2. The method for automatically regulating and controlling the dosing of oil wells according to claim 1, characterized in that, The method for outputting M continuous dosing sections 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 result, obtain the spatial position coordinates of the corresponding data points, and judge whether they are continuous in space. If the data points with the same cluster label have discontinuity in space, the breakpoint is divided into multiple sub-dosing sections, so that each sub-dosing section is a continuous interval along the conveying direction of the oil pipeline; A pre-set length threshold is provided. When the length of a sub-dosing section is less than the pre-set length threshold, and the cluster labels of the sub-dosing section and its adjacent sections on both sides are consistent, the sub-dosing section is directly merged. When the cluster labels of the adjacent sections on both sides are different, the sub-dosing section is merged into the adjacent section 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, thereby obtaining M continuous dosing sections, and the dosing sections are sequentially marked as the first dosing section, the second dosing section, …, and the Mth dosing section according to the conveying direction of the oil pipeline.
3. The method of claim 1, wherein the method comprises, The wax deposition characteristic parameters include the flow rate, pressure, oil body temperature and crude oil wax content of the first dosing section.
4. The method for automatically regulating and controlling the dosing of 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 output first dosing section includes: Obtain the wax inhibitor concentration requirement, pipe section parameters and oil body parameters of the first dosing section, the pipe section parameters including pipe section length and inner diameter, and the oil body parameters including oil body flow rate, oil body temperature and pressure; Calculate the required wax inhibitor dosing rate according to the pipe section parameters and oil body parameters of the first dosing section, and combine the concentration requirement, so that the added medicament can be fully mixed in the pipeline and reach the target concentration; Take the calculated wax inhibitor dosing rate as the control instruction to drive the dosing device of the first dosing section, including the injection pump and the metering valve, and adjust the wax inhibitor dosing rate.
5. The method of claim 4, wherein the method comprises, The method for calculating the required wax inhibitor dosing rate by combining the concentration requirement includes: According to the length of the pipe section of the first dosing section and the inner diameter Calculate the volume of the pipe section of the first dosing section ; Calculate the required total dosing amount according to the wax inhibitor concentration requirement and the pipe section volume; Obtain the average residence time of the oil body in the pipe section of the first dosing section; Calculate the wax inhibitor dosing rate based on the required total dosing amount and the average residence time.
6. The method for automatically regulating and controlling the dosing of oil wells according to claim 1, characterized in that, The method for generating the Sth dosing section dosing instruction comprises: A difference threshold is preset, a concentration difference between the wax inhibitor concentration requirement of the Sth dosing section 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 of the Sth dosing section is generated, the concentration difference is obtained, the concentration difference is marked as the wax inhibitor concentration correction requirement of the Sth dosing section, and the wax inhibitor dosing rate of the dosing device is controlled based on the output wax inhibitor concentration correction requirement of the Sth dosing section.
7. An automatic oil well regulating and dosing system for implementing the method of any one of claims 1 to 6, characterized in that, The dosing system comprises: 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 medicated section division module divides all data points into clusters to obtain category labels of all data points Based on the obtained category label sequence, the medicated sections are connected in spatial order, and M medicated sections that are continuous in space are output. The first dosing module collects the wax deposition characteristic parameters of the first dosing section along the conveying direction of the oil pipeline, inputs the obtained wax deposition characteristic parameters into the pre-constructed wax inhibitor concentration requirement prediction model, outputs the wax inhibitor concentration requirement of the first dosing section, and controls the wax inhibitor dosing rate of the dosing device based on the output wax inhibitor concentration requirement of the first dosing section; The data processing module obtains the wax deposition characteristic parameters of the Sth dosing section, S∈M, inputs the wax deposition characteristic parameters of the Sth dosing section into the pre-constructed wax inhibitor concentration requirement prediction model, and outputs the wax inhibitor concentration requirement of the Sth dosing section; The data analysis module obtains the wax inhibitor dosing rates of the first to S-1th dosing sections, obtains the comprehensive natural contribution concentration of the Sth dosing section based on the actual wax inhibitor dosing rates of the first to S-1th dosing sections; The second dosing module compares and analyzes the comprehensive natural contribution concentration and the wax inhibitor concentration requirement of the Sth dosing section, and generates the dosing instruction of the Sth dosing section.
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