Online intelligent calibration method for ultrasonic gas meter
Through the online intelligent calibration method, the ambient temperature is monitored in real time and the gas flow rate and flow rate are calculated. The ultrasonic gas meter is calibrated in combination with the historical comparison method, which solves the high cost and artificial error problems of traditional calibration methods, and achieves efficient and accurate calibration results.
Patent Information
- Application Number
- CN202411990819.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
AI Technical Summary
The traditional ultrasonic gas meter calibration method relies on manual operation, has high cost and artificial errors, and is inefficient, making it difficult to meet the needs of large-scale promotion.
The online intelligent calibration method is adopted to monitor the ambient temperature in real time, calculate the gas flow rate and flow rate, and use the historical comparison method to calibrate when the ultrasonic gas meter fails.
It reduces the error of manual calibration, improves the efficiency and accuracy of calibration, ensures the stability and reliability of the system, and is suitable for large-scale promotion.
Smart Images

Figure CN119901359A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of ultrasonic gas meter calibration, and in particular to an online intelligent calibration method for an ultrasonic gas meter. Background Art
[0002] As gas usage continues to increase, gas meters are becoming increasingly popular as metering devices among household and commercial users. Traditional gas meters mostly use mechanical metering or static electronic metering methods, which can effectively record users' gas usage. However, with the advancement of technology and the continuous increase in usage demand, ultrasonic gas meters are gradually being used as a new type of intelligent metering tool. Ultrasonic gas meters use the working principle of ultrasonic sensors to accurately measure gas flow without contacting the medium, thereby improving the accuracy and reliability of gas metering. Its measurement method not only improves the metering accuracy, but also reduces wear on the equipment and extends its service life.
[0003] However, ultrasonic gas meters also face some challenges in actual use, one of the most prominent issues is how to perform efficient and accurate calibration. In actual applications, ultrasonic gas meters are easily affected by environmental factors such as temperature. Especially after long-term operation, the metering error of the gas meter may gradually increase, resulting in inaccurate measurement. Therefore, in order to ensure the accuracy and reliability of gas metering, ultrasonic gas meters must be calibrated and corrected regularly. Traditional ultrasonic gas meter calibration methods usually rely on manual calibration or comparative verification through certain fixed standards. The specific calibration process includes manual sampling, comparison of standard meters and gas meter readings, and manual inspection of whether the calibration is in place. However, this method usually has high labor costs and is easily affected by human operation, resulting in instability of the calibration results. In addition, due to time delays and human negligence during manual operation, the calibration efficiency is low and it is difficult to meet the needs of large-scale promotion. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide an online intelligent calibration method for an ultrasonic gas meter to reduce the error of manual calibration.
[0005] The technical solution adopted by the present invention to solve the technical problem is: to provide an online intelligent calibration method for an ultrasonic gas meter, comprising the following steps:
[0006] Monitor and obtain the ambient temperature of the gas flowing through the pipeline in real time;
[0007] Use the temperature gas flow rate compensation formula to calculate the gas flow rate at the current temperature;
[0008] Obtaining the cross-sectional area of the gas pipeline and combining it with the gas flow rate at the current temperature to obtain the gas flow rate;
[0009] transmitting the gas flow to an ultrasonic gas meter and displaying it;
[0010] When an ultrasonic gas meter fails, a historical comparison method is used to calibrate the ultrasonic gas meter.
[0011] The gas flow rate at the current temperature is Calculated, where V(T current ) is the gas flow rate at the current temperature, v0 is the gas flow rate at 20°C, T current is the current temperature, β is the influence coefficient of flow rate on temperature change, n is the nonlinear index, and T0 is 20℃.
[0012] The influence coefficient β of the flow rate on the temperature change is obtained by the fitting method, specifically:
[0013] Define the error function E(β,n), expressed as: Among them, V exp (T i ) is the gas flow rate measured at the i-th temperature, T i is the i-th temperature value, m is the number of temperature values;
[0014] Calculate the partial derivative of the error function E(β,n) with respect to β and the partial derivative with respect to n respectively, and use the gradient descent method to update β and n;
[0015] Repeat the previous step, and stop iterating when the change in the error function E(β,n) is less than the change threshold of the error function.
[0016] Before using the temperature gas flow rate compensation formula to calculate the gas flow rate at the current temperature, the method further includes: calculating the sound speed at the current temperature by using the temperature effect on the sound speed formula, wherein the sound speed at the current temperature is calculated by c(T current )=c0·(1+α·(T current -T0)) is calculated, where c(T current ) is the speed of sound at the current temperature, c0 is the speed of sound at 20℃, α is the sensitivity coefficient of gas sound speed to temperature, and T0 is 20℃.
[0017] The calibrating the ultrasonic gas meter by adopting the historical comparison method specifically includes:
[0018] Use a total ultrasonic gas meter to record the total gas usage of all users;
[0019] The total ultrasonic gas meter is recorded as a total meter, and the total meter is used to record the usage of all gas in an area;
[0020] The sub-ultrasonic gas meter is recorded as a sub-meter, and the sub-meter is used to record the amount of gas used by a single user;
[0021] Obtain the faulty sub-meter under the main meter and record it as the faulty gas meter;
[0022] All sub-meters except the faulty gas meter under the main meter shall be recorded as non-faulty gas meters;
[0023] Obtain historical gas usage of the total meter, faulty gas meters, and non-faulty gas meters;
[0024] Obtain the time point at which the fault of the faulty gas meter occurs, and record it as the fault start time point;
[0025] Obtain the time point at which the fault of the faulty gas meter ends, and record it as the fault end time point;
[0026] The fault start time point and the fault end time point are both within the same day;
[0027] Calculate the fault time period of the faulty gas meter, where the fault time period = fault end time point - fault start time point;
[0028] Obtain the gas usage of the total meter and the non-faulty gas meter during the fault period respectively, and execute the gas usage data calibration strategy;
[0029] The gas usage data calibration strategy includes a gas usage first data calibration strategy and a gas usage second data calibration strategy;
[0030] Execute the first gas usage data calibration strategy for the gas usage of the total meter during the fault time period;
[0031] Analyze and process the result of the first gas usage data calibration strategy, and determine whether to execute the second gas usage data calibration strategy according to the result;
[0032] If the gas usage second data calibration strategy is executed, then the actual gas usage of the faulty gas meter during the fault time period is set according to the result of the gas usage second data calibration strategy;
[0033] If the second gas usage data calibration strategy is not executed, the actual gas usage of the faulty gas meter during the fault time period is set according to the result of the first gas usage data calibration strategy.
[0034] The step of executing the first gas usage data calibration strategy on the gas usage of the total meter during the fault time period specifically includes:
[0035] Obtain the gas usage recorded in the total meter during the fault period and record it as the current total gas usage;
[0036] Obtain the gas usage recorded in the total meter during the fault period in the historical time, and record it as the total historical gas usage;
[0037] Obtain the gas usage of all non-faulty sub-meters during the fault time period, record it as the current non-faulty gas meter record, and associate the non-faulty sub-meters with the corresponding current non-faulty gas meter record to form a gas usage data group;
[0038] Set a category of gas usage collection;
[0039] Set the total gas usage deviation threshold;
[0040] Divide the historical time into multiple sub-historical time periods based on the fault time period, and obtain the gas usage recorded in the total meter in the sub-historical time period;
[0041] If the absolute value of the difference between the gas usage recorded in the total meter in the sub-historical time period and the current total gas usage is less than or equal to the total gas usage deviation threshold, the gas usage recorded in the total meter in the sub-historical time period is entered into a gas usage set;
[0042] If the absolute value of the difference between the gas usage recorded in the total meter in the sub-historical time period and the current total gas usage is greater than the total gas usage deviation threshold, the gas usage recorded in the total meter in the sub-historical time period will not be entered into a category of gas usage set.
[0043] Select each element in a category of gas usage set in turn and perform the following steps:
[0044] The selected element is recorded as the actual total gas usage;
[0045] The date of the actual total gas usage is obtained and recorded as the index date. The endpoint time points of the time period of the actual total gas usage are obtained. The endpoint time points are specifically the start time point and the end time point of the time period. The endpoint time point before the start time point is recorded as the index start time point, and the endpoint time point after the end time point is recorded as the index end time point.
[0046] Obtain the recorded quantity of the non-faulty gas meter between the index start time point and the index end time point within the index date, and record it as the pre-selected non-faulty gas meter recorded quantity;
[0047] Obtain the current non-faulty gas meter record quantities corresponding to all non-faulty gas meters, and determine in turn whether the current non-faulty gas meter record quantities are equal to the pre-selected non-faulty gas meter record quantities corresponding to the non-faulty gas meters. If they are all equal, obtain the record quantities of the faulty gas meters between the index start time point and the index end time point within the index date, record them as the target gas usage, set the target gas usage to the actual gas usage of the faulty gas meter during the faulty time period, and stop the gas usage first data calibration strategy;
[0048] If there is a current non-faulty gas meter whose recorded quantity is not equal to the pre-selected non-faulty gas meter recorded quantity corresponding to the non-faulty gas meter, the actual total gas consumption is removed from the gas consumption set of a category;
[0049] If the number of elements in a type of gas usage set is not 0, and the actual gas usage of the faulty gas meter during the fault time period is not found, repeat the above steps in the remaining elements of the type of gas usage set until the actual gas usage of the faulty gas meter during the fault time period is found;
[0050] If the number of elements in a type of gas usage set is 0, the gas usage second data calibration strategy is executed.
[0051] The executing the second gas usage data calibration strategy specifically includes:
[0052] Set the actual recorded quantity set of the faulty gas meter;
[0053] Set the sub-fault time period set;
[0054] Divide the fault time period into N equal sub-time periods, obtain the length of the sub-time period, record it as the divided time period, and enter it into the sub-fault time period set;
[0055] For any element in the sub-failure time period set, perform the following analysis steps:
[0056] Obtain the record quantity of the total table within the sub-fault time period, and record it as the sub-record quantity of the total table;
[0057] Obtain the record quantity of all non-faulty gas meters in the sub-fault time period, and record it as the sub-record quantity of non-faulty gas meters;
[0058] Set the total gas usage collection;
[0059] Divide the historical time into multiple sub-historical time periods based on the time period, and sequentially enter the gas usage recorded in the total meter in the sub-historical time periods into the total gas usage set;
[0060] Traverse the elements in the total gas usage set. If the element is not equal to the total meter sub-record amount, remove the element from the total gas usage set. If the element is equal to the total meter sub-record amount, continue traversing until all elements are traversed.
[0061] Traverse the elements in the total gas usage collection, select one element at a time and perform the following analysis steps:
[0062] The selected element is recorded as the actual total amount of gas used for execution;
[0063] The date when the actual total gas usage is executed is obtained, recorded as the index date, and the endpoint time points of the time period described in the actual total gas usage are obtained. The endpoint time points are specifically the start time point and the end time point of one end time. The endpoint time point before the time point is recorded as the index start time point, and the endpoint time point after the time point is recorded as the index end time point.
[0064] Obtain the recorded quantity of the non-faulty gas meter between the index start time point and the index end time point within the index date, and record it as the pre-selected non-faulty gas meter recorded quantity;
[0065] Obtain all non-faulty gas meter sub-record quantities corresponding to the non-faulty gas meters, and determine in turn whether all non-faulty gas meter sub-record quantities are equal to the pre-selected non-faulty gas meter record quantities corresponding to the non-faulty gas meters.
[0066] If there is a non-faulty gas meter sub-record quantity that is not equal to the pre-selected non-faulty gas meter record quantity corresponding to the non-faulty gas meter, the second gas usage data calibration strategy is repeatedly executed until all non-faulty gas meter sub-record quantities are equal to the pre-selected non-faulty gas meter record quantities corresponding to the non-faulty gas meter;
[0067] If the sub-record quantities of the non-faulty gas meters are all equal to the pre-selected non-faulty gas meter record quantities corresponding to the non-faulty gas meters, then obtain the record quantities of the faulty gas meters between the index start time point and the index end time point within the index date, record them as the target gas usage, enter the target gas usage into the actual record quantity set of the faulty gas meter, and perform the analysis step on the remaining elements in the sub-fault time period set;
[0068] The elements in the actual recorded quantity set of the faulty gas meter are summed, and the result is set as the recorded quantity of the faulty gas meter during the fault time period.
[0069] Beneficial Effects
[0070] Due to the adoption of the above-mentioned technical solution, the present invention has the following advantages and positive effects compared with the prior art: The present invention can accurately compensate for the influence of temperature on gas velocity and flow rate by real-time monitoring of the ambient temperature in the pipeline and calculating the speed of sound at the current temperature. The formula for the influence of temperature on the speed of sound simplifies the calculation through the temperature sensitivity coefficient k and is applicable to different gas types. The temperature gas flow rate compensation formula introduces the temperature coefficient β and the nonlinear index n to effectively eliminate the error caused by temperature changes and ensure the accuracy of flow rate measurement. Accurately measure the cross-sectional area of the pipeline to convert the flow rate into flow rate to ensure consistency in different pipe diameters. Real-time transmission and display of compensated flow data improves user experience, and the historical comparison method provides an efficient calibration solution for ultrasonic gas meters, ensuring the stability and reliability of the system and optimizing the measurement performance of the gas meter. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0072] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.
[0073] The embodiment of the present invention relates to an online intelligent calibration method for an ultrasonic gas meter, such as Figure 1 As shown, including:
[0074] Monitor and obtain the ambient temperature of the gas flowing through the pipeline in real time, denoted as T current ;
[0075] The speed of sound c(T current );
[0076] The formula for the effect of temperature on the speed of sound is c(T current )=c0·(1+α·(T current -T0);
[0077] Where c0 is the speed of sound at 20°C, c0 = 343 m / s, T0 is 20°C, T current is the current temperature, α is the sensitivity coefficient of gas sound velocity to temperature, α=0.0006℃ -1 ;
[0078] Use the temperature gas flow rate compensation formula to calculate the temperature compensated gas flow rate V(T current );
[0079] The temperature gas flow rate compensation formula is:
[0080] Where v0 is the gas flow rate at 20°C, β is the influence coefficient of flow rate on temperature change, obtained by fitting method, and n is the nonlinear index, which indicates the degree of influence of temperature on flow rate;
[0081] Get the cross-sectional area of the gas pipeline, denoted as A;
[0082] The temperature-compensated gas flow rate is calculated using the temperature-compensated gas flow rate, and the compensated gas flow rate is recorded as Q(T current );
[0083] Temperature gas flow compensation formula is: Q(T current )=A·V(T current );
[0084] Where A is the cross-sectional area of the gas pipeline, V(T current ) is the gas flow rate after temperature compensation;
[0085] The compensated gas flow is transmitted to the ultrasonic gas meter, and the temperature-compensated gas flow is displayed;
[0086] When an ultrasonic gas meter fails, the historical comparison method is used to calibrate the ultrasonic gas meter.
[0087] By real-time monitoring of the ambient temperature, the dynamic response capability in the gas flow measurement is ensured, and the temperature changes of the gas flowing through the environment can be accurately reflected. This real-time performance is crucial for the calculation of gas flow rate and flow rate, because temperature directly affects the physical properties of the gas, such as the speed of sound. By accurately recording the current temperature, accurate basic data can be provided for subsequent temperature compensation, thereby improving the reliability and effectiveness of the measurement. By calculating the speed of sound at the current temperature, the deviation of the gas speed of sound caused by temperature changes can be effectively compensated, thereby improving the accuracy of the gas flow rate measurement. Since the speed of sound directly affects the propagation time of ultrasonic measurement and the final flow rate calculation result, accurate speed of sound calculation is the core link of the entire system. This step can ensure that the subsequent flow rate compensation is based on the actual speed of sound, thereby improving the applicability of the compensation algorithm, especially in application scenarios with large temperature differences, effectively reducing the measurement error caused by temperature. The use of a linear formula to express the relationship between the speed of sound and the temperature simplifies the complexity of the speed of sound calculation, while ensuring high-precision fitting within the normal temperature range. The sensitivity coefficient k in the formula can be adjusted according to the specific gas properties, making it applicable to a variety of gas types. This flexibility allows the formula to be compatible with different application scenarios and reduces the adaptation cost of the measurement system when the gas composition changes. In addition, the formula clearly quantifies the direct effect of temperature on the velocity of sound, which helps to intuitively understand and quickly respond to the change of velocity of sound under complex working conditions, thereby optimizing the measurement performance of ultrasonic gas meters. The temperature gas velocity compensation formula can effectively eliminate the interference of temperature change on velocity measurement, thereby ensuring the accuracy of gas velocity measurement. By introducing the temperature influence coefficient and the nonlinear index n, the formula can capture the complex relationship between gas velocity and temperature and adapt to gas transportation conditions in various temperature ranges. The velocity calculation results after temperature compensation can lay a reliable foundation for gas flow measurement, especially in environments with large temperature differences, which can effectively reduce the cumulative effect of temperature on velocity error and improve the stability and measurement reliability of gas meters in practical applications. The temperature gas velocity compensation formula significantly improves the accuracy and applicability of velocity measurement under complex temperature change conditions by introducing the temperature influence coefficient β and the nonlinear index n. In particular, the introduction of n can flexibly adjust the response mode of the formula in different temperature ranges to adapt to various working conditions. At the same time, the formula avoids the limitations of simple linear compensation, has stronger robustness to changes in gas characteristics in actual working conditions, and provides a solid foundation for the accurate measurement of gas flow rate. This accuracy is particularly important for long-term stable operation of gas transmission systems. Accurate measurement of pipeline cross-sectional area is a prerequisite for flow compensation calculation. By obtaining accurate cross-sectional area, the linear flow velocity of the gas can be accurately converted into volume flow, thus more intuitively reflecting the gas transmission capacity.Especially in pipelines of different diameters, this step ensures the adaptability and consistency of flow calculation. The gas flow compensation formula combines the flow velocity after temperature compensation with the cross-sectional area of the pipeline, making the flow calculation result more accurate and able to intuitively reflect the actual situation of gas transportation under different temperature conditions. This compensation eliminates the interference of temperature changes on flow measurement, especially in environments with seasonal changes or large temperature differences between day and night, which can effectively improve the reliability of measurement. The real-time transmission and display of compensated flow data improves the user's operating experience and ensures the functional transparency of the gas meter. The historical comparison method provides an efficient solution for fault diagnosis and self-calibration of the gas meter.
[0088] The fitting method in this embodiment specifically includes:
[0089] Setting the temperature increases the unit amount;
[0090] Set the base temperature value;
[0091] Taking the base temperature value as the starting point, increase N temperature increment units in sequence and record the temperature value after each increase, where N is a maximum of 5;
[0092] The temperature increase unit amount is increased sequentially by N, specifically, N is the number of increases, when the number of increases is 1, the increased temperature value is the basic temperature value + 1× the temperature increase unit amount, when the number of increases is 2, the increased temperature value is the basic temperature value + 2× the temperature increase unit amount... When the number of increases is 5, the increased temperature value is the basic temperature value + 5× the temperature increase unit amount;
[0093] At each temperature value in turn, use an ultrasonic gas meter to measure the gas flow rate and record it.
[0094] Setting the temperature increment unit provides a unified incremental basis for the fitting process, ensuring the gradualness and controllability of temperature changes during the experiment. By setting the temperature increment unit reasonably, the experimental accuracy and range can be flexibly adjusted to avoid deviation or inapplicability of experimental data caused by excessive or small temperature changes. The temperature increment unit also provides a standardized benchmark for the subsequent gradual increase of temperature, so that each increase in temperature change is consistent, thereby ensuring the consistency and reliability of the experimental results. The setting of the basic temperature value provides a starting point for the entire fitting process, ensuring the systematic and traceable temperature increase. By selecting a suitable basic temperature value, the relevance of the experimental results to the real environment can be ensured, especially in the common operating temperature range of the gas transmission system. The selection of the basic temperature value helps to simulate the changes in the actual gas flow rate under different ambient temperatures, provide a reliable reference temperature, and establish a connection between the entire experiment and the performance under normal temperature conditions, providing accurate starting data for subsequent fitting. By increasing multiple temperature values in sequence and recording after each increase, the influence of temperature changes on gas flow rate can be gradually explored. This step-by-step increase method can cover the changes in gas flow rate from the basic temperature value to the higher temperature range, forming a representative experimental data set. The temperature value after each recording provides the fine granularity of the experimental data, which helps to fit a more accurate temperature-flow rate relationship. Limiting N to a maximum of 5 ensures the operability of the experiment and simplifies the difficulty of data analysis, while avoiding overfitting or overly complex experimental data caused by too many temperature points. In practical applications, this control can ensure that the test process is both complete and efficient. By describing and refining the calculation method for each temperature increase, the progressiveness and controllability of the temperature change are ensured. This clear incremental mode helps to accurately quantify the impact of each temperature change on the flow rate, thereby improving the interpretability of the experimental results. By controlling the range of each temperature increment, the temperature fluctuations that may occur in actual work can be better simulated to ensure that the acquired data has a certain degree of representativeness and universality. The calculation method after each temperature increase not only ensures the accuracy of the experimental results, but also facilitates the subsequent data processing and fitting analysis. In addition, this mode avoids confusion in the data acquisition process through clear incremental steps, ensures the standardization and repeatability of the experiment, and measures and records the gas flow rate at each temperature, ensuring the comprehensiveness and accuracy of data acquisition. This operation quantifies the effect of temperature on gas flow rate into actual flow rate data, providing real experimental data support, so that subsequent fitting work has a reliable basis. By collecting data at different temperature points, the law of gas flow rate change with temperature can be effectively analyzed, thus providing important data for the construction of temperature compensation model.
[0095] In this embodiment, when the influence coefficient β of flow velocity on temperature change is obtained by fitting method, it specifically includes:
[0096] Assume that the gas flow rate V and temperature T are nonlinear models, specifically:
[0097] Where v0 is the flow rate at 20°C, β is the temperature influence coefficient to be fitted, n is the nonlinear index, which indicates the response degree of flow rate to temperature change, and T0 is 20°C;
[0098] Define the error function E(β,n), expressed as:
[0099] Among them, V exp (T i ) is the gas flow rate measured at the i-th temperature, T i is the i-th temperature value, m is the number of temperature values;
[0100] Setting the initial beta (0) and n (0) ;
[0101] Set the learning rate α;
[0102] Set the reference temperature T c =20℃;
[0103] S1, calculate the partial derivative of the error function with respect to β;
[0104] The partial derivative with respect to β is:
[0105]
[0106] Calculating partial derivatives
[0107] S2, calculate the partial derivative of the error function with respect to n;
[0108] The partial derivative with respect to n is:
[0109]
[0110] Calculating partial derivatives
[0111] S3. Update β and n using gradient descent:
[0112]
[0113] Among them, k is the current iteration number;
[0114] Set the change threshold of the error function;
[0115] Repeat steps S1 to S3, and stop iterating when the change of the error function E(β,n) is less than the change threshold of the error function.
[0116] Assuming that there is a nonlinear relationship between flow rate and temperature can more accurately describe the complex dynamics of gas flow rate changing with temperature. The nonlinear model can reflect that the effect of temperature on gas flow rate is not only linear, but also that the effect may show an accelerating or weakening trend as the temperature changes. Therefore, the use of a nonlinear model can more comprehensively capture the response characteristics of flow rate to temperature, especially in environments with large temperature differences or drastic flow rate changes, which can significantly improve the accuracy of flow rate compensation. This assumption makes the fitting process more flexible and accurate, and is more in line with the complex physical relationship between temperature and flow rate in actual gas measurement. The nonlinear model between gas flow rate V and temperature T clarifies the relationship between flow rate, temperature and nonlinear index, and points out the key parameters that need to be fitted. V 20As the flow rate at room temperature, it provides a benchmark for subsequent temperature compensation and ensures the effectiveness of the compensation model. By introducing the temperature influence coefficient β and the nonlinear index n, the model can dynamically adjust the response of the flow rate to temperature changes and avoid the problem that the linear assumption cannot reflect the actual situation. Specifically in the application, the nonlinear index n can be flexibly adjusted according to the actual situation, providing higher fitting flexibility and thus improving the measurement accuracy. Defining the error function is the core step of the fitting process. It guides the optimization of the model parameters by measuring the difference between the model prediction value and the actual measurement value. The error function reflects the fitting quality of the model. By minimizing the error function, the model parameters can be effectively adjusted, thereby improving the model's prediction ability for gas flow rate. Using a reasonable error function (such as the least squares error function) can gradually reduce the gap between the predicted value and the actual value in multiple iterations to ensure that the optimal temperature influence coefficient β and nonlinear index n are obtained. This optimization process can help build a more accurate compensation model. Setting the initial value for the optimization algorithm is a key step to ensure that the gradient descent method can converge smoothly. Reasonable initial values can prevent the algorithm from falling into a local optimal solution and ensure that the optimization process is efficient. The initial value is usually obtained based on experience or estimation and can affect the quality of the final fitting result. If the initial value is set properly, the gradient descent method can converge to the optimal solution faster, thus saving computing resources and time. By setting the initial value, the algorithm can start and begin iterative optimization, providing a basis for further precise adjustment of β and n. The learning rate α is a key parameter in the gradient descent method, which determines the step size of the parameter update at each iteration. An appropriate learning rate can accelerate the convergence of the model and avoid the situation where the calculation time is too long due to a small step size, or the convergence is unstable due to a large step size. By setting a suitable learning rate, the training efficiency of the model can be improved while avoiding overfitting. If the learning rate is too large, the parameter update may be too fast and miss the optimal solution; if the learning rate is too small, the convergence process may become very slow. Reasonable setting of the learning rate can ensure that the model effectively and stably approaches the optimal solution during the fitting process. The setting of the reference temperature provides a fixed benchmark for the entire fitting process. Normal temperature, such as 20°C, is usually selected as the reference temperature, which can unify the calculation standards of each temperature point. This standardization process helps to reduce the calculation errors caused by different reference benchmarks. By setting the reference temperature to 20°C, the fitting results of all temperature influence coefficients can be ensured to be consistent and can be effectively connected with the actual ambient temperature changes. The reference temperature setting can also reduce fluctuations caused by environmental changes or equipment differences and enhance the stability of the measurement system. By calculating the partial derivative of the error function with respect to β, the gradient descent method can obtain the trend of the error relative to the temperature influence coefficient β, and then adjust the value of β to reduce the error. The partial derivative reflects the rate of change of the error function under the current parameter value and is an important basis for adjusting the model parameters during the optimization process.By gradually calculating and updating β, the error function can be gradually reduced, the model can be optimized, and the model can be ensured to respond more accurately to temperature changes. This step is the core of the gradient descent method, which can minimize the error and improve the fitting accuracy. Calculating the partial derivative of the error function with respect to the nonlinear index n enables the gradient descent method to adjust the n parameter at the same time, thereby more accurately capturing the response of the flow rate to temperature changes. By updating n, the model can be optimized to make it more sensitive to the nonlinear characteristics of temperature changes, thereby improving the fitting effect of the model. This step complements the adjustment of β to ensure the coordinated update of the two, thereby improving the accuracy of temperature and flow rate compensation, especially in complex temperature environments. Calculating the partial derivative of the error function with respect to n provides a specific mathematical basis for further adjusting n. By solving the partial derivative, the gradient descent method can obtain a clear update direction and gradually correct n to make it more adaptable to the nonlinear relationship between flow rate and temperature. The partial derivative reveals the difference between the current value and the optimal value, guides the step size and direction of each update, and makes the optimization process both efficient and stable. By repeatedly adjusting n, the nonlinear index that best fits the actual flow rate-temperature relationship can be obtained. By using the gradient descent method to update β and n, the temperature influence coefficient and nonlinear index can be adjusted after each iteration, so that the model continues to approach the optimal solution. The gradient descent method is an efficient optimization algorithm that can effectively reduce the error function and improve the fitting accuracy of the model. In practical applications, by repeatedly adjusting these two parameters, it will eventually converge to the optimal temperature compensation model, significantly improving the measurement accuracy of ultrasonic gas meters under different temperature conditions. Setting the threshold of the change in the error function can ensure that the gradient descent method automatically stops when a certain accuracy is reached, avoiding excessive iterations that lead to waste of computing resources. The reasonable setting of this threshold can balance the computing efficiency and optimization accuracy, so that the model can achieve sufficiently accurate fitting results within a reasonable computing time. By controlling the change in the error, the algorithm can avoid repeated fluctuations during the optimization process, thereby improving the stability and efficiency of the convergence. By stopping the iteration when the change in the error function is lower than the set threshold, it is ensured that the gradient descent method can converge stably near the optimal solution. This avoids the waste of computing time caused by excessive iterations, while ensuring that the model meets the required accuracy requirements. This stopping criterion makes the algorithm more efficient and can quickly find the optimal values of the temperature influence coefficient β and the nonlinear index n, thereby building an accurate temperature compensation model and improving the flow rate measurement accuracy of the ultrasonic gas meter.
[0117] In this embodiment, the ultrasonic gas meter is calibrated by using a historical comparison method, which specifically includes:
[0118] Use a total ultrasonic gas meter to record the total gas usage of all users;
[0119] The total ultrasonic gas meter is recorded as a total meter, and the total meter is used to record the usage of all gas in an area;
[0120] The sub-ultrasonic gas meter is recorded as a sub-meter, and the sub-meter is used to record the amount of gas used by a single user;
[0121] Obtain the faulty sub-meter under the main meter and record it as the faulty gas meter;
[0122] All sub-meters except the faulty gas meter under the main meter shall be recorded as non-faulty gas meters;
[0123] Obtain historical gas usage of the total meter, faulty gas meters, and non-faulty gas meters;
[0124] Obtain the time point at which the fault of the faulty gas meter occurs, and record it as the fault start time point;
[0125] Obtain the time point at which the fault of the faulty gas meter ends, and record it as the fault end time point;
[0126] The fault start time point and the fault end time point are both within the same day;
[0127] Calculate the fault time period of the faulty gas meter, where the fault time period = fault end time point - fault start time point;
[0128] Obtain the gas usage of the total meter and the non-faulty gas meter during the fault period respectively, and execute the gas usage data calibration strategy;
[0129] The gas usage data calibration strategy includes a gas usage first data calibration strategy and a gas usage second data calibration strategy;
[0130] Execute the first gas usage data calibration strategy for the gas usage of the total meter during the fault time period;
[0131] Analyze and process the result of the first gas usage data calibration strategy, and determine whether to execute the second gas usage data calibration strategy according to the result;
[0132] If the gas usage second data calibration strategy is executed, then the actual gas usage of the faulty gas meter during the fault time period is set according to the result of the gas usage second data calibration strategy;
[0133] If the second gas usage data calibration strategy is not executed, the actual gas usage of the faulty gas meter during the fault time period is set according to the result of the first gas usage data calibration strategy.
[0134] By using a master ultrasonic gas meter to record the gas usage of all users, it is possible to ensure a comprehensive grasp of the overall gas consumption in a region. This practice provides a reliable reference for the subsequent calibration of individual faulty gas meters, because the master meter can provide a total data within a region, which can be used as a calibration standard for other sub-meters. The comprehensive data of the master meter can ensure that abnormal situations are discovered and analyzed in a timely manner, providing a solid foundation for accurate fault diagnosis and correction. By defining the sub-meter as a record of gas usage for a single user, the granularity of the data is clarified, and independent gas usage can be provided for each user. Such a distinction can effectively identify which users' equipment has problems and accurately calibrate when a fault occurs. As an individual measuring device, the data of the sub-meter can provide support and comparison for the master meter, ensuring the accuracy and reliability of the entire system. When troubleshooting, the fine-grained data of the sub-meter can help analyze the specific impact range of the fault and avoid attributing the problem to a systematic error. By clearly distinguishing between a faulty gas meter and a sub-meter in normal operation, the problem can be effectively located on a specific device. Identifying a faulty gas meter is the first step in fault diagnosis, which helps to quickly identify the equipment that needs to be calibrated. Through this process, unnecessary intervention in other equipment can be reduced to avoid interference with the normal operation of other equipment. Identifying faulty equipment separately can help improve the efficiency of system diagnosis and speed up problem solving. Distinguishing between faulty and non-faulty gas meters can effectively focus on handling equipment that has been confirmed to have problems, while avoiding misdiagnosis and unnecessary operations. Non-faulty gas meters, as the data benchmark for normal operating equipment, provide a reference standard for data calibration of faulty gas meters. During the calibration process, the rationality and accuracy of the calibration results can be ensured based on the normal data of non-faulty meters. This approach reduces the processing steps and improves the efficiency of calibration and repair. Obtaining historical gas usage can provide sufficient time series data support for the calibration process. By comparing the historical data of the total meter, faulty gas meters and non-faulty gas meters, the abnormal fluctuations or changes of the faulty meter within a certain time range can be analyzed, thereby providing a basis for diagnosing the cause of the fault. The collection of historical data can ensure that the calibration strategy is based on sufficient information for analysis, making fault repair more accurate. By accurately recording the start time of the fault, the occurrence period of the fault can be clarified. Accurately recording the end time of the fault provides a basis for calculating the duration of the fault, which helps to evaluate the specific impact of the fault on the total meter and sub-meter data. By clarifying the fault termination time, the exact time period during the fault can be delineated, ensuring that only the data of the relevant time period is processed during the calibration process to avoid erroneous correction of normal data. Ensuring that the fault occurs and terminates within the same day can simplify the management and calculation of time periods and avoid complex time data processing caused by cross-day faults. This setting makes the calibration of the fault time period easier and reduces the confusion of cross-date data.Limiting the fault to the same day helps to more clearly reflect the data change trend during the fault period, ensure the accuracy of the calibration process, and avoid the interference of too many complex factors. By obtaining the gas usage of the total meter and the non-faulty gas meter respectively, an accurate reference basis can be provided for the calibration of the faulty gas meter. As a normal data source, the total meter and the non-faulty meter can provide a reasonable calibration standard for the faulty meter to ensure the rationality and accuracy of the correction result. The execution of the data calibration strategy is based on the data support of these two tables, making the calibration more scientific and reasonable. Through this step, the data calibration problem can be limited to the fault time period, and the data correction can be performed within a reasonable range. By introducing a multi-level calibration strategy (the first data calibration strategy and the second data calibration strategy), a more flexible adjustment method can be provided to meet the correction needs of different fault situations. The first data calibration strategy is usually a preliminary correction method. If the correction result meets the accuracy requirements, no more complex processing is required. If the first strategy is not effective, the second data calibration strategy can further optimize the result. The introduction of multiple strategies ensures the diversity and efficiency of the calibration process, and the optimal solution can be flexibly selected according to the actual situation. The first data calibration strategy is executed on the gas usage of the total meter during the fault period, which can provide a preliminary correction basis for subsequent calibration. The first data calibration strategy is usually simple and efficient, and is suitable for common error situations. If the calibrated data meets expectations, the problem can be quickly solved and unnecessary complex operations can be avoided. This preliminary strategy provides a basis for the subsequent possible second data calibration strategy, ensuring the smooth progress of the fault repair process. By analyzing the results of the first data calibration strategy, it can be effectively determined whether further optimization is needed. If the data after the preliminary calibration has met the requirements, time and resources can be saved and unnecessary complex operations can be avoided. The process of analyzing and processing the results helps to find problems and make adjustments in time during the calibration process, ensuring the pertinence and effectiveness of the calibration strategy. This analysis step makes the calibration process more flexible and can make the most appropriate adjustments according to actual conditions. If the first strategy cannot meet the accuracy requirements, executing the second data calibration strategy can further optimize the results and ensure that the gas usage of the faulty gas meter during the fault period is accurate. The second strategy is usually aimed at complex errors or data anomalies, and can provide more accurate correction results. Through this strategy, the reliability of the data can be ensured to the greatest extent, providing accurate metering data for the system, and improving the overall accuracy of the system and user satisfaction. If the first strategy is sufficient to correct the data, the more complex second strategy can be avoided, thus saving computing resources and time. This approach improves calibration efficiency and reduces system burden. If the data set by the first strategy meets the accuracy requirements, over-correction is avoided and the corrected data is ensured to have a high degree of credibility.
[0135] In this embodiment, the gas usage of the total meter during the fault period is calibrated using the first data of the gas usage, which specifically includes:
[0136] Obtain the gas usage recorded in the total meter during the fault period and record it as the current total gas usage;
[0137] Obtain the gas usage recorded in the total meter during the fault period in the historical time, and record it as the total historical gas usage;
[0138] Obtain the gas usage of all non-faulty sub-meters during the fault time period, record it as the current non-faulty gas meter record, and associate the non-faulty sub-meters with the corresponding current non-faulty gas meter record to form a gas usage data group;
[0139] Set a category of gas usage collection;
[0140] Set the total gas usage deviation threshold;
[0141] Divide the historical time into multiple sub-historical time periods based on the fault time period, and obtain the gas usage recorded in the total meter in the sub-historical time period;
[0142] If the absolute value of the difference between the gas usage recorded in the total meter in the sub-historical time period and the current total gas usage is less than or equal to the total gas usage deviation threshold, the gas usage recorded in the total meter in the sub-historical time period is entered into a gas usage set;
[0143] If the absolute value of the difference between the gas usage recorded in the total meter in the sub-historical time period and the current total gas usage is greater than the total gas usage deviation threshold, the gas usage recorded in the total meter in the sub-historical time period will not be entered into a category of gas usage set.
[0144] By obtaining the gas usage recorded by the total meter during the fault time period, the actual gas usage during the fault period can be accurately determined. Obtaining the gas usage recorded by the total meter during the historical time period can provide a basis for historical data comparison for calibration. This data can help determine whether the gas usage during the fault time period deviates from the historical normal value, so as to find out whether there is anomaly caused by the fault. In the calibration process, historical data can be used as a reference to provide a stable background value, which helps to determine whether the data in the current fault time period is reasonable and formulate corresponding calibration strategies. By collecting the gas usage of all non-faulty sub-meters, multi-dimensional reference data can be provided for calibration. Associating the data of non-faulty sub-meters with the current gas usage helps to identify the usage deviation of the faulty sub-meter, and infer the error of the faulty meter by comparing the gas usage data of the normal meter. By associating the data of different meters, data correction can be performed more accurately, avoiding miscorrection caused by local deviation, thereby improving the accuracy of calibration. Setting a type of gas usage set can provide a unified data classification basis for subsequent calibration strategies. By concentrating the qualified gas usage in one set, it can help simplify the data processing process, so that the calibration strategy can operate on this data set efficiently. The total gas usage deviation threshold is used to define the degree of proximity between the total historical gas usage and the current gas usage. The smaller the deviation threshold, the closer or equal the two are. By dividing the historical time period into multiple sub-historical time periods according to the fault time period, the data analysis can be refined to ensure that the data of each sub-time period can be accurately evaluated. If the absolute value of the difference between the gas usage recorded in the total meter in the sub-historical time period and the current total gas usage is less than or equal to the total gas usage deviation threshold, the gas usage recorded in the total meter in the sub-historical time period is entered into a gas usage set. By setting this condition, historical data that meets the standard can be effectively screened out, thereby ensuring that the calibration strategy is only applied to historical data that is similar to the current fault time period and has acceptable deviations. By entering qualified historical data into the gas usage set, the accuracy and stability of the calibration process can be improved to avoid interference from irrelevant data. If the absolute value of the difference between the gas usage recorded in the total meter in the sub-historical time period and the current total gas usage is greater than the total gas usage deviation threshold, the gas usage recorded in the total meter in the sub-historical time period will not be entered into a gas usage set. The setting of this condition can ensure that only those historical time periods that are highly relevant to the current data are selected, thereby avoiding the influence of data with large errors on the calibration results. If the difference between the historical data and the current fault time period exceeds the set deviation threshold, these data are excluded to ensure that the calibration is only based on reliable and accurate data. By preventing data that does not meet the conditions from being entered into the gas usage set, the data quality and calibration effect can be improved, the introduction of errors can be reduced, and the final calibration results can be ensured to be more accurate and reliable.
[0145] In this embodiment, each element in a type of gas usage set is selected in turn to perform the following steps:
[0146] S4, recording the selected element as the actual total gas consumption;
[0147] S5. Obtain the date of the actual total gas usage, record it as the index date, and obtain the endpoint time points of the time period of the actual total gas usage. The endpoint time points are specifically the start time point and the end time point of the time period. The endpoint time point before the start time point is recorded as the index start time point, and the endpoint time point after the end time point is recorded as the index end time point.
[0148] S6. Obtain the recorded quantity of the non-faulty gas meter between the index start time point and the index end time point within the index date, and record it as the pre-selected non-faulty gas meter recorded quantity;
[0149] S7, obtaining the current non-faulty gas meter record quantities corresponding to all non-faulty gas meters, and determining in turn whether the current non-faulty gas meter record quantities are equal to the pre-selected non-faulty gas meter record quantities corresponding to the non-faulty gas meters, if they are equal, obtaining the record quantities of the faulty gas meters between the index start time point and the index end time point within the index date, recording them as the target gas usage, setting the target gas usage as the actual gas usage of the faulty gas meter within the faulty time period, and stopping the gas usage first data calibration strategy;
[0150] S8. If there is a current non-faulty gas meter whose recorded amount is not equal to the pre-selected non-faulty gas meter recorded amount corresponding to the non-faulty gas meter, then the actual total gas usage is removed from the gas usage set of a category;
[0151] If the number of elements in the first category of gas usage set is not 0, and the actual gas usage of the faulty gas meter during the fault time period is not found, then repeat steps S4 to S8 in the remaining elements of the first category of gas usage set until the actual gas usage of the faulty gas meter during the fault time period is found;
[0152] If the number of elements in a type of gas usage set is 0, the gas usage second data calibration strategy is executed.
[0153] By selecting each element in a set of gas usage in turn, the calibration process can be ensured to be systematic and thorough. By using the selected element as the actual total gas usage, this step clarifies the benchmark data used for the current calibration. By obtaining the date and endpoint time points of the actual total gas usage, the time range of the data can be accurately located. This provides precise time constraints for subsequent calibration, allowing calibration to be performed within the correct time frame. By clearly defining the start and end time points, it helps to control the data range, avoid correction errors caused by time errors during calibration, and ensure data consistency and accuracy. Obtaining the recorded volume of non-faulty gas meters as the pre-selected standard data volume is the basis for screening the comparison data during the calibration process. The pre-selected recorded volume of non-faulty gas meters provides an important benchmark value for calibration, which can help compare and verify the gas usage data of faulty gas meters in the same time period, ensuring that the calibration results are consistent with the data of normal meters. Through this comparison, the error of the faulty gas meter can be calibrated more accurately, ensuring that the corrected data has high credibility. Obtain the current non-fault gas meter record quantities corresponding to all non-fault gas meters, and determine in turn whether the current non-fault gas meter record quantities are equal to the pre-selected non-fault gas meter record quantities corresponding to the non-fault gas meters. If they are equal, obtain the record quantities of the faulty gas meters between the index start time point and the index end time point within the index date, record them as the target gas usage, set the target gas volume to the actual gas usage of the faulty gas meter during the fault time period, and stop the gas usage first data calibration strategy. This step ensures that during the calibration process, only when the data of the non-faulty meters are completely consistent, the relevant faulty meter data will be selected for correction. This method can minimize the errors introduced by the inconsistency of the non-faulty gas meter data. In this way, the calibration is only performed under the most accurate data matching conditions, thereby improving the reliability and accuracy of the correction results of the faulty gas meter. When the target gas usage is obtained, the calibration is stopped, which means that the entire correction process is effectively completed, avoiding redundant steps and calculations. If the current non-faulty gas meter record quantity does not match the pre-selected record quantity, the actual total gas usage is removed from the set, which helps to filter out data that does not meet the conditions. If the number of elements in a type of gas usage set is not 0, and the actual gas usage of the faulty gas meter during the fault time period is not found, then steps S4 to S8 are repeated in the remaining elements of the type of gas usage set until the actual gas usage of the faulty gas meter during the fault time period is found. This step ensures that even if the initial screening does not find suitable calibration data, the remaining data will continue to be screened until the most suitable correction data is found. This repeated verification method ensures that only the most relevant data in the data set is used, thereby improving the accuracy of the calibration result.
[0154] In this embodiment, the gas usage second data calibration strategy specifically includes:
[0155] Set the actual recorded quantity set of the faulty gas meter;
[0156] S9, setting a sub-fault time period set;
[0157] S10, evenly divide the fault time period into N equal sub-time periods, obtain the length of the sub-time period, record it as the divided time period, and enter it into the sub-fault time period set;
[0158] S11. For any element in the sub-fault time period set, perform the following steps:
[0159] S12, obtaining the record quantity of the total table within the sub-fault time period, and recording it as the sub-record quantity of the total table;
[0160] S13, obtaining the recorded quantities of all non-faulty gas meters in the sub-fault time period, and recording them as the sub-recorded quantities of non-faulty gas meters;
[0161] S14. Set the total gas consumption;
[0162] S15, dividing the historical time into a plurality of sub-historical time periods in units of divided time periods, and sequentially entering the gas usage recorded in the total table in the sub-historical time periods into the total gas usage set;
[0163] S16, traverse the elements in the total gas usage set, if the element is not equal to the total meter sub-record amount, remove the element from the total gas usage set, if the element is equal to the total meter sub-record amount, continue traversing until all elements are traversed;
[0164] S17, traverse the elements in the total gas consumption set, select one element each time and perform the following steps:
[0165] S18, recording the selected element as the actual total amount of gas used;
[0166] S19, obtaining the date on which the actual total gas usage is executed, recorded as the index date, obtaining the endpoint time points of the time period described in the actual total gas usage, the endpoint time points specifically being the start time point and the end time point of one end time, the endpoint time point before the time point being recorded as the index start time point, and the endpoint time point after the time point being recorded as the index end time point;
[0167] S20, obtaining the recorded quantity of the non-faulty gas meter between the index start time point and the index end time point within the index date, and recording it as the pre-selected non-faulty gas meter recorded quantity;
[0168] S21. Obtain all non-faulty gas meter sub-record quantities corresponding to the non-faulty gas meters, and determine in turn whether all non-faulty gas meter sub-record quantities are equal to the pre-selected non-faulty gas meter record quantities corresponding to the non-faulty gas meters.
[0169] Creating a "faulty gas meter actual record volume set" can centrally store the real record data of the faulty gas meter in all sub-fault time periods of the fault. By setting the "sub-fault time period set", the entire fault time period can be divided into multiple sub-time periods, which is convenient for more detailed calibration. Dividing the fault time period into N sub-time periods ensures that the data processing in each sub-time period has an equal time span, making the data processing of each sub-segment more balanced. This method avoids the subjectivity of time period division by even division, reduces human errors, and improves the scientific nature of data analysis during the calibration process. Uniform time period division can ensure time accuracy, so that the gas usage in each time period is more representative, which helps to improve the reliability and operability of the entire calibration. Performing the same calibration steps for each sub-fault time period ensures the systematicness and consistency of the calibration process. Each time is based on the same steps, so that the calibration process is not affected by the difference in data in a single time period, avoiding unnecessary deviations. Obtaining the record volume of the total meter in each sub-fault time period helps as a benchmark data point for calibration. This step provides basic data for subsequent comparison of the record volume of other meters. By obtaining the record volume of all non-faulty gas meters in each sub-time period, a set of standard data can be provided for calibration. This step analyzes the recorded quantities of non-faulty gas meters to ensure that the normal operating meters can be used as references during the correction process, thereby reducing the deviation caused by the errors of the faulty meters. The recorded quantities of non-faulty gas meters are used as a comparison benchmark to help compare and correct the data of the faulty meters and enhance the accuracy of the entire calibration process. By dividing the historical time into multiple sub-historical time periods, historical data can be processed more carefully. The advantage of this is that it can avoid the errors that may be caused by data when the overall time period is too long, thereby improving the representativeness and accuracy of the data in each sub-segment. By entering the total meter record quantity of each sub-time period into a set, it is possible to confirm one by one whether the data of each small segment is suitable for calibration, which helps to improve the accuracy of the data and the systematic nature of the calibration process. By traversing each element in the total gas consumption set and filtering out the data that matches the total meter sub-record quantity, it helps to improve the accuracy of the data. Eliminating elements that do not meet the conditions ensures that the data used for calibration in the end has higher relevance and accuracy. This screening step ensures that only data with high matching degree is used in the calibration process, reducing possible errors or noise, thereby ensuring the reliability of the calibration results. By going through the elements in the total gas usage set one by one, it is possible to ensure that each data point is individually verified and calibrated. In this way, the calibration process can ensure that each data point is carefully and thoroughly analyzed to reduce omissions and errors. This step makes the calibration process more precise and standardized, ensuring that the most suitable calibration results can be obtained when each data is selected, thereby improving the accuracy of the entire correction process. By clearly marking the selected element as "actual total gas usage", it is helpful to track and manage the data in subsequent steps.After marking, the calibration process can perform accurate calculations based on this data point. Clear data identification ensures that there is no data confusion in subsequent steps, and enhances the clarity and systematicness of the calibration process. By obtaining the index date and endpoint time point, the time range of the data can be accurately determined. This information provides a clear time frame for subsequent comparison and verification of other gas meter record quantities, ensuring that all data belongs to the same time period during calibration, avoiding erroneous comparisons across time periods. Clear time point definition ensures accurate positioning and use of data during the calibration process, improving the timeliness and accuracy of the calibration results. By obtaining the non-faulty gas meter record quantity within the index date, standard data is provided for subsequent data calibration. This step ensures that during the calibration process, all comparison data comes from normal gas meter records within the same time period, avoiding interference from abnormal data. By defining "pre-selected non-faulty gas meter record quantities", a reliable comparison basis can be provided for the calibration process, ensuring that the correction results of the faulty gas meter can accurately reflect the actual situation. By comparing the sub-record quantities of all non-faulty gas meters, it can further ensure that the data of each sub-time period is in line with expectations, thereby ensuring the accuracy of the calibration process. If there is inconsistency in the data, the system will continue to screen until all record quantities are consistent. This one-by-one comparison operation helps to discover potential data anomalies, ensure that the data in each sub-time period meets the calibration standards, and improve the accuracy and reliability of data processing.
[0170] In this embodiment, if there is a non-fault gas meter sub-record amount that is not equal to the pre-selected non-fault gas meter record amount corresponding to the non-fault gas meter, repeat steps S9 to S21 until all non-fault gas meter sub-record amounts are equal to the pre-selected non-fault gas meter record amounts corresponding to the non-fault gas meter;
[0171] If the sub-record quantities of the non-faulty gas meters are all equal to the pre-selected non-faulty gas meter record quantities corresponding to the non-faulty gas meters, then obtain the record quantities of the faulty gas meters between the index start time point and the index end time point within the index date, record them as the target gas usage, enter the target gas usage into the actual record quantity set of the faulty gas meter, and execute steps S12 to S21 for the remaining elements in the sub-faulty time period set;
[0172] The elements in the actual recorded quantity set of the faulty gas meter are summed, and the result is set as the recorded quantity of the faulty gas meter during the fault time period.
[0173] If there is a non-fault gas meter sub-record quantity that is not equal to the pre-selected non-fault gas meter record quantity corresponding to the non-fault gas meter, repeat steps S9 to S21 until all non-fault gas meter sub-record quantities are equal to the pre-selected non-fault gas meter record quantity corresponding to the non-fault gas meter. The main function of this step is to ensure that the record quantity of the non-fault gas meter remains consistent in each sub-time period to ensure the accuracy of the data. By continuously repeating steps S9 to S21, the system can automatically detect and correct any inconsistent data points to ensure that the gas meter record quantity in each sub-time period meets expectations. This mechanism effectively prevents calibration errors caused by inconsistent data, especially in complex time period division and data analysis processes. This repeated verification can ensure that each data point is accurately corrected, thereby improving the reliability and accuracy of calibration. Once the record quantities of the non-fault gas meters are consistent, the next stage is entered to start processing the record quantities of the faulty gas meters. By obtaining the record quantities of the faulty gas meters in the specified time period and entering them into the actual record quantity set, it is ensured that the faulty data is effectively corrected. This step effectively marks the target gas usage and files it in the actual record volume set of the faulty gas meter, ensuring that the correction of the fault data can be carried out in accordance with the established standards. This process can reduce the impact of missing or erroneous data, improve the processing accuracy of faulty data, and provide more reliable input data for subsequent calibration. By summing the elements in the actual record volume set of the faulty gas meter, the total record volume of the faulty gas meter during the fault period is obtained.
Claims
1. An online intelligent calibration method for an ultrasonic gas meter, characterized in that: The following steps are involved: Monitor and obtain the ambient temperature of the gas flowing through the pipeline in real time; Use the temperature gas flow rate compensation formula to calculate the gas flow rate at the current temperature; Obtaining the cross-sectional area of the gas pipeline and combining it with the gas flow rate at the current temperature to obtain the gas flow rate; transmitting the gas flow to an ultrasonic gas meter and displaying it; When an ultrasonic gas meter fails, a historical comparison method is used to calibrate the ultrasonic gas meter.
2. The method for online intelligent calibration of an ultrasonic gas meter according to claim 1, characterized in that: The gas flow rate at the current temperature is Calculated, where V(T current ) is the gas flow rate at the current temperature, v0 is the gas flow rate at 20°C, T current is the current temperature, β is the influence coefficient of flow rate on temperature change, n is the nonlinear index, and T0 is 20℃.
3. The method for online intelligent calibration of an ultrasonic gas meter according to claim 2, characterized in that: The influence coefficient β of the flow rate on the temperature change is obtained by the fitting method, specifically: Define the error function E(β,n), expressed as: Among them, V exp (T i ) is the gas flow rate measured at the i-th temperature, T i is the i-th temperature value, m is the number of temperature values; Calculate the partial derivative of the error function E(β,n) with respect to β and the partial derivative with respect to n respectively, and use the gradient descent method to update β and n; Repeat the previous step, and stop iterating when the change in the error function E(β,n) is less than the change threshold of the error function.
4. The method for online intelligent calibration of an ultrasonic gas meter according to claim 1, characterized in that: Before using the temperature gas flow rate compensation formula to calculate the gas flow rate at the current temperature, the method further includes: calculating the sound speed at the current temperature by using the temperature effect on the sound speed formula, wherein the sound speed at the current temperature is calculated by c(T current )=c0·(1+α·(T current -T0)) is calculated, where c(T current ) is the speed of sound at the current temperature, c0 is the speed of sound at 20℃, α is the sensitivity coefficient of gas sound speed to temperature, and T0 is 20℃.
5. The method for online intelligent calibration of an ultrasonic gas meter according to claim 1, characterized in that: The calibrating the ultrasonic gas meter by adopting the historical comparison method specifically includes: Use a total ultrasonic gas meter to record the total gas usage of all users; The total ultrasonic gas meter is recorded as a total meter, and the total meter is used to record the usage of all gas in an area; The sub-ultrasonic gas meter is recorded as a sub-meter, and the sub-meter is used to record the amount of gas used by a single user; Obtain the faulty sub-meter under the main meter and record it as the faulty gas meter; All sub-meters except the faulty gas meter under the main meter shall be recorded as non-faulty gas meters; Obtain historical gas usage of the total meter, faulty gas meters, and non-faulty gas meters; Obtain the time point at which the fault of the faulty gas meter occurs, and record it as the fault start time point; Obtain the time point at which the fault of the faulty gas meter ends, and record it as the fault end time point; The fault start time point and the fault end time point are both within the same day; Calculate the fault time period of the faulty gas meter, where the fault time period = fault end time point - fault start time point; Obtain the gas usage of the total meter and the non-faulty gas meter during the fault period respectively, and execute the gas usage data calibration strategy; The gas usage data calibration strategy includes a gas usage first data calibration strategy and a gas usage second data calibration strategy; Execute the first gas usage data calibration strategy for the gas usage of the total meter during the fault time period; Analyze and process the result of the first gas usage data calibration strategy, and determine whether to execute the second gas usage data calibration strategy according to the result; If the gas usage second data calibration strategy is executed, then the actual gas usage of the faulty gas meter during the fault time period is set according to the result of the gas usage second data calibration strategy; If the second gas usage data calibration strategy is not executed, the actual gas usage of the faulty gas meter during the fault time period is set according to the result of the first gas usage data calibration strategy.
6. The method for online intelligent calibration of an ultrasonic gas meter according to claim 5, characterized in that: The step of executing the first gas usage data calibration strategy on the gas usage of the total meter during the fault time period specifically includes: Obtain the gas usage recorded in the total meter during the fault period and record it as the current total gas usage; Obtain the gas usage recorded in the total meter during the fault period in the historical time, and record it as the total historical gas usage; Obtain the gas usage of all non-faulty sub-meters during the fault time period, record it as the current non-faulty gas meter record, and associate the non-faulty sub-meters with the corresponding current non-faulty gas meter record to form a gas usage data group; Set a category of gas usage collection; Set the total gas usage deviation threshold; Divide the historical time into multiple sub-historical time periods based on the fault time period, and obtain the gas usage recorded in the total meter in the sub-historical time period; If the absolute value of the difference between the gas usage recorded in the total meter in the sub-historical time period and the current total gas usage is less than or equal to the total gas usage deviation threshold, the gas usage recorded in the total meter in the sub-historical time period is entered into a gas usage set; If the absolute value of the difference between the gas usage recorded in the total meter in the sub-historical time period and the current total gas usage is greater than the total gas usage deviation threshold, the gas usage recorded in the total meter in the sub-historical time period will not be entered into a category of gas usage set.
7. The method for online intelligent calibration of an ultrasonic gas meter according to claim 6, characterized in that: Select each element in a category of gas usage set in turn and perform the following steps: The selected element is recorded as the actual total gas usage; The date of the actual total gas usage is obtained and recorded as the index date. The endpoint time points of the time period of the actual total gas usage are obtained. The endpoint time points are specifically the start time point and the end time point of the time period. The endpoint time point before the start time point is recorded as the index start time point, and the endpoint time point after the end time point is recorded as the index end time point. Obtain the recorded quantity of the non-faulty gas meter between the index start time point and the index end time point within the index date, and record it as the pre-selected non-faulty gas meter recorded quantity; Obtain the current non-faulty gas meter record quantities corresponding to all non-faulty gas meters, and determine in turn whether the current non-faulty gas meter record quantities are equal to the pre-selected non-faulty gas meter record quantities corresponding to the non-faulty gas meters. If they are all equal, obtain the record quantities of the faulty gas meters between the index start time point and the index end time point within the index date, record them as the target gas usage, set the target gas usage to the actual gas usage of the faulty gas meter during the faulty time period, and stop the gas usage first data calibration strategy; If there is a current non-faulty gas meter whose recorded quantity is not equal to the pre-selected non-faulty gas meter recorded quantity corresponding to the non-faulty gas meter, the actual total gas consumption is removed from the gas consumption set of a category; If the number of elements in a type of gas usage set is not 0, and the actual gas usage of the faulty gas meter during the fault time period is not found, repeat the above steps in the remaining elements of the type of gas usage set until the actual gas usage of the faulty gas meter during the fault time period is found; If the number of elements in a type of gas usage set is 0, the gas usage second data calibration strategy is executed.
8. The method for online intelligent calibration of an ultrasonic gas meter according to claim 5, characterized in that: The executing the second gas usage data calibration strategy specifically includes: Set the actual recorded quantity set of the faulty gas meter; Set the sub-fault time period set; Divide the fault time period into N equal sub-time periods, obtain the length of the sub-time period, record it as the divided time period, and enter it into the sub-fault time period set; For any element in the sub-failure time period set, perform the following analysis steps: Obtain the record quantity of the total table within the sub-fault time period, and record it as the sub-record quantity of the total table; Obtain the record quantity of all non-faulty gas meters in the sub-fault time period, and record it as the sub-record quantity of non-faulty gas meters; Set the total gas usage collection; Divide the historical time into multiple sub-historical time periods based on the time period, and sequentially enter the gas usage recorded in the total meter in the sub-historical time periods into the total gas usage set; Traverse the elements in the total gas usage set. If the element is not equal to the total meter sub-record amount, remove the element from the total gas usage set. If the element is equal to the total meter sub-record amount, continue traversing until all elements are traversed. Traverse the elements in the total gas usage collection, select one element at a time and perform the following analysis steps: The selected element is recorded as the actual total amount of gas used for execution; The date when the actual total gas usage is executed is obtained, recorded as the index date, and the endpoint time points of the time period described in the actual total gas usage are obtained. The endpoint time points are specifically the start time point and the end time point of one end time. The endpoint time point before the time point is recorded as the index start time point, and the endpoint time point after the time point is recorded as the index end time point. Obtain the recorded quantity of the non-faulty gas meter between the index start time point and the index end time point within the index date, and record it as the pre-selected non-faulty gas meter recorded quantity; Obtain all non-faulty gas meter sub-record quantities corresponding to the non-faulty gas meters, and determine in turn whether all non-faulty gas meter sub-record quantities are equal to the pre-selected non-faulty gas meter record quantities corresponding to the non-faulty gas meters.
9. The method for online intelligent calibration of an ultrasonic gas meter according to claim 8, characterized in that: If there is a non-faulty gas meter sub-record quantity that is not equal to the pre-selected non-faulty gas meter record quantity corresponding to the non-faulty gas meter, the second gas usage data calibration strategy is repeatedly executed until all non-faulty gas meter sub-record quantities are equal to the pre-selected non-faulty gas meter record quantities corresponding to the non-faulty gas meter; If the sub-record quantities of the non-faulty gas meters are all equal to the pre-selected non-faulty gas meter record quantities corresponding to the non-faulty gas meters, then obtain the record quantities of the faulty gas meters between the index start time point and the index end time point within the index date, record them as the target gas usage, enter the target gas usage into the actual record quantity set of the faulty gas meter, and perform the analysis step on the remaining elements in the sub-fault time period set; The elements in the actual recorded quantity set of the faulty gas meter are summed, and the result is set as the recorded quantity of the faulty gas meter during the fault time period.