Intelligent dosing method and dosing system for oilfield produced water based on LSTM (Long Short Term Memory)
The LSTM-based intelligent dosing system solves the problem of poor adaptability to changes in produced water quality in oilfield treatment, enabling real-time monitoring and intelligent control, improving treatment efficiency and equipment lifespan, and reducing costs.
Patent Information
- Application Number
- CN202511681778.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-13
AI Technical Summary
Existing oilfield produced water treatment processes are ill-suited to the complex changes in water quality, resulting in substandard treatment, which affects reinjection effectiveness. Furthermore, they rely on manual experience to adjust chemical dosing parameters, leading to slow response and high costs.
An intelligent dosing method based on LSTM is adopted. Real-time parameters are acquired through sensors, normalized, and temporal features are extracted. A two-layer LSTM network is then used for dosing prediction and control.
It enables real-time monitoring of water quality changes and intelligent control of reagents, improving treatment efficiency, reducing reagent consumption, extending equipment life, and achieving green development and water resource recycling.
Smart Images

Figure CN121525964A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of oilfield produced water, in particular to an intelligent dosing method and system for oilfield produced water based on LSTM. BACKGROUND
[0002] In oil exploitation activities, oilfield produced water refers to a special water body containing various impurities produced from the ground along with crude oil in the process of crude oil exploitation. The main sources of produced water are two parts: one is the original formation water in the reservoir, and the other is the external source water injected into the formation through water injection process to improve the recovery of crude oil, such as surface water, groundwater, and purified sewage after treatment of produced water, etc. These injected water is mixed with crude oil in the complex geological reservoir environment for a long time, and finally is co-produced to the ground in the exploitation process. From the water quality characteristics, oilfield produced water takes formation water and injected water as the matrix, contains crude oil, formation sand and impurities, other complex high molecular organic matter, and also dissolves a large amount of inorganic salts such as sodium chloride, calcium chloride, magnesium chloride, etc. The salinity is generally high, usually up to several to hundreds of thousands of milligrams per liter. This complex water quality not only causes the dissolved oxygen, hydrogen sulfide, carbon dioxide and other gases in the water to have a strong electrochemical corrosion effect on metal equipment and pipelines, but also causes the calcium, magnesium ions to form calcium carbonate, calcium sulfate and other scale under the conditions of temperature, pressure change or chemical reaction, which seriously affects the treatment effect and service life of equipment and facilities, and increases the operation and maintenance cost. With the development of oilfield into the middle and later stages, the reservoir pressure continues to decline, and the formation water gradually invades the oil reservoir and forms a mixed fluid with the crude oil, which is produced. In addition, water flooding development process is widely used in global oilfields to maintain production capacity, resulting in a sharp increase in the production of produced water. Especially for low-permeability, ultra-low-permeability and other "difficult-to-use" oil reservoirs, due to the extremely low permeability of the reservoir and the low water flooding efficiency, some oil reservoirs have entered the high water cut development stage with a comprehensive water cut of more than 80%, showing a serious situation of "more water and less oil", which is even described as "fishing oil from water" in the industry.
[0003] This development feature makes the actual water quality (such as oil content, suspended solids, and corrosive ion concentration) and water volume of produced water deviate significantly from the early design scheme, and the traditional treatment process is difficult to adapt to the complex changes in water quality, resulting in substandard water quality after treatment, affecting the effect of reinjection into the formation, and further adversely affecting the long-term development of the oil reservoir. At the same time, with the expansion of oilfield exploitation scale and the increase of development years, the water quality of produced water is becoming more and more complex year by year due to changes in formation lithology and injection of chemical agents, while the existing treatment process still relies on manual experience to adjust the dosing parameters, which has problems such as response lag, insufficient precision, and high treatment cost. SUMMARY
[0004] In order to solve the problems existing in the background art, the present application provides an intelligent dosing method and system for oilfield produced water based on LSTM.
[0005] An intelligent dosing method for oilfield produced water based on LSTM, comprising the steps of:
[0006] S100, obtaining historical data and real-time parameters of produced water;
[0007] S200, normalizing the real-time parameters and extracting time sequence features;
[0008] S300, inputting the time sequence features into a double-layer LSTM network trained stably, and dynamically predicting the dosing amount through the double-layer LSTM network;
[0009] S400, dosing amount control or early warning according to the predicted dosing amount.
[0010] Based on the above, in step S100, real-time parameters are obtained through various sensors, and the real-time parameters at least include flow parameters, temperature parameters, oil content parameters, turbidity parameters and PH value parameters of produced water.
[0011] Based on the above, in step S200, the normalization processing formula is:
[0012]
[0013] wherein, is the historical data set, is the d-dimensional sensor data at the t-th moment, is the normalized data.
[0014] Based on the above, in step S200, the time sequence features at least include a change rate feature, a periodic trend feature and a final characteristic vector, and the change rate feature is:
[0015]
[0016] wherein, L is the backtracking length, and k is the cycle index variable;
[0017] The periodic trend feature is:
[0018]
[0019] The final characteristic vector is defined as:
[0020] .
[0021] Based on the above, in step S300, it includes the following steps:
[0022] S310, inputting the time sequence features into the input layer of the double-layer LSTM network trained stably;
[0023] S320, performing an output operation through an output layer of the LSTM network;
[0024] S330, performing mean square error calculation on the output of the output layer;
[0025] S340, updating the cell state of the LSTM network according to the calculation result;
[0026] S350, updating the hidden layer matrix and the weight matrix of the LSTM network, and recalculating the hidden layer and the output layer output;
[0027] S360, after updating the hidden layer matrix and the weight matrix of the LSTM network again, determining whether a termination condition is met;
[0028] S370, if yes, outputting the predicted dosing amount; otherwise, repeating steps S340-S360.
[0029] Based on the above, the input sequence of the LSTM network is:
[0030]
[0031] The hidden state is:
[0032]
[0033] The cell state is:
[0034]
[0035] The output sequence is:
[0036]
[0037] Wherein, T is the total time step of the sequence input, H is the hidden state set; h is the hidden state vector; C is the cell state set; c is the cell state vector.
[0038] Based on the above, in the LSTM network, each time step is:
[0039]
[0040] The input gate in the gating unit calculation is:
[0041]
[0042] The forget gate is:
[0043]
[0044] The output gate is:
[0045]
[0046] wherein, sigma(·) is a sigmoid activation function, [·,·] represents vector splicing, is a weight matrix, is a bias vector; is an input gate, is a candidate cell state, and tanh() is a hyperbolic tangent activation function.
[0047] Based on the above, the cell state is updated as:
[0048]
[0049] The hidden state is calculated as:
[0050]
[0051] wherein represents element-wise multiplication, is a memory cell state.
[0052] Based on the above, the output layer in the LSTM network is:
[0053]
[0054] wherein is an output weight matrix, is an output bias vector, is a second layer hidden function.
[0055] An intelligent dosing system for oilfield produced water based on LSTM includes a sensor, a processor, a storage device, and a computer program stored on the storage device and executable on the processor, the sensor is used to collect real-time parameters of produced water, and the processor implements any one of the above intelligent dosing methods for oilfield produced water based on LSTM when the computer program is executed.
[0056] The present application has outstanding substantial characteristics and significant progress compared with the prior art. Specifically, the present application predicts the dosing amount through the LSTM network model according to the change trend of the key characteristic indexes in the real-time parameters of the oilfield produced water, thereby comprehensively optimizing the reaction time, the reagent ratio, and the equipment operation parameters of the existing treatment process, realizing real-time monitoring of water quality changes and intelligent control of reagent addition, which not only improves the treatment efficiency and guarantees the quality of the reinjection water, but also reduces reagent consumption, improves the service life of equipment and facilities, realizes green development of oilfields, water resource recycling, and sustainable development. BRIEF DESCRIPTION OF DRAWINGS
[0057] Figure 1 is a flowchart of the present application. Detailed Implementation
[0058] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0059] like Figure 1 As shown, an intelligent chemical dosing method for oilfield produced water based on LSTM includes the following steps: S100, acquiring historical data and real-time parameters of produced water; S200, normalizing the real-time parameters and extracting temporal features; S300, inputting the temporal features into a trained and stable two-layer LSTM network, and dynamically predicting the dosage through the two-layer LSTM network; S400, controlling or issuing early warnings for the dosage based on the predicted dosage.
[0060] Specifically, taking produced water from an oilfield as an example, sensor data is collected every 10 seconds via a PLC to ensure real-time performance. Historical data is taken from the past 6 months of operation. It should be noted that real-time parameters are normalized before storage and used as subsequent historical data. Table 1 below shows an example of real-time parameters collected over a 90-second time period:
[0061]
[0062] Table 1
[0063] After collecting real-time parameters, the parameters are normalized using the following formula:
[0064]
[0065] in, For historical datasets, For the d-dimensional sensor data at time t, This is the normalized data. Taking the traffic flow in Table 1 above as an example:
[0066]
[0067] The normalized real-time parameters are used for temporal feature extraction. The practical window definition for temporal feature extraction is as follows:
[0068]
[0069] wherein L is a backtracking length. In this embodiment, the time series features include at least a rate of change feature, a periodic trend feature, and a final feature vector, the rate of change feature being:
[0070]
[0071] wherein L is a backtracking length, and k is a cycle index variable;
[0072] the periodic trend feature being:
[0073]
[0074] the final feature vector being defined as:
[0075] .
[0076] In this embodiment, a double-layer LSTM network is used in constructing the dynamic prediction model, and the first layer (64 units) of the LSTM structure in the LSTM network structure parameters is:
[0077]
[0078] the second layer structure (32 units) being:
[0079]
[0080] the output layer being:
[0081]
[0082] wherein W is an output weight matrix, is an output bias vector, is a second layer hidden function.
[0083] After the time series features are extracted, the dosing amount is predicted through the LSTM network model, and the specific steps are as follows: S310, inputting the time series features into the input layer of the double-layer LSTM network which is stable in training; S320, performing an output operation through the output layer of the LSTM network; S330, performing a mean square error calculation on the output of the output layer; S340, updating the cell state of the LSTM network according to the calculation result; S350, updating the hidden layer matrix and weight matrix of the LSTM network, and recalculating the output of the hidden layer and the output layer; S360, after updating the hidden layer matrix and weight matrix of the LSTM network again, determining whether a termination condition is met; S370, if yes, outputting the predicted dosing amount; otherwise, repeating steps S340-S360.
[0084] In this embodiment, the input sequence of the LSTM network is:
[0085]
[0086] The hidden state is:
[0087]
[0088] The cell state is:
[0089]
[0090] The output sequence is:
[0091]
[0092] where T is the total time step of the sequence input, H is the hidden state set; h is the hidden state vector; C is the cell state set; c is the cell state vector.
[0093] In the LSTM network, each time step is:
[0094]
[0095] The input gate in the gating unit calculation is:
[0096]
[0097] The forget gate is:
[0098]
[0099] The output gate is:
[0100]
[0101] where σ(·) is the sigmoid activation function, [·,·] represents vector splicing, is the weight matrix, is the bias vector; is the input gate, is the candidate cell state, tanh() is the hyperbolic tangent activation function.
[0102] The cell state update is:
[0103]
[0104] The hidden state calculation is:
[0105]
[0106] where represents element-wise multiplication, is the memory cell state.
[0107] The mean square error loss function of the training target function is defined as:
[0108]
[0109] is the true value; is the predicted value; Loss represents the loss function.
[0110] In this embodiment, the training parameters are set as shown in Table 2 below:
[0111]
[0112] Table 2
[0113] After the produced water collection real-time parameters (one of the small data in Table 1) are predicted by the LSTM network prediction model, the predicted parameter results of the produced water are as shown in Table 3 below:
[0114]
[0115] Table 3
[0116] Based on the linear regression model, the prediction of the chemical dosage is:
[0117]
[0118] In this embodiment, the trained weight parameters are: , , , b = 3. Then according to Table 3, it is calculated that: That is, the output is 20.15 mL / min of chemical dosage instruction. Under certain flow rate and temperature, the chemical dosage is finally only related to PH, turbidity and oil content, and the flow rate and temperature parameters are indispensable for constructing a robust and intelligent prediction system. The flow rate is mainly used to evaluate the processing load and calculate the final absolute chemical dosage control instruction, and the temperature is used as a key correction variable affecting the chemical reaction efficiency and the properties of substances. When the flow rate starts to rise, even if the current pH and turbidity have not changed, the model can predict that more chemicals are needed in the next few minutes; when the temperature decreases, the model will appropriately increase the chemical dosage to compensate for the decrease in reaction rate.
[0119] In reality, when the chemical dosage control is performed according to the prediction results, the chemical dosage control strategy is also needed. In this embodiment, the chemical dosage control strategy is as shown in Table 4 below:
[0120]
[0121] Table 4
[0122] In order to test the accuracy of the prediction, a period of time when the emergency chemical dosage mode is triggered is selected, as shown in Table 5 below:
[0123]
[0124] Table 5
[0125] The verification results are shown in Table 6 as follows:
[0126]
[0127] Table 6
[0128] As can be seen from the above Table 6, the various parameters of the prediction model are all around 0.9, indicating that the prediction model can accurately achieve prediction.
[0129] This embodiment fully demonstrates the whole process from data collection to control execution, and embodies the application value of the algorithm in the actual industrial scene. It is proved that the model has high accuracy, improves the flexibility of the process, improves the processing efficiency, reduces the amount of chemicals used, thereby saving the processing cost. And has the following advantages: can predict the water quality change trend 10 minutes in advance, automatically adjusts the amount of dosing (saves about 25% of chemical consumption), multi-mode intelligent switching to deal with different working conditions, real-time monitoring and abnormal processing ability.
[0130] The embodiment also provides an intelligent dosing system for oilfield produced water based on an LSTM, which comprises a sensor, a processor, a storage device, and a computer program stored on the storage device and capable of running on the processor, the sensor is used to collect real-time parameters of the produced water, and the processor implements any intelligent dosing method for oilfield produced water based on an LSTM described above when the computer program is executed.
[0131] It is apparent for those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and the present application can be implemented in other concrete forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present application is defined by the appended claims rather than the above description, and all changes falling within the meaning and range of the equivalent elements of the claims are intended to be included in the present application. Any reference signs in the claims should not be regarded as limiting the claims involved.
Claims
1. A smart chemical dosing method for oilfield produced water based on LSTM, characterized in that, Including the following steps: S100: Obtain historical data and real-time parameters of the produced water; S200, Normalize the real-time parameters and extract temporal features; S300. Input the time-series features into a trained and stable two-layer LSTM network, and use the two-layer LSTM network to dynamically predict the dosage. S400. Control or warn about the dosage of pesticides based on the predicted dosage.
2. The intelligent chemical dosing method for oilfield produced water based on LSTM according to claim 1, characterized in that: In step S100, real-time parameters are acquired through multiple sensors. These real-time parameters include at least the flow rate, temperature, oil content, turbidity, and pH of the extracted water.
3. The intelligent chemical dosing method for oilfield produced water based on LSTM according to claim 1, characterized in that: In step S200, the normalization formula is: in, For historical datasets, For the d-dimensional sensor data at time t, This is the normalized data.
4. The intelligent chemical dosing method for oilfield produced water based on LSTM according to claim 1, characterized in that: In step S200, the time-series features include at least the rate of change feature, the periodic trend feature, and the final characteristic vector, wherein the rate of change feature is: Where L is the backtracking length and k is the loop index variable; The cyclical trend characteristics are: The final feature vector is defined as: 。 5. The intelligent chemical dosing method for oilfield produced water based on LSTM according to claim 1, characterized in that, Step S300 includes the following steps: S310. Input the time-series features into the input layer of a trained and stable two-layer LSTM network; S320. Perform an output operation through the output layer of the LSTM network; S330, Calculate the mean square error of the output layer; S340. Update the cell state of the LSTM network based on the calculation results; S350. Update the hidden layer matrix and weight matrix of the LSTM network, and recalculate the hidden layer and output layer outputs. S360. After updating the hidden layer matrix and weight matrix of the LSTM network again, determine whether the termination condition is met. S370, If yes, output the predicted dosage; Otherwise, repeat steps S340-S360.
6. The intelligent chemical dosing method for oilfield produced water based on LSTM according to claim 5, characterized in that: The input sequence for the LSTM network is: The hidden state is: The cell state is as follows: The output sequence is: Where T is the total time step of the sequence input, H is the set of hidden states, h is the hidden state vector, C is the set of cell states, and c is the cell state vector.
7. The intelligent chemical dosing method for oilfield produced water based on LSTM according to claim 5, characterized in that: In an LSTM network, each time step is: The input gate in the gate control unit calculation is: The Gate of Oblivion is: The output gate is: Where σ(·) is the sigmoid activation function, and [·,·] denotes vector concatenation. This is the weight matrix. It is the bias vector; For input gate, The candidate cell state is represented by tanh(), which is the hyperbolic tangent activation function.
8. The intelligent chemical dosing method for oilfield produced water based on LSTM according to claim 5, characterized in that: Cell status updated to: The hidden state is calculated as follows: in This indicates element-wise multiplication. This refers to the state of memory cells.
9. The intelligent chemical dosing method for oilfield produced water based on LSTM according to claim 5, characterized in that: The output layer in an LSTM network is: in To output the weight matrix, To output the bias vector, This is the second layer of hidden functions.
10. An intelligent chemical dosing system for oilfield produced water based on LSTM, comprising a sensor, a processor, a storage device, and a computer program stored on the storage device and executable on the processor, wherein the sensor is used to collect real-time parameters of the produced water, characterized in that: When the processor executes the computer program, it implements any one of the LSTM-based intelligent chemical dosing methods for oilfield produced water according to claims 1 to 9.