Metrological verification data uplink method and system
Through the measurement and verification data on-chain method, including data cleaning, dimensionality reduction, fusion and smart contract design, the problem of low data sharing in power grid laboratories has been solved, the effective sharing and safe storage of energy meter verification data has been achieved, and the experiments in the power industry have been improved. The level of intelligent management of the room.
Patent Information
- Application Number
- CN202410787641.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-10-01
AI Technical Summary
The low degree of resource and data sharing in power grid laboratories results in the failure to effectively connect and integrate detection data, hindering the development of measurement data research. It is necessary to achieve full-scenario perception and detection data sharing and integration in measurement laboratories.
Propose a method for uploading metrology calibration data to the chain, including data preprocessing, object design and smart contract design. Through data cleaning, dimensionality reduction and fusion, we develop on-chain data standards and design smart contracts to achieve effective uploading of energy meter calibration data. and share.
It improves the availability and quality of data, realizes the standardized sharing of energy meter calibration data, enhances the credibility and security of data, supports the construction of full-scenario visual measurement smart laboratories, and improves the intelligent management level of power industry laboratories.
Smart Images

Figure CN118733674A_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the technical field of metrological data processing, and in particular to a method and system for uploading metrological verification data to a chain. Background Art
[0002] At present, the level of laboratory resources and data sharing in power grids is low, and the problem that a large amount of test data has not been effectively connected and integrated has become a stumbling block for metrology data research. Therefore, it is urgent to carry out research and application of full-scene perception and test data sharing and integration technology in metrology laboratories, and through the unified, standardized and trusted access and sharing of test and detection data, realize the vertical connection, integration sharing and demonstration application of two-level metrology laboratory data, support the construction of full-scene, visual metrology smart laboratories, support data sharing and integration applications in other laboratories in the power industry, and improve the level of intelligent management of laboratories in the power industry. Summary of the invention
[0003] The technical problem to be solved by the present invention is: in response to the technical problems existing in the prior art, the present invention provides a method and system for uploading metrology verification data to the chain, which can realize effective supervision of the full-scene perception and detection data of the metrology laboratory.
[0004] In order to solve the above technical problems, the technical solution proposed by the present invention is:
[0005] A method for uploading metrological verification data to a chain comprises the following steps:
[0006] S1. Data planning for uploading electric energy meter verification data: pre-process the data before uploading it to the chain;
[0007] S2. Design of data objects for uploading the verification data of electric energy meters: Analyze and classify the verification data of electric energy meters, formulate uploading data standards to process the verification data of electric energy meters, and obtain standard data that meets the specifications;
[0008] S3. Design of smart contract for electricity meter calibration data: Analyze the demand for uploading electricity meter calibration data to the chain, determine the type of data to be recorded, design the architecture of the smart contract, plan the logical flow of the contract, and implement the design of smart contract for electricity meter calibration data.
[0009] Preferably, in step S1, preprocessing includes data cleaning, data dimension reduction and data fusion;
[0010] Data cleaning is divided into two parts: duplicate record cleaning and noise data elimination, specifically:
[0011] Duplicate record cleaning uses a basic neighbor sorting algorithm, which mainly includes the following three steps:
[0012] 1) Generate keywords: Generate a keyword for each instance by extracting the values of relevant attributes in the dataset;
[0013] 2) Data sorting: Sort the data in the data set by keywords so that potential duplicate records are adjusted to a contiguous area;
[0014] 3) Merge: Move a fixed-size window sequentially on the sorted data set, and each record in the data set is compared only with the records in the window; if the window size contains m records, then each new record entering the window must be compared with the m records that previously entered the window to detect duplicate records, and then the record that first enters the window slides out of the window, and the next record of the last record moves into the window.
[0015] Preferably, the method for eliminating noise data is an equal depth binning method, which divides the data into different bins of the same depth, specifically:
[0016] aSmoothing by bin mean
[0017] Average all values in a bin, then replace all data in the bin with the bin average.
[0018] b Smooth by box boundaries
[0019] The maximum and minimum values in a bin are considered as bin boundaries, and each value in a bin is replaced by the nearest bin boundary value.
[0020] Preferably, when performing data dimensionality reduction, for linear features in data features, the principal component analysis dimensionality reduction method is used to find the most important elements and structures in the data, remove noise and redundancy, and reduce the dimensionality of the original complex data; for nonlinear features in data features, autoencoders are used for dimensionality reduction; for the data features after dimensionality reduction, rule-based feature mining is performed to support non-reversible feature extraction;
[0021] The specific process of dimensionality reduction processing of principal component analysis dimensionality reduction method is as follows:
[0022] 1) First, calculate the feature mean value to construct the covariance matrix of the feature data;
[0023] 2) Then solve the eigenvalues and eigenvectors of the covariance matrix through SVD decomposition;
[0024] 3) The obtained eigenvalues are arranged from large to small to facilitate the selection of the eigenvalues of the principal component;
[0025] 4) After the eigenvalues of the principal components are selected, the eigenvectors corresponding to these eigenvalues constitute the subspace after dimensionality reduction;
[0026] The specific process of dimensionality reduction using the autoencoder is:
[0027] Autoencoder structure: a neural network structure consisting of three layers: input layer, hidden layer, and output layer;
[0028] Autoencoder algorithm flow:
[0029] a. For given unlabeled data, use unsupervised learning methods to learn features: For data without class labels, encode the input data through the encoder, and then use the decoder to get an output information; if the output is approximately equal to the input data, the reconstruction error can be minimized by adjusting the parameters of the encoding and decoding stages;
[0030] b. Take the features generated by the encoder as input and train the network of the lower layers layer by layer. Since the encoding obtained by the first training layer is a reproduction of the input data, the training process of the lower layers is similar to that of the first layer.
[0031] c. Fine-tune the entire neural network in a supervised manner: After training all layers of the network, the autoencoder learns to obtain features that better represent the input, and these features optimally represent the original input signal; a classifier is added after the autoencoder, and then the entire network is fine-tuned through supervised training methods.
[0032] Preferably, when performing data fusion, firstly based on feature extraction technology, for the data extracted from non-reversible data features, an adaptive data fusion algorithm is used to fuse the data on the neural data fusion system to obtain as much information as possible; then, a multivariate probability inference model is used to learn the data to form a high-value information database support.
[0033] Preferably, in step S2, the data is divided into quantity transmission data, quality inspection data, and field data according to the business classification of the electric energy meter verification data;
[0034] According to the sharing requirements of electricity meter verification data on the chain, the data is divided into basic data and test and detection data;
[0035] Basic data includes verification agencies, agency certificates, verification personnel, verification personnel certificates, electric energy meter assets, standard equipment assets, measurement equipment verification certificate information, standard equipment verification / calibration certificates, and enterprise certification certificate information;
[0036] Test and inspection data include adaptability inspection data, sample comparison data, software comparison data, full performance test and inspection data, sampling acceptance test data, and full inspection and acceptance test data.
[0037] Preferably, in step S2, the uplink data standard is used to provide data technical specifications for uplink data providers, including data format and data length; the data standard is selected based on the principle of one number and one source for fused data;
[0038] Data standards include three parts: subject definition, information items, and standard codes. The subject definition is used to record the definition and classification of data standards, and is used to standardize and identify the subject attribution of data; information items record the business attributes and technical attributes of information items of data subjects; standard codes record the encoding, classification, and usage rules of fixed code values of information items.
[0039] Preferably, the specific process of chaining is:
[0040] According to a fixed cycle, the electric energy meter asset data is synchronized in increments from the provincial information intranet MDS intermediate library to the provincial information extranet platform intermediate library;
[0041] The data uplink service monitors the data status of the intermediate library, encrypts and packages the electric energy meter asset data, measurement verification personnel data, measurement standard device data, and measurement standard instrument data to be uploaded, and performs the data uplink operation;
[0042] Trigger the data verification smart contract to verify the integrity and correctness of the on-chain data;
[0043] Execute the operation of uploading the original data to the chain and receive the result returned by the uploading service;
[0044] According to the result returned by the on-chain service, the on-chain status of the electricity meter asset data in the intermediate library is updated and the blockchain hash is recorded to complete the data on-chain operation.
[0045] Preferably, the specific process of step S3 is:
[0046] Smart contracts are jointly developed by multiple users within the blockchain and are used for any transaction between users. The agreement clearly defines the rights and obligations of both parties. The rights and obligations are programmed electronically, and the code contains conditions that trigger the automatic execution of the contract.
[0047] Once the coding is complete, the smart contract is uploaded to the blockchain network;
[0048] The smart contract periodically checks whether there are relevant events and trigger conditions; events that meet the conditions will be pushed to the queue for verification;
[0049] The verification nodes on the blockchain will first verify the signature of the event to ensure its validity. Once the majority of verification nodes reach a consensus on the event, the smart contract will be successfully executed and the user will be notified.
[0050] Successfully executed contracts will be removed from the block, while unexecuted contracts will continue to wait for the next round of processing until they are successfully executed.
[0051] The present invention also discloses a metrology verification data uplink system, comprising a memory and a processor connected to each other, wherein a computer program is stored in the memory, and when the computer program is run by the processor, the steps of the method described above are executed.
[0052] Compared with the prior art, the advantages of the present invention are:
[0053] The present invention plans the information on chaining of the verification data of the electric energy meter, cleans, reduces the dimension, and fuses the verification data of the electric energy meter before it is chained, thereby improving data availability and providing data support for chain storage; data cleaning is used to discover and correct errors stored in the data; a principal component analysis dimensionality reduction method is used to reduce the dimension of the verification data, find the most important elements and structures in the data, and remove noise and redundancy; through data fusion, the value of multi-source information data is maximized, thereby obtaining characteristics of a fusion result that is more favorable to users.
[0054] The present invention studies the business classification of electric energy meter calibration data and the demand for uplink sharing of electric energy meter calibration data, analyzes and classifies the electric energy meter calibration data, formulates uplink data standards to guide uplink data providers to process the electric energy meter calibration data, and provides standard data that meets the specifications for data uplink; by studying the concept and working principle of smart contracts, an uplink smart contract for electric energy meter calibration data is designed to realize the validity verification and safe reading of the uplinked electric energy meter calibration data. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 The present invention is a flowchart of an embodiment of data cleaning.
[0056] Figure 2 This is a data projection diagram in the principal component analysis method of the present invention.
[0057] Figure 3 This is the structure diagram of the autoencoder in the present invention.
[0058] Figure 4 This is a flow chart of the autoencoder algorithm in the present invention.
[0059] Figure 5 This is a diagram of the neuron data fusion system in the present invention.
[0060] Figure 6 This is a classification diagram of the uplink data objects in the present invention.
[0061] Figure 7 This is a flow chart of the chain-up method in the present invention.
[0062] Figure 8 This is a diagram of the smart contract model in the present invention.
[0063] Fig. 9The figure is a flow chart of an embodiment of the method for uploading metrological verification data to a chain in the present invention. DETAILED DESCRIPTION
[0064] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0065] like Fig. 9 As shown, the method for uploading measurement verification data to a chain according to an embodiment of the present invention comprises the following steps:
[0066] S1. Data planning for uploading electric energy meter verification data to the chain: Clean, reduce the dimension, and merge the electric energy meter verification data before uploading it to improve data availability and provide data support for uploading to the chain. The specific steps include:
[0067] S101. Data cleaning
[0068] like Figure 1 As shown in the figure, data cleaning is used to discover and correct errors stored in the data, including checking data consistency and integrity, processing invalid values and missing values, etc. Because the electric energy meter verification data is heterogeneous and contains historical data, it is inevitable that some data are erroneous data and some data conflict with each other. These erroneous or conflicting data are so-called "dirty data". Data cleaning is to filter out incomplete data, erroneous data, and duplicate data according to certain rules, and then hand it over to the relevant measurement laboratory to confirm whether it is filtered out or corrected by the business unit.
[0069] Incomplete data mainly refers to the lack of necessary information, which is required to be completed within the specified time. The reason for erroneous data is that the business system is not sound enough, and the input is directly written into the backend database without any judgment after receiving it. This type of error needs to be picked out from the business system database using SQL and handed over to the business management department for correction within a time limit. Duplicate data needs to be confirmed and processed by the relevant metrology laboratory to remove duplicate data.
[0070] The data sources of data collection are databases, data centers, networks, application systems, terminals, sensors, etc. Data from different sources, different properties, and different impacts may have problems such as incompleteness, errors, and duplications, which require data cleaning. Data cleaning refers to the last procedure of discovering and correcting identifiable errors in data files, including checking data consistency and processing "dirty data" such as invalid values and missing values. Apply data cleaning technology to "clean away" the "dirty" and retain valid data.
[0071] Dirty data generally includes three categories: incomplete data, erroneous data, and duplicate data:
[0072] (1) Incomplete data: This type of data mainly contains some missing information that should be available and needs to be completed within a specified time. After completion, it will be written into the data warehouse.
[0073] (2) Incorrect data: This type of error is caused by an incomplete business system, where input is directly written into the backend database without any judgment after receiving it. This type of error needs to be picked out from the business system database using SQL and handed over to the business management department for correction within a time limit. After correction, the data can be extracted again.
[0074] (3) Duplicate data: For this type of data, especially those that occur in dimension tables, all fields of the duplicate data records are exported and asked to be confirmed and sorted by the customer.
[0075] Based on the content of the electric energy meter verification data, through the study of the verification data rules, the "dirty data" such as incomplete data, erroneous data, and duplicate data that do not meet expectations are "cleaned away". This is the data cleaning process. By configuring the programmable function nodes of the verification data acquisition device, according to the characteristics of the verification data, combined with data cleaning technology, dirty data cleaning is carried out to filter out data that does not meet the requirements, and the filtering results are summarized and managed to confirm whether to filter out or extract after correction by the data business source.
[0076] Data cleaning is an iterative process that cannot be completed in a short period of time. The only way to achieve this is to constantly discover and solve problems.
[0077] Data cleaning technology is divided into two parts: duplicate record cleaning and noise data elimination, specifically:
[0078] (1) Cleaning duplicate records: In the process of constructing a data warehouse, a large amount of data needs to be imported from various data sources. Ideally, for an entity in the real world, there should be only one corresponding record in the database or data warehouse. However, when integrating multiple data sources representing heterogeneous information, due to various problems such as data input errors, format and spelling differences in the actual data, multiple records that identify the same entity cannot be correctly identified, so that the entity that logically points to the same real world may have multiple different representations in the data warehouse, that is, the same entity object may correspond to multiple records. Duplicate records will lead to incorrect mining patterns, so it is necessary to remove duplicate records in the data set to improve the accuracy and speed of subsequent mining.
[0079] Each duplicate record detection method needs to determine whether two or more instances represent the same entity. An effective detection method is to compare each instance with other instances to find duplicate instances. However, although this method works best, it is computationally complex. Given the number of records in the data set, this method is inefficient, time-consuming, and labor-intensive, and is generally not used in reality.
[0080] In order to detect and eliminate duplicate records from a data set, the first question is how to determine whether two records are duplicates. This requires comparing the corresponding attributes of the records, calculating their similarity, and then taking a weighted average based on the weight of the attributes to get the similarity of the records. If the similarity of the two records exceeds a certain threshold, the two records are considered to be matched, otherwise, they are considered to be records pointing to different entities.
[0081] The sort-merge method is a standard method for detecting completely duplicate records in a database. Specifically, the data set is sorted first, and then adjacent records are compared for equality. This method also provides a way to detect duplicate records in the entire data set, and most of the existing methods for detecting duplicate records are based on this idea. The more commonly used algorithm is the basic nearest neighbor sorting algorithm, which mainly includes the following three steps:
[0082] Generate keywords: Generate a keyword for each instance by extracting the values of relevant attributes in the dataset.
[0083] Data sorting: Sort the data in the data set according to the keywords generated in the previous step. Try to adjust the potential duplicate records to a contiguous area, so that for a specific record, the objects for record matching can be limited to a certain range.
[0084] Merge: Move a fixed-size window sequentially on the sorted data set, and each record in the data set is compared only with the records in the window. If the window size contains m records, each new record entering the window must be compared with the m records that entered the window previously to detect duplicate records, and then the record that first enters the window slides out of the window, and the next record of the last record moves into the window.
[0085] As mentioned above, real-world data generally cannot be used directly for data mining and needs to be preprocessed to meet the requirements before it can be used for mining.
[0086] (2) Eliminating Noise Data
[0087] There may be many reasons for the emergence of noise data. The existence of noise data makes the data not within the specified data domain, which will affect the subsequent mining effects and results.
[0088] A commonly used method to eliminate noisy data is the binning method.
[0089] The binning method smoothes the data values to be processed by referring to the values of surrounding instances. The data to be processed is distributed into some bins, and different binning techniques smooth these values differently. Existing binning methods include equal-depth binning and equal-width binning. The equal-depth binning method divides the data into different bins of the same depth. The specific method is as follows:
[0090] aSmoothing by bin mean
[0091] This method averages all the values in a bin and then replaces all the data in the bin with the bin average.
[0092] b Smooth by box boundaries
[0093] The maximum and minimum values in a bin are considered as bin boundaries, and each value in a bin is replaced by the nearest bin boundary value.
[0094] Table 1
[0095]
[0096] Table 1 lists some data cleaning situations. All three electricity meter calibration agencies have lost necessary data items. For example, the number of original data items collected by the calibration personnel of agency A is 135. During the collection, it was found that necessary data items such as professional title level and professional working date were missing. The number of missing data items was 5, the data format was incorrect for 4, and there were 6 duplicate data. The original number of data items collected by the calibration personnel of agency B was 203, of which 3 were missing, 7 were incorrect, and 2 were duplicate data. For the missing data, these data will be filtered out during the collection process, and the agency is required to complete the data.
[0097] During the data verification process, a lot of erroneous data was also found, such as the result data of the time type field data is not of time type, the result data of the numeric type field data is not of numeric type, the unique number (equipment code) in the production data is bound to the calibration task order, but the calibration task order cannot be located through the equipment code, etc. For example, the number of original data in the sample calibration record of institution A is 4081, but the sample delivery time in the data is not of time type. For erroneous data, set the data format verification in the application, and use the time conversion function to verify whether the data in this field is time, and use the numeric conversion function to verify whether the data in this field is data. In the sample calibration record data of institution C, it was found that the sample test report number was repeated. In the sample calibration record, the test report number is a keyword and is not allowed to be repeated. Such problems should be checked by the corresponding laboratory of the calibration agency and the cause should be found.
[0098] S102. Data Dimensionality Reduction
[0099] Data dimensionality reduction is a process. The purpose of data dimensionality reduction is to ensure that the data is not lost or distorted after the dimension of the data set is reduced, and the data after dimensionality reduction must still contain the original information of the data. The amount of data collected by the metrology laboratory is increasing. In machine learning, when the amount of data is too small, it is easy to cause "underfitting" of the data; but if there are too many eigenvalues (dimensions), it will cause dimensionality disaster. The most direct consequence of dimensionality disaster is "overfitting", which leads to classification errors, which is also the reason for data dimensionality reduction.
[0100] In order to use the layered blockchain platform technology to put measurement and detection data on the chain and realize the trusted sharing of detection data, the key technology lies in the irreversible data feature extraction, which in turn supports the extraction of valuable data based on data features and realizes the efficient and trusted storage of valuable data and non-valuable data in the blockchain platform.
[0101] Irreversible data feature extraction requires anonymizing the label information of the original data to reduce the privacy information contained in the data, then reducing the dimension of the data, performing rule-based feature mining on the data features after dimensionality reduction, and building a non-reversible feature extraction model.
[0102] This invention will focus on the linear features and nonlinear features in the data features and propose dimensionality reduction methods respectively, and propose a non-reversible data feature extraction method based on dimensionality reduction to support efficient non-reversible data feature extraction; and according to the different values of data, a value feature data storage method based on blockchain is proposed.
[0103] For linear features in data features, the principal component analysis dimensionality reduction method is used to find the most important elements and structures in the data, remove noise and redundancy, reduce the dimensionality of the original complex data, and reveal the simple data hidden behind the complex data. For nonlinear features in data features, autoencoders are used for dimensionality reduction. For the data features after dimensionality reduction, rule-based feature mining is performed to support non-reversible feature extraction applications.
[0104] (1) Principal Component Analysis (PCA):
[0105] For linear features in data features, PCA dimensionality reduction method is used. Principal Component Analysis (PCA) is the most commonly used linear dimensionality reduction method. Its goal is to map high-dimensional data to a low-dimensional space through a certain linear projection, and expect the variance of the data to be the largest in the projected dimension, so as to use fewer data dimensions while retaining more characteristics of the original data points.
[0106] In layman's terms, if all points are mapped together, almost all information (such as the distance between points) is lost, and if the variance is as large as possible after mapping, the data points will be scattered to retain more information. It can be proved that PCA is a linear dimensionality reduction method that loses the least information of the original data (in fact, it is the closest to the original data, but PCA does not try to explore the internal structure of the data).
[0107] Let n-dimensional vector w be a coordinate axis direction of the target subspace (called mapping vector), and maximize the variance after data mapping, we have:
[0108]
[0109] Where m is the number of data instances, x i is the vector representation of data instance i, is the average vector of all data instances. Define W T is a matrix containing all mapping vectors as column vectors. After linear algebraic transformation, the following optimization objective function can be obtained:
[0110]
[0111] Where tr represents the trace of the matrix and A is the data covariance matrix.
[0112] It is easy to find that the optimal W is composed of the eigenvectors corresponding to the first k largest eigenvalues of the data covariance matrix as column vectors. These eigenvectors form a set of orthogonal bases and best preserve the information in the data.
[0113] The output of PCA is Y=W'X, which reduces the original dimension of X to k dimensions.
[0114] PCA aims to maximize the retention of the intrinsic information of the data after dimensionality reduction, and to measure the importance of the direction by measuring the size of the data variance in the projection direction. However, such projection does not have much effect on distinguishing the data, but may make the data points mixed together and indistinguishable. This is also the biggest problem of PCA, which leads to poor classification results using PCA in many cases. For example Figure 2 As shown in the figure, if PCA is used to project data points into one-dimensional space, PCA will select 2 axes, which makes the two clusters of points that were originally easy to distinguish become mixed together and indistinguishable; if 1 axis is selected at this time, a good distinction result will be obtained.
[0115] PCA needs to calculate its eigenvalues and orthogonal normalized eigenvectors. These two vectors are very large in practical applications and are difficult to calculate directly. SVD decomposition is usually used to solve this problem. SVD stands for Single Dimensional Decomposition, which is a commonly used method for processing very high-dimensional matrices. Through SVD decomposition, a very high-dimensional matrix can be effectively decomposed into a low-dimensional space for solution. Through SVD decomposition, the eigenvalues and corresponding eigenvectors of a high-dimensional matrix can be easily solved.
[0116] The specific process of PCA dimensionality reduction is as follows:
[0117] 1. First, calculate the feature mean value to construct the covariance matrix of the feature data;
[0118] 2. Then use SVD decomposition to solve the eigenvalues and eigenvectors of the covariance matrix;
[0119] 3. The obtained eigenvalues are arranged from large to small to facilitate the selection of the eigenvalues of the principal component;
[0120] 4. After the eigenvalues of the principal components are selected, the eigenvectors corresponding to these eigenvalues constitute the subspace after dimensionality reduction.
[0121] (2) Data Dimensionality Reduction Method Based on Autoencoding
[0122] For the nonlinear features in the data features, the autoencoder dimensionality reduction method is used. The autoencoder is an unsupervised learning algorithm whose output can reproduce the input data. The autoencoder is a data compression algorithm that uses an encoder to achieve data compression and a decoder to achieve decompression. The encoding stage maps high-dimensional data to low-dimensional data to reduce the amount of data; the decoding stage is just the opposite, thereby achieving the reproduction of the input data. The autoencoder compresses the input data and maps it to a low-dimensional space, thereby avoiding the "dimensionality disaster"; the input data is restored in the decoding stage, thereby achieving unsupervised feature learning.
[0123] Autoencoder structure: The basic autoencoder can be regarded as a three-layer neural network structure: input layer, hidden layer, output layer. Its network structure is as follows Figure 3 shown.
[0124] Autoencoder algorithm flow:
[0125] aFor given unlabeled data, use unsupervised learning methods to learn features. For data without class labels, the input data is encoded by the encoder, and then an output information is obtained using the decoder. If the output is approximately equal to the input data, the reconstruction error can be minimized by adjusting the parameters of the encoding and decoding stages.
[0126] b. Take the features generated by the encoder as input and train the network of the lower layers layer by layer. Since the encoding obtained by the first training layer can be regarded as a reproduction of the input data, the training process of the lower layers is similar to the first layer;
[0127] Fine-tune the entire neural network in a supervised manner. After training all layers of the network, the autoencoder learns features that can better represent the input, and these features can optimally represent the original input signal. Therefore, a classifier (such as SVM, etc.) can be added after the autoencoder, and then the entire network can be fine-tuned through supervised training methods.
[0128] The algorithm steps are:
[0129] a Find the activation value of each layer
[0130] Through the forward propagation method, forward conduction calculations are performed on the neurons in each layer, and the activation values of each layer are obtained using the forward propagation formula.
[0131] b calculates the residual of W and b, and uses the gradient descent method to update W and b so that the output better represents the input. Use the back propagation method to find the residual of the final output layer and each layer of neurons, and use the gradient descent method to continuously update W and b so that the output is closer to the input.
[0132] The basic process of the encoder is as follows Figure 4 shown.
[0133] Finally, the valuable data that has completed feature extraction is modeled based on its data type so that it can be uploaded to the blockchain to achieve trusted storage of non-reversible data features.
[0134] Table 2
[0135]
[0136]
[0137] Table 2 gives an example of data dimensionality reduction. The data items of the metrology personnel qualification certificate are certificate number, issuance date, professional classification, certificate type, certificate validity date, certificate level, issuing unit, certificate attachment, registration number, personnel qualification certificate, valid until, and issuing unit, totaling 13 data items. However, the data items within each laboratory are not unified, and there are other data items. For example, the data of institution A also includes data items such as training date and training institution, and the data of institution B includes data items such as issuance method, certificate registration date, and registration unit. It is necessary to eliminate 2 data items for institution A and 3 data items for institution B. The acquisition process is standardized according to the object model, and other data items in the model are eliminated to reduce redundant information fields.
[0138] S103, Data Fusion
[0139] The idea of data fusion has the characteristics of maximizing multi-source information data to obtain a fusion result that is more beneficial to users, which just meets the requirements of the combined feature extraction method. For the data extracted from non-reversible data features, an adaptive data fusion algorithm is used to fuse the data on the neural data fusion system, striving to use the feature values that cover the maximum amount of information for feature extraction.
[0140] By investigating the differences in the degree of informatization of various verification and testing links, it was found that the degree of informatization unification was low, resulting in the test and detection data of smart electricity meters being scattered in various data warehouses and unable to be aggregated. It is urgent to merge the valuable data of each data warehouse to support the unified sharing and application of data. First, based on feature extraction technology, for the data extracted from non-reversible data features, an adaptive data fusion algorithm is used to fuse the data on the neuron data fusion system to obtain the largest amount of information possible. Then, a multivariate probability inference model is used to learn the data to form a high-value information library support.
[0141] (1) Effective fusion of multi-source data
[0142] The idea of data fusion has the characteristics of maximizing multi-source information data to obtain a fusion result that is more beneficial to users, which just meets the requirements of the combined feature extraction method. For the data extracted from non-reversible data features, an adaptive data fusion algorithm is used to fuse the data on the neural data fusion system, striving to use the feature values that cover the maximum amount of information for feature extraction.
[0143] like Figure 5 As shown, there are n training data to measure a certain object. Consider that a certain observed object generates k patterns. Each pattern is detected by n independent training data at the same time to generate N groups of data, such as Figure 5 As shown in the figure, the actual output xi(k) corresponding to each training data moment k can obtain the data set {xi(k), i≤n, k≤N} as the input of the linear neuron; Y(k) is the expected output, which is used as the input of the learning algorithm and is input into the fusion system to generate N output patterns {y(k), k≤N}.
[0144] For a linear measurement system, the relationship between input and output can be expressed in matrix form as follows: XW=Y.
[0145] The analysis shows that the weights can always be solved. The solution process can be completed by using the Widrow-Hoff learning rule to train the weights of neurons and the single neuron minimum mean square error algorithm.
[0146] The neuron data fusion system requires an ideal input and output data pair {X(k), Y(k), k=1, 2, ..., N} to train the optimal weights, which is the key and difficulty of the fusion system. On the one hand, it is difficult to obtain ideal output data directly. On the other hand, there is no standard to measure its quality. Using statistical theory, according to the optimal condition of the minimum total mean square error of each training data X(k), the corresponding optimal weight Wi is found in an adaptive way to ensure that the fused estimate X' reaches the optimal value. Finally, the data fusion estimate X' with the minimum mean square error is used as the target sample of the fusion system, thus solving the calibration problem of the fusion system.
[0147] (2) Multi-feature probabilistic reasoning
[0148] The PRM algorithm is used as the base classifier in the multi-feature probabilistic reasoning model, and then the Multivariate Probabilistic Reasoning Model (MPRM) algorithm is used to infer the data.
[0149] The algorithm uses the intra-class scatter matrix as the covariance matrix of each class, and then uses the Bayesian rule as the classification criterion, that is, the optimal classification is performed in the sense of the minimum Bayesian error rate. In this model, the output of the base classifier is the probability of the sample to be tested belonging to each potential class, and the probability value represents the membership of the anonymous sample to the known class. In the integrated model, several base classifiers with weak recognition ability are often generated, and if the voting method is used to fuse the category prediction results of the base classifier, there will be a situation where multiple categories have the same number of votes. In order to reduce the disturbance in the recognition process, the fusion of the posterior probability information of each category can more effectively determine the identity of the sample to be tested, reduce the error of the integrated recognition model, and improve the accuracy of classification.
[0150] The detailed process of the MPRM algorithm is as follows:
[0151] Input S: training sample set; x: a test sample; C: base classifier algorithm; L: number of base classifiers; n: subspace selection granularity;
[0152] Output: the category to which the test sample x belongs, x∈{1,2,…,};
[0153] Step 1, extract L groups of training subsets with granularity n from S by MPRM random sampling method to form L subspaces {S1n, S2n, …, SLn};
[0154] Step 2, base classifier C(Skn) (1≤k≤L) trains each training subset separately to obtain the base classifier model {h1,h2,..,hL};
[0155] Step 3, use the constructed L base classifier models to classify and identify x respectively;
[0156] Step 4: Count the probability decision values of each base classifier for the test sample;
[0157] Step 5. Obtain the category result to which x belongs based on the fusion strategy of the probability summation method.
[0158] Table 3 Data fusion
[0159]
[0160]
[0161] Table 3 gives an example of data dimensionality reduction. The objects of the sampling acceptance record include customer name, bidding batch, number of winning bids, contract number, production batch, plan number, product category, product type, product name, product model, voltage specification, current specification, active accuracy level, reactive accuracy level, active constant, reactive constant, calibration line / station number, barcode, factory number, calibration date, inspection items (appearance, marking and power-on inspection, basic error, smart electricity meter constant test, starting test, creeping test, daily timing error, etc.), and inspection conclusion.
[0162] The four data items of metrology institution A, such as customer name, bidding batch, number of winning bids, and contract number, exist in the ERP system. The nine data items, such as product category, product type, product name, product model, etc., exist in the calibration device control software. The calibration date, inspection items, inspection conclusions and other production inspection related data exist in the MDS metrology production scheduling platform, and the data are scattered in various data warehouses. In view of this situation, in the process of data aggregation, the fusion is directly performed on the collected original data layer, and the data is integrated and analyzed before the original measurement report is preprocessed, and the fusion processing is performed using a centralized fusion system. For the data in the relevant data system, the data is matched and fused according to the quality data model. The aggregation, optimization and dynamic allocation of information resources saves information costs and greatly improves efficiency.
[0163] S2. Design of data object for uploading electric energy meter verification data
[0164] Analyze and classify the calibration data of electricity meters, formulate standards for uplink data, guide uplink data providers to process the calibration data of electricity meters, and provide standard data that complies with regulations for data uplink.
[0165] According to the business classification of the electric energy meter verification data, the data can be divided into quantity transmission data, quality inspection data, and field data. According to the sharing requirements of the electric energy meter verification data on the chain, the data can be divided into basic data and test and detection data.
[0166] Basic data include verification institutions, institution certificates, verification personnel, verification personnel certificates, electric energy meter assets, standard equipment assets, measurement equipment verification certificate information, standard equipment verification / calibration certificates, enterprise certification certificate information, etc. Test and inspection data include adaptability inspection data, sample comparison data, software comparison data, full performance test data, sampling acceptance test data, full inspection acceptance test data, such as Figure 6 shown.
[0167] The data standards on the chain mainly provide data technical specifications for the providers of data on the chain, including specific technical parameters such as data format and data length. The data standards are mainly based on the principle of one number and one source for integrated data, and the standards of the data are selected. Whoever is the source of the data field, whose standards are selected. If the source data department does not provide relevant standards, the relevant data standards are formulated by itself. The data standards include three parts: subject definition, information items, and standard codes. The subject definition mainly records the definition and classification of data standards, which are used to standardize and identify the subject attribution of data; information items record the business attributes (classification, business meaning, business logic) and technical attributes (type, length, default rules) of the information items of the data subject; standard codes record the encoding, classification, and usage rules of the fixed code values of information items.
[0168] The chain process is as follows Figure 7 As shown:
[0169] According to a fixed cycle (days), the electric energy meter asset data is synchronized from the provincial information intranet MDS intermediate library to the provincial information extranet platform intermediate library in an incremental manner;
[0170] The data uplink service monitors the data status of the intermediate library, encrypts and packages the electric energy meter asset data, measurement verification personnel data, measurement standard device data, and measurement standard instrument data to be uploaded, and performs the data uplink operation;
[0171] Trigger the data verification smart contract to verify the integrity and correctness of the on-chain data;
[0172] Execute the operation of uploading the original data to the chain and receive the result returned by the uploading service;
[0173] According to the results of the data chain processing, the data chain status of the electric energy meter asset in the intermediate library is updated and the blockchain hash is recorded to complete the data chain operation.
[0174] S3. Design of smart contract for electric energy meter calibration data
[0175] like Figure 8The figure shows a smart contract model: a piece of code (smart contract) is deployed on a shared, replicated ledger, which can maintain its own state, control its own assets and respond to external information or assets received. The smart contract model is a computer program running on a replicable, shared ledger that can process information, receive, store and send value. A smart contract is a piece of code written on the blockchain.
[0176] The specific workflow of smart contracts includes three steps: construction-storage-execution, as follows:
[0177] 1. Smart contracts are jointly developed by multiple users within the blockchain and can be used for any transaction between users. The agreement clearly defines the rights and obligations of both parties. Developers program these rights and obligations in an electronic way, and the code contains conditions that trigger the automatic execution of the contract.
[0178] 2. Once the coding is completed, the smart contract is uploaded to the blockchain network.
[0179] 3. The smart contract will periodically check whether there are relevant events and trigger conditions; events that meet the conditions will be pushed to the queue for verification.
[0180] 4. The verification nodes on the blockchain will first verify the signature of the event to ensure its validity; after most verification nodes reach a consensus on the event, the smart contract will be successfully executed and the user will be notified.
[0181] 5. Successfully executed contracts will be removed from the block, while unexecuted contracts will continue to wait for the next round of processing until they are successfully executed.
[0182] The advantages of the above smart contracts are:
[0183] 1) It has the ability to update in real time and is very efficient. In the definition section, we introduced that the execution of smart contracts does not require the participation of a third party, and it can respond to user requests at any time, thereby ensuring the efficiency of transactions.
[0184] 2) Contracts can be executed very accurately. Because all the terms and execution processes of smart contracts have been formulated before deployment and are executed under the absolute control of computers, there is no possibility of errors in the entire process. In addition, because the contract is executed under the control of computers, a lot of labor costs are saved.
[0185] 3) The content of the contract cannot be tampered with, reducing human intervention. Once the smart contract is deployed, all the contents of the contract cannot be modified, and both parties to the transaction cannot interfere with the execution of the contract. If one party breaches the contract, it will be subject to corresponding penalties, which are also formulated before the contract is deployed.
[0186] According to its definition and advantages, smart contracts can be executed by the blockchain computing network, and all contracts are automatically executed by all nodes in the network following the protocol. It can be said that smart contracts are the APP that gives blockchain a soul, allowing users to give vitality to related applications based on the rigid, tamper-proof, traceable, and decentralized blockchain, based on Turing's complete description, to meet higher and broader application scenarios.
[0187] (2) Design of smart contract for verification data
[0188] For the smart contract of electric energy meter verification data, it is designed according to the principle of necessity. Only the functions that must be implemented by the on-chain smart contract can be implemented by the smart contract. Based on the trusted application scenarios of electric energy meter verification data, three smart contracts are designed as follows:
[0189] (1) Generation of global numbers for electronic certificates: Generate unified, global and unique certificate numbers for the verification certificates and calibration certificates of measuring equipment involved in the verification data of electric energy meters.
[0190] (2) Secure data reading: A one-time key mechanism is used to achieve secure reading of on-chain data, prevent illegal acquisition, and ensure secure access to on-chain data.
[0191] (3) Verification of the validity of on-chain data: Verify the validity of on-chain data fields to improve the quality of on-chain data.
[0192] The present invention plans the information on chaining of the verification data of the electric energy meter, cleans, reduces the dimension, and fuses the verification data of the electric energy meter before it is chained, thereby improving data availability and providing data support for chain storage; data cleaning is used to discover and correct errors stored in the data; a principal component analysis dimensionality reduction method is used to reduce the dimension of the verification data, find the most important elements and structures in the data, and remove noise and redundancy; through data fusion, the value of multi-source information data is maximized, thereby obtaining characteristics of a fusion result that is more favorable to users.
[0193] The present invention studies the business classification of electric energy meter calibration data and the demand for uplink sharing of electric energy meter calibration data, analyzes and classifies the electric energy meter calibration data, formulates uplink data standards to guide uplink data providers to process the electric energy meter calibration data, and provides standard data that meets the specifications for data uplink; by studying the concept and working principle of smart contracts, an uplink smart contract for electric energy meter calibration data is designed to realize the validity verification and safe reading of the uplinked electric energy meter calibration data.
[0194] The present invention combines the characteristics of metrology test and detection business, carries out research on sharing technology suitable for metrology test and detection data, designs blockchain technology architecture and node construction plan in combination with metrology test and detection business scenarios, designs chain data planning, objects and smart contracts for electric energy meter calibration data, realizes trusted sharing of metrology test and detection data based on blockchain application technology, and supports the improvement of the company's quality control capabilities of metrology equipment.
[0195] The present invention utilizes blockchain technology to achieve effective supervision of the full-scene perception and detection data of the metrology laboratory, improve the overall quality level of the industry, enhance the quality management capabilities of legally authorized agencies, enhance the public's sense of gain and trust, strengthen the integration of government-enterprise cooperation and management business, demonstrate the credibility of the government and power grid companies, assist in the construction of a social fairness and credibility system, and promote the construction of a transparent and fair electricity business environment, which has great social benefits.
[0196] The present invention runs through the entire chain of the metrology laboratory, builds a detection data service ecosystem, and provides regulatory agencies, power companies, and the general public with regular big data analysis and consulting services such as diversified data analysis by conducting typical demonstration application research on power companies and production enterprises. It strengthens the comprehensive management capabilities of metrology laboratories for detection data, forms resource and data sharing and fusion applications that can be replicated, converted, and promoted to other laboratories in the power industry, supports the construction of smart power laboratories, and improves the level of intelligent management of laboratories in the power industry.
[0197] The present invention also discloses a metrology verification data uplink system, comprising a memory and a processor connected to each other, wherein a computer program is stored in the memory, and when the computer program is run by the processor, the steps of the method described above are executed.
[0198] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A method for uploading metrological verification data to a blockchain. It is characterized in that Includes steps: S1. Data planning for uploading electric energy meter verification data: pre-process the data before uploading it to the chain; S2. Design of data objects for uploading the verification data of electric energy meters: Analyze and classify the verification data of electric energy meters, formulate uploading data standards to process the verification data of electric energy meters, and obtain standard data that meets the specifications; S3. Design of smart contract for electricity meter calibration data: Analyze the demand for uploading electricity meter calibration data to the chain, determine the type of data to be recorded, design the architecture of the smart contract, plan the logical flow of the contract, and implement the design of smart contract for electricity meter calibration data.
2. The method for uploading measurement verification data to a chain according to claim 1, It is characterized in that In step S1, preprocessing includes data cleaning, data dimension reduction and data fusion; Data cleaning is divided into two parts: duplicate record cleaning and noise data elimination, specifically: Duplicate record cleaning uses a basic neighbor sorting algorithm, which mainly includes the following three steps: 1) Generate keywords: Generate a keyword for each instance by extracting the values of relevant attributes in the dataset; 2) Data sorting: Sort the data in the data set by keywords so that potential duplicate records are adjusted to a contiguous area; 3) Merge: Move a fixed-size window sequentially on the sorted data set, and each record in the data set is compared only with the records in the window; if the window size contains m records, then each new record entering the window must be compared with the m records that previously entered the window to detect duplicate records, and then the record that first enters the window slides out of the window, and the next record of the last record moves into the window.
3. The method for uploading measurement verification data to a chain according to claim 2, It is characterized in that The method for eliminating noise data is the equal depth binning method, which divides the data into different bins of the same depth, specifically: aSmoothing by bin mean Average all values in a bin, then replace all data in the bin with the bin average. b Smooth by box boundaries The maximum and minimum values in a bin are considered as bin boundaries, and each value in a bin is replaced by the nearest bin boundary value.
4. The method for uploading measurement verification data to a chain according to claim 2 or 3, It is characterized in that When performing data dimensionality reduction, for linear features in data features, the principal component analysis dimensionality reduction method is used to find the most important elements and structures in the data, remove noise and redundancy, and reduce the dimensionality of the original complex data; for nonlinear features in data features, autoencoders are used for dimensionality reduction; for the data features after dimensionality reduction, rule-based feature mining is performed to support non-reversible feature extraction; The specific process of dimensionality reduction processing of principal component analysis dimensionality reduction method is as follows: 1) First, calculate the feature mean value to construct the covariance matrix of the feature data; 2) Then solve the eigenvalues and eigenvectors of the covariance matrix through SVD decomposition; 3) The obtained eigenvalues are arranged from large to small to facilitate the selection of the eigenvalues of the principal component; 4) After the eigenvalues of the principal components are selected, the eigenvectors corresponding to these eigenvalues constitute the subspace after dimensionality reduction; The specific process of dimensionality reduction using the autoencoder is: Autoencoder structure: a neural network structure consisting of three layers: input layer, hidden layer, and output layer; Autoencoder algorithm flow: a. For given unlabeled data, use unsupervised learning methods to learn features: For data without class labels, encode the input data through the encoder, and then use the decoder to get an output information; if the output is approximately equal to the input data, the reconstruction error can be minimized by adjusting the parameters of the encoding and decoding stages; b. Take the features generated by the encoder as input and train the network of the lower layers layer by layer. Since the encoding obtained by the first training layer is a reproduction of the input data, the training process of the lower layers is similar to that of the first layer. c. Fine-tune the entire neural network in a supervised manner: After training all layers of the network, the autoencoder learns to obtain features that better represent the input, and these features optimally represent the original input signal; a classifier is added after the autoencoder, and then the entire network is fine-tuned through supervised training methods.
5. The method for uploading measurement verification data to a chain according to claim 4, It is characterized in that When performing data fusion, we first use feature extraction technology to extract data from non-reversible data features, and then use an adaptive data fusion algorithm to fuse the data on the neural data fusion system to obtain the largest possible amount of information; then we use a multivariate probabilistic inference model to learn the data and form a high-value information database support.
6. The method for uploading measurement verification data to a chain according to claim 1, 2 or 3, It is characterized in that In step S2, according to the business classification of the electric energy meter verification data, the data is divided into quantity transmission data, quality inspection data, and field data; According to the sharing requirements of electricity meter verification data on the chain, the data is divided into basic data and test and detection data; Basic data includes verification agencies, agency certificates, verification personnel, verification personnel certificates, electric energy meter assets, standard equipment assets, measurement equipment verification certificate information, standard equipment verification / calibration certificates, and enterprise certification certificate information; Test and inspection data include adaptability inspection data, sample comparison data, software comparison data, full performance test and inspection data, sampling acceptance test data, and full inspection and acceptance test data.
7. The method for uploading measurement verification data to a chain according to claim 6, It is characterized in that In step S2, the on-chain data standard is used to provide data technical specifications for the on-chain data provider, including data format and data length; the data standard is selected according to the principle of one number and one source for fused data; Data standards include three parts: subject definition, information items, and standard codes. The subject definition is used to record the definition and classification of data standards, and is used to standardize and identify the subject attribution of data; information items record the business attributes and technical attributes of information items of data subjects; standard codes record the encoding, classification, and usage rules of fixed code values of information items.
8. The method for uploading measurement verification data to a chain according to claim 1, 2 or 3, It is characterized in that The specific process of chaining is as follows: According to a fixed cycle, the electric energy meter asset data is synchronized in increments from the provincial information intranet MDS intermediate library to the provincial information extranet platform intermediate library; The data uplink service monitors the data status of the intermediate library, encrypts and packages the electric energy meter asset data, measurement verification personnel data, measurement standard device data, and measurement standard instrument data to be uploaded, and performs the data uplink operation; Trigger the data verification smart contract to verify the integrity and correctness of the on-chain data; Execute the operation of uploading the original data to the chain and receive the result returned by the uploading service; According to the result returned by the on-chain service, the on-chain status of the electricity meter asset data in the intermediate library is updated and the blockchain hash is recorded to complete the data on-chain operation.
9. The method for uploading measurement verification data to a chain according to claim 1, 2 or 3, It is characterized in that The specific process of step S3 is: Smart contracts are jointly developed by multiple users within the blockchain and are used for any transaction between users. The agreement clearly defines the rights and obligations of both parties. The rights and obligations are programmed electronically, and the code contains conditions that trigger the automatic execution of the contract. Once the coding is complete, the smart contract is uploaded to the blockchain network; The smart contract periodically checks whether there are relevant events and trigger conditions; events that meet the conditions will be pushed to the queue for verification; The verification node on the blockchain first verifies the signature of the event to ensure its validity; Once the majority of verification nodes reach a consensus on the event, the smart contract will be successfully executed and the user will be notified; Successfully executed contracts will be removed from the block, while unexecuted contracts will continue to wait for the next round of processing until they are successfully executed.
10. A metrology verification data uplink system, comprising a memory and a processor connected to each other, wherein a computer program is stored in the memory. It is characterized in that When the computer program is executed by a processor, the computer program performs the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Block chain-based measurement test detection data credible sharing method
CN115934832A
Electric energy meter verification data uplink data planning method and device and storage medium
CN117113272A
