Ultrasonic water meter detection device and detection method
Through the combination of hash-winding and zk-SNARKs protocol, the problem of tampering and privacy leakage of ultrasonic water meter data is solved, and the data is anti-tampering credibility and privacy protection is achieved. It is suitable for old pipeline renovation, reducing installation costs and power consumption.
Patent Information
- Application Number
- CN202510359937.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-03-25
AI Technical Summary
The data credibility of existing ultrasonic water meters is insufficient, the original Δt data is easily tampered with or lost, and the privacy leakage risk is high, which cannot meet the needs of real-time transmission and privacy protection.
The Δt data is stored in a hash-on manner, combined with the zk-SNARKs protocol for zero-knowledge proof, optimize the transducer layout to reduce the demand for straight pipe segments, and use the improved PBFT consensus mechanism to ensure that the data is not tampered with and privacy is protected.
It realizes the anti-tampering credibility of data, improves the proof efficiency of metrological disputes, meets privacy protection requirements, reduces installation costs and power consumption, adapts to old pipeline renovation, and improves the reliability and privacy protection capabilities of the system.
Smart Images

Figure CN120293245A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ultrasonic water meters, and specifically to an ultrasonic water meter detection device and a detection method. Background Technique
[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 wave propagation in the downstream and upstream directions, and has advantages such as no mechanical wear and a wide range ratio. It is widely used in residential water supply, industrial metering, and intelligent water service systems. With the popularization of Internet of Things technology, the real-time transmission, anti-tampering, and privacy protection of water meter data have become the core requirements for technological evolution.
[0003] The current ultrasonic water meter detection technology has the following defects: insufficient data credibility. Traditional water meters rely on local storage or a centralized server to record the cumulative flow, and the original Δt data is easily tampered with or lost, resulting in a lack of traceability basis in case of metering disputes; the risk of privacy leakage. Existing blockchain water meters directly upload the user's water consumption in plain text to the blockchain, and the user's living habits can be inferred through high-frequency data analysis, violating privacy protection regulations. Summary of the Invention
[0004] The purpose of the present invention is to provide an ultrasonic water meter detection device and a detection method, which ensure the non-tampering of the metering process by hashing the original Δt data onto the blockchain, use the zk-SNARKs protocol to achieve privacy protection during water consumption verification, and optimize the transducer layout to reduce the requirement for straight pipe sections.
[0005] To achieve the above purpose, the present invention provides the following technical solution: An ultrasonic water meter detection device 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, where:
[0006] The ultrasonic detection unit includes a pair of transducers symmetrically installed diagonally on the inner surface of the water meter pipe wall. The pair of transducers consists of a transmitting end T1 and a receiving end R1, and is used to collect the time difference Δt of ultrasonic wave propagation in the downstream and upstream directions;
[0007] The signal output end of the pair of transducers is directly connected to the time difference measurement module through a high-frequency coaxial cable. The time difference measurement module is embedded in a waterproof cavity outside the pipe wall. The linear installation distance between the time difference measurement module and the pair of transducers is ≤ 5 cm, and the time measurement accuracy of the time difference measurement module is ±1 ns;
[0008] The time difference measurement module integrates a temperature sensor. The temperature sensor extends into a groove on the inner side of the pipe wall and is ≤ 2 mm away from the water flow center. The temperature sensor is used to collect water temperature data in real time and transmit it to the time difference measurement module through an I 2 C interface;
[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 constructs a Merkle tree and generates a root hash, and the root hash is written into 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 disclose the original Δt data;
[0011] The main control MCU is connected to the time difference measurement module through the SPI bus. The main control MCU triggers data uploading to the chain and zero-knowledge proof generation through a low-power communication unit (NB-IoT / LoRa dual mode).
[0012] Further, the included 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 length of the upstream straight pipe section of the pipeline is ≥10D, and the length of the downstream straight pipe section of the pipeline is ≥5D.
[0013] Further, the blockchain evidence storage unit includes a data preprocessing module and a private chain network node. The data preprocessing module groups the Δt sequences collected per second according to time windows. Each time window constructs a Merkle tree with a depth of 12, and the root hash of the Merkle tree is denoted as H block , The private chain network node consists of at least one water company server node, one regulatory agency node, and one user agent node. The private chain network node verifies blocks through an improved PBFT consensus mechanism. The block confirmation threshold of the improved PBFT consensus mechanism is 4 / 5 of the total number of nodes. The block header of the block includes the device ID, timestamp, and the encrypted signature of H block
[0014] Further, the operations of the zero-knowledge proof module include input, output, and verification processes. The input of the zero-knowledge proof module is through the Δt sequence, water temperature data, and pipeline geometric parameters. The output of the zero-knowledge proof module is through the water consumption proof π and the corresponding public parameters (total flow 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 disclosing the details of the Δt sequence.
[0015] Further, the operating modes of the low-power communication unit include a deep sleep mode, a data uplink mode, and an emergency alarm mode. The deep sleep mode has a power consumption < 10 μA and continuously monitors the wake-up signal. The data uplink mode sends block data via LoRa, with a peak power consumption ≤ 50 mA. The emergency alarm mode uploads alarm information by triggering the NB-IoT cellular network.
[0016] Further, the temperature sensor is attached to the inner groove surface of the pipe wall through thermal conductive silicone grease, and the groove depth is 1 mm to 2 mm. The temperature sensor adopts a four-wire platinum resistor (PT1000) connection method. The operating method of the four-wire platinum resistor is constant current source drive current, and the constant current source drive current is 1 mA ± 0.1%. The temperature measurement range of the temperature sensor is 0 °C to 80 °C, and the accuracy of the temperature sensor is ± 0.5 °C.
[0017] The present invention also discloses an ultrasonic water meter detection method, including the following steps:
[0018] S1. Ultrasonic data acquisition and time difference calculation:
[0019] The transducer pair alternately emits forward and reverse ultrasonic pulses. The acquisition propagation times t1 and t2 of the transducer pair are measured. The time difference measurement module and the main control MCU calculate Δt = t2 - t1. The temperature sensor and the time difference measurement module synchronously acquire the water temperature T. The main control MCU calibrates the Δt value according to the sound speed formula (c = 1402.5 + 5T - 0.06T 2 ) (where c is the propagation speed of ultrasonic waves in the fluid and T is the water temperature), and the original data is collected in real time through the transducer pair and the temperature sensor;
[0020] S2. Blockchain data deposit and consensus verification:
[0021] The original data in S1 is grouped by time window and a Merkle tree is constructed. Each group constructs a Merkle tree and generates a root hash H block , and H block is packaged into a block through the device ID and the timestamp. The block is broadcast to the private chain network nodes. The data of the private chain network nodes is verified for block validity through an improved PBFT consensus mechanism, and after the data reaches consensus, it is written into the blockchain;
[0022] S3. Zero-knowledge proof generation and verification:
[0023] Users query their monthly water consumption through the consensus-verified hash values of the Δt sequences stored in the blockchain, calculate the total flow rate Q based on the Δt sequences, 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;
[0024] S4. Data Traceability and Auditing:
[0025] The regulatory agency in the private chain network nodes decrypts the Merkle root hash H stored on the chain through an authorized key block , the Merkle root hash H block is compared with the hash value regenerated from the locally stored Δt sequence. When the hash values are inconsistent, the on-chain smart contract is triggered to alarm and freeze the water meter operation permission.
[0026] Furthermore, in S2, the time window realizes the chronological management and verification of data through the construction of a Merkle tree. 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 the SHA-256 hashes of individual Δt values, and the root hash H block 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 condition definition, arithmetic circuit compilation, trusted setup, and proof generation. The constraint condition definition is based on the fluid mechanics formula (Q = k·Δt·c·S), where Q is the volumetric flow rate, k is the calibration coefficient, S is the pipe cross-sectional area. The arithmetic circuit compilation converts the constraint conditions into an R1CS (Rank-1 Constraint System). The trusted setup pre-allocates the proof key (pk) and verification key (vk) of zk-SNARKs in the blockchain storage unit. The proof generation encrypts the mapping relationship between the Δt sequence and Q into π using pk.
[0028] Furthermore, the triggering conditions for data traceability and auditing include user complaints about abnormal water consumption, regular spot checks by regulatory agencies, and the system detecting three consecutive hash inconsistencies. When a user complains about abnormal water consumption, H during the disputed time period is automatically retrieved block and compared with local data. When the regulatory agency conducts regular spot checks, it decrypts historical blocks through an authorized key and verifies the integrity of the hash chain. When the system detects three consecutive hash inconsistencies, it is forced into the maintenance mode and uploads the fault log.
[0029] Compared with the prior art, the beneficial effects of the present invention are: This ultrasonic water meter detection device and detection method:
[0030] (1) Tamper-proof credibility: The original Δt data constructs a Merkle tree with a depth of 12 according to a time window (1 hour / group), and the root hash is stored on the chain. Any single-point data tampering will result in a root hash mismatch, supporting precise tracing back to the abnormal time point. The block header contains the device ID, timestamp, and SM2 signature, combined with an improved PBFT consensus (4 / 5 node confirmation) to resist malicious node attacks. In water disputes, the regulatory agency can quickly locate the tampering behavior by comparing the on-chain hash with the local data, and the evidence presentation efficiency is increased by more than 80%.
[0031] (2) Privacy protection: Adopt the zk-SNARKs protocol, with the constraint conditions based on the flow formula. Compile the mapping relationship between the Δt sequence and the total flow Q into an R1CS circuit to generate a 198-byte proof π. The verification process only requires the on-chain smart contract to call the preset verification key, without publicly disclosing the original Δt data, and the user's water usage behavior patterns (such as peak hours, water usage frequency) are completely hidden, meeting the requirements of privacy regulations such as GDPR.
[0032] (3) Installation adaptability: Short straight pipe section design (5D upstream, 3D downstream), suitable for the renovation of old pipe networks. The length of the straight pipe section is only 1 / 3 of the traditional scheme, and the installation cost is reduced by 40%.
[0033] (4) Low-power operation: The standby power consumption of the blockchain chip (HiChain 310) is <100 μA, and the NB-IoT / LoRa dual-mode communication switches on demand (the deep sleep mode is <10 μA, and the data sending peak value ≤50 mA); the time difference measurement module adopts a dynamic sampling rate (reduced to 1 Hz when idle), and a 3.6V lithium thionyl chloride battery supports a 10-year battery life without an external power supply, suitable for deployment in remote areas, and the operation and maintenance cycle is extended to 2 times that of traditional water meters.
[0034] (5) Abnormal rapid response: When the system detects 3 consecutive hash inconsistencies or user complaints, it automatically triggers an NB-IoT alarm and freezes the water meter permissions; the operation and maintenance personnel decrypt the historical blocks through multi-party key sharding to locate the fault time point (response time <5 minutes), reducing the dispute handling time caused by measurement errors, and the average fault recovery time is shortened by 70%. Brief Description of the Drawings
[0035] Figure 1 It is a schematic structural diagram of the ultrasonic water meter detection device of the present invention;
[0036] Figure 2 It is a schematic diagram of the ultrasonic data acquisition and time difference calculation process of the present invention;
[0037] Figure 3 It is a schematic diagram of the blockchain data deposit and consensus verification process of the present invention;
[0038] Figure 4Schematic diagram of the interaction for zero - knowledge proof generation and verification of the present invention;
[0039] Figure 5 Schematic diagram of the data audit and exception handling status of the present invention. Detailed implementation manners
[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 in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the described embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein shall have the ordinary meanings understood by those of ordinary skill in the art to which the present invention pertains.
[0041] The "first", "second" and similar terms used in the specification and claims of this patent application of the present invention do not denote any order, quantity or importance, but are only used to distinguish different components. Similarly, unless the context clearly indicates otherwise, singular forms such as "a", "an" or "the" and similar terms do not denote a quantity limitation, but mean that there is at least one. Words such as "comprising" or "including" and the like are intended to indicate that the elements or objects appearing before "comprising" or "including" cover the features, wholes, steps, operations, elements and / or components listed after "comprising" or "including", and do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0042] The following further specifically introduces the ultrasonic water meter detection device and detection method of the present invention in conjunction with the accompanying drawings and specific embodiments:
[0043] Embodiment 1: Hardware deployment and initialization of the detection device:
[0044] First, install and calibrate the transducers. In the DN20 water meter pipe wall (inner diameter 20mm), a pair of piezoelectric ceramic transducers (frequency 1MHz) are embedded using the diagonal installation method, the installation angle is θ = 55°, and the axial spacing is The surfaces of the transducers are flush with the inner wall of the pipe, and the mutual error is ≤0.1mm. The IP68 protection level is achieved by sealing the surfaces of the transducers and the pipe wall with epoxy resin. The time - difference measurement module (TDC - GP22) is fixed in the waterproof cavity outside the pipe wall. The time - difference measurement module is connected to the transducers through a 10 - cm coaxial cable. The configured time resolution of the time - difference measurement module is 0.1ns, and the sampling rate is 100Hz;
[0045] Next, install the temperature sensor. Embed the temperature sensor in the groove of the transducer housing (2 mm from the center of the water flow), and fill the gap between the temperature sensor and the transducer housing with thermal grease. The temperature sensor is connected to the 24-bit ADC module (ADS1248) according to the four-wire system. The temperature sensor calibrates the temperature measurement in a constant temperature water bath at 0°C, 20°C, and 50°C, and the measurement accuracy error of the temperature sensor is ≤ ±0.3°C;
[0046] Then, initialize the blockchain module. The main control MCU (STM32L4R9) loads the lightweight blockchain firmware (HiChain 310), and at the same time configures the private chain nodes. The private chain nodes include the water company server, the supervision node, and the user agent node. The private chain nodes set an 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 storage process:
[0048] First, trigger the measurement. The main control MCU sends a start signal to the time difference module through the SPI interface, and the start signal controls the transducer to alternately emit ultrasonic pulses in the downstream and upstream directions (pulse width 100 ns);
[0049] Next, capture the ultrasonic pulse signal. The receiving end of the transducer pair captures the ultrasonic echo signal. The ultrasonic echo signal measures the downstream propagation time t1 = 16.52 μs and the upstream propagation time t2 = 16.58 μs through the time difference module, and calculates the time difference Δt = t2 - t1 = 60 ns;
[0050] Then, perform sound speed compensation on the time difference Δt value. The sound speed compensation method is to collect the water temperature T = 20°C in real time through the temperature sensor, and calculate the sound speed c = 1402.5 + 5T - 0.06T 2 to calculate the sound speed c = 1482.5 m / s, thereby calibrating the Δt value;
[0051] Furthermore, based on the blockchain module, perform blockchain storage. Aggregate 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 ), and the leaf node hash values are combined in pairs, and the hash values are recursively calculated until the root hash H block = SHA-256(H1||H2||…||H 3600 );
[0052] Further, through the evidence storage mechanism of the blockchain, when the data is organized into a block, multiple pieces of information need to be packaged together. When the block is packaged, the device ID, timestamp, root hash, and the hash of the previous block are packaged and signed using the SM2 private key;
[0053] Finally, after broadcasting the packaged block to the private chain nodes, the block is verified using the improved PBFT mechanism (at least 3 / 4 node confirmations), and after the PBFT mechanism verification, the block is written into the blockchain;
[0054] Embodiment 3, Privacy Protection Verification Method
[0055] First, zero-knowledge proof generation is performed based on the Δt data. Zero-knowledge proof generation includes user requests, data retrieval, and proof generation;
[0056] Next, the user requests to query the monthly water consumption through the APP;
[0057] Then, data retrieval is performed through the user request. The data retrieval extracts all Δt sequences and corresponding water temperature data during this period from the local storage by the main control MCU;
[0058] Furthermore, after the data retrieval is completed, proof generation is performed. Based on the zk-SNARKs protocol, the constraint condition Q = k·Δt·c·S is set, thereby generating a proof π (198 bytes, taking 185 ms), and public parameters are generated during the data retrieval and π generation;
[0059] Finally, π and the public parameters are submitted to the smart contract. The smart contract calls the pre-set verification key vk on the chain to verify the validity of π. After the verification passes, the Q value is returned to the user, and the transaction hash is recorded.
[0060] Embodiment 4, Abnormal Handling and Audit Mechanism
[0061] First, tampering detection is performed based on the evidence storage data in the blockchain of Embodiment 2. The core part of the blockchain system is the supervision node, and the supervision node is responsible for supervising and auditing the integrity of the blockchain data. The supervision node requests the specified time period H of 5% of the water meters every month block , if the H block on the chain is inconsistent with the hash of the Δt sequence recalculated locally by the water meter for this period, the smart contract is triggered to give an alarm, and the smart contract alarm will immediately send an alarm signal to the operation and maintenance platform through the NB-IoT module;
[0062] Next, for the H block of the block where the smart contract alarm is triggered, key authorization is performed through the key shards provided by the water supply company, users, and regulatory agencies, and the original Δt sequence within H block is parsed to locate the abnormal time point;
[0063] Finally, maintenance and recovery are carried out. The operation and maintenance platform receives the alarm signal and conducts on-site maintenance. Technicians replace the faulty time difference module or blockchain chip, and after re-calibration, synchronize the blockchain historical 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 perform equivalent replacements for some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An ultrasonic water meter detection 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, where: The ultrasonic detection unit includes a pair of transducers symmetrically installed diagonally on the inner surface of the water meter pipe wall. The pair of transducers consists of a transmitting end T1 and a receiving end R1, and is used to collect the time difference Δt of ultrasonic wave propagation in the forward and reverse directions. The signal output end of the pair of transducers is directly connected to the time difference measurement module through a high-frequency coaxial cable. The time difference measurement module is embedded in a waterproof cavity outside the pipe wall. The linear installation distance between the time difference measurement module and the pair of transducers is ≤5 cm, and the time measurement accuracy of the time difference measurement module is ±1 ns. The time difference measurement module integrates a temperature sensor. The temperature sensor extends into a groove on the inner side of the pipe wall and is ≤2 mm away from the water flow center. The temperature sensor is used to collect water temperature data in real time and transmit it to the time difference measurement module through the I2C interface. The blockchain evidence storage unit includes a lightweight blockchain chip. The lightweight blockchain chip is used to receive the Δt sequence output by the time difference measurement module, construct a Merkle tree for the Δt sequence and generate a root hash, and write the root hash into 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, generates a verifiable proof π of the user's water consumption, and the zero-knowledge proof module does not disclose the original Δt data. The main control MCU is connected to the time difference measurement module through the SPI bus. The main control MCU triggers data uploading to the chain and zero-knowledge proof generation through the low-power communication unit (NB-IoT / LoRa dual-mode).
2. The ultrasonic water meter detection device according to claim 1, characterized in that The included angle θ between the pair of transducers and the pipe axis is 55° to 60°. The axial spacing of the pair of transducers is L = sin(θ)·D, where D is the inner diameter of the pipe. The front end of the pair of transducers is flush with the inner wall of the pipe. The length of the upstream straight pipe section of the pipe is ≥10D, and the length of the downstream straight pipe section of the pipe is ≥5D.
3. The ultrasonic water meter detection device according to claim 1, characterized in that, The blockchain evidence storage unit includes a data preprocessing module and a private chain network node. The data preprocessing module groups the Δt sequences collected per second according to time windows. For each group of time windows, a Merkle tree with a depth of 12 is constructed, and the root hash of the Merkle tree is denoted as H block , the private chain network node consists of at least one water company server node, one regulatory agency node, and one user agent node. The private chain network node performs block verification through an improved PBFT consensus mechanism. The block confirmation threshold of the improved PBFT consensus mechanism is 4 / 5 of the total number of nodes. The block header of the block contains the device ID, timestamp, and the encrypted signature of H block .
4. An ultrasonic water meter detection device according to claim 1, characterized in that, The operation of the zero-knowledge proof module includes an input, an output, and a verification process. 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 the water consumption proof π and the corresponding public parameters (total flow 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 disclosure of the details of the Δt sequence.
5. The ultrasonic water meter detection device according to claim 1, characterized in that, The working modes of the low-power communication unit include a deep sleep mode, a data uploading to the chain mode, and an emergency alarm mode. In the deep sleep mode, the power consumption is <10 μA, continuously listening for wake-up signals. In the data uploading to the chain mode, block data is sent through LoRa, and the peak power consumption is ≤50 mA. In the emergency alarm mode, alarm information is uploaded by triggering the NB-IoT cellular network.
6. The ultrasonic water meter detection device according to claim 1, wherein, The temperature sensor is attached to the inner surface of the groove on the pipe wall through thermal conductive silicone grease, and the depth of the groove is 1 mm to 2 mm. The temperature sensor adopts a four-wire platinum resistor (PT1000) connection method. The working method of the four-wire platinum resistor is constant current source drive current, and the constant current source drive current is 1 mA ± 0.1%. The temperature measurement range of the temperature sensor is 0 °C to 80 °C, and the accuracy of the temperature sensor is ±0.5 °C.
7. A method for detecting an ultrasonic water meter according to any one of claims 1 to 6, characterized in that, It includes the following steps: S1. Ultrasonic data acquisition and time difference calculation: The transducer pair alternately emits ultrasonic pulses in the downstream and upstream directions, collects the propagation times t1 and t2 of the transducer pair, 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, and the main control MCU calibrates the Δt value according to the sound speed formula (c = 1402.5 + 5T - 0.06T 2 ), where c is the propagation speed of ultrasonic waves in the fluid and T is the water temperature, and the original data is collected in real time through the transducer pair and the temperature sensor; S2. Blockchain data storage and consensus verification: Group the original data of S1 by time window and construct a Merkle tree. For each group, construct the Merkle tree and generate the root hash H block , and pack H block with the device ID and timestamp into a block. The block is broadcast to the nodes of the private chain network. The data of the private chain network nodes is used to verify the validity of the block 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: The user queries the monthly water consumption through the hash value of the Δt sequence stored in the blockchain after consensus verification, calculates the total flow Q based on the Δt sequence, generates a proof π using the zk-SNARKs protocol, and submits π 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 agency in the private chain network node decrypts the Merkle root hash H stored on the chain through the authorized key block , the Merkle root hash H block is compared with the hash value regenerated from the locally stored Δt sequence. When the hash values are inconsistent, the smart contract on the chain is triggered to give an alarm and freeze the water meter operation permission.
8. A method for detecting an ultrasonic water meter according to claim 7, characterized in that, In S2, the time window realizes the temporal management and verification of data through the construction of a Merkle tree. The length of the time window is 1 hour. Each group of time windows contains 3600 Δt values. The leaf nodes in the Merkle tree are the SHA-256 hashes of individual Δt values, and the root hash H block 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.
9. The ultrasonic water meter detection method according to claim 7, characterized in that The generation process of the zero-knowledge proof includes constraint condition definition, arithmetic circuit compilation, trusted setup, and proof generation. The constraint condition definition is based on the hydrodynamics formula (Q = k·Δt·c·S), where Q is the volume flow rate, k is the calibration coefficient, and S is the cross-sectional area of the pipe. The arithmetic circuit compilation converts the constraint conditions into R1CS (Rank-1 Constraint System). The trusted setup pre-sets the proof key (pk) and verification key (vk) of zk-SNARKs in the blockchain data storage unit. The proof generation encrypts the mapping relationship between the Δt sequence and Q into π using pk.
10. A method for detecting an ultrasonic water meter according to claim 7, characterized in that, The triggering conditions for the data traceability and auditing include user complaints about abnormal water consumption, regular spot checks by regulatory agencies, and the system detecting three consecutive hash inconsistencies. When a user complains about abnormal water consumption, the H during the disputed time period is automatically retrieved. block Compare it with the local data. When the regulatory agency conducts regular spot checks, decrypt the historical block through the authorized key and verify the integrity of the hash chain. When the system detects three consecutive hash inconsistencies, it is forced into the maintenance mode and the fault log is uploaded.
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
Bidirectional metering method and device applied to pipe network disturbance abnormal flow, medium and product
CN119164458A
Cited By
Cross-mechanism carbon emission data synchronization method
CN121462210A
A cross-agency carbon emission data synchronization method
CN121462210B
Traffic data hierarchical evidence storage and auditing device
CN121966984A