Steam instrument calibration method, device, electronic equipment and storage medium

By constructing a test model and a neural network model to correct the historical data of steam instruments, the problems of low correction efficiency and poor versatility of steam instruments in the existing technology are solved, and efficient calibration and accurate detection of steam instruments are achieved.

CN117606590BActive Publication Date: 2024-09-10HEBEI BAISHA TOBACCO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311362652.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-19
Publication Date
2024-09-10
Estimated Expiration
2043-10-19

AI Technical Summary

Technical Problem

The current calibration method for steam meters is inefficient and has poor versatility, and cannot be effectively applied to all steam meters. Especially in high temperature and humid environments, it has a great impact on the detection accuracy of steam flow meters.

Method used

By obtaining historical pressure data and flow data of steam instruments, a test model is constructed to determine abnormal data, and the neural network model is used to correct and calibrate the abnormal data to improve correction accuracy and efficiency.

Benefits of technology

It achieves efficient calibration of steam instruments, improves detection accuracy and versatility, is applicable to all steam instruments, and enhances the efficiency and applicability of the calibration method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117606590B
    Figure CN117606590B
Patent Text Reader

Abstract

The present invention provides a calibration method, device, electronic device and storage medium for a steam meter. The method includes: obtaining historical pressure data and historical flow data of the steam meter to be tested; constructing a verification model based on the historical pressure data and historical flow data; obtaining pressure data and flow data within a preset time period of the steam meter to be tested; inputting the pressure data and flow data within the preset time period into the verification model to determine whether there is abnormal data; if there is abnormal data, correcting the abnormal data; and calibrating the steam meter to be tested based on the corrected abnormal data, the pressure data within the preset time period, and the flow data. The abnormal data verification model and the steam meter calibration method provided by the present invention are applicable to all steam meters, and the method has strong universality, and can solve the problem that the current calibration method of steam meters has poor universality and low efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of instrument calibration, and in particular to a calibration method, device, electronic equipment and storage medium for a steam instrument. Background Art

[0002] Steam flow meter is a special instrument for measuring the cumulative mass flow of steam. It has two structural forms: mechanical and intelligent. Through the indicator dial (mechanical) or LCD (intelligent) on-site display, it can accurately read the mass of all steam flowing through the meter and can also output pulse signals.

[0003] Since the steam flow meter works in a high temperature and humid environment, it will affect the accuracy of the steam flow meter detection, so the steam flow meter needs to be compensated to calibrate its detection results. At present, the compensation method is often used to calibrate the pressure sensor or flow sensor in the steam flow meter, which can be divided into hardware compensation and software compensation. The hardware compensation method is usually used for low-precision industrial measurement sensors, and its compensation accuracy is relatively low. The software compensation method is more commonly used for high-precision sensors or digital pressure gauges for value traceability. The two current compensation methods are only applicable to the corresponding type of sensor, with poor versatility, and the compensation method is only performed on a single item, which is inefficient. Therefore, at this stage, there is an urgent need for a calibration method that is efficient and applicable to all steam instruments. Summary of the invention

[0004] The embodiments of the present invention provide a calibration method, device, electronic device and storage medium for a steam meter to solve the problem that the calibration method for steam meters at the current stage has high efficiency but poor versatility.

[0005] In a first aspect, an embodiment of the present invention provides a method for calibrating a steam meter, comprising:

[0006] Obtain historical pressure data and historical flow data of the steam instrument to be tested;

[0007] Construct a test model based on historical pressure data and historical flow data;

[0008] Obtaining pressure data and flow data of the steam instrument to be tested within a preset time period;

[0009] Input the pressure data and flow data within a preset time period into the test model to determine whether there is abnormal data;

[0010] If there are abnormal data, the abnormal data are corrected; and the steam instrument to be tested is calibrated based on the corrected abnormal data, pressure data and flow data within a preset time period.

[0011] In a possible implementation, the test model is a binary normal distribution model; the test model is constructed according to historical pressure data and historical flow data, including:

[0012] Construct a historical data set based on historical pressure data and historical flow data;

[0013] Calculate the statistical indicators of the historical pressure data and the historical flow data in the historical data set; wherein the statistical indicators include the mean and standard deviation of the historical pressure data, and the mean and standard deviation of the historical flow data;

[0014] Construct a test model based on statistical indicators.

[0015] In a possible implementation, the pressure data and flow data within a preset time period include multiple groups of data, each group of data includes one pressure data and one flow data; the pressure data and flow data within the preset time period are input into the inspection model to determine whether there is abnormal data, including:

[0016] For each set of data, perform the following steps:

[0017] Input the preset abnormal data threshold into the inspection model to obtain the standard range of pressure data and flow data;

[0018] Input the pressure data and flow data in the group of data into the inspection model;

[0019] Determine whether the pressure data and flow data in the group of data are within the standard range;

[0020] If the pressure data and flow data in the group of data are not within the standard range, the group of data is abnormal data;

[0021] If the pressure data and flow data in this group of data are within the standard range, then this group of data is not abnormal data;

[0022] Alternatively, the preset pressure data standard value and the preset flow data standard value are input into the inspection model to obtain a probability value indicator;

[0023] Input the pressure data and flow data in the group of data into the test model to obtain the probability value corresponding to the group of data;

[0024] If the probability value corresponding to the group of data is not less than the probability value index, the pressure data and historical flow data in the group of data are not abnormal data;

[0025] If the probability value corresponding to the group of data is less than the probability value index, the pressure data and historical flow data in the group of data are abnormal data.

[0026] In a possible implementation, the abnormal data is at least one group of abnormal data, each group of abnormal data includes a pressure data and a flow data; if there is abnormal data, the abnormal data is corrected, including:

[0027] If the abnormal data is continuous and the number of continuous data is less than the preset first threshold, the abnormal data is removed;

[0028] If the abnormal data is continuous and the number of continuous data is not less than a preset first threshold, it is determined that the steam instrument to be tested is faulty, and the abnormal data is corrected through a neural network model.

[0029] In a possible implementation, the abnormal data is corrected through a neural network model, including:

[0030] Vectorize each group of abnormal data and the previous group of data corresponding to each group of abnormal data to obtain multiple groups of abnormal data column vectors;

[0031] Obtain an input data matrix according to multiple groups of abnormal data column vectors;

[0032] Inputting the input data matrix into the neural network model to obtain an output data matrix; wherein the output data matrix includes the corrected abnormal data;

[0033] Replace the abnormal data with the corrected abnormal data.

[0034] In a possible implementation, before the abnormal data is vectorized to obtain the input data matrix, the following steps are included:

[0035] A historical data set is constructed based on historical pressure data and historical flow data, and a neural network model is trained based on the historical data set; the historical data set includes a training set, a validation set, and a test set; the training set is used to train the neural network model, the validation set is used to adjust the hyperparameters in the neural network model, and the test set is used to evaluate the performance of the neural network model.

[0036] In a possible implementation, the corrected abnormal data includes corrected pressure abnormal data and corrected flow abnormal data; calibrating the steam instrument to be tested according to the corrected data, pressure data within a preset time period, and flow data includes:

[0037] Calculate the measurement error based on the pressure data, flow data and corresponding corrected abnormal data within a preset time period;

[0038] Obtaining correction parameters based on measurement errors;

[0039] The steam instrument to be tested is calibrated according to the correction parameters.

[0040] In a second aspect, an embodiment of the present invention provides a calibration device for a steam meter, comprising:

[0041] An acquisition module is used to acquire historical pressure data and historical flow data of the steam instrument to be tested;

[0042] A construction module, used for constructing a test model based on historical pressure data and historical flow data;

[0043] The acquisition module is also used to acquire pressure data and flow data of the steam instrument to be tested within a preset time period;

[0044] A judgment module is used to input the pressure data and flow data within a preset time period into the inspection model to determine whether there is abnormal data;

[0045] The calibration module is used to correct the abnormal data if any; and to calibrate the steam instrument to be tested according to the corrected abnormal data, pressure data and flow data within a preset time period.

[0046] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the processor implements the steps of the method described in the first aspect or any possible implementation manner of the first aspect.

[0047] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect or any possible implementation method of the first aspect are implemented.

[0048] The embodiment of the present invention provides a calibration method, device, electronic device and storage medium for a steam meter, which obtains historical pressure data and historical flow data of the steam meter to be tested; then builds a verification model based on the historical pressure data and historical flow data. The traditional method for checking abnormal data is to check the pressure data and flow data separately, which is inefficient. This embodiment takes into account the non-independence between pressure and flow and builds a verification model. When the pressure data and flow data within a preset time period are input into the verification model, the pressure data and flow data can be checked at the same time. The model is not only applicable to all steam meters, but also can improve the detection efficiency of abnormal data. If there is abnormal data, the abnormal data is corrected; and the steam meter to be tested is calibrated based on the corrected abnormal data, the pressure data and flow data within the preset time period. The abnormal data verification model and the steam meter calibration method provided by the embodiment of the present invention are applicable to all steam meters, and the method has strong universality, which can solve the problem that the current steam meter calibration method has poor universality and low efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or related technical descriptions are 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 these drawings without paying creative labor.

[0050] Figure 1 is a flow chart of a method for calibrating a steam meter provided in an embodiment of the present invention;

[0051] Figure 2 is a system architecture diagram of a steam meter calibration method provided by an embodiment of the present invention;

[0052] Figure 3 is a schematic structural diagram of a calibration device for a steam meter provided in an embodiment of the present invention;

[0053] Figure 4 is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0055] In order to make the purpose, technical solutions and advantages of the present invention more clear, specific embodiments will be described below in conjunction with the accompanying drawings.

[0056] Figure 1 FIG. 1 is a flow chart of the implementation of the steam meter calibration method provided by the embodiment of the present invention. Figure 1 As shown:

[0057] Step 110: Obtain historical pressure data and historical flow data of the steam instrument to be tested.

[0058] In this embodiment, the steam meter can measure pressure data, flow data and temperature data. However, the embodiment of the present invention mainly calibrates the pressure data and flow data detected by the steam meter. Therefore, in this embodiment, only the historical pressure data and historical flow data of the steam meter to be tested are obtained.

[0059] Step 120: Construct a verification model based on historical pressure data and historical flow data.

[0060] In this embodiment, since the detection environment of the steam meter determines that the pressure data and flow data detected by it are not independent, this independence can be used to construct a test model, and the pressure data and flow data of the steam meter to be tested can be tested through the test model.

[0061] Step 130: Obtain pressure data and flow data of the steam instrument to be tested within a preset time period.

[0062] In this embodiment, the preset time period can be a few minutes, a few hours, etc., which is not limited here. For example, assuming that every 15 minutes is a time period, the pressure data and flow data in the preset time period can include: the pressure data and flow data detected by the steam meter to be tested during the period from the current time point to fifteen minutes ago. If the detection interval of the steam meter to be tested is 1 minute, then the pressure data detected in the preset time period is 16, and the flow data is also 16.

[0063] Step 140: Input the pressure data and flow data within a preset time period into the verification model to determine whether there is abnormal data.

[0064] In this embodiment, the inspection model can judge the input pressure data and flow data at the same time. Compared with the traditional method that can only judge the pressure data or the flow data separately, this embodiment can improve the efficiency of judging abnormal data. Moreover, this embodiment is based on the non-independence between the pressure data and the flow data, that is, the correlation, and can be applied to all steam instruments.

[0065] Step 150: If there is abnormal data, the abnormal data is corrected; and the steam instrument to be tested is calibrated according to the corrected abnormal data, the pressure data and the flow data within a preset time period.

[0066] In this embodiment, when abnormal data exists, the method provided in this embodiment can simultaneously correct the pressure data and flow data in the abnormal data. Compared with the traditional method of only correcting the pressure data or the flow data separately, the abnormal data correction method provided in this embodiment has higher efficiency. Moreover, after correcting the abnormal data, this embodiment will calibrate the steam instrument to be tested according to the corrected abnormal data, the pressure data and the flow data within a preset time period to prevent the data abnormality of the detection number of the steam instrument to be tested in subsequent detections.

[0067] In summary, the embodiment of the present invention obtains the historical pressure data and historical flow data of the steam meter to be tested; and then constructs a verification model based on the historical pressure data and historical flow data. The traditional method of checking abnormal data is to check the pressure data and flow data separately, and this verification method is inefficient. This embodiment takes into account the non-independence between pressure and flow and constructs a verification model. When the pressure data and flow data within a preset time period are input into the verification model, the pressure data and flow data can be checked at the same time. This model is not only applicable to all steam meters, but also can improve the detection efficiency of abnormal data. If there is abnormal data, the abnormal data is corrected; and the steam meter to be tested is calibrated according to the corrected abnormal data, the pressure data and flow data within the preset time period. The abnormal data verification model and the steam meter calibration method provided by the embodiment of the present invention are applicable to all steam meters, and the method is highly universal, which can solve the problem of poor universality of the current steam meter calibration method.

[0068] In some embodiments, the verification model is a binary normal distribution model; constructing the verification model according to the historical pressure data and the historical flow data in step 120 may include:

[0069] Construct a historical data set based on historical pressure data and historical flow data.

[0070] Calculate the statistical indicators of the historical pressure data and the historical flow data in the historical data set; wherein the statistical indicators include the mean and standard deviation of the historical pressure data, and the mean and standard deviation of the historical flow data.

[0071] Construct a test model based on statistical indicators.

[0072] In this embodiment, a historical data set is first constructed based on historical pressure data and historical flow data. The historical data set includes a large amount of historical pressure data and historical flow data. According to these data in the historical data set, statistical indicators of the historical pressure data and historical flow data can be calculated respectively. That is, the mean μ1 and standard deviation σ1 of the historical pressure data and the mean μ2 and standard deviation σ2 of the historical flow data.

[0073] Since there is no independence between pressure data and flow data, that is, correlation, the calculated statistical indicators can be used to derive a binary normal distribution model, which is also the test model:

[0074]

[0075] Among them, f represents pressure data; ∏ represents flow data; ρ is the correlation coefficient between flow data and pressure data,

[0076] In some embodiments, the pressure data and flow data within the preset time period include multiple groups of data, each group of data includes a pressure data and a flow data. In step 140, the pressure data and flow data within the preset time period are input into the inspection model to determine whether there is abnormal data, which may include:

[0077] For each set of data, perform the following steps:

[0078] The preset abnormal data threshold is input into the inspection model to obtain the standard range of pressure data and flow data.

[0079] The pressure data and flow data in the group of data are input into the verification model.

[0080] Determine whether the pressure data and flow data in this group of data are within the standard range.

[0081] If the pressure data and flow data in this group of data are not within the standard range, this group of data is abnormal data.

[0082] If the pressure data and flow data in this group of data are within the standard range, then this group of data is not abnormal data.

[0083] In this embodiment, the data detected by the steam meter to be tested in the preset time period exists in the form of groups, and each group of data includes one pressure data and one flow data. For example, assuming that every 15 minutes is a time period, and the detection interval of the steam meter to be tested is 1 minute, then the data detected by the steam meter in the preset time period is 16 groups, and each group of data includes one pressure data and one flow data corresponding to a detection time point.

[0084] The embodiment of the present invention provides two methods for determining whether the data detected by the steam meter to be tested contains abnormal data. Specifically, the first method may include:

[0085] Since the output of the binary normal distribution model is a probability value, we can set a probability value as the preset abnormal data threshold. By bringing this preset abnormal data threshold into the binary normal distribution model, we can get the value range of pressure data and flow data, and this value range can be used as the standard range of pressure data and flow data. That is to say, the pressure data and flow data within the standard range can be regarded as normal data, and the pressure data and flow data outside the standard range can be regarded as abnormal data. Among them, the preset abnormal data threshold can be 97%, 98%, 99%, etc., which can be set according to the historical data of the steam meter to be tested. The setting of the preset abnormal data threshold will affect the accuracy of the data detected by the steam meter to be tested. The higher the preset abnormal data threshold is set, the higher the accuracy.

[0086] After obtaining the standard range, the data within the preset time period can be input into the test model in groups. For any group of data, if the pressure data and flow data corresponding to the group of data are not within the standard range, then the group of data is abnormal data; if the pressure data and flow data corresponding to the group of data are within the standard range, then the group of data is not abnormal data.

[0087] In some other embodiments, step 140 inputs the pressure data and flow data within a preset time period into the inspection model to determine whether there is abnormal data, and may also include:

[0088] The preset pressure data standard value and the preset flow data standard value are input into the inspection model to obtain the probability value index.

[0089] The pressure data and flow data in the group of data are input into the test model to obtain the probability value corresponding to the group of data.

[0090] If the probability value corresponding to the group of data is not less than the probability value index, the pressure data and historical flow data in the group of data are not abnormal data.

[0091] If the probability value corresponding to the group of data is less than the probability value index, the pressure data and historical flow data in the group of data are abnormal data.

[0092] The embodiment of the present invention provides two methods for determining whether the data detected by the steam meter to be tested contains abnormal data. Specifically, the second method may include:

[0093] This embodiment is a second method for determining whether the data detected by the steam meter to be tested contains abnormal data. Specifically, the second method may include:

[0094] Similar to the first method, the second method calculates a preset pressure data standard value and a preset flow data standard value based on the historical pressure data and the historical flow data in the historical data set. In other words, the preset pressure data standard value and the preset flow data standard value can be used as representative values ​​of normal data detected by the steam instrument under normal circumstances.

[0095] Input the preset pressure data standard value and the preset flow data standard value into the test model to obtain the probability value index. Input the data within the preset time period into the test model in groups, and calculate the probability value corresponding to each group of data. For any group of data, if the probability value corresponding to the group of data is not less than the probability value index, the pressure data and historical flow data in the group of data are not abnormal data. If the probability value corresponding to the group of data is less than the probability value index, the pressure data and historical flow data in the group of data are abnormal data.

[0096] In some embodiments, the abnormal data is at least one group of abnormal data, each group of abnormal data includes a pressure data and a flow data; if there is abnormal data in step 150, the abnormal data is corrected, which may include:

[0097] Step 151: If the abnormal data is continuous and the number of continuous data is less than a preset first threshold, the abnormal data is removed.

[0098] Step 152: If the abnormal data is continuous and the number of continuous data is not less than a preset first threshold, it is determined that the steam instrument to be tested is faulty, and the abnormal data is corrected through a neural network model.

[0099] In this embodiment, since the data detected by the steam instrument to be tested within the preset time period exists in the form of groups, correspondingly, the abnormal data also exists in the form of groups, and a group of abnormal data includes a pressure data and a flow data.

[0100] If the abnormal data within the preset time period is continuous and the number of continuous data is less than the preset first threshold, it can be considered that the abnormal data is caused by external interference and other reasons, and since the abnormal data is small, the abnormal data can be eliminated. Alternatively, if the abnormal data is discontinuous and the number is less than the preset first threshold, the abnormal data can also be eliminated. Among them, the first preset threshold can be 3, 4, 5, etc., which is not limited here.

[0101] If the abnormal data within the preset time period is continuous and the number of continuous data is not less than the preset first threshold, it can be considered that the abnormal data is caused by the failure of the steam instrument to be tested. And because the steam instrument to be tested is faulty at this time, the data detected by it is not accurate, so these data cannot be used, and even if they are eliminated, the accuracy will be affected, so these data need to be corrected.

[0102] For example, assuming that the first preset threshold is 5, and the steam instrument to be tested detects 16 groups of data within the preset time period, of which the 10th to 12th groups are abnormal data, then although the abnormal data at this time is continuous, the number of continuous data is less than the preset first threshold, it can be considered that the generation of abnormal data is caused by external interference and other reasons, and since the abnormal data that appears is small, the abnormal data can be eliminated. If the 10th to 16th groups are abnormal data, then the abnormal data at this time is continuous, and the number of continuous data is 7, which is greater than the preset first threshold, it can be considered that the generation of abnormal data is caused by a fault in the steam instrument to be tested, and the abnormal data needs to be corrected, and the steam instrument to be tested needs to be calibrated.

[0103] In some embodiments, correcting abnormal data using a neural network model in step 152 may include:

[0104] Each group of abnormal data and the previous group of data corresponding to each group of abnormal data are vectorized to obtain multiple groups of abnormal data column vectors.

[0105] The input data matrix is ​​obtained according to multiple groups of abnormal data column vectors.

[0106] The input data matrix is ​​input into the neural network model to obtain an output data matrix; wherein the output data matrix includes the corrected abnormal data.

[0107] Replace the abnormal data with the corrected abnormal data.

[0108] In this embodiment, when abnormal data needs to be corrected, it can be corrected through a neural network model. Specifically, each group of abnormal data and the previous group of data corresponding to each group of abnormal data are vectorized to obtain multiple groups of abnormal data column vectors, wherein each group of column vectors includes pressure data and flow data corresponding to the detection time point, and pressure data and flow data at the previous time point relative to the detection time point.

[0109] Exemplarily, the column vector can be represented by X(m), where m represents the mth group of abnormal data. X(m) is a (4*1) column vector, which can be represented as Among them, f a is the pressure data in this group of abnormal data, a is the flow data in the group abnormal data, f a-1is the pressure data in the previous set of data corresponding to this set of abnormal data, ∏ a-1 It is the traffic data in the previous set of data corresponding to this set of abnormal data.

[0110] The input data matrix can be expressed as X=(X(1), X(2), X(3), ..., X(m)).

[0111] The input data matrix is ​​input into the neural network model to obtain the output data matrix Y. Wherein, Y = (Y(1), Y(2), Y(3), ..., Y(m)).

[0112] Y(n) is a (2*1) column vector, where n represents the nth group of corrected abnormal data, and n=m. Y(n) can be expressed as Among them, f b Indicates the corrected pressure data, Π b Indicates the corrected flow data.

[0113] After obtaining the corrected abnormal data, the abnormal data is replaced with the corrected abnormal data, that is, f a Replace with f b , will Π a Replace with ∏ b , the correction is completed.

[0114] This embodiment can correct the pressure data and flow data at the same time. Compared with the traditional method that can only correct the pressure data or flow data separately, the method provided by this embodiment has higher efficiency. This embodiment replaces the loop structure originally used for iteration of the neural network model with vectorized operations by directly inserting the input data matrix X into the neural network model. Since many functions and operations in NumPy support batch operations on arrays, there is no need to explicitly write loops. Therefore, when processing arrays of different dimensions, the broadcast function can be used to automatically expand the array to meet the calculation requirements. Broadcasting can simplify vectorized operations and avoid loops. The NumPy library provides many built-in vectorized functions that can be directly applied to arrays, such as np.sum(), np.dot(), np.mean(), etc. These functions achieve vectorization by performing highly optimized underlying operations. At the same time, when performing vectorized operations, try to avoid unnecessary array copying. Copying arrays consumes additional memory and computing time, reducing the efficiency of vectorization. The effect of vectorized operations is evaluated by comparing the execution time of code using vectorization and not using vectorization. Generally, vectorized code training speed will be faster.

[0115] During the back-propagation process of the neural network model, the following optimization techniques are used:

[0116] Dropout regularization: Dropout regularization technique is used in the second hidden layer to alleviate the problem of overfitting. Dropout randomly sets a certain proportion of neurons to inactive during training to force the network to learn more robust features.

[0117] Adam optimizer: Adam (Adaptive Moment Estimation) is an adaptive estimation optimization algorithm that combines the advantages of momentum gradient descent and RMSprop. It converges to the optimal value faster by adaptively adjusting the learning rate and has better performance.

[0118] Learning rate decay: Learning rate decay is a method of reducing the learning rate. Its specific expression is: a i+1 =(0.99) i *a i .

[0119] Learning rate decay has the following advantages: Improve convergence: In the initial stage, a larger learning rate helps to converge quickly to a better solution. However, if the learning rate remains large during training, it may cause the optimization process to oscillate or fail to converge. Through learning rate decay, the learning rate can be gradually reduced during training, thereby improving convergence and making the network closer to the global optimal solution in the later stages of training. Stable training: A larger learning rate may cause the gradient value to change greatly during training, making the optimization process unstable. Learning rate decay can make the model more stable during training by gradually reducing the learning rate, avoiding large parameter updates and gradient explosion. Avoid local optimal solutions: A larger learning rate may cause the optimization algorithm to skip local optimal solutions during the optimization process. Through learning rate decay, the learning rate step can be reduced when approaching the global optimal solution, making the optimization process more detailed and having a higher probability of approaching the optimal solution.

[0120] Accelerate training: Using a larger learning rate in the initial stage can make the model quickly approach the optimal solution. However, when the model is close to the optimal solution, a larger learning rate may cause oscillation or the model may not converge. Learning rate decay can reduce the learning rate in the later stages of training, thereby accelerating the convergence process and avoiding unnecessary oscillation or overfitting.

[0121] These optimization techniques can improve the performance and generalization ability of neural networks to better fit the training data and obtain more accurate prediction results.

[0122] In some embodiments, after the neural network model outputs the corrected abnormal data, the corrected abnormal data can also be input into the verification model to verify whether the corrected abnormal data is accurate. If accurate, the abnormal data is replaced with the corrected abnormal data.

[0123] In some embodiments, before vectorizing the abnormal data to obtain the input data matrix in step 152, the following may be included:

[0124] A historical data set is constructed based on historical pressure data and historical flow data, and a neural network model is trained based on the historical data set; the historical data set includes a training set, a validation set, and a test set; the training set is used to train the neural network model, the validation set is used to adjust the hyperparameters in the neural network model, and the test set is used to evaluate the performance of the neural network model.

[0125] In this embodiment, the historical data set can be divided into a training set, a validation set and a test set. The training set is used to train the neural network model; the validation set is used to adjust the hyperparameters in the neural network model; and the test set is used to evaluate the performance of the neural network model.

[0126] When training the neural network model using the training set. Through the forward propagation and back propagation algorithms, the weights and biases of the network are optimized so that the network can fit the data with known accurate values. The performance of the trained model on unseen data is evaluated using the validation set. Model tuning is performed based on the validation results. Hyperparameters such as network structure, regularization parameters, and learning rate can be adjusted to improve the generalization ability of the model. The final neural network model performance is evaluated using the test set. The results of the instrument readings predicted by the model are compared with the known accurate values ​​to evaluate the accuracy and error of the neural network model. When the accuracy and error of the neural network model meet the standards, the abnormal data can be corrected.

[0127] In some embodiments, the corrected abnormal data includes corrected pressure abnormal data and corrected flow abnormal data; in step 150, calibrating the steam instrument to be tested according to the corrected data, the pressure data and the flow data within a preset time period may include:

[0128] The measurement error is calculated based on the pressure data, flow data and the corresponding corrected abnormal data within a preset time period.

[0129] The correction parameters are obtained based on the measurement errors.

[0130] The steam instrument to be tested is calibrated according to the correction parameters.

[0131] In this embodiment, if the number of abnormal data within the preset time period is less than the first preset threshold, it means that the abnormal data is not caused by the failure of the steam instrument to be tested, and the steam instrument to be tested does not need to be calibrated. If the number of abnormal data within the preset time period is not less than the first preset threshold, it means that the abnormal data is caused by the failure of the steam instrument to be tested, and the steam instrument to be tested needs to be calibrated. Then the system will issue a warning to remind the staff to repair and eliminate the fault in time. When calibrating the steam instrument to be tested, it can be done by analyzing the abnormal data and the corrected abnormal data.

[0132] Specifically, the pressure data and flow data that are abnormal data within a preset time period can be called measurement values, and the corrected abnormal data can be called correction values. The single-chip microcomputer stores the measurement values ​​and correction values, and subtracts the corresponding correction value from the measurement value to obtain the measurement error corresponding to the measurement value. Based on all the measurement errors obtained, the average measurement error, that is, the correction parameter, is obtained. The steam meter to be tested is calibrated according to the correction parameter. Among them, the single-chip microcomputer can be set in a separate device outside the steam meter to be tested, or it can be set in the steam meter to be tested.

[0133] After the steam meter to be tested is calibrated, it needs to be verified. Specifically, the pressure data and flow data of the calibrated steam meter to be tested within a preset time period can be obtained again to verify the calibration result. That is, steps 110 to 150 are repeated to obtain new calibration parameters, and the error rate between two adjacent calibration parameters is calculated until the error rate of the steam meter to be tested meets the requirements, and the calibration of the steam meter to be tested is considered to be completed.

[0134] To ensure the stability and repeatability of the calibration of the steam instrument under test, stability tests and repeatability tests can be performed. These tests measure the same actual value repeatedly and observe whether the corrected measurement results remain stable and consistent.

[0135] The steam instrument to be measured can also be calibrated regularly due to instrument drift or other factors that may cause measurement errors. The time interval for regular calibration can be set as required, and the calibration process can be automatically triggered at a specific time point.

[0136] Figure 2 is a system architecture diagram of the steam meter calibration method provided by an embodiment of the present invention. Figure 2 As shown:

[0137] In this embodiment, the pressure data and flow data of the steam meter to be tested within a preset time period can be obtained, and the pressure data and flow data can be used to determine whether there are abnormal data through an abnormality detection algorithm (verification model). The abnormality detection algorithm can be calculated based on the historical pressure data and historical flow data of the steam meter to be tested.

[0138] If the abnormal data within the preset time period is continuous and the number is less than 5, the abnormal data can be eliminated. If the abnormal data within the preset time period is continuous and the number is not less than 5, the detection system will issue an instrument abnormality warning and correct the abnormal data through neural network model fitting. And according to the corrected abnormal data and the abnormal data obtained within the preset time period, the single-chip microcomputer controls the calibration of the steam instrument to be tested.

[0139] For parts that are not described in detail in this embodiment, reference can be made to the above embodiments.

[0140] In summary, the embodiment of the present invention obtains the historical pressure data and historical flow data of the steam meter to be tested; and then constructs a verification model based on the historical pressure data and historical flow data. The traditional method of checking abnormal data is to check the pressure data and flow data separately, and this verification method is inefficient. This embodiment takes into account the non-independence between pressure and flow and constructs a verification model. When the pressure data and flow data within a preset time period are input into the verification model, the pressure data and flow data can be checked at the same time. This model is not only applicable to all steam meters, but also can improve the detection efficiency of abnormal data. If there is abnormal data, the abnormal data is corrected; and the steam meter to be tested is calibrated according to the corrected abnormal data, the pressure data and flow data within the preset time period. The abnormal data verification model and the steam meter calibration method provided by the embodiment of the present invention are applicable to all steam meters, and the method is highly universal, which can solve the problem that the current steam meter calibration method is poor in universality and low in efficiency.

[0141] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0142] The following is an embodiment of the device of the present invention. For details not described in detail therein, reference may be made to the corresponding method embodiment described above.

[0143] Figure 3 The structural schematic diagram of a steam meter calibration device provided by an embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0144] like Figure 3 As shown, the calibration device 3 of the steam instrument comprises:

[0145] An acquisition module 31 is used to acquire historical pressure data and historical flow data of the steam instrument to be tested;

[0146] A construction module 32, for constructing a test model based on historical pressure data and historical flow data;

[0147] The acquisition module 31 is also used to acquire the pressure data and flow data of the steam instrument to be tested within a preset time period;

[0148] A judgment module 33 is used to input the pressure data and flow data within a preset time period into the inspection model to determine whether there is abnormal data;

[0149] The calibration module 34 is used to correct the abnormal data if any, and to calibrate the steam instrument to be tested according to the corrected abnormal data, the pressure data and the flow data within a preset time period.

[0150] In some embodiments, the test model is a binary normal distribution model; the construction module 32 is specifically used to:

[0151] Construct a historical data set based on historical pressure data and historical flow data;

[0152] Calculate the statistical indicators of the historical pressure data and the historical flow data in the historical data set; wherein the statistical indicators include the mean and standard deviation of the historical pressure data, and the mean and standard deviation of the historical flow data;

[0153] Construct a test model based on statistical indicators.

[0154] In some embodiments, the pressure data and flow data within the preset time period include multiple groups of data, each group of data includes one pressure data and one flow data; the judgment module 33 is specifically used to:

[0155] For each set of data, perform the following steps:

[0156] Input the preset abnormal data threshold into the inspection model to obtain the standard range of pressure data and flow data;

[0157] Input the pressure data and flow data in the group of data into the inspection model;

[0158] Determine whether the pressure data and flow data in the group of data are within the standard range;

[0159] If the pressure data and flow data in the group of data are not within the standard range, the group of data is abnormal data;

[0160] If the pressure data and flow data in this group of data are within the standard range, then this group of data is not abnormal data;

[0161] Alternatively, the preset pressure data standard value and the preset flow data standard value are input into the inspection model to obtain a probability value indicator;

[0162] Input the pressure data and flow data in the group of data into the test model to obtain the probability value corresponding to the group of data;

[0163] If the probability value corresponding to the group of data is not less than the probability value index, the pressure data and historical flow data in the group of data are not abnormal data;

[0164] If the probability value corresponding to the group of data is less than the probability value index, the pressure data and historical flow data in the group of data are abnormal data.

[0165] In some embodiments, the abnormal data is at least one group of abnormal data, each group of abnormal data includes a pressure data and a flow data; the calibration module 34 is specifically used for:

[0166] If the abnormal data is continuous and the number of continuous data is less than the preset first threshold, the abnormal data is removed;

[0167] If the abnormal data is continuous and the number of continuous data is not less than a preset first threshold, it is determined that the steam instrument to be tested is faulty, and the abnormal data is corrected through a neural network model.

[0168] In some embodiments, the calibration module 34 is specifically configured to:

[0169] Vectorize each group of abnormal data and the previous group of data corresponding to each group of abnormal data to obtain multiple groups of abnormal data column vectors;

[0170] Obtain an input data matrix according to multiple groups of abnormal data column vectors;

[0171] Inputting the input data matrix into the neural network model to obtain an output data matrix; wherein the output data matrix includes the corrected abnormal data;

[0172] Replace the abnormal data with the corrected abnormal data.

[0173] In some embodiments, the calibration module 34 is specifically configured to:

[0174] A historical data set is constructed based on historical pressure data and historical flow data, and a neural network model is trained based on the historical data set; the historical data set includes a training set, a validation set, and a test set; the training set is used to train the neural network model, the validation set is used to adjust the hyperparameters in the neural network model, and the test set is used to evaluate the performance of the neural network model.

[0175] In some embodiments, the corrected abnormal data includes corrected pressure abnormal data and corrected flow abnormal data; the calibration module 34 is specifically used for:

[0176] Calculate the measurement error based on the pressure data, flow data and corresponding corrected abnormal data within a preset time period;

[0177] Obtaining correction parameters based on measurement errors;

[0178] The steam instrument to be tested is calibrated according to the correction parameters.

[0179] Figure 4 Schematic diagram of an electronic device provided by an embodiment of the present invention. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40. When the processor 40 executes the computer program 42, the steps in the above-mentioned steam meter calibration method embodiments are implemented, for example Figure 1 Alternatively, when the processor 40 executes the computer program 42, the functions of each module / unit in the above-mentioned device embodiments are realized, for example, Figure 3 The functions of each module are shown.

[0180] Exemplarily, the computer program 42 may be divided into one or more modules / units, which are stored in the memory 41 and executed by the processor 40 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program 42 in the electronic device 4. For example, the computer program 42 may be divided into Figure 3 The modules shown.

[0181] The electronic device 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 4 may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will appreciate that Figure 4 It is only an example of the electronic device 4 and does not constitute a limitation of the electronic device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0182] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0183] The memory 41 may be an internal storage unit of the electronic device 4, such as a hard disk or memory of the electronic device 4. The memory 41 may also be an external storage device of the electronic device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 41 is used to store the computer program and other programs and data required by the electronic device. The memory 41 may also be used to temporarily store data that has been output or is to be output.

[0184] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0185] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0186] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0187] In the embodiments provided by the present invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0188] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0189] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0190] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned steam meter calibration method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium.

[0191] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for calibrating a steam instrument, characterized in that: include: Obtain historical pressure data and historical flow data of the steam instrument to be tested; Building a verification model based on the historical pressure data and the historical flow data; Obtaining pressure data and flow data of the steam instrument to be tested within a preset time period; Inputting the pressure data and flow data within the preset time period into the inspection model to determine whether there is abnormal data; If there is abnormal data, the abnormal data is corrected; and calibrating the steam instrument to be tested according to the corrected abnormal data, the pressure data and the flow data within the preset time period; The test model is a bivariate normal distribution model; The constructing of the inspection model according to the historical pressure data and the historical flow data comprises: constructing a historical data set according to the historical pressure data and the historical flow data; Calculating statistical indicators of the historical pressure data and the historical flow data in the historical data set; wherein the statistical indicators include the mean and standard deviation of the historical pressure data, and the mean and standard deviation of the historical flow data; Constructing a test model according to the statistical indicators; Wherein, the test model is: in, Indicates pressure data; Indicates traffic data; represents the standard deviation of the historical pressure data; flow ; is the correlation coefficient between flow data and pressure data, is the mean value of the historical pressure data; is the mean value of the historical traffic data; The pressure data and flow data within the preset time period include multiple groups of data, each group of data includes one pressure data and one flow data; the pressure data and flow data within the preset time period are input into the inspection model to determine whether there is abnormal data, including: For each set of data, perform the following steps: Inputting a preset abnormal data threshold into the inspection model to obtain a standard range of pressure data and flow data; Inputting the pressure data and flow data in the group of data into the verification model; Determine whether the pressure data and flow data in the set of data are within the standard range; If the pressure data and flow data in the set of data are not within the standard range, the set of data is abnormal data; If the pressure data and flow data in the set of data are within the standard range, the set of data is not abnormal data; The abnormal data is at least one group of abnormal data, each group of abnormal data includes a pressure data and a flow data; if the abnormal data exists, the abnormal data is corrected, including: If the abnormal data is continuous and the number of continuous data is less than a preset first threshold, the abnormal data is removed; If the abnormal data is continuous and the number of continuous data is not less than a preset first threshold, it is determined that the steam instrument to be tested is faulty, and the abnormal data is corrected by a neural network model; Wherein, the correction of the abnormal data by using a neural network model includes: Vectorize each group of abnormal data and the previous group of data corresponding to each group of abnormal data to obtain multiple groups of abnormal data column vectors; Obtain an input data matrix according to multiple groups of abnormal data column vectors; Inputting the input data matrix into the neural network model to obtain an output data matrix; wherein the output data matrix includes the corrected abnormal data; replacing the abnormal data with the corrected abnormal data; Before vectorizing the abnormal data to obtain an input data matrix, the method includes: Constructing a historical data set according to the historical pressure data and the historical flow data, and training the neural network model according to the historical data set; wherein the historical data set includes a training set, a validation set and a test set; the training set is used to train the neural network model, the validation set is used to adjust the hyperparameters in the neural network model, and the test set is used to evaluate the performance of the neural network model; The corrected abnormal data includes corrected pressure abnormal data and corrected flow abnormal data; the calibrating the steam instrument to be tested according to the corrected data, the pressure data and the flow data within the preset time period includes: Calculating the measurement error based on the pressure data, flow data and the corresponding corrected abnormal data within the preset time period; Obtaining a correction parameter according to the measurement error; The steam instrument to be tested is calibrated according to the correction parameters.

2. A steam meter calibration method according to claim 1, characterized in that: The step of inputting the pressure data and flow data within the preset time period into the inspection model to determine whether there is abnormal data further includes: For each set of data, perform the following steps: Inputting a preset pressure data standard value and a preset flow data standard value into the inspection model to obtain a probability value index; Inputting the pressure data and flow data in the group of data into the verification model to obtain the probability value corresponding to the group of data; If the probability value corresponding to the group of data is not less than the probability value index, the pressure data and historical flow data in the group of data are not abnormal data; If the probability value corresponding to the group of data is less than the probability value indicator, the pressure data and historical flow data in the group of data are abnormal data.

3. A calibration device for a steam instrument, characterized in that: include: An acquisition module is used to acquire historical pressure data and historical flow data of the steam instrument to be tested; A construction module, used for constructing a verification model according to the historical pressure data and the historical flow data; The acquisition module is also used to acquire pressure data and flow data of the steam instrument to be tested within a preset time period; A judgment module, used for inputting the pressure data and flow data within the preset time period into the inspection model to judge whether there is abnormal data; A calibration module, used for correcting abnormal data if any; and calibrating the steam instrument to be tested according to the corrected abnormal data, the pressure data and the flow data within the preset time period; The test model is a binary normal distribution model; the construction module is specifically used for: constructing a historical data set according to the historical pressure data and the historical flow data; Calculating statistical indicators of the historical pressure data and the historical flow data in the historical data set; wherein the statistical indicators include the mean and standard deviation of the historical pressure data, and the mean and standard deviation of the historical flow data; Constructing a test model according to the statistical indicators; Wherein, the test model is: in, Indicates pressure data; Indicates traffic data; represents the standard deviation of the historical pressure data; flow ; is the correlation coefficient between flow data and pressure data, is the mean value of the historical pressure data; is the mean value of the historical traffic data; The pressure data and flow data within the preset time period include multiple groups of data, each group of data includes one pressure data and one flow data; the judgment module is specifically used to: For each set of data, perform the following steps: Inputting a preset abnormal data threshold into the inspection model to obtain a standard range of pressure data and flow data; Inputting the pressure data and flow data in the group of data into the verification model; Determine whether the pressure data and flow data in the set of data are within the standard range; If the pressure data and flow data in the set of data are not within the standard range, the set of data is abnormal data; If the pressure data and flow data in the set of data are within the standard range, the set of data is not abnormal data; The abnormal data is at least one group of abnormal data, each group of abnormal data includes a pressure data and a flow data; the calibration module is specifically used for: If the abnormal data is continuous and the number of continuous data is less than a preset first threshold, the abnormal data is removed; If the abnormal data is continuous and the number of continuous data is not less than a preset first threshold, it is determined that the steam instrument to be tested is faulty, and the abnormal data is corrected by a neural network model; The calibration module is specifically used for: Vectorize each group of abnormal data and the previous group of data corresponding to each group of abnormal data to obtain multiple groups of abnormal data column vectors; Obtain an input data matrix according to multiple groups of abnormal data column vectors; Inputting the input data matrix into the neural network model to obtain an output data matrix; wherein the output data matrix includes the corrected abnormal data; replacing the abnormal data with the corrected abnormal data; Before vectorizing the abnormal data to obtain an input data matrix, the calibration module is specifically used to: Constructing a historical data set according to the historical pressure data and the historical flow data, and training the neural network model according to the historical data set; wherein the historical data set includes a training set, a validation set and a test set; the training set is used to train the neural network model, the validation set is used to adjust the hyperparameters in the neural network model, and the test set is used to evaluate the performance of the neural network model; The corrected abnormal data includes corrected pressure abnormal data and corrected flow abnormal data; the calibration module is specifically used for: Calculating the measurement error based on the pressure data, flow data and the corresponding corrected abnormal data within the preset time period; Obtaining a correction parameter according to the measurement error; The steam instrument to be tested is calibrated according to the correction parameters.

4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to claim 1 or 2 are implemented.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to claim 1 or 2 are implemented.