Intelligent dosing control method based on hyperspectral analysis

The intelligent dosing control method based on hyperspectral analysis combined with BP neural network and LSTM model solves the problem of real-time adjustment of dosing amount in traditional oilfield produced water treatment equipment, realizes refined management and optimized use of chemicals, and improves treatment efficiency and quality.

CN120544735BActive Publication Date: 2025-10-14SOUTHWEST PETROLEUM UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511017513.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-23
Publication Date
2025-10-14
Estimated Expiration
2045-07-23

AI Technical Summary

Technical Problem

The dosing process of traditional oilfield produced water treatment equipment cannot adjust the dosage according to real-time water quality parameters, resulting in waste of chemicals or poor treatment effects.

Method used

An intelligent dosing control method based on hyperspectral analysis is adopted. The hyperspectral analyzer is used to collect water quality parameters in real time. Combined with the BP neural network and LSTM model optimized by stochastic gradient descent, the dosage of dosing is automatically adjusted to achieve refined management.

Benefits of technology

It realizes intelligent adjustment of dosage according to real-time water quality parameters, reduces waste of chemicals, optimizes treatment effects and reduces treatment costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120544735B_ABST
    Figure CN120544735B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of intelligent dosing control method based on hyperspectral analysis, belong to oilfield produced water treatment technical field.The present application discloses a kind of intelligent dosing control method based on hyperspectral analysis, including using hyperspectral analyzer to measure the absorbance data in storage tank and oilfield reinjection water storage tank;The concentration data of each substance is calculated;Real-time dosing amount is obtained based on the BP neural network algorithm of random gradient descent optimization;LSTM model is used to output dosing amount;The input deviation is compared with the set threshold value, and the dosing amount is determined;According to prior distribution and evaluation result, the posterior distribution of parameter is constructed, new parameter combination is selected from the posterior distribution to evaluate, the posterior distribution is updated until the optimal parameter combination that meets performance requirement is found.The present application can intelligently adjust dosing amount according to the water quality parameter that hyperspectral analyzer is collected in real time, to improve the efficiency and quality of oilfield produced water treatment, reduce reagent waste, reduce processing cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an intelligent drug dosing control method based on hyperspectral analysis, and belongs to the technical field of oilfield produced water treatment. Background Art

[0002] In oil fields that utilize water injection, the water returned to the surface along with the crude oil through the production wells. The water removed from the crude oil is called produced water. Oilfield produced water treatment equipment processes the produced water through sedimentation, dosing, and filtration, allowing the treated water to be reinjected into the production wells.

[0003] Traditional oilfield produced water treatment equipment uses chemical calibration to test and calibrate the water quality, then sets a fixed dosage based on manual experience. This approach not only fails to adjust dosage based on real-time water quality parameters, but also results in a long water quality parameter calculation cycle and easily leads to wasteful treatment or poor treatment results. Summary of the Invention

[0004] The purpose of the present invention is to address the problems existing in the prior art and provide an intelligent dosing control method based on hyperspectral analysis. This method can intelligently adjust the dosage of the drug according to the water quality parameters collected in real time by the hyperspectral analyzer, so as to improve the efficiency and quality of oilfield produced water treatment, reduce drug waste, and reduce treatment costs.

[0005] The present invention solves the above technical problems by providing a technical solution: an intelligent dosing control method based on hyperspectral analysis, comprising the following steps:

[0006] Step S1: Use a hyperspectral analyzer to measure the real-time absorbance data A1 in the storage tank, and use the hyperspectral analyzer to record the absorbance data A1 from time t0+ΔT to interval T. a The absorbance data A2 in the oilfield injection water storage tank is measured at the time of t0, and the flow meter is used to measure the interval T from time t0. a The time at T a Dosage added O a ;

[0007] Step S2: Calculate the concentration data C of each substance in the sedimentation tank and the oilfield reinjection water storage tank based on the absorbance data A1 in the storage tank and the absorbance data A2 in the oilfield reinjection water storage tank. i1 、C i2 ;

[0008] Step S3: The concentration data C of each substance in the sedimentation tank i1 , imported into the BP neural network algorithm based on stochastic gradient descent optimization to obtain the real-time dosage O p1 ;

[0009] Step S4, the dosing amount O a and the concentration data C of each substance in the oilfield reinjection water storage tank i2 is imported into the LSTM model trained using the historical data in the previous time period, and the model will output the dosing amount prediction value O in the future period p2 ;

[0010] Step S5, the concentration data C of each substance in the oilfield reinjection water storage tank i2 is input into the target water quality index data to obtain an input deviation, and the input deviation is compared with a set threshold value, when the input deviation is greater than the set threshold value, the dosing amount pumped by the dosing pump is O p1 ; when the input deviation is less than the set threshold value, the dosing amount pumped by the dosing pump is O p2 ;

[0011] Step S6, the parameter performance of the algorithm is indirectly evaluated by comparing the objective function value, and then the posterior distribution of the parameters is constructed according to the prior distribution and the evaluation result, a new parameter combination is selected from the posterior distribution for evaluation, the objective function value is recorded, the new evaluation result is added to the posterior distribution, and the posterior distribution is updated until the optimal parameter combination meeting the performance requirement is found.

[0012] Further, in step S2, the collected absorbance data is first subjected to outlier processing, and then the concentration data C i1 , C i2 of each substance in the settling tank and the oilfield reinjection water storage tank is calculated by using the regression model.

[0013] Further, the regression model is:

[0014]

[0015] In the formula, A is the absorbance, B is the bias data, k i is the absorbance proportionality coefficient of each substance, e i is the molar absorption coefficient of the first substance, i i is the concentration of the first substance, C i is the light path length. l

[0016] Further, the specific process of step S3 includes:

[0017] Step S31, the concentration data C i1 of each substance in the settling tank is normalized;

[0018] ​​Step S32: Set the input and output of the neural network, determine the number of input layer nodes 4, the number of output layer nodes 6, the connection weights between the input layer and the hidden layer , and the connection weights between the hidden layer and the output layer , the threshold b of the hidden layer j , the threshold b of the output layer k ;

[0019] Step S33: setting an empirical index for a substance concentration higher than a standard qualified index, and using the objective function to evaluate the error between the treated water quality and the empirical standard;

[0020] Step S34: forward propagate the input data through the neural network to calculate the output of the hidden layer;

[0021] Step S35: Based on the output of the hidden layer and the connection weights between the hidden layer and the output layer and the threshold b of the output layer k , get the output value of the output layer of the BP neural network ;

[0022] Step S36: updating the parameters of the neural network using the stochastic gradient descent method according to the calculated objective function value of the neural network and the set learning rate;

[0023] Step S37: Calculate the target function value Error of the BP neural network in the current iteration step. If the Error of N consecutive iterations is less than the preset error threshold, e , or the maximum number of iterations M is reached, the training is terminated; otherwise, the training returns to step S32 to continue iterating;

[0024] Step S38: Denormalize the prediction results to obtain the dosage of each agent. p1 .

[0025] A further technical solution is that the objective function in step S33 is:

[0026]

[0027] Where: y i The quality of the treated water is i concentration index; y i ∗ It is the setting i The empirical concentration of each indicator; n is the total number of water quality concentration indicators; Error is the objective function.

[0028] A further technical solution is that the weight updating formula in the step S36 is:

[0029]

[0030] wherein: Q t is an updated parameter, Q t-1 is a previous parameter: is a gradient of the objective function with respect to the parameter;

[0031] is a gradient of the objective function with respect to the parameter; or is a learning rate.

[0032] A further technical solution is that the step S4 has the following specific process:

[0033] In the step S41, the dosing amount O a and the concentration data C i2 of each substance in the oilfield reinjection water storage tank are associated and combined into a 10-dimensional vector U t , and normalized.

[0034] In the step S42, an LSTM unit with a two-layer structure is used to control information flow through input gates, forget gates and output gates, and capture long-term dependencies in time series.

[0035] In the step S43, the output h t (1) of the first layer is taken as the input of the second layer, and the output ht (2) of the second layer is mapped to the predicted dosing amount O p2 .

[0036] A further technical solution is that the step S42 sets the forward propagation function as:

[0037]

[0038]

[0039]

[0040]

[0041] wherein: is the output of the forget gate; s is a Sigmoid activation function; W f is a weight matrix of the forget gate, b f is a bias term of the forget gate; i t is an activation value of the input gate;W i and W c is the weight matrix of the input gate and candidate state; b i and b c is the bias term between the input gate and the candidate state; O t is the activation value of the output gate; h t is the hidden state of the current time step; h t-1 is the hidden state of the previous time step; W o is the weight matrix of the output gate; b o is the bias term of the output gate; C t is the cell state at the current time step; C t−1 is the cell state at the previous time step; is a normalized vector.

[0042] A further technical solution is that the specific process of step S6 includes:

[0043] Step S61, select the BP neural network learning rate, the number of BP neural network hidden layer nodes, the input sequence length of LSTM and the sampling interval time T a , the number of LSTM units and the interval T starting from time t0+ΔT a The concentration data of each substance in the oilfield injection water storage tank is measured at the time C i2 and interval T starting from time t0 a The value range of these five parameters is the delay time ΔT between the dosages within the time Ta, and the matrix θ is formed by using these five parameters. t ;

[0044] Step S62: Setting the target function J ( i ) is used to evaluate the performance of the entire dosing control system and is defined as a comprehensive indicator of processing time and drug consumption;

[0045] Step S63: Randomly select several parameter combinations within the set value range. , run in the dosing control system and record the corresponding objective function value ;

[0046] Step S64: By comparing the objective function value J ( i ) indirectly evaluates array θ tAccording to the prior distribution and the evaluation result, a posterior distribution of the parameters is constructed, and a new parameter combination is selected from the posterior distribution Evaluation is performed, and the objective function value is recorded The new evaluation result is added to the posterior distribution, and the posterior distribution is updated

[0047] Steps S63 and S64 are repeated to find the optimal parameter combination that meets the performance requirement, and the optimal parameter combination is set to the parameters of the BP neural network model and the LSTM model

[0048] The parameter combination is set to the parameters of the BP neural network model and the LSTM model.

[0049] Further, the objective function in step S62 is J ( i ) is:

[0050]

[0051] In the formula: T is the time when the water quality reaches the qualified index under the parameter setting in the array θ t s , O is the total amount of medicine used under the parameter setting in the array θ t s ; α 、 β is a weight coefficient.

[0052] The beneficial effects of the present application are as follows: The intelligent dosing control method based on hyperspectral analysis can automatically adjust the amount of medicine pumped by the dosing plunger through real-time collection of absorbance data, achieving intelligent and fine management of dosing, reducing the amount of medicine used, and optimizing the lag problem existing in the detection principle of traditional intelligent dosing equipment. BRIEF DESCRIPTION OF DRAWINGS

[0053] Figure 1 A simple process flowchart of the operation of the oilfield produced water treatment equipment

[0054] Figure 2 The overall control flowchart of the present application

[0055] Figure 3 The topological structure diagram of the fast tuning ring BP neural network model

[0056] Figure 4 The BP neural network model establishment process diagram

[0057] Figure 5 The adaptive parameter setting ring Bayesian optimization model establishment process diagram ​​DETAILED DESCRIPTION

[0058] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present invention.

[0059] In oil fields that use water injection for production, the water injected into these oil fields returns to the ground along with the crude oil through the oil wells. This water is removed before the crude oil is shipped out. The water removed from the crude oil is the water entering the produced water treatment equipment of a certain production plant involved in this invention.

[0060] like Figure 1 As shown, according to the direction of water flow, the oilfield produced water treatment equipment includes a sedimentation tank, a gravity sedimentation tank and a gravity adjustment tank, a coagulation tank, a filter buffer tank, a backwash water recovery tank, and an oilfield reinjection water storage tank. The sedimentation tank stores produced water separated from the crude oil processing process. The water treatment process system draws water from the upper position of the sedimentation tank, mixes it with scale inhibitors and corrosion inhibitors, and then enters the sedimentation / adjustment tank for gravity sedimentation. The sedimentation pipe draws water from a high position, and the adjustment tank draws water from a low position and adds a catalyst. After being fully mixed with coagulants and water purifiers in the vortex reactor group, it enters the reaction tank for reaction. It then enters the coagulation tank for further coagulation. Water is drawn from a high position and enters the filter buffer tank and backwash water recovery tank. The backwash water is used to backwash and clean the water treatment equipment. The water in the buffer tank enters the double-filter filter room and is mixed with sodium hypochlorite for sterilization. After sterilization, the water can be sent to the oilfield reinjection water storage tank for oilfield reinjection.

[0061] The intelligent dosing control method based on hyperspectral analysis provided by the present invention mainly acts on the treatment tank of oilfield produced water equipment and the oilfield reinjection water storage tank. The system has the characteristics of accurately predicting the amount of dosing during sewage treatment and accurately controlling the amount of dosing pumped in by the dosing plunger.

[0062] The intelligent dosing control method based on hyperspectral analysis includes a fast adjustment loop, a slow adjustment loop, and an adaptive parameter setting loop;

[0063] For the fast adjustment loop, the sampling period of its input data is in milliseconds, which is used to quickly reduce the concentration of substances in the treatment tank and the oilfield reinjection water storage tank. Its input is the real-time substance concentration in the treatment tank obtained by the absorbance data of the hyperspectral analyzer, and the output is the predicted dosage. p1 , the feedback is the real-time concentration of the substance in the treatment tank;

[0064] For the slow adjustment loop, the sampling period of its input data is minute-level. It is used to fine-tune the concentration of the substance in the oilfield reinjection water storage tank when the concentration is close to the qualified index. Its input is the concentration of the substance in the oilfield reinjection water storage tank at the time interval obtained by the absorbance data of the hyperspectral analyzer, and the output is the predicted dosage. p2 , the feedback is the substance concentration in the oilfield reinjection water storage tank;

[0065] For the adaptive parameter tuning loop, the parameter adjustment cycle of the algorithm is at the hour level, based on the time T when the oilfield produced water quality reaches the qualified index. s The weighted value of the total amount of medicine used is obtained by weighted calculation, and then the optimal algorithm parameters and the delayed sampling time ΔT of the slow adjustment loop are selected, and the optimized algorithm parameters and the delayed sampling time ΔT of the slow adjustment loop are fed back to the control system.

[0066] like Figure 2 As shown, the present invention provides an intelligent dosing control method based on hyperspectral analysis, comprising the following steps:

[0067] Step S1: Use a hyperspectral analyzer to measure the real-time absorbance data A1 in the storage tank, and use the hyperspectral analyzer to record the absorbance data A1 from time t0+ΔT to interval T. a The absorbance data A2 in the oilfield injection water storage tank is measured at the time of t0, and the flow meter is used to measure the interval T from time t0. a The time at T a Dosage added O a ;

[0068] Step S2: Calculate the concentration data C of each substance in the sedimentation tank and the oilfield reinjection water storage tank based on the absorbance data A1 in the storage tank and the absorbance data A2 in the oilfield reinjection water storage tank. i1 、C i2 ;

[0069] First, the collected absorbance data is processed for outliers to obtain the cleaned absorbance; then, using the regression model, the absorbance data A1 and A2 are used to reversely calculate the concentrations C of suspended solids, oil content, chemical oxygen demand (COD), and biochemical oxygen demand (BOD) in the sedimentation tank and the oilfield reinjection water storage tank. i1 and C i2 ,

[0070] For the regression model, the formula is:

[0071] (1)

[0072] Where: A is absorbance; B is bias data; k iis the absorbance proportional coefficient of each substance; e i It is i The molar absorptivity of the substance; C i It is i The concentration of the substance; l is the optical path length;

[0073] For the establishment of the regression model, a large number of solutions with different substance concentrations are first prepared and the content of the four substances in each solution is measured using the chemical calibration method. Then, the bias data B and the absorbance proportional coefficient of the substance are obtained by combining formula (1), and finally the final regression model is obtained.

[0074] Step S3: The concentration data C of each substance in the sedimentation tank i1 , imported into the BP neural network algorithm based on stochastic gradient descent optimization to obtain the real-time dosage O p1 ;

[0075] For BP neural network models based on stochastic gradient descent (SGD) optimization (such as Figure 3 The establishment process of the neural network is to first train the BP neural network algorithm based on stochastic gradient descent (SGD) optimization through the original data, so that it can learn the mapping relationship between input (substance concentration in oilfield produced water) and output (predicted dosage of each agent). Figure 4 As shown, its construction includes the following processes:

[0076] Step S31: Concentration data C of each substance in the sedimentation tank i1 Perform normalization processing;

[0077] (2)

[0078] Where: x t is the original data, x min is the minimum value in the data set, x max is the maximum value in the data set; is the data after normalization;

[0079] Step S32: Combination Figure 3 The schematic diagram of the BP neural network establishment process is shown in the figure. The input of the neural network is set (normalized data ) and output (predicted dosage O p1 ) Determine the number of input layer nodes to be 4, the number of output layer nodes to be 6, and the connection weights between the input layer and the hidden layer , and the connection weights between the hidden layer and the output layer , the threshold b of the hidden layer j , the threshold b of the output layer k ;

[0080] Step S33: setting an empirical index for a substance concentration higher than a standard qualified index, and using the objective function to evaluate the error between the treated water quality and the empirical standard;

[0081] (3)

[0082] Where: y i The quality of the treated water is i concentration index; y i ∗ It is the setting i The empirical concentration of each indicator; n is the total number of water quality concentration indicators; Error is the objective function;

[0083] Step S34: forward propagate the input data through the neural network to calculate the output of the hidden layer;

[0084] Step S35: Based on the output of the hidden layer H j and the connection weights between the hidden layer and the output layer oh jk and the threshold b of the output layer k , get the output value of the output layer of the BP neural network y j ;

[0085] Step S36: Update the parameters of the neural network (the connection weights between the input layer and the hidden layer) using the stochastic gradient descent method according to the calculated objective function value of the neural network and the set learning rate. , the connection weights between the hidden layer and the output layer , the threshold value b of the network node j , b k );

[0086] (4)

[0087] Where: Q t is the updated parameter, Q t-1 The parameters for the previous time: is the gradient of the objective function with respect to the parameters; or is the learning rate;

[0088] Step S37: Calculate the target function value Error of the BP neural network in the current iteration step. If the Error of N consecutive iterations (N≥3, for example, N=5) is less than the preset error threshold, e ( e ≤0.01, e.g. e =0.005), or reaches the maximum number of iterations M (M≥1000, for example, M=2000), the training is terminated; otherwise, the process returns to step S32 to continue the iteration;

[0089] Step S38: Denormalize the prediction results to obtain the dosage Op1 of each drug.

[0090] Where P=1, 2, 3, 4, 5, 6, corresponding to coagulant aid, corrosion inhibitor, water purifier, scale inhibitor, catalyst, sodium hypochlorite bactericide respectively;

[0091] Step S4: Add the dosage O a and the concentration data of various substances in the oilfield reinjection water storage tank C i2 The association is imported into the LSTM model trained using the history of the previous time period, and the model will output the predicted value of the dosage in the future period O p2 ;

[0092] The LSTM model analyzes historical water quality parameters and dosing data of oilfield reinjection water storage tanks to capture long-term dependencies in the data and predict dosing rates over a period of time. The construction process includes the following:

[0093] Step S41: start from time t0+ΔT and wait for T a The concentration data of the substance in the oilfield injection water storage tank is measured at the time C i2 and interval T starting from time t0 a The time at time T a Total dosage data O a Associated and combined into a 10-dimensional vector U t ;

[0094] (5)

[0095] The data is normalized so that the internal data range is between [0,1], and the vector U is obtained. t * ;

[0096] Step S42: Use the two-layer LSTM unit to control the information flow through the input gate, forget gate, and output gate to capture the long-term dependency in the time series. Set the forward propagation function to:

[0097] (6)

[0098] (7)

[0099] (8)

[0100] (9)

[0101] Where: is the output of the forget gate; s is the Sigmoid activation function; W f is the weight matrix of the forget gate, b f is the bias term of the forget gate; i t is the activation value of the input gate; W i and W c is the weight matrix of the input gate and candidate state; b i and b c is the bias term between the input gate and the candidate state; O t is the activation value of the output gate; h t is the hidden state of the current time step; h t-1 is the hidden state of the previous time step; W o is the weight matrix of the output gate; b o is the bias term of the output gate; C t is the cell state at the current time step; C t−1 is the cell state at the previous time step; is a normalized vector;

[0102] Step S43: The output h of the first layer t (1) As the input of the second layer, the output of the second layer ht (2) Mapping to the predicted dosage O p2 ;

[0103] After the two-layer LSTM model is established through steps S41 to S42, the collected historical data can be used to predict the trend of substance concentration changes in the future time period, and the required amount of medicine to be added can be obtained based on the predicted trend of substance concentration changes.

[0104] The threshold ε of each substance concentration is set according to manual experiencei , using the concentration C of each substance in the oilfield reinjection water storage tank i2 and target water quality index y k1 ∗ The data gets the input deviation e c , e c With ε i For comparison, when e c Greater than ε i When the drug amount pumped by the dosing pump is Op1; when e c Less than ε i When , the amount of medicine pumped in by the dosing pump is Op2;

[0105] Step S5: Using the concentration data C of each substance in the oilfield reinjection water storage tank i2 The input deviation is obtained from the target water quality index data, and the input deviation is compared with the set threshold. When the input deviation is greater than the set threshold, the amount of dosing pump pumped in is 0 p1 When the input deviation is less than the set threshold, the amount of medicine pumped in by the dosing pump is 0 p2 ;

[0106] Step S6: indirectly evaluate the parameter performance of the algorithm by comparing the objective function value, then construct a posterior distribution of the parameters based on the prior distribution and the evaluation results, select a new parameter combination from the posterior distribution for evaluation, record the objective function value, add the new evaluation result to the posterior distribution, and update the posterior distribution until the optimal parameter combination that meets the performance requirements is found;

[0107] like Figure 5 As shown, the specific steps include:

[0108] Step S61, select the BP neural network learning rate, the number of BP neural network hidden layer nodes, the input sequence length of LSTM and the sampling interval time T a , the number of LSTM units and the interval T starting from time t0+ΔT a The concentration data of each substance in the oilfield injection water storage tank is measured at the time C i2 and interval T starting from time t0 a The value range of these five parameters is the delay time ΔT between the dosages within the time Ta, and the matrix θ is formed by using these five parameters. t ;

[0109] Step S62: Setting the target function J ( i ) is used to evaluate the performance of the entire dosing control system and is defined as a comprehensive indicator of processing time and drug consumption;

[0110] (10)

[0111] Where: For the array θ t The time T required for the water quality to reach the qualified index under the parameter settings in s , For the array θ t The total amount of medicine used is obtained by weighted calculation under the parameter settings in s ; α 、 β is the weight coefficient, which is used to balance the importance of different indicators;

[0112] Step S63: Randomly select several parameter combinations within the set value range. , run in the dosing control system and record the corresponding objective function value ;

[0113] Step S64: By comparing the objective function value J ( i ) indirectly evaluates array θ t The parameter performance in the posterior distribution of the parameters is constructed based on the prior distribution and evaluation results, and a new parameter combination is selected from the posterior distribution. Perform evaluation and record the objective function value , add the new evaluation results to the posterior distribution and update the posterior distribution;

[0114] Step S65: Repeat steps S63 and S64 to find the optimal parameter combination that meets the performance requirements, and set the parameter combination into the parameters of the BP neural network model and the LSTM model.

[0115] The above description does not limit the present invention in any form. Although the present invention has been disclosed through the above embodiments, it is not intended to limit the present invention. Any technician familiar with the profession can use the technical content disclosed above to make some changes or modifications to equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are within the scope of the technical solution of the present invention.

Claims

1. An intelligent dosing control method based on hyperspectral analysis, characterized in that: The following steps are involved: Step S1: Use a hyperspectral analyzer to measure the real-time absorbance data A1 in the storage tank, and use the hyperspectral analyzer to record the absorbance data A1 from time t0+ΔT to interval T. a The absorbance data A2 in the oilfield injection water storage tank is measured at the time of t0, and the flow meter is used to measure the interval T from time t0. a The time at T a Dosage added O a ; Step S2: Calculate the concentration data C of each substance in the sedimentation tank and the oilfield reinjection water storage tank based on the absorbance data A1 in the storage tank and the absorbance data A2 in the oilfield reinjection water storage tank. i1 、C i2 ; Step S3: The concentration data C of each substance in the sedimentation tank i1 , imported into the BP neural network algorithm based on stochastic gradient descent optimization to obtain the real-time dosage O p1 ; Step S4: Add the dosage O a and the concentration data of various substances in the oilfield reinjection water storage tank C i2 The association is imported into the LSTM model trained using the history of the previous time period, and the model will output the predicted value of the dosage in the future period O p2 ; Step S5: Using the concentration data C of each substance in the oilfield reinjection water storage tank i2 The input deviation is obtained from the target water quality index data, and the input deviation is compared with the set threshold. When the input deviation is greater than the set threshold, the amount of dosing pump pumped in is 0 p1 When the input deviation is less than the set threshold, the amount of medicine pumped in by the dosing pump is 0 p2 ; Step S6: indirectly evaluate the parameter performance of the algorithm by comparing the objective function value, then construct a posterior distribution of the parameters based on the prior distribution and the evaluation results, select a new parameter combination from the posterior distribution for evaluation, record the objective function value, add the new evaluation result to the posterior distribution, and update the posterior distribution until the optimal parameter combination that meets the performance requirements is found; Step S61, select the BP neural network learning rate, the number of BP neural network hidden layer nodes, the input sequence length of LSTM and the sampling interval time T a , the number of LSTM units and the interval T starting from time t0+ΔT a The concentration data of each substance in the oilfield injection water storage tank is measured at the time C i2 and interval T starting from time t0 a The time at time T a The delay time ΔT between the dosages within the range of these five parameters is used to form the matrix θ t ; Step S62: Setting the target function J ( θ ) is used to evaluate the performance of the entire dosing control system and is defined as a comprehensive indicator of processing time and drug consumption; The objective function J ( θ )for: Where: For the array θ t The time T required for the water quality to reach the qualified index under the parameter settings in s , For the array θ t The total amount of medicine used is obtained by weighted calculation under the parameter settings in s ; α 、 β is the weight coefficient; Step S63: Randomly select several parameter combinations within the set value range. , run in the dosing control system and record the corresponding objective function value ; Step S64: By comparing the objective function value J ( θ ) indirectly evaluates array θ t The parameter performance in the posterior distribution of the parameters is constructed based on the prior distribution and evaluation results, and a new parameter combination is selected from the posterior distribution. Perform evaluation and record the objective function value , add the new evaluation results to the posterior distribution and update the posterior distribution; Step S65: Repeat steps S63 and S64 to find the optimal parameter combination that meets the performance requirements, and set the parameter combination into the parameters of the BP neural network model and the LSTM model.

2. The intelligent dosing control method based on hyperspectral analysis according to claim 1 is characterized in that: In step S2, the collected absorbance data is first processed for outliers, and then the concentration data C of each substance in the sedimentation tank and the oilfield reinjection water storage tank are obtained by reverse calculation using the regression model. i1 、C i2 .

3. The intelligent dosing control method based on hyperspectral analysis according to claim 2 is characterized in that: The regression model is: Where: A is absorbance; B is bias data; k i is the absorbance proportional coefficient of each substance; ε i It is i The molar absorptivity of the substance; C i It is i The concentration of the substance; λ is the optical path length.

4. The intelligent dosing control method based on hyperspectral analysis according to claim 1 is characterized in that: The specific process of step S3 includes: Step S31: Concentration data C of each substance in the sedimentation tank i1 Perform normalization processing; Step S32: Set the input and output of the neural network, determine the number of input layer nodes 4, the number of output layer nodes 6, the connection weights between the input layer and the hidden layer , and the connection weights between the hidden layer and the output layer , the threshold b of the hidden layer j , the threshold b of the output layer k ; Step S33: setting an empirical index for a substance concentration higher than a standard qualified index, and using the objective function to evaluate the error between the treated water quality and the empirical standard; Step S34: forward propagate the input data through the neural network to calculate the output of the hidden layer; Step S35: Based on the output of the hidden layer and the connection weights between the hidden layer and the output layer and the threshold b of the output layer k , get the output value of the output layer of the BP neural network ; Step S36: updating the parameters of the neural network using the stochastic gradient descent method according to the calculated objective function value of the neural network and the set learning rate; Step S37: Calculate the target function value Error of the BP neural network in the current iteration step. If the Error of N consecutive iterations is less than the preset error threshold, ε , or the maximum number of iterations M is reached, the training is terminated; otherwise, the training returns to step S32 to continue iterating; Step S38: Denormalize the prediction results to obtain the dosage of each agent. p1 .

5. The intelligent dosing control method based on hyperspectral analysis according to claim 4 is characterized in that: The objective function in step S33 is: Where: y i The quality of the treated water is i concentration index; y i ∗ It is the setting i The empirical concentration of each indicator; n is the total number of water quality concentration indicators; Error is the objective function.

6. The intelligent dosing control method based on hyperspectral analysis according to claim 4 is characterized in that: The updating formula of the parameters in step S36 is: Where: Q t is the updated parameter, Q t-1 The parameters for the previous time: is the gradient of the objective function with respect to the parameters; η is the learning rate.

7. The intelligent dosing control method based on hyperspectral analysis according to claim 1 is characterized in that: The specific process of step S4 is as follows: Step S41: Add the dosage O a and the concentration data of various substances in the oilfield reinjection water storage tank C i2 Associated and combined into a 10-dimensional vector U t , and perform normalization; Step S42: Using a two-layer LSTM unit to control information flow through an input gate, a forget gate, and an output gate to capture long-term dependencies in the time series; Step S43: The output h of the first layer t (1) As the input of the second layer, the output of the second layer ht (2) Mapping to the predicted dosage O p2 .

8. The intelligent dosing control method based on hyperspectral analysis according to claim 7 is characterized in that: In step S42, the forward propagation function is set to: Where: is the output of the forget gate; σ is the Sigmoid activation function; W f is the weight matrix of the forget gate, b f is the bias term of the forget gate; i t is the activation value of the input gate; W i and W c is the weight matrix of the input gate and candidate state; b i and b c is the bias term between the input gate and the candidate state; O t is the activation value of the output gate; h t is the hidden state of the current time step; h t-1 is the hidden state of the previous time step; W o is the weight matrix of the output gate; b o is the bias term of the output gate; C t is the cell state at the current time step; C t−1 is the cell state at the previous time step; is a normalized vector.

Citation Information

Patent Citations

  • Device and method for detecting long-light-path liquid sulfide

    CN103983590A

  • Intelligent dosing control system of integrated sewage treatment equipment

    CN118210237A