Intelligent decision generation method and device for water supply projects
By processing multi-source heterogeneous data and using large language models, combined with a retrieval-enhanced generation system and knowledge graphs, the shortcomings of traditional water supply engineering systems in data processing and decision-making have been addressed, achieving efficient and intelligent decision generation and improving the system's reliability and operational efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional water supply engineering systems cannot effectively process unstructured and semi-structured data, rely on manual scheduling and simple control algorithms, resulting in low prediction accuracy, low operation and maintenance efficiency, high human error rate, and a lack of traceability and security in decision-making.
By employing multi-source heterogeneous data processing, combining large language models (LLM) and deep neural networks, and using a retrieval-enhanced generation system (RAG) and knowledge graphs for intelligent decision generation, we can achieve data preprocessing, anomaly detection, and decision strategy determination.
It improves the accuracy of anomaly detection, shortens fault response time, improves operational efficiency, ensures the traceability of decision-making strategies, and enhances system reliability and user trust.
Smart Images

Figure CN121365322B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent water supply engineering technology, and specifically relates to an intelligent decision generation method and device for water supply engineering. Background Technology
[0002] Currently, water supply engineering systems mainly rely on traditional Supervisory Control and Data Acquisition (SCADA) systems for monitoring and management.
[0003] The technical characteristics of traditional water supply engineering systems include: 1. Monitoring relies on real-time data collected through SCADA systems, primarily monitoring structured data such as pressure and flow. It cannot effectively process unstructured data, such as text data like maintenance reports, inspection logs, user complaints, and expert advice; image data like pipeline photos, water turbidity images, and equipment status pictures; voice data like voice commands, telephone repair requests, and on-site reports; and semi-structured data like weather forecasts and social event information. 2. Control is primarily manual, supplemented by simple proportional-integral-differential (PID) control algorithms. Water supply condition prediction relies on historical experience and simple statistical models, achieving a prediction accuracy of only 60-70%, which is relatively low. The operation and maintenance model uses periodic inspections plus fault response, resulting in a long average fault response time of approximately 2-8 hours. 3. The human-machine interaction is outdated. Existing systems require specialized technicians to operate through complex SCADA interfaces, making them difficult for ordinary management and maintenance personnel to use. Specifically, this manifests in several ways: the system requires memorizing numerous equipment numbers and parameter settings; fault diagnosis relies heavily on expert experience, making it difficult for beginners to learn; it cannot query equipment status and historical data using natural language; and it lacks intelligent decision-making suggestions, requiring all decisions to be made manually. This leads to low system operation and maintenance efficiency, high training costs, and a high rate of human error; 4. Decision-making lacks traceability and security. As a critical infrastructure, the security and traceability of control decisions are paramount for water supply engineering systems. Existing water supply engineering systems suffer from: the potential for operation logs to be tampered with or deleted; a lack of complete reasoning process records for critical decisions; unclear responsibilities when multiple departments collaborate; and failure to meet regulatory requirements for critical infrastructure. Summary of the Invention
[0004] To address the aforementioned problems, embodiments of the present invention provide a method and apparatus for generating intelligent decisions for water supply projects.
[0005] In a first aspect, embodiments of the present invention provide an intelligent decision-making generation method for water supply projects, comprising:
[0006] Acquire multi-source heterogeneous data from the same area and time period of a water supply project. The multi-source heterogeneous data includes M sets of input data, where M is a positive integer.
[0007] The M sets of input data are preprocessed to obtain M sets of feature vectors;
[0008] Based on the M sets of feature vectors, anomaly detection is performed to obtain anomaly detection results;
[0009] If the anomaly judgment result includes the target anomaly, then the M sets of feature vectors are fused to obtain a fused feature vector;
[0010] Acquire prompts for Retrieval-Augmented Generation (RAG) systems, knowledge graphs, and preferred Large Language Models (LLMs) in the field of water supply engineering;
[0011] Based on the target information and the prompts for the preferred LLM, each processing step is performed on the preferred LLM to obtain the first processing result corresponding to each processing step. The target information includes the RAG system, the knowledge graph, the anomaly judgment result, and the fusion feature vector.
[0012] If the first processing result cannot pass manual review, then based on the target information and the obtained alternative LLMs, each processing step is performed on the alternative LLMs to obtain the second processing result corresponding to each processing step. The parameter size of the alternative LLMs is larger than the parameter size of the preferred LLM.
[0013] Based on the second processing result, a decision-making strategy for the water supply project is determined using a deep neural network.
[0014] Secondly, embodiments of the present invention provide an intelligent decision-making generation device for water supply projects, comprising:
[0015] The multi-source heterogeneous data acquisition module is used to acquire multi-source heterogeneous data from the same area and time period of the water supply project. The multi-source heterogeneous data includes M sets of input data, where M is a positive integer.
[0016] The data preprocessing module is used to preprocess the M sets of input data respectively to obtain M sets of feature vectors;
[0017] The anomaly detection module is used to perform anomaly detection based on the M sets of feature vectors and obtain anomaly detection results.
[0018] The feature vector fusion module is used to fuse the M sets of feature vectors to obtain a fused feature vector if the anomaly judgment result includes the target anomaly.
[0019] The target acquisition module is used to acquire prompts from the retrieval enhancement generation system, knowledge graph, and preferred large language model in the field of water supply engineering.
[0020] The first processing module is used to perform various processing steps based on the preferred large language model according to the target information and the prompt instructions of the preferred large language model, and to obtain the first processing result corresponding to each processing step. The target information includes the retrieval enhancement generation system, the knowledge graph, the anomaly judgment result, and the fusion feature vector.
[0021] The second processing module is used to perform various processing steps based on the target information and the obtained candidate large language model with prompting instructions if the first processing result cannot pass the manual review, so as to obtain the second processing result corresponding to each processing step.
[0022] The decision strategy determination module is used to determine the decision strategy of the water supply project based on the second processing result and a deep neural network.
[0023] Thirdly, embodiments of the present invention provide an electronic device, comprising:
[0024] The system includes a memory and a processor, which communicate with each other via a bus; the memory stores program instructions that can be executed by the processor, which can invoke the program instructions to perform the steps of the method described in the first aspect and various possible implementations.
[0025] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect and various possible implementations.
[0026] Fifthly, embodiments of the present invention provide a computer program product containing instructions that, when the computer program product is run on a computer, cause the steps of the method described in the first aspect and various possible implementations to be executed by the computer.
[0027] The beneficial effects of the technical solution provided by the embodiments of the present invention are as follows: by fusing multimodal (i.e., multi-source heterogeneous) data and combining intelligent processing with LLM, the accuracy of anomaly detection is improved; the fault response time is shortened; operational efficiency is improved; blockchain records ensure the traceability of decision-making strategies and improve the reliability of water supply engineering systems; and the reasoning process provides detailed explanations, enhancing user trust. Attached Figure Description
[0028] Figure 1A flowchart illustrating an intelligent decision-making generation method for a water supply project provided in an embodiment of the present invention;
[0029] Figure 2 A schematic block diagram of an intelligent decision-making generation device for a water supply project provided in an embodiment of the present invention;
[0030] Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0032] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0033] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0034] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if monitoring (the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when monitoring (the stated condition or event)," or "in response to monitoring (the stated condition or event)."
[0035] Traditional water supply engineering systems cannot effectively process unstructured data, such as: text data like maintenance reports, inspection logs, user complaints, and expert advice; image data like pipeline photos, water turbidity images, and equipment status pictures; voice data like voice commands, telephone repair requests, and on-site reports; and semi-structured data like weather forecasts and social event information. Control methods are primarily manual, supplemented by simple PID control algorithms; water supply status prediction relies on historical experience and simple statistical models, with a prediction accuracy of only 60-70%, which is relatively low; the operation and maintenance model uses periodic inspections plus fault response, resulting in a long average fault response time of approximately 2-8 hours, which is excessively long; and the human-machine interaction methods are outdated. Existing systems require professional technicians to operate through complex SCADA interfaces, making them difficult for ordinary management and maintenance personnel to use. Specifically, this manifests as: needing to memorize a large number of equipment numbers and parameter settings; fault diagnosis relying on expert experience, making it difficult for beginners to learn; inability to query equipment status and historical data via natural language; and a lack of intelligent decision-making suggestions, requiring all decisions to be made manually. This leads to low system operation and maintenance efficiency, high training costs, high human error rates, and a lack of traceability and security in decision-making. As a critical infrastructure, the security and traceability of control decisions are of paramount importance for water supply engineering systems. Existing water supply engineering systems suffer from several issues, including: operational logs may be tampered with or deleted; critical decisions lack complete records of the reasoning process; responsibilities are unclear when multiple departments collaborate; and they do not meet regulatory requirements for critical infrastructure.
[0036] In view of this, embodiments of the present invention provide a flowchart of an intelligent decision-making generation method for water supply projects. The flowchart is as follows: Figure 1 As shown. Figure 1 The method, as shown in the figure, may include the following steps:
[0037] Step 101: Obtain multi-source heterogeneous data from the same area and time period of the water supply project. The multi-source heterogeneous data includes M sets of input data, where M is a positive integer.
[0038] Step 102: Preprocess the M sets of input data to obtain M sets of feature vectors.
[0039] Step 103: Based on the M sets of feature vectors, perform anomaly detection and obtain the anomaly detection results.
[0040] Step 104: If the anomaly judgment result includes the target anomaly, then fuse the M groups of feature vectors to obtain the fused feature vector.
[0041] Step 105: Obtain the RAG system, knowledge graph, and preferred LLM prompts for the water supply engineering field.
[0042] Step 106: Based on the target information and the prompts from the preferred LLM, perform each processing step according to the preferred LLM and obtain the first processing result corresponding to each processing step. The target information includes the RAG system, knowledge graph, anomaly judgment result, and fused feature vector.
[0043] Step 107: If the first processing result cannot pass the manual review, then based on the target information and the obtained alternative LLMs, perform each processing step according to the alternative LLMs to obtain the second processing result corresponding to each processing step.
[0044] Step 108: Based on the second processing result, determine the decision-making strategy for the water supply project using a deep neural network.
[0045] The following describes in detail each step of the above process and the effects that can be further produced, with reference to the embodiments of the present invention. It should be noted that the terms "first" and "second" involved in the embodiments of the present invention do not have limitations in terms of size, order, or quantity, but are only used to distinguish them by name. For example, "first abnormal score" and "second abnormal score" are used to distinguish two different abnormal scores.
[0046] First, the above step 101, namely "acquiring multi-source heterogeneous data from the same area and time period of the water supply project, wherein the multi-source heterogeneous data includes M sets of input data, where M is a positive integer", will be described in detail with reference to the embodiments of the present invention.
[0047] In this embodiment of the invention, a physical device layer is deployed, which includes the execution equipment for the water supply project. For example, intelligent water pumps, employing frequency conversion control technology, can precisely control the water supply according to actual needs. Electric valves are driven by precision stepper motors to ensure rapid and accurate flow regulation. Pressurization equipment is equipped with an intelligent pressure regulation system, which can dynamically adjust the water supply pressure according to the actual needs of the pipe network. Water treatment equipment includes multiple treatment modules such as coagulation, sedimentation, filtration, and disinfection, supporting online real-time monitoring to ensure stable and compliant effluent quality. A sensing layer is also deployed, responsible for multi-source heterogeneous data acquisition. This layer deploys 2500 pressure sensors, over 800 flow sensors, over 200 water quality sensors, a group of smart water meters, and an environmental monitoring station to provide environmental data support for water supply project system decision-making. Specifically, pressure sensors are used to sense changes in water supply pressure, flow sensors to sense changes in water supply flow, water quality sensors to sense whether the effluent quality meets standards, smart water meters to sense changes in water usage flow, and environmental monitoring stations to sense meteorological changes.
[0048] In this embodiment of the invention, the M sets of input data may include structured data, unstructured data, and semi-structured data. Structured data may include pressure sensor data, flow sensor data, water quality sensor data, and smart water meter group data. Unstructured data may include text data, visual data, and audio data. Semi-structured data may include meteorological data and structured knowledge of water supply engineering networks. The data lake storage uses the TimescaleDB time-series database to store time-series data, such as pressure sensor data; it combines the MinIO object storage system to store unstructured and semi-structured data, ensuring efficient storage and retrieval of massive amounts of data.
[0049] For example, pressure sensor data such as: Pressure sensor (number P-XXXX, located in section XX of XX district): The pressure value dropped from 0.35MPa to 0.18MPa for 10 consecutive minutes, and the time domain characteristics showed that the variance exceeded the threshold by 2.3 times, indicating an abnormal hydraulic gradient. Flow sensor data such as: Flow sensor (number F-XXXX, associated with pipe network section P-XXXX): The flow rate increased from 120m³ / h to 185m³ / h during the same period, exceeding the daily cycle trend upper limit by 30%, and the Fast Fourier Transform (FFT) showed that the frequency domain characteristics had no normal periodicity. Water quality sensor data such as: Water quality sensor (number W-XXXX, adjacent pipe network node): Turbidity 0.8 Nephelometric Turbidity Unit (NTU) (compliant), residual chlorine 0.3mg / L (compliant), no abnormal data. Smart water meter group data such as: Smart water meter group (XXX households in section XX of XX district): Average water consumption increased by 15% compared to the same period yesterday, with no concentrated water consumption peaks (excluding concentrated water consumption by users). Text data, such as: The maintenance app received 3 user complaints (within 20 minutes), stating "Water pressure in section XXX suddenly decreased" and "My water heater won't start, the water pressure is too low." The maintenance log shows that the last inspection of this pipeline section was 3 months ago, recording "Severe pipe aging, potential corrosion." Visual data, such as: Inspectors uploaded photos of the area under the manhole cover. The ViT-Large model identified obvious water stains at the pipe joint, with rust covering 40% of the total joint area. Audio data, such as: Audio recordings from previous on-site inspections by maintenance personnel, recording a continuous "hissing" sound of water flow near the pipe, with acoustic features matching a leaky audio template. Meteorological data, such as: The local meteorological bureau issued a high-temperature warning (38℃), with daily water consumption estimated to increase by 20% compared to normal days (data from environmental monitoring stations connected to edge computing nodes). Pipeline network structured knowledge, such as: through the RAG system and knowledge graph, it was found that the pipeline section was laid in 1998 as a cast iron pipe with a designed service life of 20 years, and has now exceeded its service life by 5 years (knowledge graph "physical entity node-pipeline" related data).
[0050] In an embodiment of the present invention, for example, since multiple pressure sensors can be deployed in the same area of a water supply project at the same time, and each pressure sensor can collect multiple data, the multiple data collected by the multiple pressure sensors can be referred to as a set of pressure sensor data representing the area at that time.
[0051] In this embodiment of the invention, since the acquired data is multi-source heterogeneous data from the same area and time period of the water supply project, the multi-source heterogeneous data includes M sets of input data, reflecting the status of the water supply system in the area and time period. Therefore, by way of example, the M sets of input data typically include a set of pressure sensor data corresponding to one or more pressure sensors, a set of flow sensor data corresponding to one or more flow sensors, a set of water quality sensor data corresponding to one or more water quality sensors, a set of smart water meter group data corresponding to the smart water meter group, a set of text data, a set of visual data, a set of audio data, a set of meteorological data, and a pipeline network structured knowledge.
[0052] The following describes step 102, namely "preprocessing the M sets of input data to obtain the M sets of feature vectors", in conjunction with the embodiments of the present invention.
[0053] In this embodiment of the invention, a data processing layer is deployed. As one possible implementation, this data processing layer is equipped with edge computing nodes (each edge computing node is equipped with a Neural Processing Unit (NPU) with 5 TOPS computing power, providing powerful edge artificial intelligence (AI) computing capabilities) to perform data cleaning and feature engineering on M sets of input data respectively, and obtain M sets of feature vectors.
[0054] It should be noted that before data cleaning and feature engineering, a sensor data encoder is used to encode the pressure sensor data, flow sensor data, water quality sensor data, and smart water meter group data. This sensor data encoder employs a Long Short-Term Memory (LSTM) network architecture specifically for processing time-series sensor data. The input layer of this encoder receives pressure sensor data, flow sensor data, water quality sensor data, and smart water meter group data. After processing through a three-layer stacked LSTM network, the long-term dependencies of the time series are captured through the memory mechanism of a recurrent neural network. A time attention layer is added after the LSTM layers to automatically learn the importance weights of different time steps, highlighting data features at key moments. Finally, a fully connected layer maps the data features to a unified embedding space, generating sensor representation vectors. This sensor data encoder can comprehensively capture the daily cyclical variation patterns of the water supply system.
[0055] For text data, a text encoder is employed. This text encoder, based on the Transformer architecture, handles unstructured text information such as maintenance logs, user complaints, and expert suggestions. It uses the text branch of the Qwen2.5-VL-72B model, enabling it to process technical texts containing both Chinese and English. The input text is first segmented using a BytePair Encoding (BPE) tokenizer, then converted into token embeddings with positional encoding before being fed into the Transformer encoder. This text encoder supports a context length of up to 32K tokens, allowing it to handle long technical documents and historical records. Through a self-attention mechanism, the text encoder captures long-distance dependencies within the text, deeply understanding its semantic information and generating text representation vectors.
[0056] For visual data, a visual encoder is employed. This visual encoder uses a Vision Transformer architecture to process visual information such as pipeline photos, equipment status images, and water turbidity images. Upon receiving an input image, the visual encoder first segments the image into 16×16 pixel blocks, converts them into embedding vectors through linear projection, adds positional encoding, and then feeds them into the ViT-Large model for processing. A global pooling layer is then used to finally generate the visual representation vector. This visual encoder supports various visual diagnostic tasks, including pipeline crack detection, equipment corrosion identification, and water turbidity analysis.
[0057] An audio encoder is used to encode audio data. Based on the Wav2Vec2 architecture, this encoder processes audio information such as voice commands, telephone repair requests, and on-site audio reports. It receives audio waveforms with a 16kHz sampling rate, extracts features through a one-dimensional convolutional network to capture acoustic features at different time scales, and then feeds the extracted features into a Transformer encoder for processing. The encoder is pre-trained using contrastive learning to learn robust audio representations. Finally, through temporal pooling layers, an audio representation vector is generated. This audio encoder supports voice interaction and emergency voice alarm processing.
[0058] It should be noted that the meteorological data and pipeline network structured knowledge are already encoded data.
[0059] It should be noted that since the vector representations output by each encoder have different dimensions, they need to be projected to a unified dimensional space. For example, the 512-dimensional sensor vector representation output by the sensor data encoder is projected to 4096 dimensions through a linear transformation; the 1024-dimensional visual vector representation output by the visual encoder is projected to 4096 dimensions; the 768-dimensional audio vector representation output by the audio encoder is projected to 4096 dimensions; and the text vector representation output by the text encoder is already 4096 dimensions, so no transformation is needed.
[0060] Among them, data cleaning implements the ETL (Extraction-Transformation-Loading) pipeline, which refers to performing quality checks, missing value processing, and outlier filtering on a set of vector representations corresponding to a set of pressure sensor data, a set of flow sensor data, a set of water quality sensor data, a set of smart water meter groups, a set of text data, a set of visual data, a set of audio data, and a set of meteorological data, all projected onto a unified dimensional space.
[0061] Feature engineering refers to extracting features from each set of vector representations from multiple dimensions, including time-domain features (mean, variance, skewness, kurtosis, trend, periodicity, etc.), frequency-domain features (FFT transform, power spectral density, wavelet transform, etc.), and domain-specific features (hydraulic gradient, Reynolds number, friction coefficient, etc.), to obtain M sets of feature vectors.
[0062] The following describes step 103, namely "based on M sets of feature vectors, perform anomaly judgment and obtain anomaly judgment results", in detail with reference to the embodiments of the present invention.
[0063] In this embodiment of the invention, an intelligent analysis layer is deployed. Addressing the technical problems of false negatives or missed positives and the inability to adapt to complex anomaly patterns by single detection methods, the intelligent analysis layer employs a three-layer cascaded detection architecture using statistical methods, machine learning methods, and deep learning methods. Each layer uses multiple algorithms for parallel detection, and a final judgment is generated through an intelligent fusion mechanism. As one possible implementation, based on M sets of feature vectors, anomaly detection is performed using statistical methods, machine learning methods, and deep learning methods to obtain a first anomaly score, a second anomaly score, and a third anomaly score, respectively. For example, the statistical method includes: Z-Score detection (24-hour sliding window): pressure data Z-value = 3.8 (>threshold 2.5), flow data Z-value = 3.2 (>threshold 2.5), indicating anomaly. This Z-Score detection method is based on the normal distribution assumption, calculating the standard deviation multiple of the data point from the mean; if the absolute value exceeds the threshold, it is determined to be an anomaly. Z-Score detection has extremely fast calculation speed and is suitable for real-time detection. Interquartile Range (IQR) detection: Pressure data with an interquartile range exceeding 1.5 times the IQR range is considered anomaly. This IQR detection method is based on quartiles, does not rely on distribution assumptions, and is suitable for skewed distribution data such as water consumption. This method is not sensitive to outliers themselves and has strong robustness. Grubbs algorithm: Detects pressure / flow rates as small sample outliers and classifies them as anomalies. This Grubbs algorithm is mainly used for outlier detection. It is computationally simple and easy to understand, suitable for small sample data (small sample data size N≥3 is sufficient), and has low engineering implementation costs. However, it relies on the normal distribution assumption and cannot handle multiple outliers. Statistical layer score (normalized to 0-1): First outlier score = (3.8+3.2+1.0+1.0) / 4 = 0.92. Machine learning methods include: Isolation Forest algorithm: Outlier score 0.88; This Isolation Forest algorithm does not require labeled data and works well on high-dimensional data, but its ability to detect local anomalies is weak. One-Class Support Vector Machine (One-Class SVM) algorithm: Anomaly score 0.90; This One-Class SVM algorithm has a solid theoretical foundation and is sensitive to boundary anomalies. Local Outlier Factor (LOF) algorithm: Anomaly score 0.85; This LOF algorithm can detect local anomalies and does not depend on the global distribution. Second anomaly score = (0.88 + 0.90 + 0.85) / 3 = 0.88. Deep learning methods include: Autoencoder: Reconstruction error normalized score 0.91; This Autoencoder detects anomalies by learning a compressed representation of normal data. This method is unsupervised learning and can learn complex normal patterns, but requires a large amount of training data.LSTM Autoencoder: Temporal anomaly score 0.89; This LSTM autoencoder is specifically designed for time series anomaly detection. Anomaly detection computation captures temporal dependencies and can detect temporal anomalies, but the training time is long and requires a Graphics Processing Unit (GPU) for acceleration. Variational Autoencoder (VAE): Anomaly score after uncertainty quantification 0.90; This VAE introduces probabilistic modeling on top of the autoencoder to quantify uncertainty in the generative model, but training is unstable and requires fine-tuning. Third anomaly score = (0.91 + 0.89 + 0.90) / 3 = 0.90. Based on the first, second, and third anomaly scores and their corresponding first, second, and third weights, a target anomaly score is determined. This target anomaly score is a one-dimensional matrix, where one element corresponds to no anomaly, and each of the remaining elements corresponds to a different anomaly. The first weight is 0.2, the second weight is 0.35, and the third weight is 0.45. The target anomaly score is calculated as 0.92 × 0.2 + 0.88 × 0.35 + 0.90 × 0.45 = 0.897. If the largest element in the one-dimensional matrix is greater than the anomaly score threshold corresponding to that element, the anomaly corresponding to that element is identified as the target anomaly for the same area and time period within the water supply project. If every element in the one-dimensional matrix is less than its corresponding anomaly score threshold, then there are no anomalies in the same area and time period within the water supply project. It should be noted that this embodiment of the invention determines the anomaly type based on feature analysis. If the standard deviation of the pressure sensor data exceeds a threshold, it is classified as a pressure fluctuation anomaly, and the specific device causing the pressure anomaly is located. If the average flow sensor data exceeds 115% of the expected flow, it is classified as an abnormal increase in flow. If the average pressure is lower than expected at the same time, it is further classified as a suspected leak, and the leak area is located by the spatial distribution of pressure and flow. If water quality parameters such as turbidity exceed the standard, it is classified as an abnormal water quality deterioration, and the affected component is the water treatment plant. For example, 0.897 is greater than the threshold of 0.7, therefore, it is judged as an anomaly. Anomaly classification: Pressure fluctuation + abnormal increase in flow → judged as "suspected leak", located in XXX road XX section (P-XXXX / F-XXXX coverage area). Based on the target anomaly and its weight, the comprehensive severity level is determined. The anomaly judgment result includes the first anomaly score, the second anomaly score, the third anomaly score, the target anomaly score, the target anomaly, and the comprehensive severity level. For example, the comprehensive severity level thresholds are: greater than 0.8 is urgent, 0.6 to 0.8 is high, 0.4 to 0.6 is medium, and less than 0.4 is low.In this embodiment of the invention, the overall severity level = target anomaly score 0.897 × corresponding weight 0.4 + normalized impact range (covering 120 households) 0.3 × corresponding weight 0.3 + anomaly score corresponding to the target anomaly (suspected leakage) in the one-dimensional matrix 0.8 × 0.3 = 0.7088. Since 0.7088 is between 0.6 and 0.8, the overall severity level is high.
[0064] It should be noted that, in this embodiment of the invention, the confidence level can also be determined based on the first anomaly score, the second anomaly score, and the third anomaly score. Specifically, through a voting consensus method: statistical methods including Z-Score detection, IQR detection, Grubbs algorithm; machine learning methods including Isolation Forest algorithm, One-Class SVM algorithm, Local Outlier Factor (LOF); and deep learning methods including Autoencoder, LSTM autoencoder, and VAE, all nine algorithms identified anomalies, achieving 100% consistency, thus the confidence level is 1. Through uncertainty quantification: the standard deviation of the scores from the three layers of statistical methods, machine learning methods, and deep learning methods is 0.016 (0.04 after normalization). The final confidence level = 1 - 0.04 = 0.96. Accordingly, the aforementioned anomaly judgment result may also include the confidence level.
[0065] It should be noted that the initial allocation ratios of the first, second, and third weights for the three-layer cascaded detection architecture are based on historical experience and may not reflect the actual performance of the algorithm. Therefore, continuous iteration is necessary. To address this, this embodiment of the invention utilizes an optimization control algorithm and a deep learning engine to jointly update the first, second, and third weights. Based on the difference between the predicted results and the actual situation, the weight allocation is continuously adjusted to improve prediction accuracy. If the target anomaly is determined to be different from the actual anomaly type, the first, second, and third weights are updated. The updated first, second, and third weights are then used in each step of determining the target anomaly score.
[0066] The following describes step 104, namely, "if the anomaly judgment result includes the target anomaly, then fuse M groups of feature vectors to obtain a fused feature vector," in conjunction with an embodiment of the present invention.
[0067] In this embodiment of the invention, as described in step 103, if the anomaly judgment result includes the target anomaly, indicating an anomaly in the same area and time period of the water supply project, then the M feature vectors are fused to obtain a fused feature vector. The fused feature vector is the weighted sum of each feature vector, plus the weighted sum of the cross-attention between all feature vector pairs. For example, the fused feature vector is a unified semantic representation of "sudden pressure drop in pipeline section + abnormal increase in flow + visual water stains + audio water flow sound + user complaints". The cross-attention weights employ a Cross-Attention mechanism. This attention mechanism can handle data from different modalities (i.e., multi-source heterogeneous), such as pressure sensor data, flow sensor data, water quality sensor data, smart water meter group data, text data, visual data, audio data, meteorological data, and pipeline structured knowledge. Each weight coefficient is dynamically learned through a gating mechanism, adaptively adjusting the importance of each feature vector based on the current context information. The fused representations are further fused using a 6-layer Transformer encoder, maintaining a model dimension of 4096. Each layer includes a multi-head self-attention mechanism and a feedforward neural network, with GELU as the activation function. This deep fusion enables the learning of complex interactions and complementary information between different feature vectors.
[0068] Through the aforementioned Cross-Attention mechanism, the system can automatically learn the relationships between different modalities. For example, when a pressure sensor detects an abnormal drop in pressure, and an inspection image shows a crack in the pipe, the system can integrate the two pieces of information to determine with high confidence that there is a pipe leak. Similarly, when a flow sensor detects a sudden increase in flow data, and a user complaint text mentions "low water pressure," the system can quickly locate the fault area. Furthermore, by combining historical maintenance logs and current operational data, the system can predict equipment maintenance needs.
[0069] The following describes step 105, namely "obtaining the RAG system, knowledge graph, and preferred LLM prompts in the field of water supply engineering", in conjunction with the embodiments of the present invention.
[0070] To address the limitation of LLM (Limited Learning Model) knowledge in specific fields, this invention constructs a RAG (Rich Graph) system based on a vector database, deeply integrating an external knowledge base with LLM. This RAG system for water supply engineering includes: physical entity nodes, logical entity nodes, event entity nodes, parameter entity nodes, and knowledge entity nodes. Physical entity nodes include physical components of the water supply system such as pipes, valves, pumps, water meters, sensors, water plants, and pumping stations. Logical entity nodes include logical divisions such as water supply areas, user groups, pipeline segments, and pressure zones. Event entity nodes include maintenance events such as faults, repairs, inspections, upgrades, and emergency responses. Parameter entity nodes include monitoring parameters such as pressure, flow rate, water quality indicators, and energy consumption. Knowledge entity nodes include technical knowledge such as algorithms, standards and specifications, operating procedures, and expert experience. Each entity node stores corresponding knowledge. The knowledge graph for water supply engineering defines various relationship types, including physical relationships such as connection, inclusion, control, and influence; causal relationships such as cause, prevention, mitigation, and exacerbation; temporal relationships such as prior to, simultaneous with, and periodic triggering; and semantic relationships such as synonymy, hierarchical, and part-whole relationships. The knowledge graph is stored using the Neo4j graph database. For example, there can be more than 120 types of relations.
[0071] The vector database enables semantic retrieval of massive amounts of documents. The system uses Milvus as its vector database, employing a text-embedding-3-large model to convert text into 3072-dimensional vector representations. The data is organized into multiple sets by type: the technical document set contains over ten thousand design drawings, technical standards, and operation manuals; the historical case set contains fault cases, maintenance records, and optimization cases; and the expert knowledge set contains expert experience, best practices, and lessons learned. The vector index uses the Hierarchical Navigable Small World Graphs (HNSW) algorithm, with cosine similarity as the distance metric, ensuring both retrieval speed and high recall.
[0072] The hybrid retrieval algorithm combines the advantages of dense and sparse retrieval. Dense retrieval, based on semantic similarity, encodes the user query into a vector using an embedding model and searches for the top-K most similar documents in a vector database. Filtering conditions can be added during the search, such as limiting the domain to water supply engineering systems. Sparse retrieval, based on keyword matching, uses the Best Matching 25 (BM25) algorithm to search the document index for the top-K documents containing the query keywords. Result fusion employs Reciprocal Rank Fusion (RRF) to weight and fuse the results of dense and sparse retrieval, as semantic retrieval is generally more accurate. The fused candidate documents are then refined using a Cross-Encoder re-ranking model, which more accurately calculates the relevance between the query and the documents, ultimately returning the top-5 most relevant documents.
[0073] The RAG process comprises five steps. Step 1 is query understanding, extracting key information from user queries (such as anomaly detection results from the intelligent analysis layer), including intent classification (fault diagnosis, demand prediction, optimization suggestions, knowledge queries, etc.), entity extraction (device, location, time, etc.), and constraint extraction (range, conditions, etc.). Step 2 is knowledge retrieval, searching for relevant knowledge from multiple sources: retrieving semantically relevant documents from a vector database using a hybrid retrieval and re-ranking mechanism to return the top-5 documents; retrieving structured knowledge from a knowledge graph, constructing Cypher query statements based on query analysis to retrieve relevant entities and relationships; and retrieving historical data from a time-series database for a specified time range and entity history if needed. Step 3 is context construction, formatting the retrieved knowledge and concatenating it with the current system state, historical similar cases, and user queries to construct an enhanced prompt context. Step 4 is LLM generation, inputting the enhanced prompt context into the LLM to generate comprehensive analysis and suggestions. Step 5 is answer verification, checking the factual accuracy of the generated content and cross-validating it with the retrieved knowledge; if hallucinations are found, constraints are added and the result is regenerated.
[0074] The preferred prompts for LLM include the first prompt, second prompt, third prompt, fourth prompt, and fifth prompt.
[0075] The following describes step 106, namely, "based on the target information and the preferred LLM prompts, perform each processing step based on the preferred LLM to obtain the first processing result corresponding to each processing step, wherein the target information includes the RAG system, knowledge graph, anomaly judgment result, and fusion feature vector," in detail with reference to the embodiments of the present invention.
[0076] In this embodiment of the invention, a dialogue prediction engine layer is deployed, which is equipped with an LLM.
[0077] Understandably, to address the problem of the black box nature of AI decision-making processes and the inability of users to understand the decision-making basis, this invention creatively proposes a chain-of-thought-based step-by-step reasoning mechanism. This mechanism first decomposes the problem, breaking down complex issues into multiple sub-steps.
[0078] In this embodiment of the invention, based on the target information and the prompts of the preferred LLM based on the chain-of-thought stepwise reasoning mechanism, each processing step is performed based on the preferred LLM to obtain the first processing result corresponding to each processing step.
[0079] In one embodiment of the invention, as a possible implementation, based on target information and a first prompt instruction, and using a preferred LLM (Limited Linear Model), first information is determined. This first information represents the first abnormal characteristic of the water supply project in the same area and time period, such as abnormal performance of various indicators like pressure, flow rate, and water quality. For example, if the pressure in the target pipeline segment drops by 48.6% within 10 minutes (exceeding the threshold by 30%), and the flow rate increases by 54.2% (exceeding the threshold by 25%), accompanied by concentrated user complaints, pipe stains, and audio recordings of leakage, excluding water quality abnormalities and concentrated water usage, the core anomaly is "pressure-flow mismatch + on-site leakage characteristics." Based on the first information, a second prompt instruction, and target information, and using a preferred LLM, second information is determined. This second information represents the first cause of the first abnormal characteristic. Analysis is then conducted from multiple perspectives, including equipment failure, pipeline leakage, and changes in demand. For example, RAG retrieves historical cases (Top-5 matching cases in the vector database): For scenarios like "cast iron pipe + sudden pressure drop + increased flow," 90% are due to pipe joint leakage (related to the knowledge graph "fault event node"); combined with maintenance log "pipe aging" and visual data "rust," the core cause is determined to be "moderate leakage caused by aging and corrosion of the cast iron pipe joint." Based on the second information, the third prompt instruction, and the target information, and using the preferred LLM, the third information is determined. The third information is the first impact range of the first anomaly feature, including the number of affected users and the duration. For example, based on the pipe network topology (physical relationships in the knowledge graph), the leaking pipe segment covers two communities and 120 households, with an impact area of approximately 0.3 square kilometers; the current estimated leakage is 30 m³ / h (calculated based on hydraulic gradient and flow difference). If the leakage continues, it will affect the pressure stability of the surrounding pipe network within 2 hours. Based on the third information, the fourth prompt instruction, and the target information, and using the preferred LLM, the fourth information is determined. The fourth information is the first solution for the same area and time period of the water supply project, including emergency measures and long-term solutions. For example, emergency measures include: closing the upstream and downstream electric valves (numbered V-XXXX and V-XXXX) of this pipeline segment and starting the backup booster pump (numbered P-XXX) to ensure water supply to the surrounding area; long-term solutions include: replacing the aging cast iron pipe joints with stainless steel replacements within 24 hours, and simultaneously conducting a comprehensive inspection of the 500-meter section of the pipeline. Based on the fourth information, the fifth prompt instruction, and the target information, the fifth information is determined based on the preferred LLM, and the fifth information represents the first estimated implementation effect, providing quantitative improvement indicators. For example, within 5 minutes of closing the valves, the pressure of the surrounding pipeline network can be restored to above 0.3 MPa (meeting the standard); after leakage stops, approximately 720 m³ of water is saved per day; after replacing the joints, the leakage risk of this pipeline segment is reduced by 80%, and its service life is extended by 10 years. The first, second, third, fourth, and fifth prompt instructions are used to instruct the preferred LLM to determine the first, second, third, fourth, and fifth information, respectively.The first processing result includes the first information, the second information, the third information, the fourth information, and the fifth information.
[0080] It should be noted that the preferred LLM mentioned above is an LLM with 72B (i.e., 72 billion) parameters, based on the Qwen2.5-VL architecture, with a context length of 32K tokens, and has powerful multimodal (i.e., multi-source heterogeneous data) understanding and reasoning capabilities.
[0081] The reasoning verification process checks the rationality of each reasoning result. First, the system checks physical constraints, verifying whether the pressure range and flow rate values involved in the reasoning conform to physical laws, such as the law of conservation of flow and the law of conservation of energy. For example, in the flow conservation law verification, the leakage rate = abnormal flow rate - normal water consumption, and the calculated result of 30 m³ / h conforms to physical laws. Next, a logical consistency check is performed, verifying whether the causal relationship is reasonable and whether the reasoning is contradictory. Then, a historical case comparison is performed, comparing the current reasoning result with similar cases in the knowledge base to check for consistency with historical experience. If inconsistencies are found, a verification error message is sent as feedback, and the reasoning content for that step is regenerated to ensure the accuracy and reliability of the reasoning. For example, among the 10 similar leakage cases retrieved by RAG, the success rate of using the "valve closure + pressurization + interface replacement" solution is 100%, with no secondary failures.
[0082] The following describes in detail step 107, namely, "If the first processing result cannot pass manual review, then based on the target information and the obtained alternative LLMs, each processing step is performed on the alternative LLMs to obtain the second processing result corresponding to each processing step," in conjunction with the embodiments of the present invention.
[0083] It should be noted that the alternative LLM is obtained using prompts. These prompts include the sixth, seventh, eighth, ninth, and tenth prompts. If the first processing result corresponding to each processing step obtained from the preferred LLM fails manual review, an alternative LLM with a larger parameter size is triggered. For example, this larger parameter size is greater than 72 bytes. That is, if the first processing result corresponding to each processing step fails manual review, then based on the target information and the prompts for the alternative LLM, each processing step is performed on the alternative LLM to obtain the second processing result corresponding to each processing step. The parameter size of the alternative LLM is larger than that of the preferred LLM.
[0084] As one possible implementation, based on the target information and the sixth prompt instruction, and using alternative LLMs, the sixth information is determined as the second abnormal characteristic of the water supply project in the same area and at the same time. Based on the sixth information, the seventh prompt instruction, and the target information, and using alternative LLMs, the seventh information is determined as the second cause of the second abnormal characteristic. Based on the seventh information, the eighth prompt instruction, and the target information, and using alternative LLMs, the eighth information is determined as the second scope of influence of the second abnormal characteristic. Based on the eighth information, the ninth prompt instruction, and the target information, and using alternative LLMs, the ninth information is determined as the second solution for the water supply project in the same area and at the same time. Based on the ninth information, the tenth prompt instruction, and the target information, and using alternative LLMs, the tenth information is determined as the second estimated implementation effect. The sixth, seventh, eighth, ninth, and tenth prompt instructions are used to instruct the alternative LLMs to determine the sixth, seventh, eighth, ninth, and tenth information, respectively. The second processing result includes the sixth, seventh, eighth, ninth, and tenth information.
[0085] It should be noted that the sixth prompt instruction relative to the first prompt instruction, the seventh prompt instruction relative to the second prompt instruction, the eighth prompt instruction relative to the third prompt instruction, the ninth prompt instruction relative to the fourth prompt instruction, and the tenth prompt instruction relative to the fifth prompt instruction all contain problem prompt information. This problem prompt information corresponds to the problem that occurred in each processing step of the preferred LLM.
[0086] For example, if the first and second steps of the preferred LLM are fine, that is, the first abnormal feature and the first cause of the first abnormal feature are fine, but problems arise from the third step onwards, that is, the first scope of influence of the first abnormal feature is problematic, then when using the alternative LLM, the problem that occurs in the third step of the preferred LLM is used as a problem prompt information from the first step onwards. That is, the sixth prompt instruction relative to the first prompt instruction, the seventh prompt instruction relative to the second prompt instruction, the eighth prompt instruction relative to the third prompt instruction, the ninth prompt instruction relative to the fourth prompt instruction, and the tenth prompt instruction relative to the fifth prompt instruction all contain this problem prompt information.
[0087] The following describes step 108, namely "determining the decision-making strategy for the water supply project based on the second processing result and a deep neural network," in detail with reference to embodiments of the present invention.
[0088] In one embodiment of the invention, as a possible implementation, the constraints, optimization objectives, and historical decision-making strategies of the water supply project are obtained. Based on the second processing results corresponding to each processing step, as well as the constraints, optimization objectives, historical decision-making strategies, and M sets of feature vectors of the water supply project, a decision-making strategy for the water supply project is determined using a deep neural network.
[0089] For example, the decision-making strategy includes the following:
[0090] Control command: Issued to the physical equipment layer, electric valves V-0312 and V-0313 immediately close (stepper motor driven, response time <3 seconds), standby booster pump P-078 starts, water supply pressure is set to 0.32MPa (frequency converter control).
[0091] Operation and maintenance arrangements: Push work orders to the APP of 3 operation and maintenance personnel, requiring them to arrive at the site within 15 minutes, carrying leak sealing tools and testing equipment; the dispatch center coordinates with the pipe supplier to deliver stainless steel interface fittings within 2 hours.
[0092] User notification: A water outage notice was sent to 120 affected users via SMS, informing them that "due to pipeline maintenance, the water outage is expected to last for 3 hours (15:00-18:00). During this period, a backup booster pump will ensure basic water supply."
[0093] It should be noted that, addressing the technical challenges of traceability and security in AI decision-making for water supply projects as critical infrastructure, this invention proposes a private blockchain network based on Hyperledger Fabric. This private blockchain network records all critical decisions and control instructions, ensuring the immutability and traceability of the decision-making process. The blockchain network adopts a multi-organizational consortium blockchain architecture. The network creates three channels to achieve business isolation: the supply-operations channel for water supply operation-related decisions and control, the maintenance-management channel for equipment maintenance management, and the audit-trail channel specifically for audit trails. Each channel operates independently, with data isolated from each other; organizations can join different channels based on their permissions. The consensus algorithm employs Practical Byzantine Fault Tolerance (PBFT), enabling consensus to be reached even when some nodes experience Byzantine faults (arbitrary errors or malicious behavior). A maximum of one failure is tolerated among the five Orderer nodes, and consensus requires confirmation from at least four nodes (greater than two-thirds of the total). The smart contracts are written in Go and run in Docker containers on the Peer nodes. The state database uses CouchDB, which supports rich query functionality and allows for complex queries based on attributes.
[0094] This invention can record decision-making strategies through a blockchain decision-making record contract. The decision-making strategy record structure includes fields such as a unique decision ID, timestamp, decision type (optimization, emergency response, maintenance, etc.), LLM model version, hash value of input data, content of each step in the inference chain, final decision content, confidence level, executor identity, approval status, execution result, list of affected devices, and record hash. The contract provides the `RecordDecision` function to record new decisions. This function first parses the decision data, generates a decision ID and timestamp, calculates the secure hash value (SHA256) to ensure immutability, performs permission checks to ensure only authorized LLM systems and maintenance personnel can record, and finally stores the decision record in the blockchain state database. The `QueryDecision` function queries historical decisions based on the decision ID, and the `QueryDecisionsByTimeRange` function queries the decision list by time range, supporting CouchDB's rich query functionality, allowing filtering and sorting by time, type, executor, and other conditions. The `VerifyDecisionIntegrity` function verifies the integrity of the decision record by recalculating the hash value and comparing it with the stored hash. If they are inconsistent, it indicates that the data may have been tampered with. The `UpdateDecisionExecutionResult` function updates the execution result of the decision, recording the execution time, status (success, failure, partial success), and performance metrics. For example, the decision policy ID is DL-20250715-008, the timestamp is 2025-07-15 14:42:36, and the large language model version is Qwen2.5-VL-72B. The input data hash is SHA256 encrypted multi-source heterogeneous data (ensuring immutability). The inference chain fully records each processing step performed based on the large language model LLM (e.g., five processing steps based on the first, second, third, fourth, and fifth prompt instructions), with a confidence level of 0.98 (a weighted score of 0.92 from 9 anomaly detection algorithms, and 100% voting consistency). Execution results: Maintenance personnel arrived at the site at 14:55, the valve was closed at 15:00, the interface replacement was completed at 17:30, and water supply was restored at 17:40. The actual water outage time was 40 minutes (better than the estimated 3 hours).
[0095] This invention uses a blockchain-based device management contract to record control commands and status changes of physical equipment in a water supply project. The device status structure includes fields such as device ID, device type (pump, valve, sensor), location, online status, control command, command source (LLM or manual), last update time, and operation log. The `RecordDeviceControl` function records device control commands. This function first associates with the corresponding decision record, verifies the validity of the decision ID, obtains the current device status, updates the device's control command, command source, and update time, appends the operation to the log, and finally stores it on the blockchain. The operation log recording format includes complete information such as timestamp, command content, source, and associated decision ID, forming a traceable operation chain.
[0096] This invention manages user permissions for a water supply project through a blockchain-based access control contract. The permission structure includes fields such as user ID, role (administrator, operator, viewer, auditor), permission list (read, write, execute, audit), effective start time, and effective end time. The `CheckPermission` function checks whether a user has permission to perform a certain operation. This function first retrieves the user's permission record, checks if the current time is within the validity period, then iterates through the permission list to check if the required permission or all permissions are included, and returns the check result. The contract also provides `GrantPermission` and `RevokePermission` functions for granting and revoking permissions; only administrators can perform these operations.
[0097] This invention records audit logs of user operations through a blockchain audit trail contract. The audit log structure includes fields such as log ID, timestamp, user ID, operation type, operation resources, operation result (success or failure), IP address, and detailed information. The `RecordAuditLog` function records new audit logs, generates a log ID and timestamp, and stores it in the blockchain. The `QueryAuditLogs` function queries audit logs, supporting filtering by user, time range, operation type, and other conditions, providing complete operation records for security audits and incident investigations.
[0098] This invention achieves seamless integration between LLM and blockchain through a blockchain integration module. After the LLM generates a decision, the integration module first constructs a decision record, containing complete information such as decision ID, timestamp, decision type, model version, input data hash, inference chain, decision content, confidence level, executor, approval status, execution result, and affected devices. Then, it calls the Fabric client's smart contract call interface, passing the decision record as a parameter to the RecordDecision function of the decision record contract. After contract execution, it returns a transaction ID. The system waits for the transaction to be packaged into a block and verified, with a timeout of 10 seconds. If the transaction verification status is VALID, it indicates that the decision has been successfully recorded on the blockchain, and the system returns a success result including the decision ID, transaction ID, and block number. If verification fails, an exception is thrown and an error log is recorded.
[0099] After a decision is executed, the system calls the `UpdateDecisionExecutionResult` function to update the execution result. The execution result data includes the decision ID, detailed execution information, execution time, status (success, failure, partial success), performance metrics, etc. This information is also recorded on the blockchain, forming a complete traceability chain from decision generation to execution completion.
[0100] When querying decision history, the system calls `QueryDecisionsByTimeRange` or other query functions, specifying start time, end time, and optional decision types as filtering conditions. The contract executes a rich query in the CouchDB state database, returning a list of decisions that meet the criteria. The system can then display the query results to the user or use them for data analysis and model training.
[0101] When verifying the integrity of a decision, the system calls the `VerifyDecisionIntegrity` function, passing in the decision ID to be verified. The contract reads the decision record from the blockchain, recalculates the record's hash value, and compares it with the stored hash value. If they match, the record has not been tampered with, and the verification passes; if they do not match, the data may have been tampered with, and the verification fails with a warning.
[0102] The beneficial effects of the technical solution provided by the embodiments of the present invention are as follows: Using the preferred LLM as the core of cognitive decision-making breaks through the limitation of traditional water supply engineering that can only process structured data. If the first processing result corresponding to each processing step obtained according to the preferred LLM fails manual review, a larger-scale alternative LLM is triggered; through four multimodal encoders, the system can uniformly process sensor data, text data, image data, and voice data, achieving true multimodal understanding; the cross-modal attention mechanism automatically learns the correlation between different modalities, enabling the system to make more accurate judgments by integrating multiple aspects of information; by fusing multimodal (i.e., multi-source heterogeneous) data, intelligent processing is combined with the large language model LLM, improving the accuracy of anomaly detection; the chain-of-thought reasoning mechanism decomposes the complex decision-making process into multiple clear steps, each with a clear reasoning basis, solving the problem of the black box nature of AI decision-making, enabling users to understand and trust the AI's decisions. The RAG system deeply integrates a large language model with a professional knowledge base, increasing the accuracy of professional knowledge from 70% to over 95%, reducing hallucination phenomena by 85%, and ensuring the accuracy and reliability of generated content. This invention employs a first-layer statistical method for rapid initial screening, a second-layer machine learning method for intelligent judgment, and a third-layer deep learning method to capture complex patterns. Each layer uses three different algorithms for parallel detection, and a soft-voting fusion mechanism integrates the advantages of each algorithm to overcome the limitations of a single method. Confidence assessment quantifies the credibility of the detection results, and context adjustment considers historical patterns and special events, significantly reducing the false positive rate. The anomaly classification module can determine the specific type of anomaly, and severity assessment provides a basis for emergency response decisions. The integrated detection achieves an accuracy of 96.8% and a false positive rate of only 2.1%, representing a 7.9% improvement in accuracy compared to the best existing methods, achieving a qualitative leap in anomaly detection capabilities. Blockchain technology is applied to the recording and traceability of AI decisions in water supply engineering, solving the problem of trustworthiness in critical infrastructure decisions. A private blockchain network built on Hyperledger Fabric uses the PBFT consensus algorithm, achieving high throughput and low latency of less than 500 milliseconds while ensuring security. Four types of smart contracts are responsible for decision recording, equipment management, access control, and audit trails, forming a complete security system. All decisions and control instructions generated by the LLM are recorded in an immutable blockchain ledger, with each record containing a complete inference chain, decision content, execution results, and performance metrics. A multi-organizational consortium blockchain architecture enables collaborative oversight by operators, regulators, and auditors, ensuring transparency and fairness in decision-making. The system meets relevant compliance requirements, providing necessary security for water supply, a critical infrastructure; shortening fault response time; improving operational efficiency; and ensuring the traceability of decision-making strategies through blockchain records, enhancing the reliability of the water supply system. The detailed explanation of the inference process also strengthens user trust.
[0103] According to another embodiment, an intelligent decision generation device for water supply projects is provided. Figure 2 A schematic block diagram of an intelligent decision-making generation device for a water supply project according to one embodiment is shown. Figure 2 As shown, the device 200 may include: a multi-source heterogeneous data acquisition module 201, a data preprocessing module 202, an anomaly detection module 203, a feature vector fusion module 204, a target acquisition module 205, a first processing module 206, a second processing module 207, and a decision strategy determination module 208. The main functions of each component module are as follows:
[0104] The multi-source heterogeneous data acquisition module 201 is used to acquire multi-source heterogeneous data from the same area and time period of the water supply project. The multi-source heterogeneous data includes M sets of input data, where M is a positive integer.
[0105] The data preprocessing module 202 is used to preprocess the M sets of input data respectively to obtain M sets of feature vectors;
[0106] The anomaly detection module 203 is used to perform anomaly detection based on the M sets of feature vectors and obtain anomaly detection results;
[0107] The feature vector fusion module 204 is used to fuse the M feature vectors to obtain a fused feature vector if the anomaly judgment result includes a target anomaly.
[0108] The target acquisition module 205 is used to acquire retrieval enhancement generation systems, knowledge graphs, and preferred LLM prompts in the field of water supply engineering.
[0109] The first processing module 206 is used to perform various processing steps based on the preferred large language model according to the target information and the preferred LLM prompt instructions, and obtain the first processing result corresponding to each processing step. The target information includes the retrieval enhancement generation system, the knowledge graph, the anomaly judgment result, and the fusion feature vector.
[0110] The second processing module 207 is used to perform various processing steps based on the target information and the obtained alternative LLM prompts, according to the target information and the alternative large language model, to obtain the second processing result corresponding to each processing step if the first processing result cannot pass the manual review.
[0111] The decision strategy determination module 208 is used to determine the decision strategy of the water supply project based on the second processing result and a deep neural network.
[0112] In one possible implementation, the data preprocessing module 202 is specifically used to perform data cleaning and feature engineering on the M sets of input data respectively to obtain the M sets of feature vectors.
[0113] In one possible implementation, the anomaly detection module 203 includes a first submodule, a second submodule, a third submodule, and a fourth submodule;
[0114] The first submodule is used to perform anomaly detection based on the M sets of feature vectors using statistical methods, machine learning methods, and deep learning methods, and to obtain a first anomaly score, a second anomaly score, and a third anomaly score, respectively.
[0115] The second submodule is used to determine a target anomaly score based on the first anomaly score, the second anomaly score, and the third anomaly score, as well as the corresponding first weight, second weight, and third weight. The target anomaly score is a one-dimensional matrix, in which one element corresponds to no anomaly, and each of the remaining elements corresponds to an anomaly.
[0116] The third submodule is used to determine the anomaly corresponding to the largest element as the target anomaly of the same area and time period of the water supply project if the largest element in the one-dimensional matrix is greater than the anomaly score threshold corresponding to the largest element.
[0117] The fourth submodule is used to determine the overall severity level based on the target anomaly and its weight. The anomaly judgment result includes the first anomaly score, the second anomaly score, the third anomaly score, the target anomaly score, the target anomaly, and the overall severity level.
[0118] In one possible implementation, the apparatus further includes an update module; the update module is used to update the first weight, the second weight, and the third weight if the target anomaly is different from the real anomaly.
[0119] In one possible implementation, the first processing module 206 includes a first processing submodule, a second processing submodule, a third processing submodule, a fourth processing submodule, and a fifth processing submodule:
[0120] The first processing submodule is used to determine the first information based on the target information and the first prompt instruction, using the preferred large language model. The first information is the first abnormal feature of the same area and time period of the water supply project.
[0121] The second processing submodule is used to determine the second information based on the first information, the second prompt instruction, and the target information, and the preferred large language model. The second information is the first reason for the generation of the abnormal feature.
[0122] The third processing submodule is used to determine the third information based on the second information, the third prompt instruction and the target information, and the preferred large language model. The third information is the first influence range of the abnormal feature.
[0123] The fourth processing submodule is used to determine the fourth information based on the third information, the fourth prompt instruction and the target information, and the preferred large language model. The fourth information is the first solution for the same area and time period of the water supply project.
[0124] The fifth processing submodule is used to determine the fifth information based on the fourth information, the fifth prompt instruction, and the target information, and the preferred large language model. The fifth information is the first estimated implementation effect.
[0125] Wherein, the first prompt instruction, the second prompt instruction, the third prompt instruction, the fourth prompt instruction, and the fifth prompt instruction are respectively used to instruct the preferred large language model to determine the first information, the second information, the third information, the fourth information, and the fifth information.
[0126] In one possible implementation, the second processing module 207 is specifically configured to: determine, based on the target information and the sixth prompt instruction, a sixth piece of information, which is the second abnormal feature of the same area and time period of the water supply project, according to a candidate large language model; determine, based on the sixth piece of information, the seventh prompt instruction, and the target information, a seventh piece of information, which is the second cause of the second abnormal feature; determine, based on the seventh piece of information, the eighth prompt instruction, and the target information, an eighth piece of information, which is the second influence range of the second abnormal feature, according to the candidate large language model; and determine, based on the eighth piece of information, the ninth prompt instruction, and the target information, a second piece of information, which is the second cause of the second abnormal feature; and determine, based on the eighth piece of information, the ninth prompt instruction, and the target information, a second piece of information, which is the second cause of the second abnormal feature; and determine, based on the sixth piece of information, the ninth prompt instruction, and the target information, a second piece of information, which is the second cause of the second abnormal feature; and determine, based on the sixth piece of information, the seventh ... The alternative large language model determines the ninth information, which is the second solution for the same area and time period of the water supply project; based on the ninth information, the tenth prompt instruction, and the target information, the alternative large language model determines the tenth information, which is the second estimated implementation effect; wherein, the sixth, seventh, eighth, ninth, and tenth prompt instructions are respectively used to instruct the alternative large language model to determine the sixth, seventh, eighth, ninth, and tenth information, and the second processing result includes the sixth, seventh, eighth, ninth, and tenth information.
[0127] In one possible implementation, the apparatus further includes a first contract recording module, a second contract recording module, a third contract recording module, and a fourth contract recording module;
[0128] The first contract recording module is used to record the decision-making strategy through a blockchain decision-making recording contract;
[0129] The second contract recording module is used to record the control commands and status changes of the physical equipment in the water supply project through the device management contract of the blockchain.
[0130] The third contract record module is used to manage user permissions for the water supply project through the access control contract of the blockchain;
[0131] The fourth contract recording module is used to record audit logs of user operations through the audit trail contract records of the blockchain.
[0132] In one possible implementation, the apparatus further includes a target acquisition module;
[0133] The target acquisition module is used to acquire the constraints, optimization objectives, and historical decision-making strategies of the water supply project.
[0134] The decision strategy determination module 208 is used to determine the decision strategy of the water supply project based on a deep neural network, according to the second processing result, the constraints of the water supply project, the optimization objective, historical decision strategies, and M sets of feature vectors.
[0135] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0136] In addition, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.
[0137] And an electronic device, comprising:
[0138] One or more processors; and
[0139] A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any of the foregoing method embodiments.
[0140] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.
[0141] in, Figure 3 The architecture of an electronic device is illustrated by way of example, which may include a processor 310, a video display adapter 311, a disk drive 312, an input / output interface 313, a network interface 314, and a memory 320. The processor 310, video display adapter 311, disk drive 312, input / output interface 313, network interface 314, and memory 320 can communicate with each other via a communication bus 330.
[0142] The processor 310 can be implemented using a general-purpose CPU, microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.
[0143] The memory 320 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 320 can store the operating system 321 for controlling the operation of the electronic device 300, and the basic input / output system (BIOS) 322 for controlling the low-level operations of the electronic device 300. Additionally, it can store a web browser 323, a data storage management system 324, and an intelligent decision-making generation device 325 for water supply projects, etc. The aforementioned intelligent decision-making generation device 325 for water supply projects can be the application program that specifically implements the aforementioned steps in this embodiment of the invention. In summary, when the technical solution provided in this embodiment of the invention is implemented through software or firmware, the relevant program code is stored in the memory 320 and is called and executed by the processor 310.
[0144] Input / output interface 313 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.
[0145] Network interface 314 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0146] Bus 330 includes a pathway for transmitting information between various components of the device, such as processor 310, video display adapter 311, disk drive 312, input / output interface 313, network interface 314, and memory 320.
[0147] It should be noted that although the above-described device only shows the processor 310, video display adapter 311, disk drive 312, input / output interface 313, network interface 314, memory 320, bus 330, etc., in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.
[0148] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for intelligent decision making for water supply projects, characterized in that, The method comprises the following steps: acquiring multi-source heterogeneous data from the same region and the same period of the water supply project, the multi-source heterogeneous data comprising M groups of input data; respectively pre-processing the M groups of input data to obtain M groups of feature vectors; performing abnormality judgment according to the M groups of feature vectors to obtain an abnormality judgment result; if the abnormality judgment result includes a target abnormality, fusing the M groups of feature vectors to obtain a fused feature vector; acquiring a search enhancement generation system, a knowledge graph, and a preferred large language model prompt instruction in the field of water supply projects; based on a preferred large language model, performing each processing step according to target information and the preferred large language model prompt instruction to obtain a first processing result corresponding to each processing step, wherein the target information comprises the search enhancement generation system, the knowledge graph, the abnormality judgment result, and the fused feature vector; if the first processing result cannot pass artificial review, based on an alternative large language model, performing each processing step according to the target information and an acquired alternative large language model prompt instruction to obtain a second processing result corresponding to each processing step; based on a deep neural network, determining a decision strategy for the water supply project according to the second processing result; wherein if the first processing result cannot pass artificial review, based on an alternative large language model, performing each processing step according to the target information and an acquired alternative large language model prompt instruction to obtain a second processing result corresponding to each processing step, comprising: based on an alternative large language model, determining sixth information according to the target information and a sixth prompt instruction, wherein the sixth information is a second abnormality feature of the water supply project in the same region and the same period; based on the alternative large language model, determining seventh information according to the sixth information, a seventh prompt instruction, and the target information, wherein the seventh information is a second cause of the second abnormality feature; based on the alternative large language model, determining eighth information according to the seventh information, an eighth prompt instruction, and the target information, wherein the eighth information is a second impact range of the second abnormality feature; based on the alternative large language model, determining ninth information according to the eighth information, a ninth prompt instruction, and the target information, wherein the ninth information is a second solution for the water supply project in the same region and the same period; based on the alternative large language model, determining tenth information according to the ninth information, a tenth prompt instruction, and the target information, wherein the tenth information is a second estimated implementation effect; wherein the sixth prompt instruction, the seventh prompt instruction, the eighth prompt instruction, the ninth prompt instruction, and the tenth prompt instruction are respectively used to instruct the alternative large language model to determine the sixth information, the seventh information, the eighth information, the ninth information, and the tenth information, and the second processing result comprises the sixth information, the seventh information, the eighth information, the ninth information, and the tenth information.
2. The method of claim 1, wherein, the abnormality judgment according to the M groups of feature vectors to obtain an abnormality judgment result comprises: According to the M characteristic vectors, abnormal detection is performed by statistical methods, machine learning methods and deep learning methods to obtain first, second and third abnormal scores respectively; According to the first, second and third abnormal scores and corresponding first, second and third weights, a target abnormal score is determined, which is a one-dimensional matrix, wherein one element in the one-dimensional matrix corresponds to no abnormality, and each of the remaining elements corresponds to one abnormality respectively; If the maximum element in the one-dimensional matrix is greater than the abnormal score threshold corresponding to the maximum element, the abnormality corresponding to the maximum element is determined as the target abnormality of the same region and same period of the water supply project; According to the target abnormality and the weight of the target abnormality, a comprehensive severity level is determined, and the abnormality judgment result includes the first, second and third abnormal scores, the target abnormal score, the target abnormality and the comprehensive severity level.
3. The method of claim 2, wherein, The method further comprises: If the target abnormality is different from the real abnormality, the first, second and third weights are updated.
4. The method of claim 1, wherein, According to the target information and the preferred large language model with prompt instructions, each processing step is performed based on the preferred large language model to obtain a first processing result corresponding to each processing step, which includes: According to the target information and the first prompt instruction, a first information is determined based on the preferred large language model, wherein the first information is a first abnormal feature of the same region and same period of the water supply project; According to the first information, the second prompt instruction and the target information, a second information is determined based on the preferred large language model, wherein the second information is a first reason for the first abnormal feature; According to the second information, the third prompt instruction and the target information, a third information is determined based on the preferred large language model, wherein the third information is a first influence range of the first abnormal feature; According to the third information, the fourth prompt instruction and the target information, a fourth information is determined based on the preferred large language model, wherein the fourth information is a first solution of the same region and same period of the water supply project; According to the fourth information, the fifth prompt instruction and the target information, a fifth information is determined based on the preferred large language model, wherein the fifth information is a first estimated implementation effect; The first, second, third, fourth and fifth prompt instructions are used to instruct the preferred large language model to determine the first, second, third, fourth and fifth information respectively, and the first processing result includes the first, second, third, fourth and fifth information.
5. The method of claim 1, wherein, The method further comprises: The decision strategy is recorded by a decision record contract of a blockchain; The control instructions and state changes of the physical devices in the water supply project are recorded by a device management contract of the blockchain; User permissions of the water supply project are managed through an access control contract of the blockchain; Audit logs of user operations are recorded through an audit tracking contract of the blockchain.
6. The method of claim 1 or 2, wherein, The method further comprises: obtaining constraint conditions, optimization objectives, and historical decision strategies of the water supply project; determining, based on a deep neural network, a decision strategy of the water supply project according to the second processing result, comprises: determining, based on the deep neural network, the decision strategy of the water supply project according to the second processing result and the constraint conditions, optimization objectives, historical decision strategies, and M sets of feature vectors of the water supply project.
7. An intelligent decision making device for water supply works, characterized in that, comprises: a multi-source heterogeneous data acquisition module configured to acquire multi-source heterogeneous data from the same region and the same period of the water supply project, the multi-source heterogeneous data comprising M sets of input data, M being a positive integer; a data preprocessing module configured to preprocess the M sets of input data respectively to obtain M sets of feature vectors; an anomaly judgment module configured to perform anomaly judgment according to the M sets of feature vectors to obtain an anomaly judgment result; a feature vector fusion module configured to fuse the M sets of feature vectors to obtain a fused feature vector if the anomaly judgment result comprises a target anomaly; a target acquisition module configured to acquire a search enhanced generation system, a knowledge graph, and a preferred large language model prompt instruction in the field of water supply engineering; a first processing module configured to perform each processing step based on a preferred large language model according to target information and the preferred large language model prompt instruction to obtain a first processing result corresponding to each processing step, the target information comprising the search enhanced generation system, the knowledge graph, the anomaly judgment result, and the fused feature vector; a second processing module configured to perform each processing step based on an alternative large language model according to the target information and an acquired alternative large language model prompt instruction to obtain a second processing result corresponding to each processing step if the first processing result cannot pass artificial review; a decision strategy determination module configured to determine a decision strategy of the water supply project based on a deep neural network according to the second processing result; the second processing module is specifically configured to determine sixth information of a second anomaly feature of the same region and the same period of the water supply project based on an alternative large language model according to the target information and a sixth prompt instruction; determine seventh information of a second cause of the second anomaly feature based on the alternative large language model according to the sixth information, a seventh prompt instruction, and the target information; and determine a decision strategy of the water supply project based on a deep neural network according to the seventh information. According to the seventh information, the eighth prompt instruction, and the target information, determine eighth information based on the alternative large language model, the eighth information being a second influence range of the second abnormal feature; according to the eighth information, a ninth prompt instruction, and the target information, determine ninth information based on the alternative large language model, the ninth information being a second solution of the water supply project in the same region and the same period; according to the ninth information, a tenth prompt instruction, and the target information, determine tenth information based on the alternative large language model, the tenth information being a second estimated implementation effect; wherein the sixth prompt instruction, the seventh prompt instruction, the eighth prompt instruction, the ninth prompt instruction, and the tenth prompt instruction are respectively used to instruct the alternative large language model to determine the sixth information, the seventh information, the eighth information, the ninth information, and the tenth information, and the second processing result includes the sixth information, the seventh information, the eighth information, the ninth information, and the tenth information.
8. An electronic device, comprising: Comprise: a memory and a processor, the processor and the memory communicate with each other through a bus; the memory stores program instructions executable by the processor, and the processor calling the program instructions can execute the method of any one of claims 1-6.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the method of any one of claims 1-6.
Citation Information
Patent Citations
Intelligent operation and maintenance method fusing multi-modal data and active learning
CN120198106A
Risk abnormal behavior event identification method based on multi-source risk abnormal behavior data fusion analysis
CN120930001A