Metrological verification data management and control method and system based on block chain
By using blockchain technology and IPFS distributed storage in the power system, the risk of single point failure and tampering in the storage and transmission of measurement and verification data is solved, the security and credibility of the data are improved, and the security of the measurement and verification data is ensured. transparency and integrity.
Patent Information
- Application Number
- CN202410921867.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-10-18
AI Technical Summary
Metering and verification data in existing power systems are stored in centralized databases or local computers, which poses the risk of single point failure and data tampering. Especially in multi-point distribution situations, the credibility of the data source is difficult to verify, and data transmission is vulnerable to network attacks. , there is a risk of leakage and tampering.
Adopt a blockchain-based measurement and verification data management and control method, collect data through multiple sensors and preprocess it at the edge, use data aggregation and compression technology to encrypt the data, upload it to the cloud platform and store it on the blockchain, using the blockchain's The hybrid consensus mechanism and IPFS distributed storage system ensure data security and integrity.
It realizes the safe storage and transmission of metrology and verification data, improves the transparency and credibility of the data, ensures the non-tamperability and integrity of the data, and improves the security and processing performance of the system.
Smart Images

Figure CN118796946A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data management, and in particular to a blockchain-based metrology and verification data management and control method and system. Background Art
[0002] The metering and verification data in the existing power system is usually stored in a centralized database or local computer system, which has the risk of single point failure. Once the server fails, the data may be lost or damaged; and it is easy to cause data tampering, especially when the metering equipment is distributed at multiple points, the credibility of the data source is difficult to verify. In addition, the existing data transmission is carried out through the local area network or the Internet, and the data files are transmitted using protocols such as FTP and HTTP. The data transmission process is vulnerable to network attacks and there is a risk of data leakage and tampering. Summary of the invention
[0003] In order to solve the above problems, the purpose of the present invention is to provide a blockchain-based metrology and calibration data management method and system to achieve secure storage and transmission of data and improve the transparency and credibility of metrology and calibration data management.
[0004] To achieve the above object, the present invention adopts the following technical solutions:
[0005] A blockchain-based metrology verification data management and control method comprises the following steps:
[0006] The metering equipment collects data through multiple sensors and pre-processes the data at the edge based on edge computing devices;
[0007] Use data aggregation and compression technology to reduce data volume, encrypt data through secure communication protocols, and upload encrypted data to the cloud platform;
[0008] The cloud platform uploads the encrypted data to the blockchain network through the API interface. The blockchain nodes verify the authenticity and integrity of the data and store the data metadata of the metering equipment on the blockchain to form an unalterable record. Large-scale metering data files are stored in the IPFS distributed storage system, and the on-chain records store hash values to verify the integrity of the data.
[0009] A hybrid consensus mechanism is used during blockchain upload to improve security and efficiency:
[0010] Verify uploaded transactions using proof-of-stake (PoS) and delegated proof-of-stake (DPoS) elected validation nodes (such as supernodes)
[0011] PoS_Weight i′ =Stake i′ ;
[0012]
[0013] Among them, PoS_Weight i′ is the weight of node i′ in the Proof of Stake PoS, DPoS_Votes i′ Stake is the total number of votes received by node i′ in the Delegated Proof of Stake DPoS; i′ Stake is the pledge of node i′; i′t′ is the pledge of node i′ at time t′;
[0014] Dynamic sharding technology is used to divide the blockchain network into P shards, each of which includes Q nodes, to process and store different transactions, to assign uploaded transactions to corresponding shards, and to ensure data consistency in different shards through cross-shard data synchronization;
[0015] Users submit data query requests through the visualization unit, and the cloud platform obtains relevant metadata information from the blockchain and data files from the IPFS distributed storage system. The data is decrypted and processed and then displayed to the user.
[0016] Furthermore, the metering equipment collects data through multiple sensors and pre-processes the data at the edge based on IoT devices, specifically:
[0017] Step S11: The measuring device collects data through multiple sensors, and each sensor collects data of a specific dimension, including calibration data, environmental data, and equipment data;
[0018] Step S12: Each sensor periodically collects real-time data and sends the data to the edge computing device;
[0019] Step S13: On an edge computing device (such as Raspberry Pi or NVIDIA Jetson Nano), the collected data is preliminarily processed, including filtering the sensor data and using a mean filter to remove noise.
[0020] Furthermore, data aggregation and compression technology is used to reduce the amount of data, encrypt the data through a secure communication protocol, and upload the encrypted data to the cloud platform, specifically:
[0021] Aggregate multi-sensor data and compress the aggregated data to further reduce the data volume;
[0022] Suppose there are N sensors, sensor a gives a measurement value x at time t a (t), the mean value of the measured value is μ a , with standard deviation σ a , standardize the data:
[0023]
[0024] Aggregate the data using the weighted average method;
[0025] Huffman coding is performed on the aggregated data. By constructing an optimal binary tree based on the frequency of occurrence of symbols in the data, variable-length codes are assigned to each symbol to achieve compression, and the compressed data D is obtained;
[0026] Assume that the data sequence of the aggregated data is Y, and use Huffman coding to compress the data:
[0027] The frequency of occurrence of each symbol in the statistical data sequence Y is denoted as f(y i′ );
[0028] Construct a Huffman tree based on symbol frequencies;
[0029] For each symbol y i′ Generate the corresponding Huffman code H(y i′ );
[0030] Compress the data sequence Y into Huffman-coded data C:
[0031] C=H(y 1 )H(y 2 )...,H(y i′ ),...H(y M );
[0032] Where M is the number of data in sequence Y;
[0033] The compressed data C is encrypted using the optimized symmetric encryption algorithm AES;
[0034] Use HTTP / HTTPS protocol to upload encrypted data to the cloud platform storage service.
[0035] Furthermore, the compressed data C is encrypted using the optimized symmetric encryption algorithm AES, as follows:
[0036] Generate a key K and randomly generate an initial vector IV to ensure that the encryption result is different each time;
[0037] Divide the data C into several blocks, each of which is n bits long, and fill the unfilled blocks:
[0038] C i =C[(i-1)n:in-1]
[0039] Each data block is encrypted in CBC mode. In CBC mode, IV is first XORed with the first data block and then encrypted. Each encryption result will be used as the vector of the next block:
[0040]
[0041] Where E i is the encrypted data block, and m is the total number of blocks;
[0042] The ciphertext consists of each encryption block E i And the initial vector IV is composed of:
[0043] C′=(IV,E 1 ,E 2 ,...,E m ).
[0044] Furthermore, the cloud platform uploads the encrypted data to the blockchain network through the API interface, specifically:
[0045] Upload the encrypted data file C′ to the IPFS distributed storage system, and IPFS returns the unique hash value IPFS_hash of the file;
[0046] IPFS_hash = IPFS_add(C′)
[0047] Among them, IPFS_add is the file upload function provided by IPFS;
[0048] Generate data metadata, including device ID, calibration result, and timestamp. The data metadata Meta_data is:
[0049] Meta_data={Device_ID,Calibration_Result,Timestamp,IPFS_hash};
[0050] Use the device's private key Private_Key to sign the data metadata and generate a digital signature Signature:
[0051] Signature=Sign(Meta_data,Private_Key);
[0052] Among them, Sign is the digital signature algorithm;
[0053] Upload the data metadata and digital signature to the blockchain network through the API interface. If the API interface is upload_to_blockchain, the upload is as follows:
[0054] upload_to_blockchain(Meta_data,Signature);
[0055] After receiving the data, the blockchain node uses the device's public key Public_KeyPublic_Key to verify the authenticity of the digital signature:
[0056] Verify(Meta_data,Signature,Public_Key);
[0057] Among them, Verify is the digital signature verification function;
[0058] After verification, the data metadata is stored on the blockchain to form an unalterable record.
[0059] Furthermore, the user submits a data query request through the front-end interface, and the back-end system obtains relevant metadata information from the blockchain and data files from the distributed storage system. The data is decrypted and processed and then displayed to the user. Specifically:
[0060] The user submits a data query request through the front-end interface. After identity authentication, the back-end system obtains relevant metadata information, key K and CBC mode from the blockchain, and reads the stored IPFS hash value from the blockchain:
[0061] IPFS_hash=read_from_blockchain(Device_ID,Timestamp)
[0062] Use the read IPFS hash value to obtain the encrypted data file C′ from the IPFS distributed storage system;
[0063] Decryption is performed based on the key K and CBC mode:
[0064] Extract the initial vector IV and encrypted data block E from C′ i
[0065] Using the same key K and CBC mode, decrypt the data blocks one by one:
[0066]
[0067] Each decrypted block D i Concatenate into compressed data:
[0068] C=D 1 ||D2||...||D m ;
[0069] Finally, the Huffman tree is used to decode the compressed data C, restore the original data, and display it to the user.
[0070] Furthermore, users submit data query requests through the front-end interface, using an asynchronous processing architecture and event-driven model to improve system response speed, as follows:
[0071] Users submit data query requests through the front-end interface, and the requests enter the task queue and wait for processing;
[0072] Tasks are distributed to multiple worker threads or services for parallel processing; data is obtained asynchronously from blockchain and distributed storage systems;
[0073] Decrypt and process the acquired data; merge the processed data results, and finally return the processed results to the front end asynchronously.
[0074] A blockchain-based metrology verification data management and control system, including a data acquisition unit, a data transmission unit, an edge computing unit, a data transmission unit, a cloud platform, a blockchain network, an IPFS distributed storage system and a visualization unit;
[0075] The data acquisition unit collects data through multiple sensors and pre-processes the data at the edge based on the edge computing unit;
[0076] The data transmission unit uses data aggregation and compression technology to reduce the amount of data, encrypts the data through a secure communication protocol, and uploads the encrypted data to the cloud platform;
[0077] The cloud platform uploads the encrypted data to the blockchain network through the API interface. The blockchain nodes verify the authenticity and integrity of the data, and store the data metadata of the metering equipment on the blockchain to form an unalterable record. Large-scale metering data files are stored in the IPFS distributed storage system, and the on-chain records store hash values to verify the integrity of the data.
[0078] A hybrid consensus mechanism is used during blockchain upload to improve security and efficiency:
[0079] Verify uploaded transactions using proof-of-stake (PoS) and delegated proof-of-stake (DPoS) elected validation nodes (such as supernodes)
[0080] PoS_Weight i′ =Stake i′ ;
[0081]
[0082] Among them, PoS_Weight i′ is the weight of node i′ in the Proof of Stake PoS, DPoS_Votes i′Stake is the total number of votes received by node i′ in the Delegated Proof of Stake DPoS; i′ Stake is the pledge of node i′; i′t′ is the pledge of node i′ at time t′;
[0083] Dynamic sharding technology is used to divide the blockchain network into P shards, each of which includes Q nodes, to process and store different transactions, to assign uploaded transactions to corresponding shards, and to ensure data consistency in different shards through cross-shard data synchronization;
[0084] Users submit data query requests through the front-end visualization unit. The cloud platform obtains relevant metadata information from the blockchain and data files from the IPFS distributed storage system. The data is decrypted and processed and then displayed to the user.
[0085] The present invention has the following beneficial effects:
[0086] 1. The present invention stores the data metadata of the metering equipment on the blockchain to form an unalterable record; large-scale metering data files are stored in the IPFS distributed storage system, and the chain records the storage hash value to verify the integrity of the data, thereby ensuring the security and reliability of the data
[0087] 2. The blockchain network of the present invention adopts a hybrid consensus mechanism and dynamic sharding technology to improve the security and processing performance of the blockchain network, and effectively improve the security and reliability of metrology and verification data management and control;
[0088] 3. The present invention optimizes the data processing and transmission process to ensure high efficiency and high security in every link from data collection to display, meeting the requirements of modern metrology and verification services for data authenticity, integrity and real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] Figure 1 is a flow chart of the method of the present invention;
[0090] Figure 2 FIG. 4 is a system architecture diagram in one embodiment of the present invention. DETAILED DESCRIPTION
[0091] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0092] refer to Figure 1 The present invention provides a blockchain-based metrology verification data management and control method, comprising the following steps:
[0093] The metering equipment collects data through multiple sensors and pre-processes the data at the edge based on edge computing devices;
[0094] Use data aggregation and compression technology to reduce data volume, encrypt data through secure communication protocols, and upload encrypted data to the cloud platform;
[0095] The cloud platform uploads the encrypted data to the blockchain network through the API interface. The blockchain nodes verify the authenticity and integrity of the data and store the data metadata of the metering equipment (such as equipment ID, calibration results, timestamp, etc.) on the blockchain to form an unalterable record. Large-scale metering data files are stored in the IPFS distributed storage system, and the on-chain records store hash values to verify the integrity of the data.
[0096] The blockchain network adopts a hybrid consensus mechanism and dynamic sharding technology to improve the security and processing performance of the blockchain network;
[0097] A hybrid consensus mechanism is used during blockchain upload to improve security and efficiency:
[0098] Verify uploaded transactions using proof-of-stake (PoS) and delegated proof-of-stake (DPoS) elected validation nodes (such as supernodes)
[0099] PoS_Weight i′ =Stake i′ ;
[0100]
[0101] Among them, PoS_Weight i′ is the weight of node i′ in the Proof of Stake PoS, DPoS_Votes i′ Stake is the total number of votes received by node i′ in the Delegated Proof of Stake DPoS; i′ Stake is the pledge of node i′; i′t′ is the pledge of node i′ at time t′;
[0102] Dynamic sharding technology is used to divide the blockchain network into P shards, each of which includes Q nodes, to process and store different transactions, to assign uploaded transactions to corresponding shards, and to ensure data consistency in different shards through cross-shard data synchronization;
[0103] The user submits a data query request through the visualization unit, and the cloud platform obtains relevant metadata information from the blockchain and the data file from the IPFS distributed storage system. The data is decrypted and processed and displayed to the user. (Introducing a cache mechanism and hierarchical storage to reduce data query time and optimize user experience. Implementing fine-grained permission control to ensure data security).
[0104] In this embodiment, the metering device collects data through multiple sensors and pre-processes the data at the edge based on the IoT device, specifically:
[0105] Step S11: The measuring device collects data through multiple sensors, and each sensor collects data of a specific dimension, including calibration data, environmental data, and equipment data;
[0106] Step S12: Each sensor periodically collects real-time data and sends the data to the edge computing device;
[0107] Step S13: On an edge computing device (such as Raspberry Pi or NVIDIA Jetson Nano), the collected data is preliminarily processed, including filtering the sensor data and using a mean filter to remove noise.
[0108] In this embodiment, data aggregation and compression technology is used to reduce the amount of data, encrypt the data through a secure communication protocol, and upload the encrypted data to the cloud platform, specifically:
[0109] Aggregate multi-sensor data and compress the aggregated data to further reduce the data volume;
[0110] Suppose there are N sensors, sensor a gives a measurement value x at time t a (t), the mean value of the measured value is μ a , with standard deviation σ a , standardize the data:
[0111]
[0112] Aggregate the data using the weighted average method;
[0113] Huffman coding is performed on the aggregated data. By constructing an optimal binary tree based on the frequency of occurrence of symbols in the data, variable-length codes are assigned to each symbol to achieve compression, and the compressed data D is obtained;
[0114] Assume that the data sequence of the aggregated data is Y, and use Huffman coding to compress the data:
[0115] The frequency of occurrence of each symbol in the statistical data sequence Y is denoted as f(y i′ );
[0116] Construct a Huffman tree based on symbol frequencies;
[0117] For each symbol y i′ Generate the corresponding Huffman code H(y i′ );
[0118] Compress the data sequence Y into Huffman-coded data C:
[0119] C=H(y 1 )H(y 2 )...,H(y i′ ),...H(y M );
[0120] Where M is the number of data in sequence Y;
[0121] The compressed data C is encrypted using the optimized symmetric encryption algorithm AES;
[0122] Use HTTP / HTTPS protocol to upload encrypted data to the cloud platform storage service.
[0123] In this embodiment, the compressed data C is encrypted using the optimized symmetric encryption algorithm AES, as follows:
[0124] Generate a key K and randomly generate an initial vector IV to ensure that the encryption result is different each time;
[0125] Divide the data C into several blocks, each of which is n bits long (e.g. 128 bits), and fill the unfilled blocks:
[0126] C i =C[(i-1)n:in-1]
[0127] Each data block is encrypted in CBC mode. In CBC mode, IV is first XORed with the first data block and then encrypted. Each encryption result will be used as the vector of the next block:
[0128]
[0129] Where E i is the encrypted data block, and m is the total number of blocks;
[0130] The ciphertext consists of each encryption block E i And the initial vector IV is composed of:
[0131] C′=(IV,E 1 ,E 2 ,...,E m ).
[0132] In this embodiment, the cloud platform uploads the encrypted data to the blockchain network through the APO interface, specifically:
[0133] Upload the encrypted data file C′ to the IPFS distributed storage system, and IPFS returns the unique hash value IPFS hash of the file;
[0134] IPFS_hash = IPFS_add(C′)
[0135] Among them, IPFS add is the file upload function provided by IPFS;
[0136] Generate data metadata, including device ID, calibration result, and timestamp. The data metadata Meta_data is:
[0137] Meta_data={Device_ID,Calibration_Result,Timestamp,IPFS_hash};
[0138] Use the device's private key Private_Key to sign the data metadata and generate a digital signature Signature:
[0139] Signature=Sign(Meta_data,Private_Key);
[0140] Among them, Sign is the digital signature algorithm; (such as ECDSA)
[0141] Upload the data metadata and digital signature to the blockchain network through the API interface. If the API interface is upload_to_blockchain, the upload is as follows:
[0142] upload_to_blockchain(Meta_data,Signature);
[0143] After receiving the data, the blockchain node uses the device's public key Public_KeyPublic_Key to verify the authenticity of the digital signature:
[0144] Verify(Meta_data,Signature,Public_Key);
[0145] Among them, Verify is the digital signature verification function;
[0146] After verification, the data metadata is stored on the blockchain to form an unalterable record.
[0147] In this embodiment, the user submits a data query request through the front-end interface, and the back-end system obtains relevant metadata information from the blockchain and data files from the distributed storage system. The data is decrypted and processed and then displayed to the user. Specifically:
[0148] The user submits a data query request through the front-end interface. After identity authentication, the back-end system obtains relevant metadata information, key K and CBC mode from the blockchain, and reads the stored IPFS hash value from the blockchain:
[0149] IPFS_hash=read_from_blockchain(Device_ID,Timestamp)
[0150] Use the read IPFS hash value to obtain the encrypted data file C′ from the IPFS distributed storage system;
[0151] Decryption is performed based on the key K and CBC mode:
[0152] Extract the initial vector IV and encrypted data block E from C′ i
[0153] Using the same key K and CBC mode, decrypt the data blocks one by one:
[0154]
[0155] Each decrypted block D i Concatenate into compressed data:
[0156] C=D 1 ||D 2 ||...||D m ;
[0157] Finally, the Huffman tree is used to decode the compressed data C, restore the original data, and display it to the user.
[0158] In this embodiment, the user submits a data query request through the front-end interface, and adopts an asynchronous processing architecture and an event-driven model to improve the system response speed, as follows:
[0159] Users submit data query requests through the front-end interface, and the requests enter the task queue and wait for processing;
[0160] Tasks are distributed to multiple worker threads or services for parallel processing; data is obtained asynchronously from blockchain and distributed storage systems;
[0161] Decrypt and process the acquired data; merge the processed data results, and finally return the processed results to the front end asynchronously.
[0162] refer to Figure 2 , the present invention also provides another embodiment, a metrology verification data management and control system based on blockchain, including a data acquisition unit, a data transmission unit, an edge computing unit, a data transmission unit, a cloud platform, a blockchain network, an IPFS distributed storage system and a visualization unit;
[0163] The data acquisition unit collects data through multiple sensors and pre-processes the data at the edge based on the edge computing unit;
[0164] The data transmission unit uses data aggregation and compression technology to reduce the amount of data, encrypts the data through a secure communication protocol, and uploads the encrypted data to the cloud platform;
[0165] The cloud platform uploads the encrypted data to the blockchain network through the API interface. The blockchain nodes verify the authenticity and integrity of the data, and store the data metadata of the metering equipment on the blockchain to form an unalterable record. Large-scale metering data files are stored in the IPFS distributed storage system, and the on-chain records store hash values to verify the integrity of the data.
[0166] A hybrid consensus mechanism is used during blockchain upload to improve security and efficiency:
[0167] Verify uploaded transactions using proof-of-stake (PoS) and delegated proof-of-stake (DPoS) elected validation nodes (such as supernodes)
[0168] PoS_Weight i′ =Stake i′ ;
[0169]
[0170] Among them, PoS_Weight i′ is the weight of node i′ in the Proof of Stake PoS, DPoS_Votes i′ Stake is the total number of votes received by node i′ in the Delegated Proof of Stake DPoS; i′ Stake is the pledge of node i′; i′t′ is the pledge of node i′ at time t′;
[0171] Dynamic sharding technology is used to divide the blockchain network into P shards, each of which includes Q nodes, to process and store different transactions, to assign uploaded transactions to corresponding shards, and to ensure data consistency in different shards through cross-shard data synchronization;
[0172] Users submit data query requests through the front-end visualization unit. The cloud platform obtains relevant metadata information from the blockchain and data files from the IPFS distributed storage system. The data is decrypted and processed and then displayed to the user.
[0173] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0174] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0175] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0176] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0177] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
Claims
1. A blockchain-based metrology and verification data management and control method, characterized in that: The following steps are involved: The metering equipment collects data through multiple sensors and pre-processes the data at the edge based on edge computing devices; Use data aggregation and compression technology to reduce data volume, encrypt data through secure communication protocols, and upload encrypted data to the cloud platform; The cloud platform uploads the encrypted data to the blockchain network through the API interface. The blockchain nodes verify the authenticity and integrity of the data and store the data metadata of the metering equipment on the blockchain to form an unalterable record. Large-scale metering data files are stored in the IPFS distributed storage system, and the on-chain records store hash values to verify the integrity of the data. A hybrid consensus mechanism is used during blockchain upload to improve security and efficiency: Verify uploaded transactions using proof-of-stake (PoS) and delegated proof-of-stake (DPoS) elected validation nodes (such as supernodes) PoS_Weight i′ =Stake i′ ; Among them, PoS_Weight i′ is the weight of node i′ in the Proof of Stake PoS, DPoS_Votes i′ Stake is the total number of votes received by node i′ in the Delegated Proof of Stake DPoS; i′ Stake is the pledge of node i′; i′t′ is the pledge of node i′ at time t′; Dynamic sharding technology is used to divide the blockchain network into P shards, each of which includes Q nodes, to process and store different transactions, to assign uploaded transactions to corresponding shards, and to ensure data consistency in different shards through cross-shard data synchronization; Users submit data query requests through the visualization unit, and the cloud platform obtains relevant metadata information from the blockchain and data files from the IPFS distributed storage system. The data is decrypted and processed and then displayed to the user.
2. According to a blockchain-based metrology verification data management and control method according to claim 1, it is characterized in that: The metering equipment collects data through multiple sensors and pre-processes the data at the edge based on IoT devices, specifically: Step S11: The measuring device collects data through multiple sensors, and each sensor collects data of a specific dimension, including calibration data, environmental data, and equipment data; Step S12: Each sensor periodically collects real-time data and sends the data to the edge computing device; Step S13: On an edge computing device (such as Raspberry Pi or NVIDIA JetsonNano), the collected data is preliminarily processed, including filtering the sensor data and removing noise using a mean filter.
3. According to a blockchain-based metrology verification data management and control method according to claim 1, it is characterized in that: The data aggregation and compression technology is used to reduce the amount of data, encrypt the data through a secure communication protocol, and upload the encrypted data to the cloud platform, specifically: Aggregate multi-sensor data and compress the aggregated data to further reduce the data volume; Suppose there are N sensors, sensor a gives a measurement value x at time t a (t), the mean value of the measured value is μ a , with standard deviation σ a , standardize the data: Aggregate the data using the weighted average method; Huffman coding is performed on the aggregated data. By constructing an optimal binary tree based on the frequency of occurrence of symbols in the data, variable-length codes are assigned to each symbol to achieve compression, and the compressed data D is obtained; Assume that the data sequence of the aggregated data is Y, and use Huffman coding to compress the data: The frequency of occurrence of each symbol in the statistical data sequence Y is denoted as f(y i′ ); Construct a Huffman tree based on symbol frequencies; For each symbol y i′ Generate the corresponding Huffman code H(y i′ ); Compress the data sequence Y into Huffman-coded data C: C=H(y1)H(y2)...,H(yi ′ ),...H(y M ); Where M is the number of data in sequence Y; The compressed data C is encrypted using the optimized symmetric encryption algorithm AES; Use HTTP / HTTPS protocol to upload encrypted data to the cloud platform storage service.
4. According to a blockchain-based measurement and verification data management and control method according to claim 3, it is characterized in that: The compressed data C is encrypted using the optimized symmetric encryption algorithm AES, as follows: Generate a key K and randomly generate an initial vector IV to ensure that the encryption result is different each time; Divide the data C into several blocks, each of which is n bits long, and fill the unfilled blocks: C i =C[(i-1)n:in-1] Each data block is encrypted in CBC mode. In CBC mode, IV is first XORed with the first data block and then encrypted. Each encryption result will be used as the vector of the next block: Where E i is the encrypted data block, and m is the total number of blocks; The ciphertext consists of each encryption block E i And the initial vector IV is composed of: C'=(IV,E1,E2,...,E m )。 5. According to a blockchain-based metrology verification data management and control method according to claim 1, it is characterized in that: The cloud platform uploads the encrypted data to the blockchain network through the API interface, specifically: Upload the encrypted data file C′ to the IPFS distributed storage system, and IPFS returns the unique hash value IPFS_hash of the file; IPFS_hash = IPFS_add(C′) Among them, IPFS_add is the file upload function provided by IPFS; Generate data metadata, including device ID, calibration result, and timestamp. The data metadata Meta_data is: Meta_data={Device_ID,Calibration_Result,Timestamp,IPFS_hash}; Use the device's private key Private_Key to sign the data metadata and generate a digital signature Signature: Signature=Sign(Meta_data,Private_Key); Among them, Sign is the digital signature algorithm; Upload the data metadata and digital signature to the blockchain network through the API interface. If the API interface is upload_to_blockchain, the upload is as follows: upload_to_blockchain(Meta_data,Signature); After receiving the data, the blockchain node uses the device's public key Public_KeyPublic_Key to verify the authenticity of the digital signature: Verify(Meta_data,Signature,Public_Key); Among them, Verify is the digital signature verification function; After verification, the data metadata is stored on the blockchain to form an unalterable record.
6. According to a blockchain-based metrology verification data management and control method according to claim 3, it is characterized in that: The user submits a data query request through the front-end interface, and the back-end system obtains relevant metadata information from the blockchain and data files from the distributed storage system. The data is decrypted and processed and then displayed to the user. Specifically: The user submits a data query request through the front-end interface. After identity authentication, the back-end system obtains relevant metadata information, key K and CBC mode from the blockchain, and reads the stored IPFS hash value from the blockchain: IPFS_hash=read_from_blockchain(Device_ID,Timestamp) Use the read IPFS hash value to obtain the encrypted data file C′ from the IPFS distributed storage system; Decryption is performed based on the key K and CBC mode: Extract the initial vector IV and encrypted data block E from C′ i Using the same key K and CBC mode, decrypt the data blocks one by one: Each decrypted block D i Concatenate into compressed data: C=D1||D2||...||D m ; Finally, the Huffman tree is used to decode the compressed data C, restore the original data, and display it to the user.
7. According to a blockchain-based metrology verification data management and control method according to claim 6, it is characterized in that: The user submits a data query request through the front-end interface, and adopts an asynchronous processing architecture and event-driven model to improve the system response speed, as follows: Users submit data query requests through the front-end interface, and the requests enter the task queue and wait for processing; Tasks are distributed to multiple worker threads or services for parallel processing; data is obtained asynchronously from blockchain and distributed storage systems; Decrypt and process the acquired data; merge the processed data results, and finally return the processed results to the front end asynchronously.
8. A blockchain-based metrology verification data management and control system, characterized in that: It includes data collection unit, data transmission unit, edge computing unit, data transmission unit, cloud platform, blockchain network, IPFS distributed storage system and visualization unit; The data acquisition unit collects data through multiple sensors and pre-processes the data at the edge based on the edge computing unit; The data transmission unit uses data aggregation and compression technology to reduce the amount of data, encrypts the data through a secure communication protocol, and uploads the encrypted data to the cloud platform; The cloud platform uploads the encrypted data to the blockchain network through the API interface. The blockchain nodes verify the authenticity and integrity of the data, and store the data metadata of the metering equipment on the blockchain to form an unalterable record. Large-scale metering data files are stored in the IPFS distributed storage system, and the on-chain records store hash values to verify the integrity of the data. A hybrid consensus mechanism is used during blockchain upload to improve security and efficiency: Verify uploaded transactions using proof-of-stake (PoS) and delegated proof-of-stake (DPoS) elected validation nodes (such as supernodes) PoS_Weight i′ =Stake i′ ; Among them, PoS_Weight i′ is the weight of node i′ in the Proof of Stake PoS, DPoS_Votes i′ Stake is the total number of votes received by node i′ in the Delegated Proof of Stake DPoS; i′ Stake is the pledge of node i′; i′t′ is the pledge of node i′ at time t′; Dynamic sharding technology is used to divide the blockchain network into P shards, each of which includes Q nodes, to process and store different transactions, to assign uploaded transactions to corresponding shards, and to ensure data consistency in different shards through cross-shard data synchronization; Users submit data query requests through the front-end visualization unit. The cloud platform obtains relevant metadata information from the blockchain and data files from the IPFS distributed storage system. The data is decrypted and processed and then displayed to the user.
Citation Information
Cited By
Terminal network access whole process automatic management and control method based on distribution automation system
CN119295023A
Peritoneal dialysis data management system and method based on cloud
CN119316418A
