Two-phase medium interface positioning identification method based on distributed optical fiber thermal response signals
By using an embedded ARM controller and a variety of filtering algorithms in a distributed optical fiber temperature measurement device, the problem of positioning and identification of two-phase media interfaces is solved, system performance and ease of use are improved, and accurate monitoring and control of the media interface is achieved. position.
Patent Information
- Application Number
- CN202410618861.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-08-27
AI Technical Summary
Existing distributed optical fiber temperature measurement devices are difficult to achieve positioning and identification of two-phase medium interfaces, have high operational complexity, and lack the ability to deploy general algorithms.
It uses an embedded ARM controller as the main controller, integrates data processing and display functions, and processes fiber temperature data through a variety of filtering and fitting algorithms (such as random sampling consensus algorithm, local linear weighted regression algorithm, Kalman filter algorithm, etc.). Extract media interface location information.
It improves the performance and ease of use of the distributed optical fiber temperature measurement system, achieves precise monitoring and positioning of the two-phase medium interface, and reduces the impact of light source fluctuations and light intensity loss on temperature measurement accuracy.
Smart Images

Figure CN118549486A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of photoelectric detection, and in particular relates to a two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals. Background Art
[0002] The working principle of distributed optical fiber temperature measurement is as follows: First, the laser emits a pulsed laser beam to the sensing optical fiber. This pulsed laser beam interacts with the optical fiber medium molecules during transmission, causing three scattering phenomena: Rayleigh, Raman and Brillouin. Raman scattering is caused by the energy exchange between the thermal vibration of the optical fiber molecules and the interaction of photons. If part of the light energy is converted into thermal vibration, a light with a longer wavelength than the light source will be emitted, called Stokes light; if part of the thermal vibration is converted into light energy, a light with a shorter wavelength than the light source will be emitted, called anti-Stokes light. Raman scattered light consists of these two different wavelengths of light. Since anti-Stokes light scattering depends on the number of molecules in the excited state, when the temperature rises, more molecules are in a high-energy state. Therefore, the measured anti-Stokes light intensity is related to temperature. However, Stokes light is not very dependent on temperature. This shows that the optical signal is modulated by the temperature signal on the optical fiber. By detecting the anti-Stokes light intensity related to temperature, temperature information can be obtained. Raman backscattered light is detected and obtained by installing a detector on the same side of the laser. The optical fiber temperature measurement device combines the optical time domain reflection positioning method and the light intensity temperature demodulation algorithm to realize the distributed temperature measurement of the optical fiber along the straight direction.
[0003] Since the intensity of anti-Stokes light is not only modulated by the temperature signal, but also affected by the attenuation coefficient of the optical fiber itself, light source oscillation, optical fiber microbending and other factors, while Stokes light is only affected by the factors of the optical fiber itself, the temperature can be measured by detecting the ratio of the intensity of anti-Stokes light to Stokes light in the Raman scattered light, and the error caused by the factors of the optical fiber itself can be effectively eliminated. However, the distributed optical fiber temperature measurement technology has not yet been applied to the positioning and identification of the interface of two-phase media.
[0004] In the current technical context, existing distributed fiber optic temperature measurement devices usually use programmable logic devices as the main controller. However, this design is not conducive to the deployment of general algorithms. In addition, operators need to connect to the host computer on the computer to view the temperature curve, which increases the complexity of use. In order to facilitate the deployment of algorithms, we propose to use an embedded ARM controller as the main controller of the distributed fiber optic device. This design uses the ARM controller as a deployment platform for scattered light data acquisition, temperature data demodulation, and two-phase medium interface positioning and identification methods, and is also responsible for the algorithm process curve display and positioning point display. Therefore, this device is conceived as a two-phase medium interface host that integrates data processing and display functions. Through this design, we can more conveniently deploy various filtering methods and fitting trend algorithms to support the effective implementation of the two-phase medium interface positioning method. This improvement is expected to improve the performance and ease of use of distributed fiber optic temperature measurement systems.
[0005] Therefore, a two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals needs to be proposed urgently. Summary of the invention
[0006] In order to solve the defects of the prior art, the present invention provides a two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals.
[0007] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0008] The present invention provides a two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals, comprising the following steps:
[0009] S1. Collect DTS temperature data after heating the optical fiber cable to fit the temperature curve, and obtain the original curve S(t) of the temperature curve before heating the optical fiber cable;
[0010] S2, filtering the original optical fiber data after heating to obtain a filtering curve F(t) without high-frequency components. The filtering process can reduce the high-frequency signal content and increase its signal-to-noise ratio;
[0011] S3, perform difference calculation on the filtered curve F(t) and the original curve S(t) to obtain the difference curve D(t), extract the position with the largest temperature difference change, find the first zero crossing point of the difference curve D(t) backward, and calibrate the set distance L meters before and after it as the rough positioning range of the medium interface, L = 2 to 5 meters;
[0012] S4. Calculate the rate of change of each point on the filter curve F(t) within the coarse positioning range, and use the curvature of each point on the curve as the research object. First, regard the data points in the array as discrete points on a curve. Assume that the data points contained in the array are (x1, y1), (x2, y2)…, (x n ,y n ), for each data point, the differential method is used to approximate the first-order derivative and the second-order derivative; the accuracy can be improved by using N data points for differential calculation, and the slope curve G(t) is calculated, N ≥ 3;
[0013] S5. Perform weighted calculation on the obtained slope curve G(t) and the difference curve D(t) to obtain a weighted curve W(t). The weighted formula is as follows:
[0014] W(t)=(1-μ)G(t)-μD(t)
[0015] Among them, the weight coefficient μ ranges from 0 to 1, and the value of μ is related to the degree of corrosion and aging of the heating optical cable;
[0016] S6. Find the extreme point of the weighted curve W(t) in the rough positioning area, that is, the position with the largest rate of change. This point is the interface position obtained by positioning.
[0017] Preferably, the algorithm used for filtering the curve in step S1 is any one of a random sampling consensus algorithm, a local linear weighted regression algorithm, a polynomial regression fitting algorithm, a decision tree regression algorithm, and a random forest regression algorithm.
[0018] Preferably, the random sampling consensus algorithm in step S1 includes:
[0019] S111, randomly selecting a minimum number of data points from the collected temperature data of the heated optical fiber to construct an initial model;
[0020] S112, fitting a model according to these data points, and determining the data points that meet the model and the data points that do not meet the model, the data points that meet the model are inliers, and the data points that do not meet the model are outliers;
[0021] S113, randomly selecting a certain number of data points from the interior points to refit the model, and calculating the fitting error between the new model and the data set;
[0022] S114, repeat steps S111-S113 multiple times, and select the model with the smallest fitting error as the final model;
[0023] S115. Use the final model to fit all the data, and take the data points that meet the model as internal points and the data points that do not meet the model as external points to evaluate the accuracy and robustness of the model.
[0024] Preferably, the local linear weighted regression algorithm in step S1 includes:
[0025] S121, initialization parameters: given the temperature data set X and the corresponding target value y acquired by the optical fiber, and given the bandwidth parameter τ, which is used to control the weighting degree;
[0026] S122. For each data point x i , perform the weight calculation step: for the current data point x i , calculate all data points to x i The weighted value of the distance is calculated using the Gaussian kernel function. i , where w i represents the weight of the i-th data point;
[0027] S123, for each data point xi, perform the local model fitting step: use the weighted least squares method to fit a linear model y=θ0+θ1x, so that the loss function is minimized ∑wi(yi-(θ0+θ1xi)) 2 ;
[0028] S124, predicting temperature data points: for a new input x, use the parameters θ0 and θ1 obtained in the above steps to predict the corresponding temperature output value y;
[0029] S125. Repeat the above operation for each data point until all the temperature data point output values are obtained.
[0030] Preferably, the polynomial regression algorithm processing in step S1 includes:
[0031] S131, given the temperature data set X collected by the optical fiber and the corresponding target value y; and determining the order n of the polynomial to determine the complexity of the model;
[0032] S132, perform polynomial feature conversion on the original characteristic temperature X, and convert the characteristic x into a temperature containing x 0 ,x 1 ,x 2 ,x 3 …x n The eigenvector of ;
[0033] S133, fitting the model, using the regression model to fit the transformed feature vector φ(x), and obtain the parameter θ, so that the loss function is minimized: θ = (X T X) -1 X T y, where X is the matrix containing all sample features and y is the vector of temperature target values;
[0034] S134. For a new input temperature data point x, convert it into a feature vector φ(x), and then use the parameter θ for prediction: y^=θ T φ(x);
[0035] S135. Finally, the model is evaluated according to the fitting results: the model is evaluated using evaluation indicators to check the fitting effect of the model. The evaluation indicators include but are not limited to mean square error and R square.
[0036] Preferably, the algorithm used for the filtering process in step S2 is any one of a mean filtering algorithm, a Gaussian filtering algorithm, a Kalman filtering algorithm, a bilateral filtering algorithm, a median filtering algorithm and the like.
[0037] Preferably, the Kalman filter algorithm in step S2 includes a prediction step and an update step; the prediction step uses the dynamic model of the system and previous state estimates to predict the next state of the system; the update step uses measurement data to correct the predicted state to obtain the best estimate of the current state of the system.
[0038] Preferably, the Gaussian filtering algorithm processing in step S2 includes:
[0039] S211, preparing data: processing the vertical temperature curve of the cavity making well obtained by the optical fiber sensor into one-dimensional temperature data;
[0040] S212, select filter: determine the parameters of the Gaussian filter, including the size or standard deviation of the filter, and the weight distribution of the filter;
[0041] S213, construct Gaussian kernel: construct a Gaussian kernel using the selected parameters; the Gaussian kernel is a two-dimensional array whose values are calculated based on Gaussian distribution;
[0042] S214, convolve the temperature curve: use the constructed Gaussian kernel to perform a convolution operation on the original curve;
[0043] S215, processing boundary effects: after the convolution operation, boundary effects may appear; these effects are mitigated by taking appropriate boundary processing methods at the boundaries, including but not limited to zero padding and period padding;
[0044] S216, adjusting output: adjusting the output after convolution as needed, including but not limited to truncating redundant parts and normalizing;
[0045] S217, parameter adjustment, fine-tuning the convolution kernel according to the effect of the two-phase medium positioning algorithm.
[0046] Preferably, the mean filtering algorithm processing in step S2 includes:
[0047] S221. Data preparation: obtaining one-dimensional temperature data: obtaining temperature data from the optical fiber sensor source, and preprocessing the data, including but not limited to removing outliers and noise;
[0048] S222, select filter window size: determine the window size used to calculate the mean; the larger the window size, the more obvious the smoothing effect, but may cause loss of details;
[0049] S223, implement mean filtering: apply a mean filter to the temperature data; for one-dimensional temperature data, take data within a certain range around each data point, calculate the average value of these data, and use the result as a new filtered data point;
[0050] S224, boundary processing: For the first and last data points, boundary processing needs to be performed according to the specific situation; the data is expanded to allow the full window to be applied at the boundary;
[0051] S225. Evaluation results: Analyze the difference between the filtered temperature data and the original temperature data to evaluate whether the filtering effect meets expectations; consider the smoothness and detail retention of the data based on the effect of the two-phase medium positioning algorithm; based on the evaluation results, it may be necessary to adjust the window size or other filter parameters to optimize the results.
[0052] Preferably, the temperature data of the optical fiber after heating is collected by a temperature calibration method, which uses a temperature measurement probe in an external self-calibration device to measure and calibrate the temperature of the optical fiber ring, and then the temperature test circuit board sends the measured temperature data to the host computer through an RS232 communication interface or an RS485 communication interface.
[0053] Compared with the prior art, the present invention has the following beneficial effects:
[0054] The present invention practices a variety of filtering algorithms, divides common filtering algorithms into two categories: trend filtering and noise filtering in the direction of data filtering of the two-phase medium interface positioning algorithm, selects the Kalman filtering algorithm for noise filtering, and selects the local linear regression algorithm for trend fitting. The Kalman filtering algorithm and the RANSAC filtering algorithm are combined to process the temperature curve to realize the monitoring and positioning of the medium interface position. The Kalman filtering algorithm can effectively process the noise and uncertainty in the temperature curve, and improve the accuracy and stability of the data; while the RANSAC filtering algorithm can identify abnormal values in the temperature curve, thereby effectively extracting the position information of the medium interface. Through the combined application of these two algorithms, accurate monitoring and positioning of the medium interface position can be achieved, providing a reliable technical means for the study of the two-phase medium interface of the cavity well. The present invention adopts a dual-channel temperature demodulation method, which has the advantage of eliminating the influence of light source fluctuations and light intensity loss on temperature measurement accuracy.
[0055] The present invention controls the heater to instantaneously heat the test medium, and utilizes the propagation characteristics of temperature difference changes at the interfaces of different media to achieve rapid testing and analysis of the position and properties of the oil-water-gas multiphase interface. This testing method based on temperature difference changes has the advantages of fast response speed, strong non-invasiveness, high testing accuracy, etc., and is suitable for interface monitoring and analysis of complex multiphase media.
[0056] The present invention uses ARM as the core processor, integrates data acquisition, demodulation, and algorithm deployment into the same circuit board, and adds an OLED display screen for interaction with users, thereby improving the convenience of the device. The two-phase medium interface positioning and identification method is deployed to verify the recognition accuracy of the two-phase medium interface positioning and identification method. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a schematic diagram of oil-gas-water interface monitoring of the present invention.
[0058] Figure 2 It is a schematic diagram of heating temperature difference.
[0059] Figure 3 It is a flowchart of the method for positioning and identifying the interface of two-phase media.
[0060] Figure 4 It is a schematic diagram of the coarse positioning algorithm.
[0061] Figure 5 It is a schematic diagram of the precise positioning algorithm.
[0062] Figure 6 This is the hardware platform block diagram of the two-phase medium interface positioning and identification method. DETAILED DESCRIPTION
[0063] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0064] Example 1
[0065] like Figure 1-Figure 6 As shown, this embodiment provides a two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals, comprising the following steps:
[0066] S1. Use the random sampling consensus algorithm to fit the temperature curve change trend of the collected heated optical fiber temperature data to obtain the RANSAC filter curve; the random sampling consensus algorithm processing includes:
[0067] S111, randomly selecting a minimum number of data points from the collected temperature data of the heated optical fiber to construct an initial model;
[0068] S112, fitting a model according to these data points, and determining the data points that meet the model and the data points that do not meet the model, the data points that meet the model are inliers, and the data points that do not meet the model are outliers;
[0069] S113, randomly selecting a certain number of data points from the interior points to refit the model, and calculating the fitting error between the new model and the data set;
[0070] S114, repeat steps S111-S113 multiple times, and select the model with the smallest fitting error as the final model;
[0071] S115. Use the final model to fit all data, and take the data points that meet the model as inliers and the data points that do not meet the model as outliers, so as to evaluate the accuracy and robustness of the model;
[0072] S2, using a Kalman filter algorithm to process the collected temperature data of the heated optical fiber to obtain a Kalman filter temperature curve; the Kalman filter algorithm processing includes a prediction step and an update step; the prediction step uses a dynamic model of the system and a previous state estimate to predict the next state of the system; the update step uses the measurement data to correct the predicted state, thereby obtaining the best estimate of the current state of the system;
[0073] S3. Perform difference calculation on the Kalman filter temperature curve and the RANSAC filter curve, extract the position with the largest temperature difference, and calibrate the distance L meters before and after it as the rough positioning range of the medium interface. Since the oil-water mixing area is about 1 meter, and the rough positioning can be located in the mixing area, in order to avoid unnecessary interference, L can be set to 2-5 meters. Figure 4 As shown;
[0074] S4. Calculate the rate of change for each point on the Kalman filter curve within the coarse positioning range. In order to increase the rate of change feature, the curvature of each point on the curve is used as the research object for the rate of change feature. First, the data points in the array are regarded as discrete points on a curve. Assume that the data points contained in the array are (x1, y1), (x2, y2)…, (x n ,y n ); for each data point (x n ,y n ), use the difference method to approximate the first-order derivative and the second-order derivative; comprehensively compare multiple sets of data, and use N data points for difference calculation to improve the accuracy (N = 3, 4, 5...). It is recommended to take N = 10 when the waveform noise of the actual data is large. If the waveform noise of the actual data is small, the N value can be appropriately lowered to calculate the slope curve;
[0075] S5. Analyze the obtained slope curve and perform weighted calculation on it and the difference curve. The weighted formula is as follows:
[0076] W(t)=(1-μ)G(t)-μD(t)
[0077] Among them, the weighting coefficient μ of the weighting formula takes a value of 0 to 1, and the value of u is related to the degree of corrosion and aging of the heating optical cable (service life). When the optical cable has a long service life and is severely aged, it is recommended that u = 0.5, and the weighted curve W(t) is obtained. The extreme point of the weighted curve in the rough positioning area is found, that is, the position with the largest rate of change. This point is the interface position obtained by positioning, such as Figure 5 shown.
[0078] Specifically, the temperature data of the optical fiber after heating is collected through a temperature calibration method, which uses a temperature measurement probe in an external self-calibration device to measure and calibrate the temperature of the optical fiber ring, and then the temperature test circuit board sends the measured temperature data to the host computer through the RS232 communication interface or the RS485 communication interface, thereby reducing the temperature difference caused by environmental factors and increasing the accuracy of the temperature.
[0079] like Figure 1 As shown, the above method of this embodiment is used to compare the position information obtained by the neutron logging method in actual engineering, and it is determined that the error of this method is within 0.5 meters.
[0080] Example 2
[0081] As a preferred embodiment, the rest is the same as embodiment 1, except that in step S1, a local linear weighted regression algorithm is used to fit the change trend of the temperature curve of the collected temperature data of the heated optical fiber, including:
[0082] S121, initialization parameters: given the temperature data set X and the corresponding target value y acquired by the optical fiber, and given the bandwidth parameter τ, which is used to control the weighting degree;
[0083] S122. For each data point x i , perform the weight calculation step: for the current data point x i , calculate all data points to x i The weighted value of the distance is calculated using the Gaussian kernel function. i , where w i represents the weight of the i-th data point;
[0084] S123, for each data point xi, perform the local model fitting step: use the weighted least squares method to fit a linear model y=θ0+θ1x, so that the loss function is minimized ∑wi(yi-(θ0+θ1xi)) 2 ;
[0085] S124, predicting temperature data points: for a new input x, use the parameters θ0 and θ1 obtained in the above steps to predict the corresponding temperature output value y;
[0086] S125. Repeat the above operation for each data point until all the temperature data point output values are obtained.
[0087] Example 3
[0088] As a preferred embodiment, the rest is the same as embodiment 1, except that in step S1, a polynomial regression algorithm is used to fit the change trend of the temperature curve of the collected temperature data of the heated optical fiber, including:
[0089] S131, given the temperature data set X collected by the optical fiber and the corresponding target value y; and determining the order n of the polynomial to determine the complexity of the model;
[0090] S132, perform polynomial feature conversion on the original characteristic temperature X, and convert the characteristic x into a temperature containing x 0 ,x 1 ,x 2 ,x 3 …x n The eigenvector of ;
[0091] S133, fitting the model, using the regression model to fit the transformed feature vector φ(x), and obtain the parameter θ, so that the loss function is minimized: θ = (X T X) -1 X T y, where X is the matrix containing all sample features and y is the vector of temperature target values;
[0092] S134. For a new input temperature data point x, convert it into a feature vector φ(x), and then use the parameter θ for prediction: y^=θ T φ(x);
[0093] S135. Finally, the model is evaluated according to the fitting results: the model is evaluated using evaluation indicators to check the fitting effect of the model. The evaluation indicators include but are not limited to mean square error and R square.
[0094] Example 4
[0095] As a preferred embodiment, the rest is the same as embodiment 1, except that in step S2, a Gaussian filter algorithm is used to process the collected temperature data of the heated optical fiber, including:
[0096] S211, preparing data: processing the vertical temperature curve of the cavity making well obtained by the optical fiber sensor into one-dimensional temperature data;
[0097] S212, select filter: determine the parameters of the Gaussian filter, including the size or standard deviation of the filter, and the weight distribution of the filter;
[0098] S213, construct Gaussian kernel: construct a Gaussian kernel using the selected parameters; the Gaussian kernel is a two-dimensional array whose values are calculated based on Gaussian distribution;
[0099] S214, convolve the temperature curve: use the constructed Gaussian kernel to perform a convolution operation on the original curve;
[0100] S215, processing boundary effects: after the convolution operation, boundary effects may appear; these effects are mitigated by taking appropriate boundary processing methods at the boundaries, including but not limited to zero padding and period padding;
[0101] S216, adjusting output: adjusting the output after convolution as needed, including but not limited to truncating redundant parts and normalizing;
[0102] S217, parameter adjustment, fine-tuning the convolution kernel according to the effect of the two-phase medium positioning algorithm.
[0103] Example 5
[0104] As a preferred embodiment, the rest is the same as embodiment 1, except that in step S2, a mean filtering algorithm is used to process the collected temperature data of the heated optical fiber, including:
[0105] S221. Data preparation: obtaining one-dimensional temperature data: obtaining temperature data from the optical fiber sensor source, and preprocessing the data, including but not limited to removing outliers and noise;
[0106] S222, select filter window size: determine the window size used to calculate the mean; the larger the window size, the more obvious the smoothing effect, but may cause loss of details;
[0107] S223, implement mean filtering: apply a mean filter to the temperature data; for one-dimensional temperature data, take data within a certain range around each data point, calculate the average value of these data, and use the result as a new filtered data point;
[0108] S224, boundary processing: For the first and last data points, boundary processing needs to be performed according to the specific situation; the data is expanded to allow the full window to be applied at the boundary;
[0109] S225. Evaluation results: Analyze the difference between the filtered temperature data and the original temperature data to evaluate whether the filtering effect meets expectations; consider the smoothness and detail retention of the data based on the effect of the two-phase medium positioning algorithm; based on the evaluation results, it may be necessary to adjust the window size or other filter parameters to optimize the results.
[0110] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals. It is characterized in that The following steps are involved: S1. Collect DTS temperature data after heating the optical fiber cable to fit the temperature curve, and obtain the original curve S(t) of the temperature curve before heating the optical fiber cable; S2, filtering the original optical fiber data after heating to obtain a filtering curve F(t) without high-frequency components. The filtering process can reduce the high-frequency signal content and increase its signal-to-noise ratio; S3, perform difference calculation on the filtered curve F(t) and the original curve S(t) to obtain the difference curve D(t), extract the position with the largest temperature difference change, find the first zero crossing point of the difference curve D(t) backward, and calibrate the set distance L meters before and after it as the rough positioning range of the medium interface, L = 2 to 5 meters; S4. Calculate the rate of change of each point on the filter curve F(t) within the coarse positioning range, and use the curvature of each point on the curve as the research object. First, regard the data points in the array as discrete points on a curve. Assume that the data points contained in the array are (x 1 ,y 1 ), (x 2 ,y 2 )…,(x n ,y n ), for each data point, the differential method is used to approximate the first-order derivative and the second-order derivative; the accuracy can be improved by using N data points for differential calculation, and the slope curve G(t) is calculated, N ≥ 3; S5. Perform weighted calculation on the obtained slope curve G(t) and the difference curve D(t) to obtain a weighted curve W(t). The weighted formula is as follows: W(t)=(1-μ)G(t)-μD(t) Among them, the weight coefficient μ ranges from 0 to 1, and the value of μ is related to the degree of corrosion and aging of the heating optical cable; S6. Find the extreme point of the weighted curve W(t) in the rough positioning area, that is, the position with the largest rate of change. This point is the interface position obtained by positioning.
2. The two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals according to claim 1, It is characterized in that The algorithm used for filtering the curve in step S1 is any one of a random sampling consensus algorithm, a local linear weighted regression algorithm, a polynomial regression fitting algorithm, a decision tree regression algorithm, and a random forest regression algorithm.
3. The two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals according to claim 2, It is characterized in that The random sampling consensus algorithm in step S1 includes: S111, randomly selecting a minimum number of data points from the collected temperature data of the heated optical fiber to construct an initial model; S112, fitting a model according to these data points, and determining the data points that meet the model and the data points that do not meet the model, the data points that meet the model are inliers, and the data points that do not meet the model are outliers; S113, randomly selecting a certain number of data points from the interior points to refit the model, and calculating the fitting error between the new model and the data set; S114, repeat steps S111-S113 multiple times, and select the model with the smallest fitting error as the final model; S115. Use the final model to fit all the data, and take the data points that meet the model as internal points and the data points that do not meet the model as external points to evaluate the accuracy and robustness of the model.
4. The two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals according to claim 2, It is characterized in that The local linear weighted regression algorithm in step S1 includes: S121, initialization parameters: given the temperature data set X and the corresponding target value y acquired by the optical fiber, and given the bandwidth parameter τ, which is used to control the weighting degree; S122. For each data point x i , perform the weight calculation step: for the current data point x i , calculate all data points to x i The weighted value of the distance is calculated using the Gaussian kernel function. i , where w i represents the weight of the i-th data point; S123, for each data point xi, perform the local model fitting step: use the weighted least squares method to fit a linear model y=θ 0 +θ 1 x, so that the loss function is minimized∑wi(yi-(θ0+θ1xi)) 2 ; S124, predict the temperature data point: for the new input x, use the parameter θ obtained in the above steps 0 and θ 1 To predict the corresponding temperature output value y; S125. Repeat the above operation for each data point until all the temperature data point output values are obtained.
5. The two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals according to claim 2, It is characterized in that The polynomial regression algorithm processing in step S1 includes: S131, given the temperature data set X collected by the optical fiber and the corresponding target value y; and determining the order n of the polynomial to determine the complexity of the model; S132, perform polynomial feature conversion on the original characteristic temperature X, and convert the characteristic x into a temperature containing x 0 ,x 1 ,x 2 ,x 3 …x n The eigenvector of ; S133, fitting the model, using the regression model to fit the transformed feature vector φ(x), and obtain the parameter θ, so that the loss function is minimized: θ = (X T X) -1 X T y, where X is the matrix containing all sample features and y is the vector of temperature target values; S134. For a new input temperature data point x, convert it into a feature vector φ(x), and then use the parameter θ for prediction: y^=θ T φ(x); S135. Finally, the model is evaluated according to the fitting results: the model is evaluated using evaluation indicators to check the fitting effect of the model. The evaluation indicators include but are not limited to mean square error and R square.
6. The two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals according to claim 1, It is characterized in that The filtering algorithm used in step S2 is any one of a mean filtering algorithm, a Gaussian filtering algorithm, a Kalman filtering algorithm, a bilateral filtering algorithm, a median filtering algorithm and the like.
7. The two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals according to claim 6, It is characterized in that The Kalman filter algorithm in step S2 includes a prediction step and an update step; the prediction step uses the system's dynamic model and previous state estimates to predict the next state of the system; the update step uses measurement data to correct the predicted state to obtain the best estimate of the current state of the system.
8. The two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals according to claim 6, It is characterized in that The Gaussian filtering algorithm processing in step S2 includes: S211, preparing data: processing the vertical temperature curve of the cavity making well obtained by the optical fiber sensor into one-dimensional temperature data; S212, select filter: determine the parameters of the Gaussian filter, including the size or standard deviation of the filter, and the weight distribution of the filter; S213, construct Gaussian kernel: construct a Gaussian kernel using the selected parameters; the Gaussian kernel is a two-dimensional array whose values are calculated based on Gaussian distribution; S214, convolve the temperature curve: use the constructed Gaussian kernel to perform a convolution operation on the original curve; S215, processing boundary effects: after the convolution operation, boundary effects may appear; these effects are mitigated by taking appropriate boundary processing methods at the boundaries, including but not limited to zero padding and period padding; S216, adjusting output: adjusting the output after convolution as needed, including but not limited to truncating redundant parts and normalizing; S217, parameter adjustment, fine-tuning the convolution kernel according to the effect of the two-phase medium positioning algorithm.
9. The two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals according to claim 6, It is characterized in that The mean filtering algorithm processing in step S2 includes: S221. Data preparation: obtaining one-dimensional temperature data: obtaining temperature data from the optical fiber sensor source, and preprocessing the data, including but not limited to removing outliers and noise; S222, select filter window size: determine the window size used to calculate the mean; the larger the window size, the more obvious the smoothing effect, but may cause loss of details; S223, implement mean filtering: apply a mean filter to the temperature data; for one-dimensional temperature data, take data within a certain range around each data point, calculate the average value of these data, and use the result as a new filtered data point; S224, boundary processing: For the first and last data points, boundary processing needs to be performed according to the specific situation; the data is expanded to allow the full window to be applied at the boundary; S225. Evaluation results: Analyze the difference between the filtered temperature data and the original temperature data to evaluate whether the filtering effect meets expectations; consider the smoothness and detail retention of the data based on the effect of the two-phase medium positioning algorithm; based on the evaluation results, it may be necessary to adjust the window size or other filter parameters to optimize the results.
10. The two-phase medium interface positioning and identification method based on distributed optical fiber thermal response signals according to claim 1, It is characterized in that The temperature data of the heated optical fiber is collected by temperature calibration, which uses a temperature measuring probe in an external self-calibration device to measure and calibrate the temperature of the optical fiber ring, and then the temperature test circuit board sends the measured temperature data to the host computer through the RS232 communication interface or the RS485 communication interface.
Citation Information
Cited By
Multi-sensor liquid-liquid two-phase interface detection method and system
CN121186145A
A multi-sensor liquid-liquid two-phase interface detection method and system
CN121186145B
