An ultrasonic water meter testing device and testing method
By integrating blockchain evidence storage and zero-knowledge proof modules into ultrasonic water meters, and combining this with optimized transducer layout, the issues of data credibility and privacy leakage are resolved. This achieves efficient and secure metering traceability and privacy protection, making it suitable for residential water supply, industrial metering, and smart water systems.
Patent Information
- Application Number
- CN202510359937.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-03-25
AI Technical Summary
Existing ultrasonic water meter testing technologies suffer from issues such as insufficient data reliability, privacy risks, and a lack of traceability in metering disputes. In particular, with the widespread adoption of the Internet of Things, raw Δt data is easily tampered with or lost, and traditional water meters cannot meet privacy protection regulations.
The system employs a combination of ultrasonic detection unit, blockchain storage unit, zero-knowledge proof module and low-power communication unit. It ensures the metering process is tamper-proof by hashing on the blockchain, and uses the zk-SNARKs protocol to protect the privacy of water consumption verification. It also optimizes the transducer layout to reduce the need for straight pipe sections.
It achieves tamper-proof trustworthiness, privacy protection, and low-power operation, supports accurate tracking of metering anomalies, meets GDPR privacy regulations, reduces installation costs and extends maintenance cycles, and reduces metering dispute resolution time.
Smart Images

Figure CN120293245B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ultrasonic water meter technology, specifically to an ultrasonic water meter testing device and testing method. Background Technology
[0002] An ultrasonic water meter is a metering device that measures water flow based on the ultrasonic time difference principle. It calculates the flow velocity by detecting the time difference (Δt) of ultrasonic waves propagating in the upstream and downstream directions. It has advantages such as no mechanical wear and a wide range of measurement capabilities. It is widely used in residential water supply, industrial metering and smart water systems. With the popularization of Internet of Things (IoT) technology, real-time transmission, tamper-proofing and privacy protection of water meter data have become core requirements for technological evolution.
[0003] Current ultrasonic water meter detection technology has the following drawbacks: insufficient data reliability; traditional water meters rely on local storage or centralized servers to record cumulative flow, and the original Δt data is easily tampered with or lost, resulting in a lack of traceability in metering disputes; privacy risks; existing blockchain water meters directly record users' water consumption in plaintext on the chain, and users' living habits can be inferred through high-frequency data analysis, which violates privacy protection regulations. Summary of the Invention
[0004] The purpose of this invention is to provide an ultrasonic water meter testing device and testing method. The original Δt data is hashed and uploaded to the blockchain to ensure that the metering process is tamper-proof. The zk-SNARKs protocol is used to achieve privacy protection when verifying water consumption. The transducer layout is optimized to reduce the straight pipe section requirement.
[0005] To achieve the above objectives, the present invention provides the following technical solution: an ultrasonic water meter detection device, comprising an ultrasonic detection unit, a blockchain evidence storage unit, a zero-knowledge proof module, a main control MCU, and a low-power communication unit, wherein:
[0006] The ultrasonic detection unit includes a pair of transducers diagonally symmetrically installed on the inner surface of the water meter pipe wall. The transducer pair is composed of a transmitting end T1 and a receiving end R1. The transducer pair is used to collect the ultrasonic propagation time difference Δt between the downstream and upstream flows.
[0007] The signal output terminal of the transducer pair is directly connected to the time difference measurement module via a high-frequency coaxial cable. The time difference measurement module is embedded in a waterproof cavity on the outside of the tube wall. The linear installation distance between the time difference measurement module and the transducer pair is ≤5cm, and the time measurement accuracy of the time difference measurement module is ±1ns.
[0008] The time difference measurement module integrates a temperature sensor, which extends into a groove inside the pipe wall and is ≤2mm from the center of the water flow. This temperature sensor is used to collect water temperature data in real time and transmit it via I... 2 Transmitted via C interface to the time difference measurement module;
[0009] The blockchain evidence storage unit includes a lightweight blockchain chip, which is used to receive the Δt sequence output by the time difference measurement module. The Δt sequence is used to construct a Merkle tree and generate a root hash. The root hash is written to a private chain based on an improved PBFT consensus mechanism.
[0010] The zero-knowledge proof module is based on the zk-SNARKs protocol. The zero-knowledge proof module communicates with the blockchain evidence storage unit and the main control MCU. The zero-knowledge proof module generates a verifiable proof π of the user's water consumption, and the zero-knowledge proof module does not leak the original Δt data.
[0011] The main control MCU is connected to the time difference measurement module via the SPI bus. The main control MCU triggers data uplink and zero-knowledge proof generation through a low-power communication unit (NB-IoT / LoRa dual-mode).
[0012] Furthermore, the angle θ between the transducer pair and the pipeline axis is 55° to 60°, the axial spacing of the transducer pair is L = sin(θ)·D, where D is the inner diameter of the pipeline, the front end of the transducer pair is flush with the inner wall of the pipeline, the upstream straight pipe section length is ≥10D, and the downstream straight pipe section length is ≥5D.
[0013] Furthermore, the blockchain evidence storage unit includes a data preprocessing module and private blockchain network nodes. The data preprocessing module groups the Δt sequence collected per second into time windows, and constructs a Merkle tree of depth 12 for each time window group. The root hash of the Merkle tree is denoted as H. block The private blockchain network nodes consist of at least one water company server node, one regulatory agency node, and one user agent node. These nodes verify blocks using an improved PBFT consensus mechanism, where the block confirmation threshold is 4 / 5 of the total number of nodes. The block header includes a device ID, a timestamp, and an H... block The encrypted signature.
[0014] Furthermore, the operation of the zero-knowledge proof module includes input, output, and verification processes. The input of the zero-knowledge proof module is through the Δt sequence, water temperature data, and pipe geometric parameters. The output of the zero-knowledge proof module is through water consumption to prove π and the corresponding public parameters (total flow rate Q, time range). The verification process of the zero-knowledge proof module verifies the validity of π through an on-chain smart contract, and the verification process does not require the public disclosure of Δt sequence details.
[0015] Furthermore, the low-power communication unit has three operating modes: deep sleep mode, data uplink mode, and emergency alarm mode. In deep sleep mode, the power consumption is <10μA, and the system continuously listens for wake-up signals. In data uplink mode, the system sends block data via LoRa with a peak power consumption of ≤50mA. In emergency alarm mode, the system triggers the NB-IoT cellular network to upload alarm information.
[0016] Furthermore, the temperature sensor is attached to the inner groove surface of the pipe wall with thermally conductive silicone grease, and the groove depth is 1mm to 2mm. The temperature sensor adopts a four-wire platinum resistance thermometer (PT1000) connection method. The four-wire platinum resistance thermometer operates in constant current source drive current mode, and the constant current source drive current is 1mA±0.1%. The temperature measurement range of the temperature sensor is 0℃ to 80℃, and the accuracy of the temperature sensor is ±0.5℃.
[0017] This invention also discloses an ultrasonic water meter testing method, comprising the following steps:
[0018] S1. Ultrasonic data acquisition and time difference calculation:
[0019] The transducers alternately emit ultrasonic pulses with and against the current. The propagation times of the transducers are t1 and t2. The time difference measurement module and the main control MCU calculate Δt = t2 - t1. The temperature sensor and the time difference measurement module synchronously collect the water temperature T. The main control MCU calculates the water temperature based on the speed of sound formula (c = 1402.5 + 5T - 0.06T). 2 The calibration Δt value is given, where c is the propagation speed of ultrasound in the fluid and T is the water temperature. Raw data is collected in real time through the transducer pair and temperature sensor.
[0020] S2, Blockchain Data Storage and Consensus Verification:
[0021] The original data of S1 is grouped by time window and Merkle trees are constructed. For each group, a Merkle tree is constructed and a root hash H is generated. block , H block The device ID and timestamp are packaged into blocks, which are then broadcast to private blockchain network nodes. The data from the private blockchain network nodes are used to verify the validity of the blocks through an improved PBFT consensus mechanism. After the data reaches a consensus, it is written into the blockchain.
[0022] S3. Zero-knowledge proof generation and verification:
[0023] Users query monthly water usage by storing consensus-verified hash values of the Δt sequence in the blockchain, calculate the total flow Q based on the Δt sequence, generate a proof π using the zk-SNARKs protocol, and submit π to the on-chain smart contract. The on-chain smart contract verifies the validity of π and returns the Q value without disclosing the original Δt data.
[0024] S4. Data Traceability and Auditing:
[0025] The regulatory body within the private blockchain network node decrypts the Merkel root hash H stored on the chain using an authorization key. block The Merkle root hash H block The hash value is compared with the hash value regenerated from the locally stored Δt sequence. If the hash values are inconsistent, the on-chain smart contract is alerted and the water meter operation permissions are frozen.
[0026] Furthermore, in S2, the time window is constructed using a Merkle tree to achieve time-series management and verification of data. The time window length is 1 hour, and each group of time windows contains 3600 Δt values. The leaf nodes in the Merkle tree are SHA-256 hashes of a single Δt value, and the root hash H... block It is generated through layer-by-layer hash aggregation, and the hash aggregation process is completed within the hardware security module (HSM) of the blockchain chip.
[0027] Furthermore, the generation process of the zero-knowledge proof includes constraint definition, arithmetic circuit compilation, trust setting, and proof generation. The constraint definition is based on the fluid dynamics formula (Q = k·Δt·c·S), where Q is the volumetric flow rate, k is the calibration coefficient, and S is the pipe cross-sectional area. The arithmetic circuit compilation converts the constraints into R1CS (Rank-1 Constraint System). The trust setting pre-sets the proof key (pk) and verification key (vk) of zk-SNARKs in the blockchain evidence storage unit. The proof generation uses pk to encrypt the mapping relationship between the Δt sequence and Q into π.
[0028] Furthermore, the triggering conditions for data traceability and auditing include user complaints of abnormal water consumption, periodic spot checks by regulatory agencies, and the system detecting three consecutive hash inconsistencies. When a user complains of abnormal water consumption, the system automatically retrieves the hash data for the disputed time period. block Compared with local data, the regulatory agency decrypts historical blocks and verifies the integrity of the hash chain through an authorized key during periodic spot checks. When the system detects three consecutive hash inconsistencies, it forces the system to enter maintenance mode and uploads fault logs.
[0029] Compared with the prior art, the beneficial effects of the present invention are: an ultrasonic water meter testing device and testing method:
[0030] (1) Anti-tampering credibility: The original Δt data is constructed into a Merkle tree of depth 12 according to the time window (1 hour / group), and the root hash is stored on the chain. Any single point of data tampering will result in root hash mismatch, supporting accurate tracing to the abnormal time point. The block header contains device ID, timestamp and SM2 signature. Combined with the improved PBFT consensus (4 / 5 node confirmation), it resists malicious node attacks. In water disputes, regulatory agencies can quickly locate tampering behavior by comparing the on-chain hash with local data, improving the efficiency of evidence collection by more than 80%.
[0031] (2) Privacy protection: The zk-SNARKs protocol is adopted. The constraints are based on the flow formula. The mapping relationship between the Δt sequence and the total flow Q is compiled into an R1CS circuit to generate a 198-byte proof π. The verification process only requires the on-chain smart contract to call the pre-set verification key. There is no need to disclose the original Δt data. The user's water use behavior pattern (such as peak hours and water use frequency) is completely hidden, which meets the privacy regulations such as GDPR.
[0032] (3) Installation adaptability: The short straight pipe section design (5D upstream and 3D downstream) is suitable for the renovation of old pipe networks. The length of the straight pipe section is only 1 / 3 of that of the traditional solution, and the installation cost is reduced by 40%.
[0033] (4) Low power consumption operation: The standby power consumption of the blockchain chip (HiChain 310) is <100μA, and the NB-IoT / LoRa dual-mode communication can be switched on demand (deep sleep mode <10μA, data transmission peak ≤50mA); the time difference measurement module adopts a dynamic sampling rate (reduced to 1Hz when idle), and the 3.6V lithium-ion battery supports 10 years of battery life. No external power supply is required, making it suitable for deployment in remote areas and extending the maintenance cycle to twice that of traditional water meters.
[0034] (5) Rapid response to abnormalities: When the system detects three consecutive hash inconsistencies or user complaints, it automatically triggers an NB-IoT alarm and freezes the water meter permissions; maintenance personnel decrypt historical blocks by multi-party key fragmentation to locate the fault time point (response time < 5 minutes), reducing the time for handling disputes caused by metering errors, and shortening the average fault recovery time by 70%. Attached Figure Description
[0035] Figure 1 This is a schematic diagram of the ultrasonic water meter testing device of the present invention;
[0036] Figure 2 This is a schematic diagram of the ultrasonic data acquisition and time difference calculation process of the present invention;
[0037] Figure 3 This is a schematic diagram of the blockchain data storage and consensus verification process of the present invention;
[0038] Figure 4This is a schematic diagram illustrating the interaction between zero-knowledge proof generation and verification in this invention;
[0039] Figure 5 This is a schematic diagram illustrating the data auditing and anomaly handling status of the present invention. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the scope of protection of the present invention. Unless otherwise defined, the technical or scientific terms used herein should have the ordinary meaning understood by those skilled in the art to which this invention pertains.
[0041] The terms "first," "second," and similar words used in the specification and claims of this patent application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, unless the context clearly indicates otherwise, the singular forms of "an," "a," or "the," etc., do not indicate a quantity limitation, but rather indicate the presence of at least one. Terms such as "comprising" or "including" mean that the element or object preceding "comprising" encompasses the features, integrals, steps, operations, elements, and / or components listed following "comprising" or "including," and do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.
[0042] The following detailed description of the ultrasonic water meter detection device and method of the present invention, with reference to the accompanying drawings and specific embodiments, is as follows:
[0043] Example 1: Hardware Deployment and Initialization of the Detection Device
[0044] First, the transducers were installed and calibrated. A pair of piezoelectric ceramic transducers (1MHz frequency) were embedded diagonally into the wall of a DN20 water meter pipe (20mm inner diameter), with an installation angle of θ = 55° and an axial spacing of [missing information]. The transducer surface is flush with the inner wall of the tube, with a mutual error of ≤0.1mm. The transducer surface and the tube wall are sealed with epoxy resin to achieve IP68 protection level. The time difference measurement module (TDC-GP22) is fixed to the waterproof cavity on the outside of the tube wall. The time difference measurement module is connected to the transducer through a 10cm coaxial cable. The time difference measurement module is configured with a time resolution of 0.1ns and a sampling rate of 100Hz.
[0045] Next, the temperature sensor is installed by embedding it into the groove of the transducer housing (2mm from the center of the water flow). The gap between the temperature sensor and the transducer housing is filled with thermal grease. The temperature sensor is connected to a 24-bit ADC module (ADS1248) using a four-wire system. The temperature sensor is calibrated in constant temperature water baths at 0℃, 20℃, and 50℃. The measurement accuracy error of the temperature sensor is ≤±0.3℃.
[0046] Then, the blockchain module is initialized. The main control MCU (STM32L4R9) loads the lightweight blockchain firmware (HiChain 310) and configures private chain nodes, including the water company server, regulatory nodes and user agent nodes. The private chain nodes are set to the improved PBFT consensus mechanism. The block confirmation threshold in the PBFT consensus mechanism is 75% (3 / 4 nodes) and the block generation interval is 2 seconds.
[0047] Example 2: Data Acquisition and Evidence Storage Process:
[0048] First, a trigger measurement is performed. The main control MCU sends a start signal to the time difference module through the SPI interface. The start signal controls the transducer to alternately emit concurrent and countercurrent ultrasonic pulses (pulse width 100ns).
[0049] Next, ultrasonic pulse signal acquisition is performed. The receiving end of the transducer pair acquires the ultrasonic echo signal. The ultrasonic echo signal is measured by the time difference module. The downstream propagation time t1 = 16.52 μs and the upstream propagation time t2 = 16.58 μs are measured. The time difference Δt = t2 - t1 = 60 ns is calculated.
[0050] Then, sound velocity compensation is performed on the time difference Δt. The sound velocity compensation method uses a temperature sensor to collect the water temperature in real time (T = 20℃) and calculates the velocity using the formula c = 1402.5 + 5T - 0.06T. 2 The speed of sound is calculated to be c = 1482.5 m / s, and the value of Δt is calibrated accordingly.
[0051] Further, based on the blockchain module, blockchain notarization is performed, aggregating 3600 Δt values per hour (once per second) to construct a Merkle tree. The leaf node hash in the Merkle tree is H. i =SHA-256(Δt) i The leaf node hash values are combined pairwise and the hash values are recursively calculated until the root hash H is generated. block =SHA-256(H1| |H2| |…| |H 3600 );
[0052] Furthermore, through the blockchain's evidence storage mechanism, when data is organized into a block, multiple pieces of information need to be packaged together. The block packaging includes the device ID, timestamp, root hash, and the hash of the previous block, and is signed using an SM2 private key.
[0053] Finally, after the packaged block is broadcast to the private chain nodes, the block is verified using the improved PBFT mechanism (at least 3 / 4 of the nodes confirm), and after verification by the PBFT mechanism, the block is written to the blockchain;
[0054] Example 3: Privacy Protection Verification Method
[0055] First, zero-knowledge proofs are generated based on the Δt data. The generation of zero-knowledge proofs includes user requests, data retrieval, and proof generation.
[0056] The user then requested to check their monthly water consumption through the app;
[0057] Then, data is retrieved through user requests. The data retrieval process involves the main control MCU extracting all Δt sequences and corresponding water temperature data for that time period from local storage.
[0058] Further, after the data retrieval is completed, proof generation is performed. The proof generation is based on the zk-SNARKs protocol, and the constraint condition Q=k·Δt·c·S is set to generate proof π (198 bytes, taking 185ms). Public parameters are generated during the data retrieval and π generation process.
[0059] Finally, π and the public parameters are submitted to the smart contract. The smart contract calls the pre-set verification key vk on the blockchain to verify the validity of π. After successful verification, the Q value is returned to the user, and the transaction hash is recorded.
[0060] Example 4: Exception Handling and Auditing Mechanism
[0061] First, tamper detection is performed on the evidence-stored data in the blockchain of Example 2. The core component of the blockchain system is the supervisory node, which is responsible for monitoring and auditing the integrity of the blockchain data. The supervisory node requests a specified time period H from the 5% water meter every month. block If H on the chain block If the hash of the Δt sequence for that time period is inconsistent with the local recalculation of the water meter, a smart contract alarm is triggered. The smart contract alarm will immediately send an alarm signal to the operation and maintenance platform through the NB-IoT module.
[0062] Then trigger the H block of the smart contract alarm. block Key authorization is achieved through key fragmentation provided by the water company, users, and regulatory agencies, and H is parsed. block The original Δt sequence within the time frame is used to locate the anomalous time point;
[0063] Finally, maintenance and recovery are carried out. The operation and maintenance platform receives alarm signals, performs on-site maintenance, and technicians replace the faulty time difference module or blockchain chip, recalibrate, and synchronize the historical blockchain data.
[0064] Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An ultrasonic water meter testing device, characterized in that, It includes an ultrasonic detection unit, a blockchain evidence storage unit, a zero-knowledge proof module, a main control MCU, and a low-power communication unit, among which: The ultrasonic detection unit includes a pair of transducers diagonally symmetrically installed on the inner surface of the water meter pipe wall. The transducer pair is composed of a transmitting end T1 and a receiving end R1. The transducer pair is used to collect the ultrasonic propagation time difference Δt between the downstream and upstream flows. The signal output terminal of the transducer pair is directly connected to the time difference measurement module via a high-frequency coaxial cable. The time difference measurement module is embedded in a waterproof cavity on the outside of the tube wall. The linear installation distance between the time difference measurement module and the transducer pair is ≤5cm, and the time measurement accuracy of the time difference measurement module is ±1ns. The time difference measurement module integrates a temperature sensor. The temperature sensor extends into the groove inside the pipe wall and is ≤2mm away from the center of the water flow. The temperature sensor is used to collect water temperature data in real time and transmit it to the time difference measurement module through the I²C interface. The blockchain evidence storage unit includes a lightweight blockchain chip, which is used to receive the Δt sequence output by the time difference measurement module. The Δt sequence is used to construct a Merkle tree and generate a root hash. The root hash is written to a private chain based on an improved PBFT consensus mechanism. The zero-knowledge proof module is based on the zk-SNARKs protocol. The zero-knowledge proof module communicates with the blockchain evidence storage unit and the main control MCU. The zero-knowledge proof module generates a verifiable proof π of the user's water consumption, and the zero-knowledge proof module does not leak the original Δt data. The main control MCU is connected to the time difference measurement module via the SPI bus, and triggers data uplink and zero-knowledge proof generation through a low-power communication unit with NB-IoT / LoRa dual-mode. The blockchain evidence storage unit includes a data preprocessing module and private blockchain network nodes. The data preprocessing module groups the Δt sequence collected per second into time windows, and constructs a Merkle tree of depth 12 for each time window. The root hash of the Merkle tree is denoted as... The private blockchain network nodes consist of at least one water company server node, one regulatory agency node, and one user agent node. These nodes verify blocks using an improved PBFT consensus mechanism. The block confirmation threshold for this improved PBFT consensus mechanism is 4 / 5 of the total number of nodes. The block header includes a device ID, a timestamp, and... Encrypted signature.
2. The ultrasonic water meter testing device according to claim 1, characterized in that, The angle θ between the transducer pair and the pipeline axis is 55°~60°, the axial spacing of the transducer pair is L=sin(θ)⋅D, where D is the inner diameter of the pipeline, the front end of the transducer pair is flush with the inner wall of the pipeline, the upstream straight pipe section length is ≥10D, and the downstream straight pipe section length is ≥5D.
3. The ultrasonic water meter testing device according to claim 1, characterized in that, The operation of the zero-knowledge proof module includes input, output, and verification processes. The input of the zero-knowledge proof module consists of a Δt sequence, water temperature data, and pipe geometric parameters. The output of the zero-knowledge proof module proves π and the corresponding public parameters through water consumption. The public parameters include the total flow rate Q and the time range. The verification process of the zero-knowledge proof module verifies the validity of π through an on-chain smart contract, and the verification process does not require the disclosure of Δt sequence details.
4. The ultrasonic water meter testing device according to claim 1, characterized in that, The low-power communication unit has three operating modes: deep sleep mode, data uplink mode, and emergency alarm mode. In deep sleep mode, the power consumption is <10μA and the unit continuously listens for wake-up signals. In data uplink mode, the unit sends block data via LoRa with a peak power consumption of ≤50mA. In emergency alarm mode, the unit triggers the NB-IoT cellular network to upload alarm information.
5. The ultrasonic water meter testing device according to claim 1, characterized in that, The temperature sensor is attached to the inner groove surface of the pipe wall with thermally conductive silicone grease, and the groove depth is 1mm~2mm. The temperature sensor adopts a four-wire platinum resistance (PT1000) connection method. The four-wire platinum resistance operates in constant current source drive mode, and the constant current source drive current is 1mA±0.1%. The temperature measurement range of the temperature sensor is 0℃~80℃, and the accuracy of the temperature sensor is ±0.5℃.
6. The ultrasonic water meter testing method according to any one of claims 1 to 5, characterized in that, Includes the following steps: S1. Ultrasonic data acquisition and time difference calculation: The transducer alternately emits concurrent and countercurrent ultrasonic pulses, and the transducer collects propagation times t1 and t2. The time difference measurement module and the main control MCU calculate... The temperature sensor and time difference measurement module synchronously acquire the water temperature T, and the main control MCU calculates the water temperature T according to the speed of sound formula. The Δt value is calibrated, where c is the propagation speed of ultrasound in the fluid and T is the water temperature. Raw data is collected in real time through the transducer pair and temperature sensor. S2, Blockchain Data Storage and Consensus Verification: The original data of S1 is grouped by time window and a Merkle tree is constructed. The root hash corresponding to each group of original data is then generated using the Merkle tree. ,Will The device ID and timestamp are packaged into blocks, which are then broadcast to private blockchain network nodes. The data from the private blockchain network nodes are used to verify the validity of the blocks through an improved PBFT consensus mechanism. After the data reaches a consensus, it is written into the blockchain. S3. Zero-knowledge proof generation and verification: Users query monthly water consumption by storing consensus-verified hash values of Δt sequences in the blockchain, calculate the total flow Q based on the Δt sequence, generate a proof π using the zk-SNARKs protocol, and submit π to the on-chain smart contract. After the on-chain smart contract verifies the validity of π, π returns the Q value without disclosing the original Δt data. S4. Data Traceability and Auditing: The regulatory node in the private blockchain network decrypts the Merkel root hash stored on the chain using an authorization key. The Merkel root hash The hash values of the locally stored Δt sequence are compared. If the hash values are inconsistent, an alarm is triggered in the on-chain smart contract and the water meter operation permissions are frozen.
7. The ultrasonic water meter testing method according to claim 6, characterized in that, In S2, the time window is constructed using a Merkle tree to achieve time-series management and verification of data. The time window length is 1 hour, and each group of time windows contains 3600 Δt values. The leaf nodes in the Merkle tree are SHA-256 hashes of a single Δt value, and the root hash... It is generated through layer-by-layer hash aggregation, and the hash aggregation process is completed within the hardware security module (HSM) of the blockchain chip.
8. The ultrasonic water meter testing method according to claim 6, characterized in that, The generation process of the zero-knowledge proof includes constraint definition, arithmetic circuit compilation, trust setting, and proof generation. The constraint definition is based on fluid dynamics formulas. Q is the volumetric flow rate, k is the calibration coefficient, and S is the pipe cross-sectional area. The arithmetic circuit compilation process converts the constraints into R1CS (Rank-1 Constraint System). The trusted setting pre-sets the proof key (pk) and verification key (vk) of zk-SNARKs in the blockchain evidence storage unit. The proof generation uses pk to encrypt the mapping relationship between the Δt sequence and Q into π.
9. The ultrasonic water meter testing method according to claim 6, characterized in that, The triggering conditions for data traceability and auditing include user complaints of abnormal water consumption, periodic spot checks by regulatory agencies, and the system detecting three consecutive hash inconsistencies. When a user complains of abnormal water consumption, the system automatically retrieves the data for the disputed time period. Compared with local data, the regulatory agency decrypts historical blocks and verifies the integrity of the hash chain through an authorized key during periodic spot checks. When the system detects three consecutive hash inconsistencies, it forces the system to enter maintenance mode and uploads fault logs.
Citation Information
Patent Citations
Intelligent system data supervision method based on private chain
CN112100278A
Ultra-low power consumption ultrasonic water meter and working method thereof
CN112484797A