Intelligent dosing control method based on hyperspectral analysis
Through hyperspectral analysis, combined with BP neural network and LSTM model, the problem of the inability to adjust the dosage in traditional oilfield production water treatment equipment cannot be adjusted in real time, and refined management and efficient use of drugs are achieved.
Patent Information
- Application Number
- CN202511017513.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-07-23
AI Technical Summary
The dosing process of traditional oilfield production water treatment equipment cannot adjust the dosing amount according to real-time water quality parameters, resulting in waste of agents or poor treatment effect.
Using an intelligent dosing control method based on hyperspectral analysis, a hyperspectral analyzer is used to collect water quality parameters in real time, combined with a BP neural network optimized by stochastic gradient descent and LSTM model, the dosing dosage is automatically adjusted to achieve refined management.
It realizes intelligent adjustment of dosage according to real-time water quality parameters, reduces waste of drugs, optimizes treatment effects, and reduces treatment costs.
Smart Images

Figure CN120544735A_ABST
Abstract
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: 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 i2The 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 the 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.
[0006] A further technical solution is 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 .
[0007] A further technical solution is that the regression model is:
[0008] Where: A is absorbance; B is bias data; k i is 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.
[0009] A further technical solution is 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 layerk ; 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, e , 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 .
[0010] A further technical solution is that the objective function in step S33 is:
[0011] 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.
[0012] A further technical solution is that the weight update formula in step S36 is:
[0013] Where: Q t is the updated parameter, Q t-1 The parameters for the previous time: The objective function is the parameter The gradient of the number; or is the learning rate.
[0014] A further technical solution is that the specific process of step S4 is: 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 .
[0015] A further technical solution is that in step S42, the forward propagation function is set to:
[0016]
[0017]
[0018]
[0019] 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 ois 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.
[0020] A further technical solution is that the specific process of step S6 includes: 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 these five parameters. t ; 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; 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 ( 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; Step S65: Repeat steps S63 and S64 to find the optimal parameter combination that meets the performance requirements and The parameter combination is set to the parameters of the BP neural network model and the LSTM model.
[0021] A further technical solution is that the objective function in step S62 is J ( i )for:
[0022] Where: For the array θ tThe 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.
[0023] Beneficial effects of the present invention: The intelligent dosing control method based on hyperspectral analysis of the present invention can automatically and continuously adjust the amount of medicine pumped in by the dosing plunger through the absorbance data collected in real time, thereby realizing intelligent and refined 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 THE DRAWINGS
[0024] Figure 1 A simplified process flow chart of the operation of produced water treatment equipment in an oil field Figure 2 It is the overall control flow chart of the present invention; Figure 3 The topological structure diagram of the BP neural network model of the fast adjustment loop; Figure 4 Schematic diagram of the process of establishing BP neural network model; Figure 5 Schematic diagram of the process of establishing the Bayesian optimization model in the adaptive parameter tuning loop. DETAILED DESCRIPTION
[0025] 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.
[0026] 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.
[0027] like Figure 1As 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.
[0028] 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.
[0029] The intelligent dosing control method based on hyperspectral analysis includes a fast adjustment loop, a slow adjustment loop, and an adaptive parameter setting loop; 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; 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; 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.
[0030] like Figure 2 As shown, the present invention provides an intelligent dosing control method based on hyperspectral analysis, comprising the following steps: 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 ; 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 , For the regression model, the formula is: (1) Where: A is absorbance; B is bias data; k i is 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; 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. 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 ; 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 4As shown, its construction includes the following processes: Step S31: Concentration data C of each substance in the sedimentation tank i1 Perform normalization processing; (2) 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; 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 ; 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; (3) 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; 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 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 ; 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 ); (4) 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; 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; Step S38: Denormalize the prediction results to obtain the dosage Op1 of each drug. Where P=1, 2, 3, 4, 5, 6, corresponding to coagulant aid, corrosion inhibitor, water purifier, scale inhibitor, catalyst, sodium hypochlorite bactericide respectively; 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 ; 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: 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 ; (5) The data is normalized so that the internal data range is between [0,1], and the vector U is obtained. t * ; 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: (6) (7) (8) (9) 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; 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 ; 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.
[0031] The threshold ε of each substance concentration is set according to manual experience i , 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; 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; like Figure 5 As shown, the specific steps include: 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 these five parameters. t ; 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; (10) 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; 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 ( 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; 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.
[0032] 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 the 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.
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.
9. The intelligent dosing control method based on hyperspectral analysis according to claim 1, characterized in that: The specific process of step S6 includes: 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; 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.
10. The intelligent drug dosing control method based on hyperspectral analysis according to claim 9, characterized in that: The objective function in step S62 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.
Citation Information
Patent Citations
Device and method for detecting long-light-path liquid sulfide
CN103983590A
Cerebroprotein hydrolysate preparation and designing method thereof
CN107320710A
Intelligent dosing control system of integrated sewage treatment equipment
CN118210237A
Water treatment dosing method and dosing system based on alumen ustum detection
CN120081476A