A data analysis and processing method, system and storage medium
Through capacitive sensor and friction component technology combined with acoustic wave calculation, the accurate measurement of liquid flow is achieved, and the problem of inaccurate measurement results of ultrasonic flowmeters in complex environments is solved, and the measurement accuracy and stability are improved.
Patent Information
- Application Number
- CN202411472896.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-22
AI Technical Summary
Existing ultrasonic flowmeters are susceptible to interference from factors such as electromagnetic field, temperature changes, and airflow disturbances in complex and changeable environments, resulting in inaccuracy of measurement results.
Capacitor sensor combined with friction member technology is used to output the initial square wave signal by sensing the capacitance value in the target flow cavity, and the target square wave signal is obtained through regular correction processing. Then, the frequency value corresponding to the capacitance value sensed by the capacitance sensor is calculated and inputted to the pre-trained flow calibration model to obtain the liquid flow estimate. Finally, the liquid flow estimated value is corrected based on the acoustic wave calculation results to obtain the liquid flow target value.
It improves the accuracy and stability of flow measurement, enhances the adaptability and robustness of the system, and can better cope with complex and variable fluid environments and measurement needs.
Smart Images

Figure CN118999705B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data analysis and processing method, system and storage medium. Background Art
[0002] Existing flow meters, especially ultrasonic flow meters, as a non-contact flow measurement tool, are widely used in various fluid flow monitoring scenarios, but they have some disadvantages in actual use. This type of flow meter estimates the flow rate by the propagation speed and time difference of sound waves (especially ultrasonic waves) in the fluid. However, this measurement method is susceptible to interference from many factors. In a complex and changing environment, factors such as electromagnetic fields, temperature changes, and airflow disturbances may have an adverse effect on the propagation of ultrasonic signals. In particular, electromagnetic field interference may cause signal distortion or loss, which seriously affects the accuracy of the measurement data. In addition, when the measured fluid contains a large amount of bubbles, scaling or impurities, these substances will reflect or scatter ultrasonic signals, causing signal attenuation and complexity of the reflection path. This not only increases the difficulty of signal processing, but may also cause the measurement results to deviate from the true value. Summary of the invention
[0003] The main purpose of the present invention is to provide a data analysis and processing method, system and storage medium, aiming to solve the technical problem in the prior art that the measurement results of the acoustic wave flow meter are easily affected by the external environment and cause the results to deviate and be distorted.
[0004] To achieve the above objectives, in a first aspect, an embodiment of the present application provides a data analysis and processing method, the method comprising:
[0005] Obtaining an initial square wave signal outputted corresponding to the capacitance value in the target flow cavity sensed by the capacitance sensor, wherein the electrode plates of the capacitance sensor are respectively arranged on both sides of the target flow cavity, a friction piece is arranged in the target flow cavity, the flow rate of the liquid in the target flow cavity is positively correlated with the heat generated by the friction of the liquid flowing through the friction piece, and the capacitance value sensed by the capacitance sensor is positively correlated with the temperature of the liquid in the target flow cavity;
[0006] Performing regularization and correction processing on the initial square wave signal to obtain a target square wave signal;
[0007] Calculate the frequency value corresponding to the capacitance value sensed by the capacitance sensor according to the target square wave signal;
[0008] Inputting the frequency value corresponding to the capacitance value sensed by the capacitance sensor into a pre-trained flow calibration model to obtain an estimated value of the liquid flow;
[0009] The liquid flow rate estimate is corrected according to the acoustic wave measurement result to obtain the liquid flow rate target value.
[0010] To achieve the above objectives, in a first aspect, an embodiment of the present application provides a data analysis and processing method, the method comprising:
[0011] Obtaining an initial square wave signal outputted corresponding to the capacitance value in the target flow cavity sensed by the capacitance sensor, wherein the electrode plates of the capacitance sensor are respectively arranged on both sides of the target flow cavity, a friction piece is arranged in the target flow cavity, the flow rate of the liquid in the target flow cavity is positively correlated with the heat generated by the friction of the liquid flowing through the friction piece, and the capacitance value sensed by the capacitance sensor is positively correlated with the temperature of the liquid in the target flow cavity;
[0012] Performing regularization and correction processing on the initial square wave signal to obtain a target square wave signal;
[0013] Calculate the frequency value corresponding to the capacitance value sensed by the capacitance sensor according to the target square wave signal;
[0014] Inputting the frequency value corresponding to the capacitance value sensed by the capacitance sensor into a pre-trained flow calibration model to obtain an estimated value of the liquid flow;
[0015] The liquid flow rate estimate is corrected according to the acoustic wave measurement result to obtain the liquid flow rate target value.
[0016] In a possible implementation, the step of calculating, according to the target square wave signal, a frequency value corresponding to a capacitance value sensed by the capacitance sensor includes:
[0017] Obtaining a first calculation weight corresponding to a third target square wave within a preset range of the second target square wave and a second calculation weight corresponding to other square waves except the third target square wave, wherein the first calculation weight is less than the second calculation weight;
[0018] Obtaining a period corresponding to a target square wave signal according to a period corresponding to the third target square wave, periods corresponding to other square waves except the third target square wave, and the first calculation weight and the second calculation weight;
[0019] The frequency value corresponding to the capacitance value sensed by the capacitance sensor is obtained according to the period corresponding to the target square wave signal.
[0020] In a possible implementation manner, the step of adjusting the duty cycle of the first target square wave to obtain a target square wave signal includes:
[0021] Determine a corresponding compensation amount according to current duty cycle values and expected duty cycle values of the plurality of first target square waves, wherein the compensation amount includes a high level duration and a low level duration;
[0022] The duty cycle of the first target square wave is adjusted according to the corresponding compensation amount to obtain a target square wave signal.
[0023] In a possible implementation, inputting the frequency value corresponding to the capacitance value sensed by the capacitance sensor into a pre-trained flow calibration model to obtain a liquid flow estimation value includes:
[0024] Inputting the frequency value corresponding to the capacitance value sensed by the capacitance sensor into a pre-trained capacitance value estimation model to obtain the capacitance value at the current liquid flow rate, wherein the capacitance value estimation model represents the mapping relationship between the frequency value and the capacitance value;
[0025] The capacitance value at the current liquid flow rate is input into the flow calibration model to obtain the estimated value of the liquid flow rate, and the flow calibration model represents the mapping relationship between the capacitance value and the liquid flow rate.
[0026] In a possible implementation manner, before inputting the capacitance value at the current liquid flow rate into the flow calibration model to obtain the estimated value of the liquid flow rate, the method further includes:
[0027] Acquire a numerical range of historical capacitance values sensed by the capacitance sensor;
[0028] Determine that the capacitance value at the current liquid flow rate is within the numerical range of the historical capacitance value, and input the capacitance value at the current liquid flow rate into the flow calibration model to obtain an estimated value of the liquid flow rate;
[0029] Determining that the capacitance value at the current liquid flow rate is not within the numerical range of the historical capacitance values, and judging whether the capacitance value at the current liquid flow rate is abnormal;
[0030] When there is no abnormality in the capacitance value at the current liquid flow rate, the capacitance value at the current liquid flow rate is input into the flow calibration model to obtain an estimated value of the liquid flow rate.
[0031] In a possible implementation, the step of correcting the estimated liquid flow rate according to the acoustic wave measurement result to obtain a target liquid flow rate value includes:
[0032] According to the acoustic wave measurement result and the estimated value of the liquid flow, corresponding weight configuration is performed to obtain a first weight and a second weight;
[0033] Performing weighted sum processing on the acoustic wave measurement result and the liquid flow estimated value to obtain a liquid flow target value;
[0034] Among them, when the difference between the acoustic wave measurement result and the liquid flow estimated value is greater than or equal to a preset difference, the first weight corresponding to the acoustic wave measurement result is less than the second weight corresponding to the liquid flow estimated value; when the difference between the acoustic wave measurement result and the liquid flow estimated value is less than the preset difference, the first weight corresponding to the acoustic wave measurement result is equal to the second weight corresponding to the liquid flow estimated value.
[0035] In a possible implementation, after the liquid flow rate estimate is corrected according to the acoustic wave measurement result to obtain the liquid flow rate target value, the method further includes:
[0036] When the fluctuation range of the target value of the liquid flow rate exceeds a preset range, the first weight and the second weight are dynamically adjusted to keep the fluctuation range of the target value of the liquid flow rate within the preset range.
[0037] In a possible implementation, the dynamically adjusting the first weight and the second weight to keep the fluctuation range of the target value of the liquid flow rate within the preset range includes calculating the adjustment amount of the first weight and the second weight according to the following formula:
[0038] ;
[0039] Wherein, ΔW1 is the adjustment amount of the first weight, ΔW2 is the adjustment amount of the second weight; 0.2β is the adjustment coefficient, and the value range of β is between 1-1.5, which is used to control the amplitude of the adjustment; W1 is the first weight before adjustment; is the standard deviation of the liquid flow target value in the current time window; is the preset fluctuation range threshold.
[0040] In a second aspect, an embodiment of the present application further provides a data analysis and processing system, comprising a memory and a processor, wherein the memory is used to store program code, and the processor is used to call the program code to execute the method described in the first aspect.
[0041] In a third aspect, an embodiment of the present application further provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in the first aspect are performed.
[0042] Different from the prior art, the data analysis and processing method provided in the embodiment of the present application first obtains the initial square wave signal corresponding to the capacitance value in the target flow cavity sensed by the capacitance sensor, and then performs regular correction processing on the initial square wave signal to obtain the target square wave signal; then calculates the frequency value corresponding to the capacitance value sensed by the capacitance sensor according to the target square wave signal; then inputs the frequency value corresponding to the capacitance value sensed by the capacitance sensor into the pre-trained flow calibration model to obtain the liquid flow estimated value; finally, the liquid flow estimated value is corrected according to the acoustic wave measurement result to obtain the liquid flow target value. That is, firstly, the liquid flow is estimated according to the sensing data of the capacitance sensor, and then the liquid flow estimated value is corrected according to the acoustic wave measurement result to obtain the liquid flow target value. In this way, the liquid flow measurement method that integrates the capacitance sensor measurement technology and the acoustic wave measurement technology not only improves the measurement accuracy and stability, but also enhances the adaptability and robustness of the system, so that it can better cope with complex and changeable fluid environments and measurement requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0044] Figure 1 This is a schematic diagram of the state of the flow chamber of the flow meter in some embodiments of the present application;
[0045] Figure 2 This is a flowchart of a data analysis and processing method in some embodiments of the present application;
[0046] Figure 3 This is a flow chart of step S200 of the data analysis and processing method in some embodiments of the present application;
[0047] Figure 4 This is a flow chart of step S400 of the data analysis and processing method in some embodiments of the present application;
[0048] Figure 5 This is a flow chart of step S500 of the data analysis and processing method in some embodiments of the present application;
[0049] Figure 6 This is a schematic diagram of the hardware structure of the data analysis and processing system in some embodiments of the present application.
[0050] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0053] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, "and / or" in the full text includes three solutions. Taking A and / or B as an example, it includes technical solution A, technical solution B, and technical solution that satisfies both A and B. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in this field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0054] Existing flow meters, especially ultrasonic flow meters, as a non-contact flow measurement tool, are widely used in various fluid flow monitoring scenarios, but they have some disadvantages in actual use. This type of flow meter estimates the flow rate by the propagation speed and time difference of sound waves (especially ultrasonic waves) in the fluid. However, this measurement method is susceptible to interference from many factors. In a complex and changing environment, factors such as electromagnetic fields, temperature changes, and airflow disturbances may have an adverse effect on the propagation of ultrasonic signals. In particular, electromagnetic field interference may cause signal distortion or loss, which seriously affects the accuracy of the measurement data. In addition, when the measured fluid contains a large amount of bubbles, scaling or impurities, these substances will reflect or scatter ultrasonic signals, causing signal attenuation and complexity of the reflection path. This not only increases the difficulty of signal processing, but may also cause the measurement results to deviate from the true value.
[0055] In view of the above problems, the present application proposes a data analysis and processing method, which can be applied to flowmeters and other devices with flow measurement functions or data analysis and processing systems, such as Figure 1 As shown, Figure 1 This is a schematic diagram of the state of the flow chamber of the flow meter in some embodiments of the present application. Figure 1 In the embodiment, the electrode plates of the capacitive sensor 100 are respectively installed on both sides of the target flow cavity 200. A friction member 300 is arranged inside the target flow cavity 200. When the fluid passes through the target flow cavity (as shown by the arrow in the figure), it will generate friction with the friction member 300 and thus generate heat. Since the fluid flow rate is relatively fast, the accumulation of heat is avoided, that is, the instantaneous heat generated is relatively small. Therefore, in the case where the heat generation is relatively small, there is a positive correlation between the flow rate of the liquid in the target flow cavity and the heat generated by the friction between the fluid and the friction member. Further, in the process of heat generated by the friction between the fluid and the friction member 300, this heat will be partially transferred to the liquid in the target flow cavity, causing the liquid temperature to rise. Within a certain range, since the dielectric constant of the liquid increases with the increase of temperature, this temperature change will further affect the capacitance value of the capacitive sensor, so that the capacitance value sensed by the capacitive sensor is positively correlated with the liquid temperature in the target flow cavity.
[0056] like Figure 1-Figure 5 As shown, the following takes the data analysis and processing system executing the data analysis and processing method as an example for explanation. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here. Figure 2 The method comprises the following steps S100 to S500:
[0057] S100, obtaining an initial square wave signal outputted corresponding to a capacitance value in a target flow cavity sensed by a capacitance sensor, wherein electrode plates of the capacitance sensor are respectively arranged on both sides of the target flow cavity, a friction member is arranged in the target flow cavity, a flow rate of a liquid in the target flow cavity is positively correlated with heat generated by friction of the liquid flowing through the friction member, and a capacitance value sensed by the capacitance sensor is positively correlated with a temperature of the liquid in the target flow cavity;
[0058] It can be understood that the capacitive sensor is a component that detects changes in physical quantities by measuring changes in capacitance between two electrode plates. In an embodiment of the present application, one electrode plate of the capacitive sensor 100 is fixedly installed in the target flow cavity, while the other electrode plate is isolated from the fluid by an insulating material (such as a lining) and does not directly contact the fluid. When the fluid flows through the target flow cavity, the fluid flow rate changes, and factors such as the dynamic characteristics of the fluid (such as eddy currents, turbulence, etc.) and the frictional heat generated between the fluid and the friction member 300 will cause the fluid temperature to change, thereby causing a change in the dielectric constant between the electrode plates of the capacitive sensor 100, which in turn causes a change in the capacitance value of the capacitive sensor, and the liquid temperature is positively correlated with the liquid flow rate, and the capacitance value is positively correlated with the liquid temperature in the target flow cavity.
[0059] The data analysis and processing system of the embodiment of the present application includes a signal conversion circuit, which can convert the change of the capacitance value into an electrical signal. That is, in this process, the change of the capacitance value will be converted into a change of voltage or current. In order to facilitate subsequent signal processing and analysis, the signal conversion circuit converts the continuous voltage or current change into a discrete square wave signal. This square wave signal has a fixed frequency and amplitude, and its frequency or duty cycle is in a certain proportional relationship with the change of the capacitance value. In other words, after signal conversion and square wave generation, the capacitance sensor will output an initial square wave signal corresponding to the capacitance value. Provide initial data for subsequent data processing.
[0060] S200, performing regularization and correction processing on the initial square wave signal to obtain a target square wave signal;
[0061] It is understandable that capacitive sensing may be affected by many factors, such as edge effect (the uneven distribution of the electric field at the edge of the capacitive sensor plate, resulting in measurement errors), signal noise, etc. These factors may cause deviations in the waveform, frequency or amplitude of the initial square wave signal, thereby affecting the accuracy of subsequent flow measurement. Therefore, after obtaining the initial square wave signal, it is necessary to regularize and correct the initial square wave signal to obtain the target square wave signal, so as to eliminate or weaken the adverse factors such as noise, interference and deviation in the initial square wave signal, so as to obtain a more accurate, stable and reliable target square wave signal. This helps with subsequent signal processing and analysis, and improves the accuracy and stability of flow measurement.
[0062] The method of regularization and correction processing may include one or more steps of filtering, smoothing, denoising, calibration, etc. Among them, filtering can remove high-frequency noise and interference; smoothing can reduce signal fluctuations and jitters; denoising can eliminate random noise and outliers in the signal; calibration can adjust parameters such as the amplitude and frequency of the signal to make it more in line with actual measurement requirements.
[0063] In one embodiment, the step S200: performing regularization and correction processing on the initial square wave signal to obtain a target square wave signal includes:
[0064] S210, screening out first target square waves that do not meet the duty cycle threshold according to a preset duty cycle threshold, and counting the proportion of the first target square waves;
[0065] S220: When the proportion of the first target square wave is greater than or equal to a first preset value, adjust the duty cycle of the first target square wave to obtain a target square wave signal;
[0066] S230, screening out second target square waves that do not meet the cycle threshold according to a preset cycle threshold, and counting the proportion of the second target square waves;
[0067] S240: When the proportion of the second target square wave is greater than or equal to a second preset value, delete the second target square wave to obtain a target square wave signal.
[0068] It should be noted that in the embodiment of the present application, the proportion of the high level in the square wave signal is called the duty cycle. For example, if the high level duration of the square wave signal is 50% of the entire cycle, the duty cycle is 50%.
[0069] Specifically, the embodiment of the present application first sets a reasonable duty cycle range as a threshold value according to actual application requirements. Then traverse the initial square wave signal, find the square wave whose duty cycle is not within the set threshold range, and mark it as the first target square wave. Then calculate the proportion of the first target square wave in the total square wave signal to evaluate the severity of the problem. When the proportion of the first target square wave is greater than or equal to the first preset value, it means that the initial direction signal fluctuates greatly, and it is necessary to adjust the duty cycle of the first target square wave to obtain the target square wave signal. For the first target square wave whose duty cycle does not meet the threshold requirement, adjust its duty cycle through an algorithm to meet the set requirements. The adjustment method may include changing the duration of a high level or a low level. Further, according to actual application requirements, set a reasonable period range as a threshold. Traverse the initial square wave signal, find the square wave whose period is not within the set threshold range, and mark it as the second target square wave. Calculate the proportion of the second target square wave in the total square wave signal to evaluate the severity of the problem. When the proportion of the second target square wave is greater than or equal to the second preset value, it means that the noise of the initial square wave signal is large, and the noise signal (second target square wave) needs to be deleted to obtain the target square wave signal. In this way, the quality of the initial square wave signal is improved and optimized through the steps of screening, statistics, adjustment and deletion. By setting a reasonable duty cycle threshold and period threshold, as well as the corresponding first preset value and second preset value, it can be ensured that the target square wave signal meets the actual application requirements and improves the accuracy and stability of flow measurement.
[0070] Exemplarily, the embodiment of the present application sets the reasonable range of the duty cycle to 45% to 55%, that is, the duty cycle threshold is [45%, 55%]. The initial square wave signal is traversed to find the square wave whose duty cycle is not in the range of 45% to 55%, and it is marked as the first target square wave. Assuming that the total number of initial square wave signals is 1000, of which the number of first target square waves whose duty cycle does not meet the threshold is 150, the proportion of the first target square wave is 15%. The first preset value is set to 10%. Since the proportion of the first target square wave is 15% greater than or equal to the first preset value, it means that the duty cycle of the initial square wave signal fluctuates greatly. The duty cycle of these 150 first target square waves is adjusted. For example, the duration of the high level or low level is adjusted to meet the range of 45% to 55% through an algorithm.
[0071] Furthermore, the embodiment of the present application sets a reasonable range of the period to 1ms to 2ms, that is, the period threshold is [1ms, 2ms]. The initial square wave signal is traversed to find the square wave whose period is not in the range of 1ms to 2ms, and it is marked as the second target square wave. Assuming that among the 1000 initial square wave signals, the number of second target square waves whose periods do not meet the threshold is 80, then the proportion of second target square waves is 8%. The second preset value is set to 5%. Since the proportion of the second target square wave of 8% is greater than or equal to the second preset value, it means that the noise of the initial square wave signal is large. These 80 second target square waves (i.e., noise signals) are deleted to obtain a purer target square wave signal.
[0072] In one embodiment, the step S220: adjusting the duty cycle of the first target square wave to obtain a target square wave signal, includes: determining a corresponding compensation amount based on current duty cycle values and expected duty cycle values of multiple first target square waves, the compensation amount including a high level duration and a low level duration; adjusting the duty cycle of the first target square wave according to the corresponding compensation amount to obtain a target square wave signal.
[0073] Specifically, first traverse all signals marked as the first target square wave and record their current duty cycle values. Then, according to the expected duty cycle (e.g., 50%), for each first target square wave, calculate the difference between its current duty cycle value and the expected duty cycle value. According to this difference, determine the high level duration and low level duration that need to be increased or decreased, that is, the compensation amount. The calculation of the compensation amount can be based on a linear relationship, a proportional relationship, or other appropriate mathematical model, depending on the accuracy requirements of the duty cycle adjustment and the dynamic characteristics of the system. Use the calculated compensation amount to adjust the high level duration and low level duration of the first target square wave accordingly. If the duty cycle needs to be increased, increase the high level duration or reduce the low level duration (or both at the same time). If the duty cycle needs to be reduced, reduce the high level duration or increase the low level duration (or both at the same time). After the compensation amount is adjusted, the duty cycle of the first target square wave will approach or reach the expected duty cycle value. In this way, the corresponding compensation amount is determined according to the current duty cycle values and the expected duty cycle values of the plurality of first target square waves, and the duty cycles of these square waves are accurately adjusted, thereby improving the efficiency of the duty cycle adjustment.
[0074] Exemplarily, when the duty cycle needs to be increased, the duration of the high level is increased and the duration of the low level is reduced to increase the duty cycle, or, when the duty cycle needs to be reduced, the duration of the high level is reduced and the duration of the low level is increased to reduce the duty cycle. In this way, by adjusting the duration of the high level and the low level at the same time, the adjustment of the duty cycle can be more effectively balanced, avoiding the problem of system instability or too slow adjustment speed that may be caused by a single adjustment. In addition, this simultaneous adjustment strategy can also improve the accuracy and efficiency of the duty cycle adjustment, so that the duty cycle of the first target square wave can approach or reach the desired duty cycle value more quickly.
[0075] S300, calculating a frequency value corresponding to a capacitance value sensed by a capacitance sensor according to the target square wave signal;
[0076] After completing the regularization and correction processing of the initial square wave signal and successfully obtaining the target square wave signal, the corresponding frequency value can be accurately calculated according to the specific parameters of the target square wave signal. For example, after accurately measuring the time length of a complete cycle of the target square wave signal, its frequency value can be obtained through simple mathematical operations.
[0077] It can be understood that since the second target square wave is judged as a noise signal, the square wave signal near the second target square wave may also be interfered to a certain extent. Based on this, in one embodiment, the frequency value corresponding to the capacitance value sensed by the capacitive sensor is calculated based on the target square wave signal, including: obtaining the first calculation weight corresponding to the third target square wave within the preset range of the second target square wave and the second calculation weight corresponding to other square waves except the third target square wave, wherein the first calculation weight is less than the second calculation weight; obtaining the period corresponding to the target square wave signal according to the period corresponding to the third target square wave, the period corresponding to other square waves except the third target square wave, and the first calculation weight and the second calculation weight; obtaining the frequency value corresponding to the capacitance value sensed by the capacitive sensor according to the period corresponding to the target square wave signal.
[0078] When the second target square wave is identified as a noise signal, its adjacent square wave signal (third target square wave) may also be interfered to varying degrees. In order to still accurately calculate the frequency value corresponding to the capacitance value sensed by the capacitive sensor in this case, the embodiment of the present application adopts a weighted processing strategy to reduce the impact of the interfered square wave on the overall calculation result.
[0079] First, determine the third target square wave within the preset range of the second target square wave. These square waves may be interfered by the second target square wave (noise signal). Assign a smaller first calculation weight to the third target square wave, which reflects their lower credibility in the overall calculation. At the same time, assign a larger second calculation weight to other square waves except the third target square wave, which are relatively more reliable. Measure and record the period of each square wave (including the third target square wave and other square waves). According to the assigned first calculation weight and second calculation weight, perform weighted summation on the period of each square wave. This weighted average value is used as the period corresponding to the target square wave signal. Finally, use the inverse relationship between period and frequency (f = 1 / T) to convert the period corresponding to the target square wave signal into a frequency value. In this way, the frequency value corresponding to the capacitance value sensed by the capacitive sensor can be further improved, thereby providing reliable data support for the accurate measurement of subsequent flow.
[0080] S400, inputting the frequency value corresponding to the capacitance value sensed by the capacitance sensor into a pre-trained flow calibration model to obtain an estimated value of the liquid flow;
[0081] After obtaining the frequency value corresponding to the capacitance value, the frequency value can be directly input into a pre-trained liquid flow prediction model, and the liquid flow prediction model represents the mapping relationship between the frequency value and the liquid flow.
[0082] In order to improve the efficiency and accuracy of model training, the embodiment of the present application pre-trains two branch models, namely, the first branch model: a capacitance value estimation model, which characterizes the mapping relationship between frequency value and capacitance value; the second estimation model: a flow calibration model, which characterizes the mapping relationship between capacitance value and liquid flow.
[0083] In the training process of the capacitance estimation model of the embodiment of the present application, the frequency values and corresponding capacitance value data of the capacitance sensor output under different conditions (different liquid flow rates, temperatures, pressures, etc.) are first widely collected, and then the data is thoroughly cleaned to remove abnormal, repeated and invalid information. Then, machine learning models such as linear regression, decision tree regression, random forest regression or neural network are selected as candidates, and the model is built based on the preprocessed data. In the training stage, the model obtains the final capacitance estimation model by continuously iteratively adjusting the parameters to minimize the prediction error, thereby improving the accuracy of the predicted capacitance value.
[0084] In the training process of the flow calibration model of the embodiment of the present application, the capacitance values and the corresponding actual liquid flow data under various working conditions (including but not limited to different liquid flow, temperature, and pressure conditions) are also first collected. These data constitute the basis for model training. Then, these data are preprocessed, including removing outliers, removing duplicate data, and processing missing values to ensure the data quality of the input model. Then, models such as linear regression, decision tree regression, random forest regression, or neural network are selected to build the flow calibration model. These models will learn the complex mapping relationship between capacitance value and liquid flow. Then the selected model is trained using the preprocessed high-quality data. During the training process, the model will continuously iterate and adjust its internal parameters to minimize the prediction error, thereby improving the accuracy of predicting the liquid flow. Finally, strategies such as cross-validation are used to evaluate the performance of the model, and the model is adjusted and optimized as necessary according to the evaluation results. Ultimately, the fully trained and optimized flow calibration model will be able to accurately predict the liquid flow under a given capacitance value, providing strong support for practical applications.
[0085] In one embodiment, the step S400: inputting the frequency value corresponding to the capacitance value sensed by the capacitance sensor into a pre-trained flow calibration model to obtain a liquid flow estimation value includes:
[0086] S410, inputting the frequency value corresponding to the capacitance value sensed by the capacitance sensor into a pre-trained capacitance value estimation model to obtain the capacitance value at the current liquid flow rate, wherein the capacitance value estimation model represents the mapping relationship between the frequency value and the capacitance value;
[0087] S420, inputting the capacitance value at the current liquid flow rate into a flow calibration model to obtain an estimated value of the liquid flow rate, wherein the flow calibration model represents a mapping relationship between the capacitance value and the liquid flow rate.
[0088] Specifically, firstly, a fully trained capacitance estimation model is used (the model is to establish and characterize the mapping relationship between frequency value and capacitance value). In actual operation, the frequency value captured by the capacitance sensor in real time can be used as input and passed to the capacitance estimation model. After receiving the input, the model will quickly calculate the corresponding capacitance value under the current liquid flow condition according to the mapping rules learned internally. This process is essentially to convert the indirect measurement value of frequency into a capacitance value that is more directly related to the liquid flow, providing a more accurate data basis for subsequent steps. After obtaining the capacitance value, further, the capacitance value obtained in step S410 is used as a new input and passed to another trained flow calibration model (the model focuses on establishing and characterizing the mapping relationship between capacitance value and liquid flow). The flow calibration model receives the capacitance value as input and accurately predicts the current liquid flow value based on its internal learning algorithm and parameter settings. This process makes full use of the inherent relationship between capacitance value and liquid flow, realizes the direct conversion from capacitance value to liquid flow, and provides an accurate flow estimate for practical applications.
[0089] In this way, the embodiment of the present application not only fully utilizes the respective advantages of the two branch models by first converting the frequency value into a capacitance value and then further converting it into an estimated value of the liquid flow, but also significantly improves the accuracy and reliability of the liquid flow estimation through a step-by-step processing approach.
[0090] In one embodiment, before the step S420: inputting the capacitance value at the current liquid flow rate into the flow calibration model to obtain the estimated value of the liquid flow rate, the method further includes:
[0091] Obtain the numerical range of historical capacitance values sensed by the capacitance sensor; determine that the capacitance value at the current liquid flow rate is within the numerical range of the historical capacitance values, and input the capacitance value at the current liquid flow rate into the flow calibration model to obtain an estimated liquid flow value; determine that the capacitance value at the current liquid flow rate is not within the numerical range of the historical capacitance values, and determine whether there is an abnormality in the capacitance value at the current liquid flow rate; when there is no abnormality in the capacitance value at the current liquid flow rate, input the capacitance value at the current liquid flow rate into the flow calibration model to obtain an estimated liquid flow value.
[0092] Specifically, first extract all the historical capacitance values sensed by the capacitance sensor in the past, and calculate the numerical range of these values. This range will serve as a reference for us to determine whether the current capacitance value is normal. When the capacitance value at the current liquid flow rate is obtained, this value is compared with the historical capacitance value range calculated previously. If the capacitance value at the current liquid flow rate falls within the numerical range of the historical capacitance value, this indicates that the value fluctuates within the normal range, and it can be safely input into the flow calibration model to obtain an estimated value of the liquid flow rate. If the capacitance value at the current liquid flow rate exceeds the numerical range of the historical capacitance value, this means that there may be an abnormality, such as sensor failure, sudden change in liquid properties, etc. At this point, we cannot directly input the value into the flow calibration model, but need to further determine the source of this abnormal value. For capacitance values that exceed the normal range, a series of inspection methods are required to determine whether they are truly abnormal. This may include checking the physical state of the sensor, confirming whether the liquid properties have changed, and checking whether there are errors in the data transmission process. If it is confirmed that the abnormality of the current capacitance value is caused by changes in normal working conditions (such as normal fluctuations in capacitance caused by changes in liquid flow, temperature, pressure and other conditions), and this change has been considered during model training, we can still input this value into the flow calibration model for prediction. If it is confirmed that the abnormality of the current capacitance value is caused by abnormal factors such as sensor failure and data error, we should regard this value as invalid data, do not perform flow prediction, and trigger measures such as error reminders.
[0093] S500, correcting the estimated value of the liquid flow rate according to the acoustic wave measurement result to obtain a target value of the liquid flow rate.
[0094] In one embodiment, the step S500 of correcting the estimated liquid flow rate according to the acoustic wave measurement result to obtain a target liquid flow rate value includes:
[0095] S510, performing corresponding weight configuration according to the acoustic wave measurement result and the estimated value of the liquid flow to obtain a first weight and a second weight;
[0096] S520. Perform weighted summation on the acoustic wave measurement result and the liquid flow estimate to obtain a liquid flow target value; wherein, when the difference between the acoustic wave measurement result and the liquid flow estimate is greater than or equal to a preset difference, the first weight corresponding to the acoustic wave measurement result is less than the second weight corresponding to the liquid flow estimate; when the difference between the acoustic wave measurement result and the liquid flow estimate is less than a preset difference, the first weight corresponding to the acoustic wave measurement result is equal to the second weight corresponding to the liquid flow estimate.
[0097] Specifically, after obtaining the estimated value of the liquid flow obtained by the flow calibration model, in order to ensure its accuracy, further correction is required to obtain an accurate liquid flow target value. There can be many correction methods, such as using the acoustic wave measurement result to correct the estimated value of the liquid flow. In the embodiment of the present application, an intelligent weight allocation strategy is adopted to fuse the two measurement results. Specifically, when the difference between the acoustic wave measurement result and the estimated value of the liquid flow is significant, it means that there is a large error or inconsistency between the two. In view of the fact that the estimated value of the liquid flow is based on a more stable and reliable measurement principle (such as capacitance measurement), the system is more inclined to trust the estimated value. Therefore, in this case, the system assigns a smaller first weight to the acoustic wave measurement result and a larger second weight to the estimated value of the liquid flow. On the contrary, when the difference between the acoustic wave measurement result and the estimated value of the liquid flow is small, it means that the measured values of the two are relatively close and may be quite accurate. At this time, the two have similar credibility, so the system assigns them equal weights, that is, the first weight is equal to the second weight. After determining the weights of the two, the system fuses them by weighted summation to obtain the final liquid flow target value. This strategy not only makes full use of the advantages of the two measurement methods, but also improves the accuracy and reliability of the overall measurement through flexible weight allocation. By implementing the above strategy, it is possible to effectively reduce the errors that may be caused by a single measurement method and improve the accuracy of liquid flow measurement. Whether facing significant measurement differences or slight differences, the system can intelligently adjust the weights to ensure that the final liquid flow target value is closer to the true value. This not only improves the measurement accuracy, but also provides more reliable data support for subsequent flow control and management.
[0098] In one embodiment, after the liquid flow rate estimate is corrected according to the acoustic wave measurement result to obtain the liquid flow rate target value, the method further includes:
[0099] When the fluctuation range of the target value of the liquid flow rate exceeds a preset range, the first weight and the second weight are dynamically adjusted to keep the fluctuation range of the target value of the liquid flow rate within the preset range.
[0100] Specifically, when the target value of liquid flow rate fluctuates abnormally, that is, its fluctuation range exceeds the preset range set by the system, it means that the current weight distribution is no longer applicable to the current measurement environment or conditions. At this time, the system automatically dynamically adjusts the first weight (the weight corresponding to the acoustic wave measurement result) and the second weight (the weight corresponding to the estimated value of liquid flow rate) to rebalance the contribution between the two, thereby ensuring that the target value of liquid flow rate can be stably maintained within the preset range. In this way, by implementing a dynamic weight adjustment strategy, it is possible to effectively cope with possible abnormal fluctuations in the target value of liquid flow rate, ensure that the measurement results always remain within the preset range, and further improve the accuracy of liquid flow rate measurement.
[0101] Exemplarily, the following formula may be used to calculate the adjustment amount of the first weight and the second weight:
[0102] ; In the formula, ΔW1 is the adjustment amount of the first weight, ΔW2 is the adjustment amount of the second weight; 0.2β is the adjustment coefficient, and the value range of β is between 1-1.5, which is used to control the adjustment amplitude; W1 is the first weight before adjustment, and W2 is the second weight before adjustment; is the standard deviation of the liquid flow target value in the current time window; is the preset fluctuation range threshold. The adjusted weights W1′ and W2′ are W1′=W1+ΔW1 and W2′=W2+ΔW2 respectively. In this way, the dynamic adjustment range of the first weight and the second weight is limited to a smaller range (the adjustment value is related to the change of the liquid flow target value in the current time window), ensuring that the adjusted weight value is always within a reasonable range, thereby ensuring the stability and reliability of the system.
[0103] Please see attached Figure 6 , Figure 6 A schematic diagram of the hardware structure of a data analysis and processing system provided for some embodiments of the present application; the data analysis and processing system provided in the embodiments of the present application comprises a memory 110 and a processor 120, wherein the memory 110 is used to store program code, and the processor 120 is used to call the program code to execute the method described above.
[0104] Among them, the processor 120 is used to provide computing and control capabilities to control the data analysis and processing system to perform corresponding tasks, for example, to control the data analysis and processing system to perform the data analysis and processing method in any of the above method embodiments, the method comprising: obtaining an initial square wave signal output corresponding to the capacitance value in the target flow cavity sensed by the capacitance sensor, the electrode plates of the capacitance sensor are respectively arranged on both sides of the target flow cavity, the target flow cavity is provided with a friction member, the liquid flow rate in the target flow cavity is positively correlated with the heat generated by the friction of the liquid flowing through the friction member, and the capacitance value sensed by the capacitance sensor is positively correlated with the liquid temperature in the target flow cavity; the initial square wave signal is regulated and corrected to obtain a target square wave signal; the frequency value corresponding to the capacitance value sensed by the capacitance sensor is calculated according to the target square wave signal; the frequency value corresponding to the capacitance value sensed by the capacitance sensor is input into a pre-trained flow calibration model to obtain a liquid flow estimated value; the liquid flow estimated value is corrected according to the acoustic wave measurement result to obtain a liquid flow target value.
[0105] The processor 120 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip, or any combination thereof; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0106] The memory 110 is a non-transitory computer-readable storage medium that can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the data analysis and processing method in the embodiments of the present application. The processor 120 can implement the data analysis and processing method in any of the above method embodiments by running the non-transitory software programs, instructions and modules stored in the memory 110.
[0107] Specifically, the memory 110 may include a volatile memory (VM), such as a random access memory (RAM); the memory 110 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD) or other non-transitory solid-state storage device; the memory 110 may also include a combination of the above types of memory.
[0108] In summary, the data analysis and processing system of the present application adopts the technical solution of any one of the above-mentioned data analysis and processing method embodiments, and therefore, has at least the beneficial effects brought by the technical solution of the above-mentioned embodiments, which will not be described one by one here.
[0109] The embodiment of the present application also provides a computer-readable storage medium, such as a memory including a program code, and the program code can be executed by a processor to complete the data analysis and processing method in the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CDROM), a magnetic tape, a floppy disk, and an optical data storage device.
[0110] The present application also provides a computer program product, which includes one or more program codes stored in a computer-readable storage medium. The processor of the data analysis and processing system reads the program code from the computer-readable storage medium, and the processor executes the program code to complete the steps of the data analysis and processing method provided in the above embodiment.
[0111] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware or by hardware associated with a program code, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0112] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0113] Through the description of the above embodiments, it can be clearly understood by those skilled in the art that each embodiment can be implemented by means of software plus a general hardware platform, or by hardware. It can be understood by those skilled in the art that all or part of the processes in the above embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0114] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the inventive concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A data analysis and processing method, characterized in that: The method comprises: Obtaining an initial square wave signal outputted corresponding to the capacitance value in the target flow cavity sensed by the capacitance sensor, wherein the electrode plates of the capacitance sensor are respectively arranged on both sides of the target flow cavity, a friction piece is arranged in the target flow cavity, the flow rate of the liquid in the target flow cavity is positively correlated with the heat generated by the friction of the liquid flowing through the friction piece, and the capacitance value sensed by the capacitance sensor is positively correlated with the temperature of the liquid in the target flow cavity; Performing regularization and correction processing on the initial square wave signal to obtain a target square wave signal; Calculate the frequency value corresponding to the capacitance value sensed by the capacitance sensor according to the target square wave signal; Inputting the frequency value corresponding to the capacitance value sensed by the capacitance sensor into a pre-trained flow calibration model to obtain an estimated value of the liquid flow; The liquid flow rate estimate is corrected according to the acoustic wave measurement result to obtain a liquid flow rate target value, wherein the acoustic wave measurement result is a flow rate measurement result obtained by inferring the flow rate through the propagation speed and time difference of the acoustic wave in the fluid; The method of correcting the estimated value of the liquid flow rate according to the acoustic wave measurement result to obtain the target value of the liquid flow rate includes: According to the acoustic wave measurement result and the estimated value of the liquid flow, corresponding weight configuration is performed to obtain a first weight and a second weight; Performing weighted sum processing on the acoustic wave measurement result and the liquid flow estimated value to obtain a liquid flow target value; Among them, when the difference between the acoustic wave measurement result and the liquid flow estimated value is greater than or equal to a preset difference, the first weight corresponding to the acoustic wave measurement result is less than the second weight corresponding to the liquid flow estimated value; when the difference between the acoustic wave measurement result and the liquid flow estimated value is less than the preset difference, the first weight corresponding to the acoustic wave measurement result is equal to the second weight corresponding to the liquid flow estimated value.
2. The data analysis and processing method according to claim 1, characterized in that: The step of performing regularization and correction processing on the initial square wave signal to obtain a target square wave signal includes: Screening out first target square waves that do not meet the duty cycle threshold according to a preset duty cycle threshold, and counting the proportion of the first target square waves; When the proportion of the first target square wave is greater than or equal to a first preset value, adjusting the duty cycle of the first target square wave to obtain a target square wave signal; Screening out second target square waves that do not meet the cycle threshold according to a preset cycle threshold, and counting the proportion of the second target square waves; When the proportion of the second target square wave is greater than or equal to a second preset value, the second target square wave is deleted to obtain a target square wave signal.
3. The data analysis and processing method according to claim 2, characterized in that: The step of calculating the frequency value corresponding to the capacitance value sensed by the capacitance sensor according to the target square wave signal includes: Obtaining a first calculation weight corresponding to a third target square wave within a preset range of the second target square wave and a second calculation weight corresponding to other square waves except the third target square wave, wherein the first calculation weight is less than the second calculation weight; Obtaining a period corresponding to a target square wave signal according to a period corresponding to the third target square wave, periods corresponding to other square waves except the third target square wave, and the first calculation weight and the second calculation weight; The frequency value corresponding to the capacitance value sensed by the capacitance sensor is obtained according to the period corresponding to the target square wave signal.
4. The data analysis and processing method according to claim 2, characterized in that: The step of adjusting the duty cycle of the first target square wave to obtain a target square wave signal includes: Determine a corresponding compensation amount according to current duty cycle values and expected duty cycle values of the plurality of first target square waves, wherein the compensation amount includes a high level duration and a low level duration; The duty cycle of the first target square wave is adjusted according to the corresponding compensation amount to obtain a target square wave signal.
5. The data analysis and processing method according to claim 1, characterized in that: The step of inputting the frequency value corresponding to the capacitance value sensed by the capacitance sensor into a pre-trained flow calibration model to obtain a liquid flow estimation value includes: Inputting the frequency value corresponding to the capacitance value sensed by the capacitance sensor into a pre-trained capacitance value estimation model to obtain the capacitance value at the current liquid flow rate, wherein the capacitance value estimation model represents the mapping relationship between the frequency value and the capacitance value; The capacitance value at the current liquid flow rate is input into the flow calibration model to obtain the estimated value of the liquid flow rate, and the flow calibration model represents the mapping relationship between the capacitance value and the liquid flow rate.
6. The data analysis and processing method according to claim 5, characterized in that: Before inputting the capacitance value at the current liquid flow rate into the flow calibration model to obtain the estimated value of the liquid flow rate, the method further includes: Acquire a numerical range of historical capacitance values sensed by the capacitance sensor; Determine that the capacitance value at the current liquid flow rate is within the numerical range of the historical capacitance value, and input the capacitance value at the current liquid flow rate into the flow calibration model to obtain an estimated value of the liquid flow rate; Determining that the capacitance value at the current liquid flow rate is not within the numerical range of the historical capacitance values, and judging whether the capacitance value at the current liquid flow rate is abnormal; When there is no abnormality in the capacitance value at the current liquid flow rate, the capacitance value at the current liquid flow rate is input into the flow calibration model to obtain an estimated value of the liquid flow rate.
7. The data analysis and processing method as claimed in claim 1, characterized in that: After the liquid flow rate estimate is corrected according to the acoustic wave measurement result to obtain the liquid flow rate target value, the method further includes: When the fluctuation range of the target value of the liquid flow rate exceeds a preset range, the first weight and the second weight are dynamically adjusted to keep the fluctuation range of the target value of the liquid flow rate within the preset range; and / or, The dynamically adjusting the first weight and the second weight to keep the fluctuation range of the target value of the liquid flow rate within the preset range includes calculating the adjustment amount of the first weight and the second weight according to the following formula: ; ; Wherein, ΔW1 is the adjustment amount of the first weight, ΔW2 is the adjustment amount of the second weight; 0.2β is the adjustment coefficient, and the value range of β is between 1-1.5, which is used to control the amplitude of the adjustment; W1 is the first weight before adjustment; is the standard deviation of the liquid flow target value in the current time window; is the preset fluctuation range threshold.
8. A data analysis and processing system, characterized in that: The method comprises a memory and a processor, wherein the memory is used to store program codes, and the processor is used to call the program codes to execute the method according to any one of claims 1 to 7.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are performed.
Citation Information
Patent Citations
Paperless office file auxiliary processing tool
CN116109253A
In-line monitor method and device for flow and concentration of dust-contained airflow
CN1303017A