Multi-parameter real-time detection device and method of intelligent metering instrument

By employing a multi-parameter real-time detection method, combined with data preprocessing, time-frequency domain feature extraction, and machine learning model training, the shortcomings of intelligent metering instruments in multi-parameter detection and error calibration are addressed, achieving high-precision and intelligent metering data processing.

CN120065106BActive Publication Date: 2025-11-04WEIWANG IOT TECH (WUHAN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510268941.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-11-04
Estimated Expiration
2045-03-07

AI Technical Summary

Technical Problem

Existing intelligent metering instruments are insufficient in terms of real-time detection of multiple parameters, intelligent identification of metering modes, and self-learning calibration of errors, making it difficult to meet the high precision, real-time performance, and intelligence requirements of modern industrial production and intelligent metering applications.

Method used

A multi-parameter real-time detection method is adopted, including data preprocessing, time-frequency domain feature extraction, machine learning model training, self-learning calibration and compensation mechanism, and knowledge distillation technology, to achieve efficient analysis and error calibration of multi-parameter measurement data.

Benefits of technology

It improves the accuracy and reliability of measurement data, adapts to diverse testing needs, reduces hardware resource consumption, and enhances the intelligence and practicality of the instrument.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120065106B_ABST
    Figure CN120065106B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of metering instruments, in particular to a multi-parameter real-time detection device and method for intelligent metering instruments, which comprises the following steps: collecting multi-parameter metering data through a metering instrument; performing feature extraction and analysis on the obtained metering data, extracting the time-frequency domain features of the data, and performing feature selection and dimension reduction; training a machine learning model based on the extracted feature data, intelligently identifying and detecting the metering mode required for the current medium; introducing a self-learning calibration and compensation mechanism to automatically calibrate and compensate the data detection error under the current metering mode; and compressing the trained machine learning model through a knowledge distillation technology to reduce the model size and realize efficient deployment of the model in the intelligent metering instrument. The present application effectively improves the data detection accuracy and intelligent level of metering instruments and meets the high-precision metering requirements of multiple scenes and multiple media.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of metering instruments, in particular to a multi-parameter real-time detection device and method of intelligent metering instruments. BACKGROUND

[0002] Intelligent metering instruments can detect and measure the physical parameters of various media in real time. Current intelligent metering instruments still have many deficiencies in practical application, mainly in the following aspects:

[0003] Existing intelligent metering instruments mainly rely on the measurement of a single physical parameter, and have weak real-time collection and analysis capabilities for multiple parameters. The data collected by most instruments is difficult to reflect the overall characteristics of the detected medium without sufficient feature extraction and analysis, resulting in low accuracy and reliability of the measurement results.

[0004] For different detection media, existing intelligent metering instruments lack targeted metering mode recognition and adaptive adjustment capabilities. Due to the diversity and complexity of the measurement medium, a single metering mode cannot meet the accurate measurement requirements in different application scenarios. The metering mode in the prior art mostly relies on manual setting and lacks automatic recognition and intelligent optimization mechanism, which cannot adapt to medium changes in time, further leading to measurement errors.

[0005] Current intelligent metering instruments have a large error accumulation problem in the measurement process. Although some instruments have a simple error compensation function, the compensation model is usually rough and does not consider the complex relationship between error and multiple influencing factors, which cannot effectively calibrate and compensate measurement errors, affecting the precision and stability of the measurement results. In the long-term running process, the error compensation model also lacks self-learning and dynamic updating mechanism, leading to gradual decline of instrument performance.

[0006] In summary, the existing technology cannot meet the high-precision, real-time and intelligent requirements of modern industrial production and intelligent metering applications. Therefore, an intelligent metering instrument detection method is needed, which can realize multi-parameter real-time detection, intelligent identification of metering mode, self-learning calibration of error and efficient deployment of machine learning model, to improve the measurement accuracy and system performance.

[0007] In view of this, the present application provides a multi-parameter real-time detection device and method of intelligent metering instruments. SUMMARY

[0008] To achieve the above-mentioned purpose, the present application provides a multi-parameter real-time detection device and method of intelligent metering instruments, and the specific technical solutions are as follows: a multi-parameter real-time detection method of intelligent metering instruments, comprising:

[0009] Step 1: Obtain the multi-parameter metering data collected by the metering instrument when detecting the medium, and pre-process the metering data;

[0010] Step 2: analyze the acquired metrology data, extract metrology data feature parameters, including time-frequency domain feature data of metrology data, and perform feature selection and dimension reduction;

[0011] Step 3: based on the extracted time-frequency domain feature data of metrology data, train a machine learning model to identify the metrology mode required for detecting the current medium;

[0012] Step 4: according to the identified metrology mode, introduce a self-learning calibration and compensation mechanism to calibrate and compensate the data detection error under the current metrology mode;

[0013] Step 5: knowledge distillation is performed on the trained machine learning model to reduce the volume of the model occupying the meter, and the machine learning model is deployed in the intelligent meter.

[0014] Preferably, the intelligent meter detects multiple parameters of the medium, including multiple types of electrical data; each physical parameter is converted into an electrical signal by a corresponding sensor, and then converted into a digital quantity by a signal acquisition circuit;

[0015] Let the collected physical parameters be x1, x2,...,x n n is the number of collected physical parameters; the corresponding digital quantity is represented as d1, d2,...,d n ; the conversion relationship between the digital quantity and the physical quantity is:

[0016] d n = k n ·x n +b n

[0017] Where k n is the sensitivity coefficient of the physical quantity sensor corresponding to the n-th collected physical parameter, and b i is the zero point offset; the obtained digital quantity data is preprocessed, and the preprocessed multi-parameter digital quantity data is arranged in the order of sampling time to form a data matrix D:

[0018]

[0019] Where m is the number of sampling time points, and n is the number of collected physical parameters; the data matrix D is the multi-parameter metrology data analyzed in the subsequent steps.

[0020] Preferably, the multi-parameter metrology data matrix D obtained after preprocessing is subjected to feature extraction; the extracted features include time domain features and frequency domain features;

[0021] The time domain features of the multi-parameter metrology data are extracted, and the statistical feature quantities of each physical parameter data are calculated, including: mean μi Standard deviation σ i kurtosis β i and skewness S i ;

[0022] Extract the frequency domain features from multi-parameter measurement data, and perform a Fast Fourier Transform on each physical parameter data to obtain the frequency domain signal X. i (f); Calculate frequency domain characteristics based on the frequency domain signal, including: frequency domain energy E i and frequency domain entropy H i ;

[0023] The extracted time-domain features and frequency-domain features are combined to form a feature vector v:

[0024] v=[μ1,σ1,β1,S1,E1,H1,…,μ n ,σ n ,β n ,S n E n H n ] T

[0025] The feature vector has a dimension of 6n, where n is the number of physical parameters.

[0026] Preferably, principal component analysis is used to select and reduce the dimensionality of the extracted features; the feature vector v is centered to obtain the centered feature matrix X. c :

[0027]

[0028] in, v is the mean of the sampling features at the m-th sampling time, where m is the number of sampling time points and n is the number of physical parameters. mn It is the sampled characteristic value of the nth physical parameter at the mth sampling time;

[0029] Calculate the centered feature matrix X c Find the covariance matrix S, and perform eigenvalue decomposition on the covariance matrix S: X c =UΣU T Where U is the eigenvector matrix, U T Σ is the transpose of the eigenvector matrix, and Σ is the eigenvalue matrix;

[0030] Select the eigenvectors corresponding to the first r largest eigenvalues ​​to construct a dimension-reduced matrix W: W = [u1, u2, ..., u...]. r r is determined based on the cumulative contribution rate γ:

[0031]

[0032] Where δ is the cumulative contribution rate threshold;

[0033] Using the dimensionality reduction matrix W to center the feature matrix X c Mapping to a lower-dimensional space yields the dimensionality-reduced feature matrix Y:Y=X c W; Let v be the feature vector of each sample in Y. * That is: v * =[y1,y2,...,y r ] T ;v * This refers to the new eigenvectors obtained after dimensionality reduction through principal component analysis, with a dimension of r.

[0034] Preferably, the extracted time-frequency domain feature data is divided into a training set. N train and test set in Let l be the feature vector of the i-th sample in the training set. i For the measurement pattern label corresponding to the i-th sample in the training set, Let l be the feature vector of the i'th sample in the test set. i' Let N be the measurement pattern label corresponding to the i'th sample in the test set, and N be the number of data sets. train The number of training sets to be partitioned;

[0035] A neural network from the machine learning model was selected as the quantitative pattern recognition model and trained; the training set D was used. train Train the selected machine learning model;

[0036] The design incorporates a fully connected structure with L hidden layers and employs the cross-entropy loss function and the Adam optimization algorithm for training.

[0037] Using test set D test Test the trained machine learning model and evaluate its accuracy, precision, recall, and F1 score performance metrics.

[0038] Preferably, based on the identified metrology mode, a self-learning calibration and compensation mechanism is introduced to calibrate and compensate for data detection errors under the current metrology mode; specifically as follows:

[0039] For a given measurement model Establish a mathematical model between measurement error and influencing factors; let the actual physical quantity be x, and the measurement value of the measuring instrument be x. The measurement error is then expressed as:

[0040] Introduce the influencing factor vector ξ = [ξ1, ξ2, ..., ξ]K ] T where K is the number of influencing factors; assuming that there is a linear relationship between the measurement error and the influencing factors, the error model is represented as: ε2= α T ψ(ξ) + β; where α = [α1, α2,..., α H ] T K-1]T is the model weight vector, ψ(ξ) = [ψ1(ξ), ψ2(ξ),..., ψ H (ξ)] T K-1]T is the model weight vector, ψ(ξ) = [ψ1(ξ), ψ2(ξ),..., ψ e K-1]T is the model weight vector, ψ(ξ) = [ψ1(ξ), ψ2(ξ),..., ψ e K-1]T is the model weight vector, ψ(ξ) = [ψ1(ξ), ψ2(ξ),..., ψ s K-1]T is the model weight vector, ψ(ξ) = [ψ1(ξ), ψ2(ξ),..., ψ s K-1]T is the model weight vector, ψ(ξ) = [ψ1(ξ), ψ2(ξ),..., ψ

[0041] Preferably, a self-learning calibration error model is constructed to self-learn and calibrate the parameters α and β of the error model; measurement values within a preset time are recorded true values x e and corresponding influencing factors ξ e , where e = 1, 2,..., N s , N s is the number of calibration samples;

[0042] The gradient descent method is used to optimize the loss function, and the error model parameters α and β are updated, and the iteration is updated until the loss function converges or a preset number of iterations is reached;

[0043] The calibrated error model is used to compensate the measurement value of the intelligent metering instrument in real time; for the current measurement value and the influencing factor ξ, the measurement error is calculated:

[0044] The measurement error is subtracted from the measurement value to obtain the compensated measurement value: which is the measurement result after compensating the measurement error, as the final output of the intelligent metering instrument;

[0045] During the operation of the metering instrument, the error model is periodically updated adaptively using newly collected data.

[0046] Preferably, the trained machine learning model is knowledge distilled to reduce the volume of the model occupying the metering instrument, and the deployment of the machine learning model in the intelligent metering instrument is realized, specifically including: taking the trained metering pattern recognition model as a teacher model, denoted as f T (·); a student model is designed, denoted as f S (·), and the student model adopts a shallow neural network model;

[0047] The student model is trained by using the knowledge of the teacher model, and a soft label is used as a training target of the student model, and the soft label is obtained by temperature scaling the output of the teacher model; a temperature parameter τ controls the smoothing degree of the soft label; let z T and z S be the outputs of the teacher model and the student model respectively, and the calculation formula of the soft label y T is:

[0048]

[0049] wherein, softmax(·) is a softmax function, z T,q is the qth element of z T ; the training loss function L S of the student model is a weighted sum of the cross-entropy loss and the soft label loss:

[0050]

[0051] wherein, L CE (·) is a cross-entropy loss function, y is a real label, L KL (·) is a KL divergence loss function, is a weight coefficient; by minimizing the loss function L S , the student model learns the information of the real label and the knowledge of the teacher model at the same time.

[0052] Preferably, after the knowledge distillation training, the student model is adjusted using the original training set, and during the adjustment process, the loss function of the student model is the cross-entropy loss L finetune =L CE (y,f S (x));

[0053] The performance of the student model is evaluated using the test set, and if the performance of the student model meets the requirements, it is deployed to the intelligent metering instrument; otherwise, the structure of the student model is adjusted or the knowledge distillation training is performed again;

[0054] The trained student model is converted into a format suitable for running in the intelligent metering instrument, and is loaded into the program memory of the instrument; during the running of the metering instrument, new data is regularly collected, and the student model is incrementally trained and updated to adapt to the changes of the metering environment.

[0055] A multi-parameter real-time detection device of an intelligent metering instrument, which is used to realize the multi-parameter real-time detection method of the intelligent metering instrument, and includes a data acquisition module, a data analysis module, a metering mode recognition module, an error compensation module, and a distillation deployment module.

[0056] The data acquisition module acquires multi-parameter measurement data collected by the measurement instrument when detecting the medium, and pre-processes the measurement data;

[0057] The data analysis module analyzes the acquired measurement data, extracts measurement data characteristic parameters, including time-frequency domain characteristic data of the measurement data, and performs feature selection and dimension reduction;

[0058] The measurement mode recognition module trains a machine learning model based on the extracted time-frequency domain characteristic data of the measurement data, and identifies the measurement mode required for detecting the current medium;

[0059] The error compensation module introduces a self-learning calibration and compensation mechanism according to the identified measurement mode, calibrates and compensates for the data detection error under the current measurement mode;

[0060] The distillation deployment module performs knowledge distillation on the trained machine learning model, reduces the volume of the model occupying the measurement instrument, and realizes the deployment of the machine learning model in the intelligent measurement instrument.

[0061] The beneficial effects of the present application are: the present application acquires multi-parameter measurement data and pre-processes it to remove noise and outliers, ensuring the accuracy and reliability of the input data, and providing a high-quality data basis for subsequent feature analysis.

[0062] The present application extracts time domain and frequency domain features, and performs feature selection and dimension reduction, reduces data redundancy, highlights key features, and improves the efficiency of data analysis and the training speed of the machine learning model.

[0063] The present application trains a machine learning model based on time-frequency domain characteristic data, accurately identifies the best measurement mode for detecting the medium, improves the accuracy of measurement mode selection, and adapts to diversified detection requirements.

[0064] The present application introduces a self-learning mechanism to automatically calibrate and compensate for measurement errors, dynamically adapts to different measurement modes, and significantly improves the accuracy of data detection and the reliability of intelligent measurement instruments.

[0065] The present application reduces the complexity of the machine learning model through knowledge distillation, reduces the resource occupation of the measurement instrument, realizes efficient deployment, and ensures that the model still has good performance under hardware limited conditions.

[0066] The technical scheme of the present application realizes intelligent identification and adaptation of different media, automatically calibrates detection errors, and effectively improves the accuracy and reliability of measurement data. At the same time, through knowledge distillation to reduce the volume of the model, the machine learning model can be efficiently deployed in the measurement instrument, reducing the occupation of hardware resources, improving the intelligent level and practicality of the instrument, and meeting the measurement requirements in multiple scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0067] Figure 1 The flow chart of the multi-parameter real-time detection method of the intelligent metering instrument provided by the present application;

[0068] Figure 2 The structural diagram of the multi-parameter real-time detection device of the intelligent metering instrument provided by the present application. DETAILED DESCRIPTION

[0069] For a better understanding of the present application, various aspects of the present application will be described in more detail with reference to the accompanying drawings. It is to be understood that the detailed description is merely descriptive of illustrative embodiments of the present application and is not intended to limit the scope of the present application in any way. Throughout the description, like reference numerals refer to like elements. The expression "and / or" includes any and all combinations of one or more of the associated listed items.

[0070] In the drawings, the size, dimensions, and shapes of the elements have been slightly adjusted for ease of illustration. The drawings are merely examples and are not drawn to scale. As used in this document, the terms "substantially", "approximately", and similar terms are used as terms of approximation and not as terms of degree, and are intended to account for the inherent deviations in a measuring or computing process that would be recognized by those of ordinary skill in the art. Additionally, in the present application, the order of the step processes described does not necessarily indicate the order in which the processes occur in actual operation, unless otherwise explicitly limited or otherwise inherently implied by context.

[0071] It should also be understood that expressions such as "include", "including", "have", "has", "contain" and / or "containing" are open-ended terms that are intended to mean that the listed elements are present, but that other elements not listed are optional and can or can not be present. Additionally, when expressions such as "at least one of" appear alongside a list of two or more items, they are used to indicate that at least one of the listed items is present at a minimum, but that one or more of the other listed items can or can not be present also. Furthermore, when describing embodiments of the present application, the use of "can" means "one or more embodiments of the present application". Also, the use of the term "exemplary" is intended to refer to an example or illustration.

[0072] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an overly formal or overly literal sense unless expressly so defined in the present application.

[0073] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

[0074] Embodiment 1

[0075] Reference Figure 1 For the first embodiment of the present application, a multi-parameter real-time detection method of a smart metering instrument is provided.

[0076] Step 1: Obtain the multi-parameter metering data collected by the metering instrument when detecting the medium, and pre-process the metering data.

[0077] The multi-parameters of the smart metering instrument detecting the medium are obtained, including multi-type electrical data; each physical parameter is converted into an electrical signal by a corresponding sensor, and then an analog-to-digital conversion is performed by a signal acquisition circuit to obtain a digital quantity.

[0078] Let the collected physical parameters be x1, x2,..., xn, and the corresponding digital quantities be d1, d2,..., dn. n , where n is the number of collected physical parameters; the corresponding digital quantity is represented as d1, d2,..., dn. n The conversion relationship between the digital quantity and the physical quantity is:

[0079] d n = k n ·x n +b n

[0080] where k n is the sensitivity coefficient of the physical quantity sensor corresponding to the n-th collected physical parameter, b i is the zero-point offset; k i and b i are determined through sensor calibration experiments.

[0081] Since the original digital quantity data collected by the sensor may contain noise data such as abnormal values and missing values, pre-processing is needed to improve data quality. The pre-processing of the obtained digital quantity data includes: abnormal value detection and elimination, missing value filling, and data smoothing.

[0082] The pre-processed multi-parameter digital quantity data is arranged in the order of sampling time to form a data matrix D:

[0083]

[0084] where m is the number of sampling time points, and n is the number of collected physical parameters; the data matrix D is the multi-parameter metering data analyzed in the subsequent steps, and d mn is the digital quantity data of the n-th physical parameter sampled at the m-th sampling time.

[0085] Step 2: Analyze the acquired metrology data, extract metrology data feature parameters, including time-frequency domain feature data of metrology data, and perform feature selection and dimension reduction.

[0086] Feature extraction is performed on the multi-parameter metrology data matrix D obtained after preprocessing; the extracted features include time domain features and frequency domain features.

[0087] Time domain feature extraction; calculate the statistical feature quantity of each physical parameter data, including:

[0088] Mean:

[0089] Standard deviation:

[0090] Kurtosis:

[0091] Skewness:

[0092] Where m is the number of sampling time points, n is the number of collected physical parameters, is the digital quantity of the i-th physical parameter at the j-th sampling time.

[0093] Frequency domain feature extraction, fast Fourier transform (FFT) is performed on each physical parameter data to obtain frequency domain signal X i (f); calculate the frequency domain feature quantity, including:

[0094] Frequency domain energy: E i =∑ f |X i (f)| 2 ,i=1,2,...,n;

[0095] Frequency domain entropy: H i = -∑ f P i (f)·logP i (f),i=1,2,...,n;

[0096] Where, is the normalized power spectral density.

[0097] The extracted time domain features and frequency domain features are combined into a feature vector v:

[0098] v=[μ1,σ1,β1,S1,E1,H1,…,μ n ,σ n ,β n ,S n ,E n ,H n ] T

[0099] The dimension of the feature vector is 6n, where n is the number of physical parameters.

[0100] Principal component analysis (PCA) is used to select and reduce the dimension of the extracted features; the feature vector v is centralized to obtain the centralized feature matrix X c :

[0101]

[0102] wherein, is the mean value of the sampling features at the mth sampling time, m is the number of sampling time points, n is the number of physical parameters, v mn is the sampling feature value of the nth physical parameter at the mth sampling time.

[0103] The covariance matrix S of the centralized feature matrix X c is calculated, and the covariance matrix S is subjected to eigenvalue decomposition: X c =UΣU T ; wherein, U is the eigenvector matrix, U T is the transpose of the eigenvector matrix, and Σ is the eigenvalue matrix.

[0104] The eigenvectors corresponding to the first r largest eigenvalues are selected to form the dimension reduction matrix W: W=[u1,u2,...,u r ]; r can be determined according to the cumulative contribution rate γ:

[0105]

[0106] wherein, δ is the cumulative contribution rate threshold, generally taking a value of 0.8-0.95;

[0107] The centralized feature matrix X c is mapped to a low-dimensional space by using the dimension reduction matrix W, to obtain the dimension-reduced feature matrix Y: Y=X c W; the feature vector of each sample in Y is denoted as v * , that is: v * =[y1,y2,...,y r ] T ; v * is the new feature vector obtained after principal component analysis dimension reduction, and the dimension is r.

[0108] The extracted time-frequency domain feature data is divided into a training set and a test set wherein is the feature vector of the ith sample in the training set, l iis the measurement mode label corresponding to the i-th sample in the training set, is the feature vector of the i'-th sample in the test set, and N is the number of data sets, N i' is the measurement mode label corresponding to the i'-th sample in the test set, and N is the number of data sets, N train is the number of training sets.

[0109] Step 3: Based on the extracted time-frequency domain feature data of the measurement data, train the machine learning model to identify the measurement mode required for detecting the current medium.

[0110] Select a neural network in the machine learning model as the measurement mode identification model and train it; use the training set D train Train the selected machine learning model.

[0111] Design a fully connected structure containing L hidden layers, and use a cross-entropy loss function: and Adam optimization algorithm for training, where θ is the neural network parameter, l ih and p ih represent the h-th element of the real label and the predicted label respectively, and M is the total number of classes in the classification task.

[0112] Use the test set D test Test the trained machine learning model to evaluate the accuracy, precision, recall, and F1 score performance indicators of the model. If the model performance meets the requirements, it can be used for subsequent measurement mode identification tasks; otherwise, the model structure, hyperparameters, or training data need to be adjusted, and the training and testing need to be performed again.

[0113] Step 4: According to the identified measurement mode, introduce a self-learning calibration and compensation mechanism to calibrate and compensate for data detection errors under the current measurement mode.

[0114] According to the identified measurement mode, introduce a self-learning calibration and compensation mechanism to calibrate and compensate for data detection errors under the current measurement mode; specifically as follows:

[0115] Construct a measurement error model, for a given measurement mode Establish a mathematical model between the measurement error and the influencing factors; let the real physical quantity be x, and the measurement value of the measuring instrument be The measurement error is represented as:

[0116] Introduce an influencing factor vector ξ = [ξ1, ξ2,..., ξ K ] T , where ξ Kis the Kth influence factor vector, K is the number of influence factors; assuming that there is a linear relationship between the measurement error and the influence factors, the error model is represented as: ε2= α T ψ(ξ) + β; where, α = [α1, α2,..., α H ] T is the model weight vector, α H is the H-dimensional weight vector, ψ(ξ) = [ψ1(ξ), ψ2(ξ0,..., ψ H (ξ)] T is the characteristic mapping function of the influence factor, ψ H (·) is the H-dimensional characteristic mapping function, β is the bias term, and H is the dimension of the characteristic mapping function.

[0117] An error model is constructed by self-learning calibration, and the parameters α and β of the error model are calibrated by the data collected by the intelligent meter during actual measurement; the measurement values within a preset time are recorded the true value x e and the corresponding influence factor ξ e , where e = 1, 2,..., N s , N s is the number of calibration samples; the loss function of the error model is defined as the mean square error (MSE):

[0118]

[0119] where, ε e is the measurement error of the e-th calibration sample.

[0120] The gradient descent method is used to optimize the loss function, and the error model parameters α and β are updated, and the iteration is updated until the loss function converges or reaches the preset number of iterations.

[0121] The calibrated error model is used to compensate the measurement value of the intelligent meter in real time; for the current measurement value and the influence factor ξ, the estimated measurement error is calculated:

[0122] The estimated measurement error is subtracted from the measurement value to obtain the compensated measurement value: That is, the measurement result after compensating the measurement error, which is the final output of the intelligent meter.

[0123] During the long-term operation of the meter, periodically update the error model by using newly collected data. The error model is updated adaptively; the effectiveness and robustness of the error model are maintained.

[0124] Through the above self-learning calibration and compensation mechanism, the intelligent metering instrument can adaptively calibrate and compensate the data detection error in the current mode according to the identified metering mode, thereby improving the accuracy of the metering data.

[0125] Step 5: Knowledge distillation is performed on the trained machine learning model to reduce the volume of the model occupying the metering instrument, and to realize the deployment of the machine learning model in the intelligent metering instrument.

[0126] Knowledge distillation is performed on the trained machine learning model to reduce the volume of the model occupying the metering instrument, and to realize the deployment of the machine learning model in the intelligent metering instrument; specifically as follows:

[0127] The trained metering mode recognition model is taken as a teacher model, denoted as f T (·); the teacher model has high recognition accuracy, but the model complexity is high, and is not suitable for direct deployment in the resource-limited intelligent metering instrument.

[0128] A simplified student model is constructed, and a student model with simple structure and small number of parameters is designed, denoted as f S (·); the student model adopts a shallow neural network model to reduce the model complexity and the occupation of computing resources.

[0129] The knowledge of the teacher model is used to guide the training of the student model, and a soft label is used as the training target of the student model, which is obtained by temperature scaling the output of the teacher model; the temperature parameter τ controls the smoothing degree of the soft label, and the higher the temperature, the smoother the soft label; let z T and z S be the outputs of the teacher model and the student model respectively, and the calculation formula of the soft label y T is:

[0130]

[0131] wherein, softmax(·) is a softmax function, z T,q is the qth element of z T ; the training loss function L S of the student model is the weighted sum of the cross-entropy loss and the soft label loss:

[0132]

[0133] wherein, L CE (·) is a cross-entropy loss function, y is a real label, and L KL (·) is a KL divergence loss function, is a weight coefficient; by minimizing the loss function L S , the student model can learn the information of the real label and the knowledge of the teacher model at the same time.

[0134] After knowledge distillation training, the student model is adjusted using the original training set to further improve its performance. During the adjustment process, the loss function of the student model is the cross-entropy loss: finetune = L CE (y, f S (x)).

[0135] Through adjustment, the student model can better adapt to the original task and achieve a performance level close to that of the teacher model.

[0136] The performance of the student model is evaluated using the test set, including accuracy, precision, recall, and F1 score, etc. If the performance of the student model meets the requirements, it will be deployed to the intelligent metering instrument. Otherwise, the structure of the student model is adjusted or the knowledge distillation training is re-performed.

[0137] The trained student model is converted into a format suitable for running in the intelligent metering instrument (such as C language code) and loaded into the program memory of the metering instrument. During the operation of the instrument, new data is regularly collected and the student model is incrementally trained and updated on the cloud or locally to adapt to changes in the metering environment.

[0138] Through the above knowledge distillation technology, a complex metering pattern recognition model can be converted into a simplified student model, reducing the model's occupation of the metering instrument's computing and storage resources, and realizing efficient deployment and real-time inference of machine learning models in resource-constrained intelligent metering instruments. At the same time, through model adjustment and incremental updating, the long-term adaptability and robustness of the model are maintained.

[0139] Embodiment 2

[0140] Referring to Figure 2 , the second embodiment of the present application provides a multi-parameter real-time detection device for an intelligent metering instrument, which includes a data acquisition module, a data analysis module, a metering pattern recognition module, an error compensation module, and a distillation deployment module.

[0141] The data acquisition module acquires multi-parameter metering data collected by the metering instrument during detection of the medium and pre-processes the metering data.

[0142] The data analysis module analyzes the acquired metering data, extracts metering data feature parameters, including time-frequency domain feature data of the metering data, and performs feature selection and dimension reduction.

[0143] The metering pattern recognition module trains a machine learning model based on the extracted time-frequency domain feature data of the metering data to identify the metering pattern required for detecting the current medium.

[0144] The error compensation module introduces a self-learning calibration and compensation mechanism according to the identified metering mode, and calibrates and compensates for the data detection error under the current metering mode.

[0145] The distillation deployment module performs knowledge distillation on the trained machine learning model, reduces the volume of the model occupying the metering instrument, and realizes the deployment of the machine learning model in the intelligent metering instrument.

[0146] The above order of steps for the method is only for illustration, and the steps of the method of the present application are not limited to the above specifically described order, unless otherwise specifically stated.

[0147] In addition, in some embodiments, the present application can also be implemented as programs recorded in recording media, which include machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers the recording media storing the programs for executing the method according to the present application.

[0148] In addition, the part of the above technical solutions provided in the embodiments of the present application which is consistent with the implementation principle of the corresponding technical solutions in the prior art is not described in detail to avoid excessive repetition.

[0149] The specific embodiments described above further illustrate the objects, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A multi-parameter real-time detection method for intelligent metering instruments, characterized in that, Comprise: Step 1: Obtain the multi-parameter metering data collected by the metering instrument when detecting the medium, and pre-process the metering data; Step 2: Analyze the obtained metering data, extract the characteristic parameters of the metering data, including the time-frequency domain characteristic data of the metering data, and perform feature selection and dimension reduction; Step 3: Based on the extracted time-frequency domain characteristic data of the metering data, train a machine learning model to identify the metering mode required for detecting the current medium; Step 4: According to the identified metering mode, introduce a self-learning calibration and compensation mechanism to calibrate and compensate the data detection error under the current metering mode; Step 5: knowledge distillation is performed on the trained machine learning model, the volume of the model occupying the meter is reduced, and the deployment of the machine learning model in the intelligent meter is realized; specifically comprising: taking the trained meter pattern recognition model as a teacher model, denoted as f T (·);designing a student model, denoted as f S (·) The student model adopts a shallow neural network model; Knowledge of the teacher model is used to guide training of the student model, soft labels are used as training targets of the student model, and the soft labels are obtained by temperature scaling of outputs of the teacher model; a temperature parameter τ controls a smoothing degree of the soft labels; let z T and z S be outputs of the teacher model and the student model respectively, and a calculation formula of the soft label y T is: where softmax(·) is a softmax function, z T,q is the qth element of z T ; the training loss function L S of the student model is a weighted sum of cross-entropy loss and soft label loss: wherein L CE (·) is a cross-entropy loss function, y is a real label, L KL (·) is a KL divergence loss function, is a weight coefficient; by minimizing the loss function L S , the student model learns the information of the real label and the knowledge of the teacher model simultaneously; After the knowledge distillation training, the student model is adjusted using the original training set, and during the adjustment process, the loss function of the student model is cross-entropy loss L finetune = L CE (y, f S (x)); Evaluate the performance of the student model using the test set, if the performance of the student model meets the requirements, deploy it to the intelligent metering instrument; otherwise, adjust the structure of the student model or retrain the knowledge distillation; Convert the trained student model into a format suitable for running in the intelligent metering instrument, and load it into the program memory of the instrument; during the operation of the metering instrument, regularly collect new data and update the student model to adapt to changes in the metering environment.

2. The method as claimed in claim 1, wherein, Obtain the multi-parameters of the metering instrument detecting the medium, including multiple types of electrical data; each physical parameter is converted into an electrical signal by a corresponding sensor, and then an analog-to-digital conversion is performed by a signal acquisition circuit to obtain a digital quantity; Let the collected physical parameters be x1, x2,..., x n , where n is the number of collected physical parameters; the corresponding digital quantity is represented as d1, d2,..., d n ; the conversion relationship between the digital quantity and the physical quantity is: d n = k n • x n + b n Wherein, k n is the sensitivity coefficient of the physical quantity sensor corresponding to the nth physical parameter, b i is the zero point offset; the obtained digital quantity data is preprocessed, and the preprocessed multi-parameter digital quantity data is sequentially composed into a data matrix D according to the sampling time. Wherein, m is the number of sampling time points, n is the number of collected physical parameters; the data matrix D is the multi-parameter metering data.

3. The method as claimed in claim 2, wherein, Feature extraction is performed on the pre-processed multi-parameter metering data matrix D; the extracted features include time domain features and frequency domain features; Extracting time domain features of multi-parameter metrology data, calculating statistical characteristic quantities of each physical parameter data, including: mean μ i , standard deviation σ i , kurtosis β i and skewness S i ; Extracting frequency domain features of multi-parameter metrology data, performing fast Fourier transform on each physical parameter data to obtain frequency domain signal X i (f); calculating frequency domain features from the frequency domain signal, including: frequency domain energy E i and frequency domain entropy H i ; The extracted time domain features and frequency domain features are combined to form a feature vector v: v = [μ1, σ1, β1, S1, E1, H1,..., μ n , σ n , β n , S n , E n , H n ] T The dimension of the feature vector is 6n, where n is the number of physical parameters.

4. The method as claimed in claim 3, wherein, The principal component analysis is used to select and reduce dimensions of the extracted features; and the feature vector v is centrally processed to obtain a centralized feature matrix X c : wherein, is the mean value of the sampling features of the mth sampling time, m is the number of sampling time points, n is the number of physical parameters, v mn is the sampling feature value of the nth physical parameter at the mth sampling time; computing a covariance matrix S of the centralized feature matrix X c and performing eigenvalue decomposition on the covariance matrix S: X c = UΣU T ; where U is a matrix of eigenvectors, U T is a transpose of the matrix of eigenvectors, and∑ is a matrix of eigenvalues. Select the eigenvectors corresponding to the first r largest eigenvalues ​​to construct a dimension-reduced matrix W: W = [u1, u2, ..., u...]. r r is determined based on the cumulative contribution rate γ: Wherein, δ is the cumulative contribution rate threshold; Using the dimensionality reduction matrix W to center the feature matrix X c Mapping to a lower-dimensional space yields the dimensionality-reduced feature matrix Y:Y=X c W; Let v be the feature vector of each sample in Y. * That is: v * =[y1,y2,...,y r ] T ;v * This refers to the new eigenvectors obtained after dimensionality reduction through principal component analysis, with a dimension of r.

5. The method as claimed in claim 4, wherein, The extracted time-frequency domain feature data is divided into a training set and a test set wherein is a feature vector of the i-th sample in the training set, l i is a metrological pattern label corresponding to the i-th sample in the training set, is a feature vector of the i'-th sample in the test set, l i' is a metrological pattern label corresponding to the i'-th sample in the test set, N is the number of data sets, N train is the number of divided training sets; A neural network in a machine learning model is selected as a metrological pattern recognition model and trained; a training set D train The selected machine learning model is trained; A fully connected structure containing L hidden layers is designed, and a cross-entropy loss function and Adam optimization algorithm are used for training; Using test set D test The trained machine learning model is tested to evaluate the accuracy, precision, recall, and F1 score performance indicators of the model.

6. The method as claimed in claim 5, wherein, According to the identified metering mode, introduce a self-learning calibration and compensation mechanism to calibrate and compensate the data detection error under the current metering mode; specifically as follows: For a given metrology mode A mathematical model between metrology error and influencing factors is established; let the real physical quantity be x, and the measurement value of the metrology instrument be The metrology error is expressed as: The influence factor vector ξ = [ξ1, ξ2,..., ξK] is introduced, where K is the number of influence factors; assuming that there is a linear relationship between the measurement error and the influence factors, the error model is represented as: ε2= α K ] T where K is the number of influence factors; assuming that there is a linear relationship between the measurement error and the influence factors, the error model is represented as: ε2= α T ψ(ξ) + β; where a = [a1, a2,..., a H ] T is the model weight vector, and ψ(ξ) = [ψ1(ξ), ψ2(ξ),..., ψ H (ξ)] T is the feature mapping function of the influencing factor, β is the bias term, and H is the dimension of the feature mapping function.

7. The method as claimed in claim 6, wherein, Constructing a self-learning calibration error model, and performing self-learning calibration on parameters α and β of the error model; recording measurement values within a preset time True value x e And the corresponding influencing factors ξ e Wherein, e = 1, 2,..., N s , N s Is the number of calibration samples; Optimize the loss function using the gradient descent method to update the error model parameters α and β, and iteratively update until the loss function converges or reaches the preset number of iterations; The measurement value of the intelligent metering instrument is compensated in real time by using the calibrated error model; for the current measurement value and the influencing factor ξ, the metering error is calculated: Subtract the metering error from the measured value to obtain the compensated measured value: That is, the measurement result after compensating the metering error, as the final output of the intelligent metering instrument; During the operation of the metering instrument, regularly update the error model adaptively using newly collected data.

8. The multi-parameter real-time detection device of the smart metering instrument, which is used for realizing the multi-parameter real-time detection method of the smart metering instrument according to any one of claims 1 to 7, characterized in that, Comprise: Data acquisition module, data analysis module, metering mode identification module, error compensation module and distillation deployment module; The data acquisition module obtains the multi-parameter metering data collected by the metering instrument when detecting the medium, and pre-processes the metering data; The data analysis module analyzes the obtained metering data, extracts the characteristic parameters of the metering data, including the time-frequency domain characteristic data of the metering data, and performs feature selection and dimension reduction; The metering mode identification module, based on the extracted time-frequency domain characteristic data of the metering data, trains a machine learning model to identify the metering mode required for detecting the current medium; The error compensation module, according to the identified metering mode, introduces a self-learning calibration and compensation mechanism to calibrate and compensate the data detection error under the current metering mode; The distillation deployment module performs knowledge distillation on the trained machine learning model, reduces the volume of the model occupying the meter, and realizes the deployment of the machine learning model in the intelligent meter; Specifically comprising: taking the trained metrology pattern recognition model as a teacher model, denoted as f T (·);designing a student model, denoted as f S (·), wherein the student model adopts a shallow neural network model; The knowledge of the teacher model is used to guide the student model training, and a soft label is used as a training target of the student model, and the soft label is obtained by temperature scaling the output of the teacher model; a temperature parameter τ controls the smoothing degree of the soft label; z T and z S are respectively outputs of the teacher model and the student model, and a calculation formula of the soft label y T is as follows: where softmax(·) is a softmax function, z t,q is the qth element of z T ; the training loss function L S of the student model is a weighted sum of cross-entropy loss and soft label loss: wherein L CE (·) is a cross-entropy loss function, y is a real label, L KL (·) is a KL divergence loss function, is a weight coefficient; by minimizing the loss function L S , the student model learns the information of the real label and the knowledge of the teacher model simultaneously; After the knowledge distillation training, the student model is adjusted using the original training set, and during the adjustment process, the loss function of the student model is cross-entropy loss L finetune = L CE (y, f S (x)); The performance of the student model is evaluated using the test set. If the performance of the student model meets the requirements, it is deployed to the intelligent meter; otherwise, the structure of the student model is adjusted or the knowledge distillation training is re-performed; The trained student model is converted into a format suitable for running in the intelligent meter, and is loaded into the program memory of the meter. During the running of the meter, new data is regularly collected, and the student model is incrementally trained and updated to adapt to changes in the metering environment.

Citation Information

Patent Citations

  • System and method for training student friendly teacher model and student model

    US20220207431A1

  • Born-again TSK fuzzy classifier based on knowledge distillation

    US20230401424A1