Intelligent water resource tracing and transaction management system fused with block chain technology

By combining IoT sensors, the Harris Eagle optimization algorithm, and an improved practical Byzantine fault-tolerant consensus algorithm with smart contracts, the problems of non-real-time data collection, information silos, and untimely anomaly detection in smart water systems have been solved, enabling real-time, accurate, and secure data traceability and transaction management for water resources management.

CN120634583AInactive Publication Date: 2025-09-12MIRROR VISION (ZHEJIANG) TECHNOLOGY CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510736304.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing smart water system has shortcomings in aspects such as non-real-time data collection, information islands, easy data tampering, low consensus efficiency, and untimely anomaly detection. Especially in water resources management, it is difficult to meet the high real-time and dynamic requirements.

Method used

IoT sensors are used for real-time data collection, and the Harris Eagle optimization algorithm is combined to perform global optimization of the anomaly detection model. Multi-node cross-validation is performed through an improved practical Byzantine fault-tolerant consensus algorithm, and smart contracts are used to achieve secure data on-chain and automatic response.

Benefits of technology

It realizes the real-time collection, accurate anomaly detection and secure uploading of water data, improves the accuracy and consistency of data, increases the response speed of water resource scheduling and the robustness of the system, and realizes the intelligent and transparent management of water resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120634583A_ABST
    Figure CN120634583A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent water affair water resource tracing and transaction management system fused with a block chain technology, and the system comprises the following steps: a data collection and preprocessing module which is used for collecting real-time water affair data, carrying out the preprocessing of the real-time water affair data, and forming a structured data file; the parameter optimization and intelligent early warning module is used for constructing an anomaly detection model and performing global adjustment; the consensus verification module is used for performing consensus verification based on a practical Byzantine fault-tolerant consensus algorithm; the secure uplink and transaction management module is used for performing secure uplink on the data after the consensus verification to form a non-tampering data storage certificate; and the automatic response and decision support module is used for automatically triggering an intelligent contract and executing water resource scheduling, transaction management and emergency response operation. According to the invention, the block chain, the Internet of Things and an intelligent optimization algorithm are fused, real-time collection, accurate detection, safe chaining and automatic management of water resource data are realized, and the efficiency and transparency of the intelligent water affair system are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a smart water resource traceability and transaction management system that integrates blockchain technology. Background Art

[0002] With the continuous development of smart cities and the Internet of Things (IoT) technologies, smart water systems are becoming an important tool for urban water resource management. Traditional water management systems rely primarily on centralized data collection and manual scheduling, which presents numerous issues, including non-real-time data collection, information silos, susceptibility to tampering during data storage and transmission, and insufficient trust mechanisms. Existing technologies use various sensors for real-time monitoring of key indicators such as water quality and quantity. However, because data from each monitoring point is often collected and stored independently by different systems, data sharing and integration face significant challenges. Furthermore, traditional systems lack effective data traceability and tracking mechanisms, making it impossible to ensure data integrity and accuracy throughout its lifecycle, leading to significant risks in water resource management and scheduling decisions.

[0003] In recent years, blockchain technology, owing to its decentralized, tamper-proof, and transparent properties, has been increasingly applied to various fields, including water resource management. By putting water utility data on-chain, blockchain technology enables distributed data storage and traceability, thereby improving data security and transparency. However, while blockchain offers a new solution for data storage and traceability, existing technical solutions still have certain shortcomings. For one thing, traditional blockchain systems, when faced with large amounts of real-time data, are susceptible to communication delays and node failures in their data verification and consensus mechanisms. This is especially true when using conventional practical Byzantine fault-tolerant algorithms, which make the inter-node verification process cumbersome and difficult to adapt to the high data volatility and high real-time requirements of the water sector. Furthermore, existing water utility systems rely heavily on traditional statistical and rule-based methods for data anomaly detection, failing to fully utilize multi-dimensional data for comprehensive assessment. This results in a delay in issuing timely and accurate warning signals when anomalies occur, hindering the system's automated response and scheduling decisions.

[0004] At the same time, most consensus mechanisms currently used in blockchain applications still utilize standard practical Byzantine fault-tolerant algorithms. While originally designed to address the problem of malicious or faulty nodes in distributed systems, in practice, particularly within the specific area of ​​water systems, there is still room for improvement. For example, traditional algorithms fail to fully consider the dynamic characteristics of water environment data and water quality anomalies in aspects such as node election, verification threshold setting, and data consistency determination. This results in low consensus efficiency and insufficient system robustness in some cases. Furthermore, the verification criteria for each node in traditional consensus algorithms are relatively simple, failing to dynamically adjust based on the node's actual performance, response speed, and historical reliability. Furthermore, they lack long-term monitoring and prediction of node reputation, making it easy for the poor status of some nodes to affect the stability of the overall consensus and the credibility of the data.

[0005] Therefore, how to provide a smart water resource traceability and transaction management system that integrates blockchain technology is an urgent problem that technical personnel in this field need to solve. Summary of the Invention

[0006] One objective of the present invention is to propose a smart water resource traceability and transaction management system that integrates blockchain technology. The present invention fully utilizes advanced technologies such as Internet of Things data collection, Harris Eagle optimization algorithm, improved practical Byzantine fault-tolerant consensus algorithm, and smart contracts. It describes in detail a complete solution from real-time data collection, anomaly detection, data consensus verification, to secure on-chain and automatic response transaction management. Specifically, the present invention uses IoT sensors to achieve real-time monitoring of key indicators such as water quality and water quantity, and integrates historical monitoring data to form a structured data archive. The Harris Eagle optimization algorithm is used to globally optimize the key parameters of the anomaly detection model, thereby achieving intelligent early warning of anomalies in water data. Furthermore, through the improved practical Byzantine fault-tolerant consensus algorithm, combined with dynamic node election, adaptive verification threshold adjustment, and node reputation prediction mechanism, multi-node cross-validation is performed on the verification data to ensure high consistency and security before the data is uploaded to the blockchain. Finally, the system uses smart contracts to automatically trigger water resource scheduling, transaction management, and emergency response operations. As a result, the present invention has the advantages of high data security, accurate traceability, fast response, and strong system robustness, significantly improving the management level of the smart water system and the efficiency of water resource scheduling.

[0007] The smart water resource traceability and transaction management system integrating blockchain technology according to an embodiment of the present invention includes:

[0008] The data collection and preprocessing module is used to collect and preprocess real-time water service data, and integrate historical monitoring data into structured data archives;

[0009] Parameter optimization and intelligent early warning module, which is used to build anomaly detection models and use the Harris Eagle optimization algorithm to globally adjust model parameters;

[0010] Consensus verification module, which is based on the practical Byzantine fault-tolerant consensus algorithm, through dynamic node election, adaptive verification threshold adjustment and node reputation prediction;

[0011] The secure on-chain and transaction management module is used to securely upload consensus-verified data to the chain, forming tamper-proof data evidence and managing water resource transaction information;

[0012] The automatic response and decision support module is used to automatically trigger smart contracts based on data on the chain and anomaly detection results to perform water resource scheduling, transaction management and emergency response operations.

[0013] Optionally, modules can be connected using the following methods:

[0014] S1. Collect real-time water service data through IoT sensors and pre-process the real-time water service data;

[0015] S2. Store the pre-processed real-time water service data into a temporary database and integrate the system's historical monitoring data to form a structured data archive;

[0016] S3. Build an anomaly detection model using structured data archives and optimize it using the Harris Eagle optimization algorithm, performing global search and dynamic adjustment of key parameters.

[0017] S4. Analyze the real-time data based on the optimized anomaly detection model to generate normal data, abnormal data, and corresponding anomaly detection results;

[0018] S5. Submit normal data and abnormal data to the improved practical Byzantine fault-tolerant consensus algorithm for multi-node verification, cross-confirmation and consistency verification;

[0019] S6. Store the verified data on-chain, using blockchain technology to record the timestamp and traceability information of each data entry, forming an unalterable data evidence.

[0020] S7. Automatically trigger smart contracts based on data on-chain and anomaly detection results to execute water resource scheduling, transaction management, and emergency response operations. All transaction data is recorded, traced, and archived in real time to build a complete closed-loop management system.

[0021] Optionally, the S2 specifically includes:

[0022] S21. Acquire pre-processed real-time water data from multiple water monitoring points and classify and store them according to data collection time, geographic location, and monitoring equipment number. Each piece of real-time water data includes collection time, water volume value, water quality parameters, and monitoring point information.

[0023] S22. Call the system historical data storage module to retrieve historical monitoring data corresponding to the current real-time water service data, and organize the historical data according to the time series. Each piece of historical monitoring data includes the historical collection time, water volume value, water quality parameters and monitoring point information;

[0024] S23. Match and fuse real-time water service data and historical monitoring data, associate the data according to monitoring point location, data category, and timestamp, remove data redundancy and outliers, and standardize the data;

[0025] S24. Based on the matched and fused data, a unified data format is established according to the time dimension, water quality monitoring indicators, water volume values, and monitoring point information to generate a structured data archive;

[0026] S25. The generated structured data is archived and stored in a temporary database, and the data is recorded in a standardized storage format.

[0027] Optionally, the S3 specifically includes:

[0028] S31. Extract the data set from the structured data archive, denoted as D s , where D s ={d s,1 ,d s,2 ,…,d s,N}, N represents the total number of data records in the structured data archive, and each data record d s,k Indicated as d s,k =(T k ,V k ,I k ,L k ), where T k is the acquisition timestamp, V k is the water volume data, I k is the water quality parameter, L k Identify the monitoring point;

[0029] S32, build an anomaly detection model M, the anomaly detection model will each input data d s,k Mapping to predicted output And define the parameter vector to be optimized in the constant detection model as θ=(θ1,θ2,…,θ p ), p represents the total number of parameters;

[0030] S33. Define the objective function J(θ) to quantify the error between the predicted output and the expected output of the anomaly detection model:

[0031]

[0032] Among them, l() represents the loss function used to measure the deviation between the predicted output and the expected output, y k For data record d s,k Expected output:

[0033] S34, initialize the Harris Eagle optimization algorithm and set the initial parameter vector to θ (0) , the initial search step is Δ( 0 ), and set the iteration count t = 0;

[0034] S35, in the tth iteration, the Harris Hawk optimization algorithm is used to optimize the parameter vector θ (t) To update:

[0035] Calculate the update term using the Harris Hawk's pursuit and roundup strategy:

[0036] θ′ (t+1) =θ (t) +r1·(θ best -θ (t) )-r2·(θ (t) -θ rand );

[0037] Among them, θ best is the best parameter vector obtained in the current iteration, θ rand is a vector randomly selected from the parameter space, r1 and r2 are coefficients randomly generated from the interval [0,1], and θ′ (t+1) is the intermediate parameter vector; incorporating chaotic perturbations enhances global search capabilities:

[0038] θ (t+1) =θ′ (t+1) +β·Chaos(x t );

[0039] Among them, β is the preset disturbance coefficient, Chaos(x t ) is a chaotic sequence generated based on logarithmic mapping, θ (t+1) is the parameter vector updated after the t+1th iteration;

[0040] S36. Update the search step size using a dynamic adaptive strategy:

[0041]

[0042] Among them, γ is the step size adjustment coefficient, δ is a small constant to prevent division by zero, J(θ(t) ) and J(θ (t+1) ) are the objective function values ​​at the tth and t+1th iterations, Δ(t) represents the search step size for the tth iteration, and Δ (t+1) represents the search step size of the t+1th iteration;

[0043] S37, judge the convergence condition, when |J(θ (t+1) )-J(θ (t) )|<ε, terminate the iteration, otherwise set t=t+1 and return to step S35;

[0044] S38, determine the optimal parameter vector as θ * =θ (t+1) , update the anomaly detection model M to form the optimized anomaly detection model M * =M(θ * ).

[0045] Optionally, the S4 specifically includes:

[0046] S41. extracting real-time water service data from the structured data archive, and organizing the real-time water service data according to timestamp, monitoring point identifier, water quantity, and water quality;

[0047] S42. Input the extracted real-time water service data into the optimized anomaly detection model, analyze the real-time water service data, and generate a predicted value of the current data by combining historical monitoring data and optimized parameters;

[0048] S43. The optimized anomaly detection model dynamically adjusts the data classification criteria based on the water service characteristics of different monitoring points, evaluates the anomalies of water quantity and water quality parameters, and generates data judgment results based on the baseline values ​​or trend changes set by the system;

[0049] S44. Based on the data determination result, classify the data to generate a normal data set and an abnormal data set, and add an abnormal category label to the abnormal data;

[0050] S45. Perform secondary analysis on the abnormal data set, by comparing historical monitoring trends and adjacent monitoring point data, to confirm whether the abnormality is continuous or locally sudden, and generate abnormality detection results, including abnormality category, severity and potential impact;

[0051] S46. Output normal data, abnormal data and abnormal detection results, and store the judgment information of abnormal data in the abnormal record library.

[0052] Optionally, the S5 specifically includes:

[0053] S51. Extract normal data set D norm With the abnormal data set D anom, give each data record a unique identifier ID and a verification timestamp T v ;

[0054] S52. Construct a data set D to be verified pending , including normal data sets and abnormal data sets;

[0055] S53. Use the improved practical Byzantine fault-tolerant consensus algorithm to verify the data set D pending Perform multi-node verification, and the consensus node set formed by dynamic node election and adaptive threshold adjustment is N consensus , each node in the consensus node set records the data d∈D pending Output verification value V i (d);

[0056] S54. For the verification data record d, the verification values ​​output by all consensus nodes are required to meet the consistency condition:

[0057]

[0058] Among them, τ i is the consensus node n calculated in step S534 i The adaptive verification threshold, κ′ is the global adjustment factor calculated in step S536, min represents the minimum operation, max represents the maximum operation, V i (d) represents consensus node n i The verification value output by the verification data record d, V j (d) represents consensus node n j Verification value output for the verification data record d;

[0059] S55. The data records that have passed the consistency verification constitute the consensus data set D. consensus , and further divided into normal data record set C norm and abnormal data record set C anom :

[0060] C norm ={d∈D consensus |Consensus(d)=0};

[0061] C anom ={d∈D consensus |Consensus(d)=1};

[0062] Among them, Consensus(d) is the decision function;

[0063] S56, record the normal data confirmed by consensus C norm With abnormal data record Canom Stored in the blockchain, it forms an unalterable data certificate.

[0064] Optionally, the S53 specifically includes:

[0065] S531, define the candidate node set as Indicates the total number of candidate nodes participating in the consensus process;

[0066] S532: For each candidate node n i ∈C, calculate the performance score S of the candidate node i :

[0067] S i =σ·R i +τ·H i +μ·U i ;

[0068] Among them, R i Represents candidate node n i Response time score, H i Represents candidate node n i Historical reliability rating, U i Represents candidate node n i The resource utilization score, σ, τ and μ are preset weights;

[0069] S533. Calculate the dynamic election threshold τ of the candidate node performance score based on the water environment fluctuation factor. election :

[0070]

[0071] Among them, mean(S i ) and std(S i ) are the mean and standard deviation of the candidate node performance scores, λ e is the election threshold adjustment coefficient, var(W) represents the variance of the current water affairs data W, var ref is the preset reference variance, is the water environment sensitivity coefficient, and the coefficient that satisfies S i ≥τ election The candidate nodes constitute the consensus node set N consensus ;

[0072] S534. For each consensus node n i ∈N consensus , adjust the adaptive verification threshold τ according to the performance score and water quality abnormality i :

[0073]

[0074] Among them, τ base is the basic verification threshold, η is the performance adjustment coefficient, A(W) represents the current water quality abnormality rate, A ref is the preset reference abnormality rate, μ o is the water quality sensitivity coefficient;

[0075] S535, introduce node reputation prediction mechanism, for each consensus node n i Update the predicted reputation score P i :

[0076]

[0077] in, is the consensus node n i The predicted reputation score of the last update, ζ is the smoothing factor;

[0078] Based on the predicted reputation scores of all consensus nodes, a global adjustment factor is calculated to adjust the consistency verification conditions:

[0079]

[0080] Among them, κ′ represents the global adjustment factor, ρ represents the reputation adjustment coefficient, mean(P i ) represents the average of the predicted reputation scores of all consensus nodes.

[0081] The beneficial effects of the present invention are:

[0082] The smart water resource traceability and transaction management system of the present invention, which integrates blockchain technology, realizes real-time data collection, accurate anomaly detection and secure chain upload by integrating IoT data collection, Harris Eagle optimization algorithm, improved practical Byzantine fault-tolerant consensus algorithm and smart contracts. This system uses IoT sensors arranged at various monitoring points to collect key indicators such as water quality and water quantity, and forms structured data archives through data preprocessing and integration with historical data, effectively solving the problems of information islands and data inconsistency in traditional smart water systems. At the same time, the Harris Eagle optimization algorithm is used to globally optimize the key parameters of the anomaly detection model, so that the system can intelligently evaluate anomalies in water data, issue early warnings in a timely manner, provide a scientific basis for water resource scheduling, and significantly improve the accuracy and response speed of early warnings.

[0083] In the data verification link, the present invention realizes multi-node cross-validation and data consistency confirmation through an improved practical Byzantine fault-tolerant consensus algorithm, combined with dynamic node election, adaptive verification threshold adjustment, and node reputation prediction mechanism. Only data that has been strictly verified can be stored on the chain to ensure the authenticity and non-tamperability of data records. When faced with fluctuations in network node status and dynamic changes in the water environment, the system can still maintain a stable and efficient consensus process, greatly improving the security of data on the chain and the robustness of the system. In addition, the automatic triggering function of the smart contract further realizes the full-process automated management of water resource scheduling, transaction management, and emergency response, improving the operating efficiency and security of the system.

[0084] In summary, this invention, through the integrated application of a series of innovative technologies, not only overcomes the shortcomings of existing smart water systems in data collection, anomaly detection, and data consensus verification, but also enables intelligent management of the entire water resource process through secure data on-chain and automated transaction management. This system boasts significant advantages such as accurate data traceability, rapid response, secure verification, and strong system robustness. It provides a new, efficient, transparent, and intelligent solution for water resource management, with broad application prospects and promotional value. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0086] Figure 1 This is a flowchart of the smart water resource traceability and transaction management system that integrates blockchain technology proposed in this invention;

[0087] Figure 2 This is a flowchart of the improved practical Byzantine fault-tolerant consensus algorithm module of the smart water resources traceability and transaction management system proposed by the present invention that integrates blockchain technology. DETAILED DESCRIPTION

[0088] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.

[0089] refer to Figure 1 and Figure 2 , a smart water resource traceability and transaction management system integrating blockchain technology, including:

[0090] The data collection and preprocessing module is used to collect and preprocess real-time water service data, and integrate historical monitoring data into structured data archives;

[0091] Parameter optimization and intelligent early warning module, which is used to build anomaly detection models and use the Harris Eagle optimization algorithm to globally adjust model parameters;

[0092] Consensus verification module, which is based on the practical Byzantine fault-tolerant consensus algorithm, through dynamic node election, adaptive verification threshold adjustment and node reputation prediction;

[0093] The secure on-chain and transaction management module is used to securely upload consensus-verified data to the chain, forming tamper-proof data evidence and managing water resource transaction information;

[0094] The automatic response and decision support module is used to automatically trigger smart contracts based on data on the chain and anomaly detection results to perform water resource scheduling, transaction management and emergency response operations.

[0095] In this embodiment, the modules are connected through the following methods:

[0096] S1. Collect real-time water service data through IoT sensors and pre-process the real-time water service data;

[0097] S2. Store the pre-processed real-time water service data into a temporary database and integrate the system's historical monitoring data to form a structured data archive;

[0098] S3. Build an anomaly detection model using structured data archives and optimize it using the Harris Eagle optimization algorithm, performing global search and dynamic adjustment of key parameters.

[0099] S4. Analyze the real-time data based on the optimized anomaly detection model to generate normal data, abnormal data, and corresponding anomaly detection results;

[0100] S5. Submit normal data and abnormal data to the improved practical Byzantine fault-tolerant consensus algorithm for multi-node verification, cross-confirmation and consistency verification;

[0101] S6. Store the verified data on-chain, using blockchain technology to record the timestamp and traceability information of each data entry, forming an unalterable data evidence.

[0102] S7. Automatically trigger smart contracts based on data on-chain and anomaly detection results to execute water resource scheduling, transaction management, and emergency response operations. All transaction data is recorded, traced, and archived in real time to build a complete closed-loop management system.

[0103] In this embodiment, S2 specifically includes:

[0104] S21. Acquire pre-processed real-time water data from multiple water monitoring points and classify and store them according to data collection time, geographic location, and monitoring equipment number. Each piece of real-time water data includes collection time, water volume value, water quality parameters, and monitoring point information.

[0105] S22. Call the system historical data storage module to retrieve historical monitoring data corresponding to the current real-time water service data, and organize the historical data according to the time series. Each piece of historical monitoring data includes the historical collection time, water volume value, water quality parameters and monitoring point information;

[0106] S23. Match and fuse real-time water service data and historical monitoring data, associate the data according to monitoring point location, data category, and timestamp, remove data redundancy and outliers, and standardize the data;

[0107] S24. Based on the matched and fused data, a unified data format is established according to the time dimension, water quality monitoring indicators, water volume values, and monitoring point information to generate a structured data archive;

[0108] S25. The generated structured data is archived and stored in a temporary database, and the data is recorded in a standardized storage format.

[0109] In this embodiment, S3 specifically includes:

[0110] S31. Extract the data set from the structured data archive, denoted as D s , where D s ={d s,1 ,d s,2 ,…,d s,N}, N represents the total number of data records in the structured data archive, and each data record d s,k Indicated as d s,k =(T k ,V k ,I k ,L k ), where T k is the acquisition timestamp, V k is the water volume data, I k is the water quality parameter, L k Identify the monitoring point;

[0111] S32, build an anomaly detection model M, the anomaly detection model will each input data d s,k Mapping to predicted output And define the parameter vector to be optimized in the constant detection model as θ=(θ1,θ2,…,θ p ), p represents the total number of parameters;

[0112] S33. Define the objective function J(θ) to quantify the error between the predicted output and the expected output of the anomaly detection model:

[0113]

[0114] Among them, l() represents the loss function used to measure the deviation between the predicted output and the expected output, y k For data record d s,k Expected output:

[0115] S34, initialize the Harris Eagle optimization algorithm and set the initial parameter vector to θ (0) , the initial search step is Δ( 0 ), and set the iteration count t = 0;

[0116] S35, in the tth iteration, the Harris Hawk optimization algorithm is used to optimize the parameter vector θ (t) To update:

[0117] Calculate the update term using the Harris Hawk's pursuit and roundup strategy:

[0118] θ′ (t+1) =θ (t) +r1·(θ best -θ (t) )-r2·(θ (t) -θ rand );

[0119] Among them, θ best is the best parameter vector obtained in the current iteration, θ rand is a vector randomly selected from the parameter space, r1 and r2 are coefficients randomly generated from the interval [0,1], and θ′ (t+1) is the intermediate parameter vector; incorporating chaotic perturbations enhances global search capabilities:

[0120] θ (t+1) =θ′ (t+1) +β·Chaos(x t );

[0121] Among them, β is the preset disturbance coefficient, Chaos(x t ) is a chaotic sequence generated based on logarithmic mapping, θ (t+1) is the parameter vector updated after the t+1th iteration;

[0122] S36. Update the search step size using a dynamic adaptive strategy:

[0123]

[0124] Among them, γ is the step size adjustment coefficient, δ is a small constant to prevent division by zero, J(θ(t) ) and J(θ (t+1) ) are the objective function values ​​at the tth and t+1th iterations, Δ(t) represents the search step size for the tth iteration, and Δ (t+1) represents the search step size of the t+1th iteration;

[0125] S37, judge the convergence condition, when |J(θ (t+1) )-J(θ (t) )|<ε, terminate the iteration, otherwise set t=t+1 and return to step S35;

[0126] S38, determine the optimal parameter vector as θ * =θ (t+1) , update the anomaly detection model M to form the optimized anomaly detection model M * =M(θ * ).

[0127] In this embodiment, the S4 specifically includes:

[0128] S41. extracting real-time water service data from the structured data archive, and organizing the real-time water service data according to timestamp, monitoring point identifier, water quantity, and water quality;

[0129] S42. Input the extracted real-time water service data into the optimized anomaly detection model, analyze the real-time water service data, and generate a predicted value of the current data by combining historical monitoring data and optimized parameters;

[0130] S43. The optimized anomaly detection model dynamically adjusts the data classification criteria based on the water service characteristics of different monitoring points, evaluates the anomalies of water quantity and water quality parameters, and generates data judgment results based on the baseline values ​​or trend changes set by the system;

[0131] S44. Based on the data determination result, classify the data to generate a normal data set and an abnormal data set, and add an abnormal category label to the abnormal data;

[0132] S45. Perform secondary analysis on the abnormal data set, by comparing historical monitoring trends and adjacent monitoring point data, to confirm whether the abnormality is continuous or locally sudden, and generate abnormality detection results, including abnormality category, severity and potential impact;

[0133] S46. Output normal data, abnormal data and abnormal detection results, and store the judgment information of abnormal data in the abnormal record library.

[0134] In this embodiment, the S5 specifically includes:

[0135] S51. Extract normal data set D norm With the abnormal data set Danom , give each data record a unique identifier ID and a verification timestamp T v ;

[0136] S52. Construct a data set D to be verified pending , including normal data sets and abnormal data sets;

[0137] S53. Use the improved practical Byzantine fault-tolerant consensus algorithm to verify the data set D pending Perform multi-node verification, and the consensus node set formed by dynamic node election and adaptive threshold adjustment is N consensus , each node in the consensus node set records the data d∈D pending Output verification value V i (d);

[0138] S54. For the verification data record d, the verification values ​​output by all consensus nodes are required to meet the consistency condition:

[0139]

[0140] Among them, τ i is the consensus node n calculated in step S534 i The adaptive verification threshold, κ′ is the global adjustment factor calculated in step S536, min represents the minimum operation, max represents the maximum operation, V i (d) represents consensus node n i The verification value output by the verification data record d, V j (d) represents consensus node n j Verification value output for the verification data record d;

[0141] S55. The data records that have passed the consistency verification constitute the consensus data set D. consensus , and further divided into normal data record set C norm and abnormal data record set C anom :

[0142] C norm ={d∈D consensus |Consensus(d)=0};

[0143] C anom ={d∈D consensus |Consensus(d)=1};

[0144] Among them, Consensus(d) is the decision function;

[0145] S56, record the normal data confirmed by consensus C normWith abnormal data record C anom Stored in the blockchain, it forms an unalterable data certificate.

[0146] In this embodiment, the S53 specifically includes:

[0147] S531, define the candidate node set as Indicates the total number of candidate nodes participating in the consensus process;

[0148] S532: For each candidate node n i ∈C, calculate the performance score S of the candidate node i :

[0149] S i =σ·R i +τ·H i +μ·U i ;

[0150] Among them, R i Represents candidate node n i Response time score, H i Represents candidate node n i Historical reliability rating, U i Represents candidate node n i The resource utilization score, σ, τ and μ are preset weights;

[0151] S533. Calculate the dynamic election threshold τ of the candidate node performance score based on the water environment fluctuation factor. election :

[0152]

[0153] Among them, mean(S i ) and std(S i ) are the mean and standard deviation of the candidate node performance scores, λ e is the election threshold adjustment coefficient, var(W) represents the variance of the current water affairs data W, var ref is the preset reference variance, is the water environment sensitivity coefficient, and the coefficient that satisfies S i ≥τ election The candidate nodes constitute the consensus node set N consensus ;

[0154] S534. For each consensus node n i ∈N consensus , adjust the adaptive verification threshold τ according to the performance score and water quality abnormality i :

[0155]

[0156] Among them, τ base is the basic verification threshold, η is the performance adjustment coefficient, A(W) represents the current water quality abnormality rate, A ref is the preset reference abnormality rate, μ o is the water quality sensitivity coefficient;

[0157] S535, introduce node reputation prediction mechanism, for each consensus node n i Update the predicted reputation score P i :

[0158]

[0159] in, is the consensus node n i The predicted reputation score of the last update, ζ is the smoothing factor;

[0160] Based on the predicted reputation scores of all consensus nodes, a global adjustment factor is calculated to adjust the consistency verification conditions:

[0161]

[0162] Among them, κ′ represents the global adjustment factor, ρ represents the reputation adjustment coefficient, mean(P i ) represents the average of the predicted reputation scores of all consensus nodes.

[0163] Example 1:

[0164] In order to verify the feasibility of the present invention in implementation, the present invention is applied to the smart water management of a coastal city, which has faced problems in recent years such as untimely water resource scheduling, inaccurate water quality monitoring data, and opaque transaction information. Traditional water systems mainly rely on centralized data collection and manual scheduling. Not only are there problems with data collection delays, information islands, and data sharing difficulties, but data is also susceptible to human or system failures during transmission and storage, resulting in data being easily tampered with, making it difficult to achieve efficient traceability management and intelligent scheduling. To solve the above problems, the present invention proposes a smart water resource traceability and transaction management system that integrates blockchain technology. It realizes real-time data collection, precise anomaly detection, multi-node consensus verification of data, and secure on-chaining in the project pilot area, and automatically triggers water resource scheduling and transaction management through smart contracts, thereby realizing intelligent, automated, and transparent water management.

[0165] In the pilot project, the system installed high-precision IoT sensors in major water supply networks, industrial parks, and some residential areas. Through the data acquisition and preprocessing module, it collected real-time data on key indicators such as water quality, water quantity, and flow rate, and performed noise filtering, data cleaning, and normalization on the data. At the same time, the system integrated historical monitoring data from the past three years to form a unified structured data archive, providing standardized data input for subsequent anomaly detection and data consensus. Through the parameter optimization and intelligent early warning module, the system used the Harris Eagle optimization algorithm to globally adjust the parameters of the anomaly detection model, enabling the model to fully capture subtle changes in water quality and quantity, thereby promptly detecting water quality anomalies and sudden changes in water quantity. After six months of continuous operation and analysis of monitoring data, the system's accuracy in detecting abnormal events reached over 98%, and the early warning response time was reduced from an average of 15 minutes using traditional methods to less than 5 minutes.

[0166] In terms of data consensus verification, this system utilizes an improved practical Byzantine fault-tolerant consensus algorithm, combined with dynamic node election, adaptive verification threshold adjustment, and a node reputation prediction mechanism. This system performs multi-node cross-validation on the data being verified, ensuring that the data undergoes rigorous consistency checks before being uploaded to the blockchain. The improved consensus algorithm selects high-performance consensus nodes and dynamically adjusts verification standards based on water environment fluctuations and water quality anomalies, ensuring highly consistent verification results across consensus nodes. System testing has reduced data verification latency from an average of 15 seconds to 8 seconds, with a consistency verification compliance rate exceeding 99.5%. Consensus-verified data is securely stored in the blockchain, forming an immutable data repository, providing a solid data foundation for subsequent water resource trading management and scheduling decisions.

[0167] Table 1 Comparison of water management performance before and after system implementation

[0168]

[0169] This table visually illustrates the changes in key water management performance indicators before and after the system's implementation, highlighting the significant advantages of the proposed system in improving data collection accuracy, shortening exception response time, reducing verification latency, and enhancing consensus consistency. The table shows that while the traditional system's data collection accuracy was only 85%, the proposed system, with the implementation of IoT sensors and preprocessing modules, achieved 98%. This demonstrates that through efficient data cleaning and fusion, the system effectively eliminates information silos and provides an accurate data foundation for subsequent anomaly detection.

[0170] In terms of anomaly detection, traditional systems have a long response time, requiring an average of 15 minutes to issue an early warning. However, the system proposed in this paper uses the Harris Eagle optimization algorithm to achieve global optimization of anomaly detection model parameters, significantly reducing response time to less than 5 minutes, increasing response speed by approximately 70%, and significantly improving the real-time and security of water resource scheduling. Regarding data verification latency, this system uses an improved practical Byzantine fault-tolerant consensus algorithm, combined with dynamic node election and adaptive threshold adjustment, to reduce verification latency from 15 seconds to 8 seconds, increasing verification efficiency by approximately 47%, further ensuring the consistency and reliability of data before it is uploaded to the blockchain.

[0171] Furthermore, the average daily data volume has increased from 4,000 to 5,000, demonstrating a significant improvement in the system's data collection capabilities, enabling it to cover a wider monitoring area and provide more comprehensive information support. Consensus verification consistency has increased from 95% to 99.5%, demonstrating the improved consensus mechanism's outstanding performance in ensuring highly consistent node verification results, providing solid data support for water resource traceability and transaction management.

[0172] Overall, the data in this table fully demonstrates that the system of the present invention has achieved significant improvements in data collection, anomaly detection, consensus verification, and on-chain storage. The system not only significantly improves data accuracy and real-time performance, but also ensures data security and immutability through an intelligent consensus mechanism, providing a reliable basis for water management scheduling decisions and significantly enhancing management efficiency and transparency. These improvements effectively address the information silos, data latency, and inconsistencies that exist in traditional smart water management, demonstrating the significant advantages and broad application prospects of the present invention in practical applications.

[0173] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. The smart water resource traceability and transaction management system integrating blockchain technology is characterized by: include: The data collection and preprocessing module is used to collect and preprocess real-time water service data, and integrate historical monitoring data into structured data archives; Parameter optimization and intelligent early warning module, which is used to build anomaly detection models and use the Harris Eagle optimization algorithm to globally adjust model parameters; Consensus verification module, which is based on the practical Byzantine fault-tolerant consensus algorithm, through dynamic node election, adaptive verification threshold adjustment and node reputation prediction; The secure on-chain and transaction management module is used to securely upload consensus-verified data to the chain, forming tamper-proof data evidence and managing water resource transaction information; The automatic response and decision support module is used to automatically trigger smart contracts based on data on the chain and anomaly detection results to perform water resource scheduling, transaction management and emergency response operations.

2. The smart water resource traceability and transaction management system integrating blockchain technology according to claim 1 is characterized in that: The modules are implemented as follows: S1. Collect real-time water service data through IoT sensors and pre-process the real-time water service data; S2. Store the pre-processed real-time water service data into a temporary database and integrate the system's historical monitoring data to form a structured data archive; S3. Build an anomaly detection model using structured data archives and optimize it using the Harris Eagle optimization algorithm, performing global search and dynamic adjustment of key parameters. S4. Analyze the real-time data based on the optimized anomaly detection model to generate normal data, abnormal data, and corresponding anomaly detection results; S5. Submit normal data and abnormal data to the improved practical Byzantine fault-tolerant consensus algorithm for multi-node verification, cross-confirmation and consistency verification; S6. Store the verified data on-chain, using blockchain technology to record the timestamp and traceability information of each data entry, forming an unalterable data evidence. S7. Automatically trigger smart contracts based on data on-chain and anomaly detection results to execute water resource scheduling, transaction management, and emergency response operations. All transaction data is recorded, traced, and archived in real time to build a complete closed-loop management system.

3. The smart water resource traceability and transaction management system integrating blockchain technology according to claim 2 is characterized in that: The S2 specifically includes: S21. Acquire pre-processed real-time water data from multiple water monitoring points and classify and store them according to data collection time, geographic location, and monitoring equipment number. Each piece of real-time water data includes collection time, water volume value, water quality parameters, and monitoring point information. S22. Call the system historical data storage module to retrieve historical monitoring data corresponding to the current real-time water service data, and organize the historical data according to the time series. Each piece of historical monitoring data includes the historical collection time, water volume value, water quality parameters and monitoring point information; S23. Match and fuse real-time water service data and historical monitoring data, associate the data according to monitoring point location, data category, and timestamp, remove data redundancy and outliers, and standardize the data; S24. Based on the matched and fused data, a unified data format is established according to the time dimension, water quality monitoring indicators, water volume values, and monitoring point information to generate a structured data archive; S25. The generated structured data is archived and stored in a temporary database, and the data is recorded in a standardized storage format.

4. The smart water resource traceability and transaction management system integrating blockchain technology according to claim 2 is characterized in that: The S3 specifically includes: S31. Extract the data set from the structured data archive, denoted as D s , where D s ={d s,1 ,d s,2 ,…,d s,N }, N represents the total number of data records in the structured data archive, and each data record d s,k Indicated as d s,k =(T k ,V k ,I k ,L k ), where T k is the acquisition timestamp, V k is the water volume data, I k is the water quality parameter, L k Identify the monitoring point; S32, build an anomaly detection model M, the anomaly detection model will each input data d s,k Mapping to predicted output And define the parameter vector to be optimized in the constant detection model as θ=(θ1,θ2,…,θ p ), p represents the total number of parameters; S33. Define the objective function J(θ) to quantify the error between the predicted output and the expected output of the anomaly detection model: in, represents the loss function used to measure the deviation between the predicted output and the expected output, y k For data record d s,k Expected output: S34, initialize the Harris Eagle optimization algorithm and set the initial parameter vector to θ (0) , the initial search step is Δ( 0 ), and set the iteration count t = 0; S35, in the tth iteration, the Harris Hawk optimization algorithm is used to optimize the parameter vector θ (t) To update: Calculate the update term using the Harris Hawk's pursuit and roundup strategy: θ′ (t+1) =θ (t) +r1·(θ best -θ (t) )-r2·(θ (t) -θ rand ); Among them, θ best is the best parameter vector obtained in the current iteration, θ rand is a vector randomly selected from the parameter space, r1 and r2 are coefficients randomly generated from the interval [0,1], and θ′ (t+1) is the intermediate parameter vector; Incorporating chaotic perturbations to enhance global search capabilities: i (t+1) =θ′ (t+1) +β·Chaos(x t ); Among them, β is the preset disturbance coefficient, Chaos(x t ) is a chaotic sequence generated based on logarithmic mapping, θ (t+1) is the parameter vector updated after the t+1th iteration; S36. Update the search step size using a dynamic adaptive strategy: Among them, γ is the step size adjustment coefficient, δ is a small constant to prevent division by zero, J(θ (t) ) and J(θ (t+1) ) are the objective function values ​​at the tth and t+1th iterations, Δ(t) represents the search step size for the tth iteration, and Δ (t+1) represents the search step size of the t+1th iteration; S37, judge the convergence condition, when |J(θ (t+1) )-J(θ (t) )|<ε, terminate the iteration, otherwise set t=t+1 and return to step S35; S38, determine the optimal parameter vector as θ * =θ (t+1) , update the anomaly detection model M to form the optimized anomaly detection model M * =M(θ * ).

5. The smart water resource traceability and transaction management system integrating blockchain technology according to claim 2 is characterized in that: The S4 specifically includes: S41. extracting real-time water service data from the structured data archive, and organizing the real-time water service data according to timestamp, monitoring point identifier, water quantity, and water quality; S42. Input the extracted real-time water service data into the optimized anomaly detection model, analyze the real-time water service data, and generate a predicted value of the current data by combining historical monitoring data and optimized parameters; S43. The optimized anomaly detection model dynamically adjusts the data classification criteria based on the water service characteristics of different monitoring points, evaluates the anomalies of water quantity and water quality parameters, and generates data judgment results based on the baseline values ​​or trend changes set by the system; S44. Based on the data determination result, classify the data to generate a normal data set and an abnormal data set, and add an abnormal category label to the abnormal data; S45. Perform secondary analysis on the abnormal data set, by comparing historical monitoring trends and adjacent monitoring point data, to confirm whether the abnormality is continuous or locally sudden, and generate abnormality detection results, including abnormality category, severity and potential impact; S46. Output normal data, abnormal data and abnormal detection results, and store the judgment information of abnormal data in the abnormal record library.

6. The smart water resource traceability and transaction management system integrating blockchain technology according to claim 2 is characterized in that: The S5 specifically includes: S51. Extract normal data set D norm With the abnormal data set D anom , give each data record a unique identifier ID and a verification timestamp T v ; S52. Construct a data set D to be verified pending , including normal data sets and abnormal data sets; S53. Use the improved practical Byzantine fault-tolerant consensus algorithm to verify the data set D pending Perform multi-node verification, and the consensus node set formed by dynamic node election and adaptive threshold adjustment is N consensus , each node in the consensus node set records the data d∈D pending Output verification value V i (d); S54. For the verification data record d, the verification values ​​output by all consensus nodes are required to meet the consistency condition: Among them, τ i is the consensus node n calculated in step S534 i The adaptive verification threshold, κ′ is the global adjustment factor calculated in step S536, min represents the minimum operation, max represents the maximum operation, V i (d) represents consensus node n i The verification value output by the verification data record d is V j (d) represents consensus node n j Verification value output for the verification data record d; S55. The data records that have passed the consistency verification constitute the consensus data set D. consensus , and further divided into normal data record set C norm and abnormal data record set C anom : C norm ={d∈D consensus ∣Consensus(d)=0}; C anom ={d∈D consensus ∣Consensus(d)=1}; Among them, Consensus(d) is the decision function; S56, record the normal data confirmed by consensus C norm With abnormal data record C anom Stored in the blockchain, it forms an unalterable data certificate.

7. The smart water resource traceability and transaction management system integrating blockchain technology according to claim 6 is characterized in that: The S53 specifically includes: S531, define the candidate node set as Indicates the total number of candidate nodes participating in the consensus process; S532: For each candidate node n i ∈C, calculate the performance score S of the candidate node i : S i =σ·R i +t·H i +μ·U i ; Among them, R i Represents candidate node n i Response time score, H i Represents candidate node n i Historical reliability rating, U i Represents candidate node n i The resource utilization score, σ, τ and μ are preset weights; S533. Calculate the dynamic election threshold τ of the candidate node performance score based on the water environment fluctuation factor. election : Among them, mean(S i ) and std(S i ) are the mean and standard deviation of the candidate node performance scores, λ e is the election threshold adjustment coefficient, var(W) represents the variance of the current water affairs data W, var ref is the preset reference variance, is the water environment sensitivity coefficient, and the coefficient that satisfies S i ≥τ election The candidate nodes constitute the consensus node set N consensus ; S534. For each consensus node n i ∈N consensus , adjust the adaptive verification threshold τ according to the performance score and water quality abnormality i : Among them, τ base is the basic verification threshold, η is the performance adjustment coefficient, A(W) represents the current water quality abnormality rate, A ref is the preset reference abnormality rate, μ o is the water quality sensitivity coefficient; S535, introduce node reputation prediction mechanism, for each consensus node n i Update the predicted reputation score P i : in, is the consensus node n i The predicted reputation score of the last update, ζ is the smoothing factor; Based on the predicted reputation scores of all consensus nodes, a global adjustment factor is calculated to adjust the consistency verification conditions: Among them, κ′ represents the global adjustment factor, ρ represents the reputation adjustment coefficient, mean(P i ) represents the average of the predicted reputation scores of all consensus nodes.

Citation Information

Cited By

  • Internet of Things data evidence storage control method and device, block chain gateway equipment and computer program product

    CN121711083A

  • Hydrological sequence missing data complementation and trend prediction system and method

    CN121958786A