A semantic interaction system and method based on a large water resources model
By constructing a fault knowledge network and a digital twin model, and combining physical laws and expert experience, simulated labeled samples are generated, solving the problem of data scarcity in the water industry and achieving efficient and low-cost model training and fault prediction.
Patent Information
- Application Number
- CN202611184726.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-11-10
AI Technical Summary
The water industry suffers from a scarcity of high-quality labeled data, which causes existing models to degrade in performance under new scenarios instead of improving. Furthermore, traditional methods rely on expensive destructive field experiments or lengthy data accumulation cycles.
By constructing a fault knowledge network and digital twin model for scarce data scenarios, and combining physical laws and domain expert experience, structured causal logic diagrams and simulated labeled samples are generated. Feature vectors and quality assessment mechanisms are used to screen and train models to solve the problem of data scarcity.
By generating massive amounts of simulated data covering various boundaries under a very small number of real fault modes, the performance of the model in scarce data scenarios is improved, costs and risks are reduced, and the credibility and acceptance rate of the engineering scheduling system are enhanced.
Smart Images

Figure CN123068543A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of semantic retrieval technology, specifically to a semantic interaction system and method based on a large water resources model. Background Technology
[0002] With the rapid development of artificial intelligence technology, the water industry is undergoing a profound transformation from traditional automated control to intelligent decision-making. Large-scale water models, as the core technological carrier of this transformation, are widely used in key business scenarios such as water supply scheduling optimization, water quality prediction and early warning, pipeline fault diagnosis, and pump station energy-saving control. Currently, deep learning-based time-series prediction models, knowledge graph-based fault reasoning systems, and digital twin-based simulation platforms have become the three mainstream technological routes for intelligent water management. Despite significant progress in data acquisition and basic modeling in the water industry, there is a severe shortage of high-quality labeled data for training large-scale models. The design principle of water systems is safety, reliability, and continuous operation. Therefore, abnormal events such as pipe bursts, severe water quality exceeding standards, and critical equipment failures occur very infrequently in actual production. The sample ratio of normal operating condition data to faulty operating condition data often reaches 10:1. 5 The data exhibits an extremely unbalanced distribution, with values of 1 or higher, making it nearly impossible for supervised learning algorithms to effectively learn fault modes from the data. Current technologies primarily address this issue through data transfer equations, but direct transfer can lead to a decline in model performance in new scenarios due to significant differences in processes and water quality between different wastewater treatment plants. Summary of the Invention
[0003] The purpose of this invention is to provide a semantic interaction system and method based on a large water resources model to solve the problems raised in the prior art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: A semantic interaction method based on a large water resources model, the method comprising the following steps: S100. Extract all scenario types from the water affairs big data model, collect fault labeling data for each scenario type, and calculate the normal quantity threshold of fault labeling data; extract existing fault labeling data for the scenario asked by the user during interaction, and determine whether the scenario asked is a scarce data scenario. Furthermore, the specific steps for determining whether the question scenario is a scarce data scenario are as follows: S101. Extract the number of fault labeling data for all scenario types. The fault labeling data represents the labeled fault records that occurred in the scenario history. For all scenarios, extract the historical data and train using the fault labeling data to output the interaction accuracy rate. The interaction accuracy rate represents the proportion of correct interactions between the historical scenario and the user to the total number of interactions. Calculate the average and standard deviation of the interaction accuracy rate for all scenarios. Subtract the standard deviation from the average to obtain the accuracy threshold. Use the number of fault labeling data for the scenario corresponding to the accuracy threshold as the normal quantity threshold. If the accuracy threshold does not correspond to a scenario, select the scenario with the closest difference in interaction accuracy rate as the normal quantity threshold. S102. Extract existing fault labeling data for the scenario asked by the user during interaction. When the existing fault labeling data is less than or equal to the normal quantity threshold, determine that the current user question scenario is a scarce data scenario.
[0005] S200. For scenarios with scarce data, extract fault variables and causal relationships from existing fault-labeled data, use fault variables as network nodes and causal relationships as directed edges of the network to construct a fault knowledge network for scenarios with scarce data. Furthermore, the specific steps for constructing the fault knowledge network for scarce data scenarios are as follows: S201. Collect existing fault-labeled data for scarce data scenarios and combine it with the experience of water industry experts to extract all fault-related state variables for the scarce data scenarios, and use the fault-related state variables as network nodes; for any two network nodes v p and v q If experts determine v based on existing fault labeling data and experience p The occurrence of the effect v q If this occurs, then a directed edge v is set up on the network. p →v q The network nodes include those with excessive COD concentration in the influent, pH value in the sedimentation tank below 6.5, and abnormal dosing pump frequency. The edge weight is calculated for each directed edge in the network using the following formula: ; In the formula, w pq Represents a directed edge v p →v q edge weights, D s (v) p v q This indicates that network node v appears simultaneously in all existing fault-labeled data. p and v q The number of existing fault labeling data, D s (v) p This indicates that network node v appears in all existing fault-labeled data. pThe number of existing fault-labeled data; adding 1 to the denominator to prevent division by zero; utilizing network nodes, directed edges, and edge weights in scenarios with scarce data to create a fault knowledge network; S202. For each network node, the fault-related state variables are required to be determined only by the parent node, where the parent node refers to all the upstream network nodes that point to the corresponding network node.
[0006] Transforming extremely limited, scattered data that cannot be directly used to train models into structured causal logic graphs is equivalent to weaving "scattered points" into a "deductive network".
[0007] When data is insufficient, domain experts are allowed to intervene and correct node relationships and weights, avoiding the predicament that pure data-driven approaches completely fail when there are very few samples.
[0008] S300: Extract all state variables of the scarce data scenario, construct a digital twin model based on physical laws and historical operation records of the scarce data scenario, and input the fault knowledge network into the digital twin model; Furthermore, the specific steps for constructing the digital twin model are as follows: S301. Extract all state variables of the scarce data scenario and define the state vector s of the scarce data scenario at any time t. t The state vector contains all state variables; the state variables include the current water level, influent flow rate, effluent flow rate, concentration of various water quality indicators, and operating parameters of various equipment, etc. Based on physical laws and historical operation records of scarce data scenarios, a state vector is constructed from s t to s t+1 The recurrence relation is used as the state transition equation, which is: ; In the formula, s t+1 Let a represent the state vector at time t+1. t ϵ represents the external impact of time t on the scarce data scenario. t M represents the process random noise at time t, which follows a normal distribution and is set by staff based on environmental interference from historical operation records in scarce data scenarios; Ω DTThis represents a combination of all physical laws and formulas in a scarce data scenario; these physical laws and formulas include water balance equations, pollutant convection and diffusion equations, etc.; a digital twin model is constructed using state transition equations; unlike black-box models that fit data, this twin is built based on the conservation laws of hydraulics and water chemistry; this means that the generated simulation trajectory can never "structurally" violate common sense physics, fundamentally eliminating absurd data such as "water flows uphill". Without creating leaks or adding pollutants in a real pipe network, the fault process can be reproduced infinitely in virtual space, acquiring massive amounts of time-series evolution data with zero risk and zero cost.
[0009] S302. Set up physical consistency verification. Professionals set verification rules according to each physical law formula. When the state variables in the digital twin model do not meet any verification rules, the simulated trajectory in the corresponding digital twin model is discarded and reconstructed. The simulated trajectory represents the state variables in the digital twin model caused by external influences. Then, through the state transition equation and all the changes in the knowledge network, the knowledge network is input into the digital twin model for combination.
[0010] S400. Extract fault labeling data from other scenarios of the water affairs big model and filter out rich data scenarios; extract feature vectors from rich data scenarios and scarce data scenarios, use feature vectors to calculate cosine similarity with scarce data scenarios, filter candidate scenarios, and extract the fault causes from the fault labeling data of candidate scenarios. Furthermore, the specific steps for extracting the fault cause from the fault annotation data of the candidate scene are as follows: S401. Extract fault labeling data from other scenarios of the water affairs big model, count the number of fault labeling data in each scenario, and judge it as a rich data scenario when the number of fault labeling data is greater than the normal number threshold; extract feature vectors from rich data scenarios and scarce data scenarios, the feature vectors include average pipe diameter, average flow velocity, average influent chemical oxygen demand (COD), standard deviation of influent COD, average daily treated water volume, etc. Calculate the cosine similarity Sim(Ω, R) of feature vectors in rich and scarce data scenarios. i ), with a preset similarity threshold τ, when Sim(Ω, R) i When ) ≥ τ, determine the rich data scenario R i For candidate scenarios, construct a candidate scenario set; when Sim(Ω, R) i When the threshold is less than τ, scenarios with abundant data are judged to be significantly different from those with scarce data and are discarded. By quantifying scenario characteristics, only scenarios with similar physical structures are allowed to enter the migration candidate pool, thus avoiding "negative migration" from the source.
[0011] S402. For the fault labeling data of each candidate scenario, extract the state vectors of the last normal state before the fault occurred and the first abnormal state after the fault occurred, and calculate the state difference vector using the following formula: △s=s after anomaly -s before nomal ; In the formula, Δs represents the state difference, and s after anomaly s represents the state vector of the first abnormal state after a failure occurs in the candidate scenario. before nomal This represents the state vector of the last normal state before the candidate scenario failure occurred; the average of the state difference vectors of all fault-labeled data is taken as the fault cause F. i The causes of failure in all candidate scenarios are integrated into a failure cause vector.
[0012] S500: Extract the state variables of the scarce data scenario during normal operation and input them into the digital twin model for initialization. Input the cause of the fault into the initialized digital twin model and output simulated labeled samples based on the fault knowledge network simulation iteration. Furthermore, the specific steps for iteratively outputting simulated labeled samples are as follows: S501. In scenarios with scarce data, extract the current normal operating state vector as the initial state input to the digital twin model for initialization. For each candidate scenario, the cause of the fault is taken as the external influence of the state transition equation. At the simulation start time t=0 of the digital twin model, a0=F i When t>0, let a t =0, a0 represents the external impact on the scarce data scenario at the start of the simulation; Based on the state transition equation and knowledge network, iterative simulations are performed in the digital twin model from time t=0 to t=T-1. The simulation is repeated E times for the same fault cause, and E can be set independently. The random noise in the process is different in each simulation. Each simulation's fault cause and all generated data constitute a simulated labeled sample, where the total number of simulated samples = E × the number of candidate scenarios. With only a very small number of real-world fault modes, hundreds or thousands of simulated trajectories covering various boundaries can be rapidly generated by injecting different cause vectors into the twin model and combining them with random noise perturbations, completely breaking the limitation of "small sample size" on model training.
[0013] The random noise seed for each simulation can be recorded, meaning that any "abnormal data" generated can be repeatedly verified and traced back, greatly enhancing the auditability of engineering experiments.
[0014] S600. Calculate the quality score of each simulated labeled sample and the existing fault labeled data in the scarce data scenario, set a screening threshold, use the screening threshold to judge the quality score of each simulated labeled sample, and output the qualified simulated labeled dataset. Furthermore, the specific steps for outputting the qualified simulated labeled dataset are as follows: S601. For each simulated labeled sample, calculate the Wasserstein distance between it and all existing fault labeled data in the scarce data scenario, and extract the minimum Wasserstein distance between the simulated labeled sample and all existing fault labeled data as the quality score W. Calculate the quality score of all simulated labeled samples, extract the median Med and interquartile range (IQR) of the quality scores of all simulated labeled samples, and calculate the screening threshold δ, with the formula: δ=Med-λ×IQR, where λ represents an adjustable parameter; dynamically calculate the screening threshold based on the distribution characteristics of the simulated data itself, and the mechanism can adaptively remove the worst samples regardless of whether the overall quality of the simulated data is high or low.
[0015] S602. Use the screening threshold to screen all simulated annotation samples. When W≤δ, discard the corresponding simulated annotation sample and keep the simulated annotation sample as qualified simulated annotation sample and form a qualified simulated annotation dataset. The screening confidence level is calculated using the number of qualified simulated labeled samples, where the screening confidence level = number of qualified simulated labeled samples / total number of simulated labeled samples.
[0016] S700: When the water affairs big data model interacts with users semantically, the real data loss function of the existing fault-labeled data and the simulated data loss function of the qualified simulated labeled samples are defined respectively. The weights of the real data loss function and the simulated data loss function are calculated. The weights are used to combine the real data loss function and the simulated data loss function to form the total loss function for training the scarce data scenario. After training is completed, the user's question is answered.
[0017] Furthermore, the specific steps for training on scarce data scenarios by combining the real data loss and simulated data loss using weights to form a total loss are as follows: S701. When the water affairs big data model interacts with the user semantics, let L be the real data loss function of the existing fault-labeled data defined during the training of the water affairs big data model. real The loss function for the simulated data of qualified simulated labeled samples is L. sim Specifically: ; In the formula, D Ω R D represents the number of existing fault labeling data. Ω FilThe number of qualified simulated labeled samples is represented by x, which represents the input features during training, and y represents the true label during training. θ (x) represents the predicted output of the current large-scale water management model for input x under parameter θ; g represents the basic loss function, which is set by professionals; S702. Calculate the weights of the loss function for the real data using the training epochs. The formula is: ; In the formula, α(r) represents the weight of the loss function of the real data at the current training epoch r, k represents the decay rate parameter, and r0 represents half of the total training epochs; The weights of the loss function for the real data are optimized using the screening confidence level. The formula is: α(r)'=α(r)×β+(1-β), where α(r)' represents the weights of the loss function for the real data after optimization. S703. Using the weights of the optimized real data loss function, combine the real data loss function and the simulated data loss function to form the total loss function, the formula is: L total =α(r)'×L real (1-α(r)')×L sim L total Indicates the total loss; The total loss is calculated in each round of training, and the model parameters θ are updated through backpropagation to minimize the loss; the water management big data model after training is used to respond to user questions.
[0018] A semantic interaction system based on a large water affairs model, comprising a current scene judgment module, a fault knowledge network module, a digital twin model module, a fault cause extraction module, a sample simulation module, a quality assessment module, and a fusion training module; The current scenario judgment module is used to extract all scenario types in the water affairs big model, statistically analyze fault labeling data for each scenario type, calculate the normal quantity threshold of fault labeling data, extract existing fault labeling data for the scenario asked during user interaction, and determine whether the scenario asked is a scarce data scenario. The fault knowledge network module is used to extract fault variables and causal relationships from existing fault-labeled data for scarce data scenarios. Fault variables are used as network nodes and causal relationships are used as directed edges of the network to construct a fault knowledge network for scarce data scenarios. The digital twin model module is used to construct a digital twin model based on physical laws and historical operation records of scarce data scenarios, and to incorporate a fault knowledge network into the digital twin model. The fault cause extraction module is used to extract fault labeling data from other scenarios of the water affairs big model, filter out rich data scenarios, extract feature vectors from rich data scenarios and scarce data scenarios, use feature vectors to calculate cosine similarity with scarce data scenarios, filter candidate scenarios, and extract fault causes from fault labeling data of candidate scenarios. The sample simulation module is used to input the cause of the fault into the initialized digital twin model and output simulated labeled samples based on the fault knowledge network simulation iteration. The quality assessment module is used to calculate the quality score of each simulated labeled sample and the existing faulty labeled data in the scarce data scenario, set a screening threshold, use the screening threshold to judge the quality score of each simulated labeled sample, and output a qualified simulated labeled dataset. The fusion training module is used to define the real data loss function for existing fault-labeled data and the simulated data loss function for qualified simulated labeled samples, calculate the weights of the real data loss function and the simulated data loss function, and use the weights to combine the real data loss function and the simulated data loss function to form a total loss function for training in scarce data scenarios. After training is completed, it responds to user questions.
[0019] The fault cause extraction module includes candidate scenario units and fault cause units; The candidate scenario unit is used to extract fault labeling data from other scenarios of the water affairs big model, and filter out rich data scenarios; extract feature vectors from rich data scenarios and scarce data scenarios, and use the feature vectors to calculate the cosine similarity with scarce data scenarios to filter candidate scenarios. The fault cause unit is used to calculate the state difference vector of all fault labeling data and take the average value as the fault cause.
[0020] Compared with the prior art, the beneficial effects of the present invention are: 1. Traditional AI relies on "big data feeding," while this solution completely shifts to a new paradigm of "extracting causal relationships from limited data and using physical laws to calculate data." This solves the fundamental pain point in the water industry of "always scarce fault samples," eliminating reliance on expensive, destructive field experiments or lengthy data accumulation cycles.
[0021] 2. Each simulation data point generated by this solution has a clear physical cause, evolution process, and selection criteria. Engineers can clearly trace why the model makes a certain decision, greatly improving the reliability and acceptance rate of the water dispatching system in engineering projects. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the structure of a semantic interaction method based on a large water resources model according to the present invention. Detailed Implementation
[0023] 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, and 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.
[0024] Example: Figure 1 As shown, the present invention provides a technical solution. A semantic interaction method based on a large water resources model, the method comprising the following steps: S100. Extract all scenario types from the water affairs big data model, collect fault labeling data for each scenario type, and calculate the normal quantity threshold of fault labeling data; extract existing fault labeling data for the scenario asked by the user during interaction, and determine whether the scenario asked is a scarce data scenario. The specific steps for determining whether the question scenario is a scarce data scenario are as follows: S101. Extract the number of fault labeling data for all scenario types. The fault labeling data represents the labeled fault records that occurred in the scenario history. For all scenarios, extract the historical data and train using the fault labeling data to output the interaction accuracy rate. The interaction accuracy rate represents the proportion of correct interactions between the historical scenario and the user to the total number of interactions. Calculate the average and standard deviation of the interaction accuracy rate for all scenarios. Subtract the standard deviation from the average to obtain the accuracy threshold. Use the number of fault labeling data for the scenario corresponding to the accuracy threshold as the normal quantity threshold. If the accuracy threshold does not correspond to a scenario, select the scenario with the closest difference in interaction accuracy rate as the normal quantity threshold. S102. Extract existing fault labeling data for the scenario asked by the user during interaction. When the existing fault labeling data is less than or equal to the normal quantity threshold, determine that the current user question scenario is a scarce data scenario.
[0025] S200. For scenarios with scarce data, extract fault variables and causal relationships from existing fault-labeled data, use fault variables as network nodes and causal relationships as directed edges of the network to construct a fault knowledge network for scenarios with scarce data. The specific steps for constructing a fault knowledge network for scarce data scenarios are as follows: S201. Collect existing fault-labeled data for scarce data scenarios and combine it with the experience of water industry experts to extract all fault-related state variables for the scarce data scenarios, and use the fault-related state variables as network nodes; for any two network nodes v p and v q If experts determine v based on existing fault labeling data and experience p The occurrence of the effect v qIf this occurs, then a directed edge v is set up on the network. p →v q The network nodes include those with excessive COD concentration in the influent, pH value in the sedimentation tank below 6.5, and abnormal dosing pump frequency. The edge weight is calculated for each directed edge in the network using the following formula: ; In the formula, w pq Represents a directed edge v p →v q edge weights, D s (v) p v q This indicates that network node v appears simultaneously in all existing fault-labeled data. p and v q The number of existing fault labeling data, D s (v) p This indicates that network node v appears in all existing fault-labeled data. p The number of existing fault-labeled data; adding 1 to the denominator to prevent division by zero; utilizing network nodes, directed edges, and edge weights in scenarios with scarce data to create a fault knowledge network; S202. For each network node, the fault-related state variables are required to be determined only by the parent node, where the parent node refers to all the upstream network nodes that point to the corresponding network node.
[0026] Transforming extremely limited, scattered data that cannot be directly used to train models into structured causal logic graphs is equivalent to weaving "scattered points" into a "deductive network".
[0027] When data is insufficient, domain experts are allowed to intervene and correct node relationships and weights, avoiding the predicament that pure data-driven approaches completely fail when there are very few samples.
[0028] S300: Extract all state variables of the scarce data scenario, construct a digital twin model based on physical laws and historical operation records of the scarce data scenario, and input the fault knowledge network into the digital twin model; The specific steps for constructing the digital twin model are as follows: S301. Extract all state variables of the scarce data scenario and define the state vector s of the scarce data scenario at any time t. t The state vector contains all state variables; the state variables include the current water level, influent flow rate, effluent flow rate, concentration of various water quality indicators, and operating parameters of various equipment, etc. Based on physical laws and historical operation records of scarce data scenarios, a state vector is constructed from s t to s t+1 The recurrence relation is used as the state transition equation, which is: ; In the formula, s t+1 Let a represent the state vector at time t+1. t ϵ represents the external impact of time t on the scarce data scenario. t M represents the process random noise at time t, which follows a normal distribution and is set by staff based on environmental interference from historical operation records in scarce data scenarios; Ω DT This represents a combination of all physical laws and formulas in a scarce data scenario; these physical laws and formulas include water balance equations, pollutant convection and diffusion equations, etc.; a digital twin model is constructed using state transition equations; unlike black-box models that fit data, this twin is built based on the conservation laws of hydraulics and water chemistry; this means that the generated simulation trajectory can never "structurally" violate common sense physics, fundamentally eliminating absurd data such as "water flows uphill". Without creating leaks or adding pollutants in a real pipe network, the fault process can be reproduced infinitely in virtual space, acquiring massive amounts of time-series evolution data with zero risk and zero cost.
[0029] S302. Set up physical consistency verification. Professionals set verification rules according to each physical law formula. When the state variables in the digital twin model do not meet any verification rules, the simulated trajectory in the corresponding digital twin model is discarded and reconstructed. The simulated trajectory represents the state variables in the digital twin model caused by external influences. Then, through the state transition equation and all the changes in the knowledge network, the knowledge network is input into the digital twin model for combination.
[0030] S400. Extract fault labeling data from other scenarios of the water affairs big model and filter out rich data scenarios; extract feature vectors from rich data scenarios and scarce data scenarios, use feature vectors to calculate cosine similarity with scarce data scenarios, filter candidate scenarios, and extract the fault causes from the fault labeling data of candidate scenarios. The specific steps for extracting the fault cause from the fault annotation data of the candidate scene are as follows: S401. Extract fault labeling data from other scenarios of the water affairs big model, count the number of fault labeling data in each scenario, and judge it as a rich data scenario when the number of fault labeling data is greater than the normal number threshold; extract feature vectors from rich data scenarios and scarce data scenarios, the feature vectors include average pipe diameter, average flow velocity, average influent chemical oxygen demand (COD), standard deviation of influent COD, average daily treated water volume, etc. Calculate the cosine similarity Sim(Ω, R) of feature vectors in rich and scarce data scenarios. i ), with a preset similarity threshold τ, when Sim(Ω, R) i When ) ≥ τ, determine the rich data scenario Ri For candidate scenarios, construct a candidate scenario set; when Sim(Ω, R) i When the threshold is less than τ, scenarios with abundant data are judged to be significantly different from those with scarce data and are discarded. By quantifying scenario characteristics, only scenarios with similar physical structures are allowed to enter the migration candidate pool, thus avoiding "negative migration" from the source.
[0031] S402. For the fault labeling data of each candidate scenario, extract the state vectors of the last normal state before the fault occurred and the first abnormal state after the fault occurred, and calculate the state difference vector using the following formula: △s=s after anomaly -s before nomal ; In the formula, Δs represents the state difference, and s after anomaly s represents the state vector of the first abnormal state after a failure occurs in the candidate scenario. before nomal This represents the state vector of the last normal state before the candidate scenario failure occurred; the average of the state difference vectors of all fault-labeled data is taken as the fault cause F. i The causes of failure in all candidate scenarios are integrated into a failure cause vector.
[0032] S500: Extract the state variables of the scarce data scenario during normal operation and input them into the digital twin model for initialization. Input the cause of the fault into the initialized digital twin model and output simulated labeled samples based on the fault knowledge network simulation iteration. The specific steps for iteratively outputting simulated labeled samples are as follows: S501. In scenarios with scarce data, extract the current normal operating state vector as the initial state input to the digital twin model for initialization. For each candidate scenario, the cause of the fault is taken as the external influence of the state transition equation. At the simulation start time t=0 of the digital twin model, a0=F i When t>0, let a t =0, a0 represents the external impact on the scarce data scenario at the start of the simulation; Based on the state transition equation and knowledge network, iterative simulations are performed in the digital twin model from time t=0 to t=T-1. The simulation is repeated E times for the same fault cause, and E can be set independently. The random noise in the process is different in each simulation. Each simulation's fault cause and all generated data constitute a simulated labeled sample, where the total number of simulated samples = E × the number of candidate scenarios. With only a very small number of real-world fault modes, hundreds or thousands of simulated trajectories covering various boundaries can be rapidly generated by injecting different cause vectors into the twin model and combining them with random noise perturbations, completely breaking the limitation of "small sample size" on model training.
[0033] The random noise seed for each simulation can be recorded, meaning that any "abnormal data" generated can be repeatedly verified and traced back, greatly enhancing the auditability of engineering experiments.
[0034] S600. Calculate the quality score of each simulated labeled sample and the existing fault labeled data in the scarce data scenario, set a screening threshold, use the screening threshold to judge the quality score of each simulated labeled sample, and output the qualified simulated labeled dataset. The specific steps for outputting a qualified simulated labeled dataset are as follows: S601. For each simulated labeled sample, calculate the Wasserstein distance between it and all existing fault labeled data in the scarce data scenario, and extract the minimum Wasserstein distance between the simulated labeled sample and all existing fault labeled data as the quality score W. Calculate the quality score of all simulated labeled samples, extract the median Med and interquartile range (IQR) of the quality scores of all simulated labeled samples, and calculate the screening threshold δ, with the formula: δ=Med-λ×IQR, where λ represents an adjustable parameter; dynamically calculate the screening threshold based on the distribution characteristics of the simulated data itself, and the mechanism can adaptively remove the worst samples regardless of whether the overall quality of the simulated data is high or low.
[0035] S602. Use the screening threshold to screen all simulated annotation samples. When W≤δ, discard the corresponding simulated annotation sample and keep the simulated annotation sample as qualified simulated annotation sample and form a qualified simulated annotation dataset. The screening confidence level is calculated using the number of qualified simulated labeled samples, where the screening confidence level = number of qualified simulated labeled samples / total number of simulated labeled samples.
[0036] S700: When the water affairs big data model interacts with users semantically, the real data loss function of the existing fault-labeled data and the simulated data loss function of the qualified simulated labeled samples are defined respectively. The weights of the real data loss function and the simulated data loss function are calculated. The weights are used to combine the real data loss function and the simulated data loss function to form the total loss function for training the scarce data scenario. After training is completed, the user's question is answered.
[0037] The specific steps for training on scarce data scenarios by combining the real data loss and simulated data loss with weights to form a total loss are as follows: S701. When the water affairs big data model interacts with the user semantically, let L be the real data loss function of the existing fault-labeled data defined during the training of the water affairs big data model. real The loss function for the simulated data of qualified simulated labeled samples is L. sim Specifically: ; In the formula, D Ω R D represents the number of existing fault labeling data. Ω Fil The number of qualified simulated labeled samples is represented by x, which represents the input features during training, and y represents the true label during training. θ (x) represents the predicted output of the current large-scale water management model for input x under parameter θ; g represents the basic loss function, which is set by professionals; S702. Calculate the weights of the loss function for the real data using the training epochs. The formula is: ; In the formula, α(r) represents the weight of the loss function of the real data at the current training epoch r, k represents the decay rate parameter, and r0 represents half of the total training epochs; The weights of the loss function for the real data are optimized using the screening confidence level. The formula is: α(r)'=α(r)×β+(1-β), where α(r)' represents the weights of the loss function for the real data after optimization. S703. Using the weights of the optimized real data loss function, combine the real data loss function and the simulated data loss function to form the total loss function, the formula is: L total =α(r)'×L real (1-α(r)')×L sim L total Indicates the total loss; The total loss is calculated in each round of training, and the model parameters θ are updated through backpropagation to minimize the loss; the water management big data model after training is used to respond to user questions.
[0038] A semantic interaction system based on a large water affairs model, comprising a current scene judgment module, a fault knowledge network module, a digital twin model module, a fault cause extraction module, a sample simulation module, a quality assessment module, and a fusion training module; The current scenario judgment module is used to extract all scenario types in the water affairs big model, statistically analyze fault labeling data for each scenario type, calculate the normal quantity threshold of fault labeling data, extract existing fault labeling data for the scenario asked during user interaction, and determine whether the scenario asked is a scarce data scenario. The fault knowledge network module is used to extract fault variables and causal relationships from existing fault-labeled data for scarce data scenarios. Fault variables are used as network nodes and causal relationships are used as directed edges of the network to construct a fault knowledge network for scarce data scenarios. The digital twin model module is used to construct a digital twin model based on physical laws and historical operation records of scarce data scenarios, and to incorporate a fault knowledge network into the digital twin model. The fault cause extraction module is used to extract fault labeling data from other scenarios of the water affairs big model, filter out rich data scenarios, extract feature vectors from rich data scenarios and scarce data scenarios, use feature vectors to calculate cosine similarity with scarce data scenarios, filter candidate scenarios, and extract fault causes from fault labeling data of candidate scenarios. The sample simulation module is used to input the cause of the fault into the initialized digital twin model and output simulated labeled samples based on the fault knowledge network simulation iteration. The quality assessment module is used to calculate the quality score of each simulated labeled sample and the existing faulty labeled data in the scarce data scenario, set a screening threshold, use the screening threshold to judge the quality score of each simulated labeled sample, and output a qualified simulated labeled dataset. The fusion training module is used to define the real data loss function for existing fault-labeled data and the simulated data loss function for qualified simulated labeled samples, calculate the weights of the real data loss function and the simulated data loss function, and use the weights to combine the real data loss function and the simulated data loss function to form a total loss function for training in scarce data scenarios. After training is completed, it responds to user questions.
[0039] The fault cause extraction module includes candidate scenario units and fault cause units; The candidate scenario unit is used to extract fault labeling data from other scenarios of the water affairs big model, and filter out rich data scenarios; extract feature vectors from rich data scenarios and scarce data scenarios, and use the feature vectors to calculate the cosine similarity with scarce data scenarios to filter candidate scenarios. The fault cause unit is used to calculate the state difference vector of all fault labeling data and take the average value as the fault cause. Example
[0040] A water affairs scenario dataset from a wastewater treatment plant was selected, with a similarity threshold of 0.7, a loss decay coefficient of 0.02, a balance coefficient of 0.8, an adjustable quality score parameter of 1.5, 2 simulations per candidate scenario, a total of 100 training rounds, and 50 half-rounds. The plant area has a total of 8 water-related scenarios, with scenarios 1-7 being rich data scenarios and scenario 8 being a scarce data scenario;
[0041] The accuracy threshold is calculated as 0.893125 - 0.069277 = 0.823848, and the normal number threshold is 273. Suppose that in rare scenario 8, the fault variables include sedimentation tank pH < 6.5, influent COD exceeding the standard, and abnormal dosing pump frequency; There are 12 instances of historical labeled data where both (v1 and v2) appear simultaneously, and 15 instances where only (v1) appears. The edge weight is calculated to be 0.75, and a weighted directed fault knowledge network is constructed.
[0042] Extract the feature vector of Scenario 8 (Ω=[1.2,0.65,125,18.3,820]) and the feature vector of Scenario 1 (R1=[1.18,0.63,122,17.9,815]), calculate the cosine similarity (Sim(Ω,R1)=0.91≥0.7), and include them in the candidates; Scenario 4 has a similarity of 0.65 (<0.7), so it is discarded. The final candidate scenario set is: {Scenario 1, Scenario 3, Scenario 5}.
[0043] Extract the first existing fault-labeled data for Scenario 1: the normal state vector before the fault [1.15, 0.62, 118, 16.2, 805], and the abnormal state vector after the fault [1.28, 0.71, 142]. [,21.5,836], calculate the state difference [0.13, 0.09, 24, 5.3, 31]; calculate the fault cause of scenario 1 with average fault label data = [0.12, 0.08, 22.6, 4.9, 29.7]; The cause of the failure was input into the digital twin model for iterative simulation, and simulated labeled samples were output. The Wasserstein distance W between each of the 60 simulated samples and the real failure data in scenario 8 was calculated to obtain the total quality score. The screening threshold was 2.16-1.5×0.48=1.44. Finally, 42 qualified samples were retained. The screening confidence level was 0.7.
[0044] When the training rounds r=30, the base value of the true loss weight is 0.731. The weight is optimized by introducing the confidence level: 0.731×0.8+0.2=0.7848. After calculating the total loss function, the backpropagation is minimized in each round. After training, the water big data model receives user questions about water quality and equipment failures and outputs accurate semantic interactive answers.
[0045] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A semantic interaction method based on a large water resources model, characterized in that: The method includes the following steps: S100. Extract all scenario types from the water affairs big data model, collect fault labeling data for each scenario type, and calculate the normal quantity threshold of fault labeling data; extract existing fault labeling data for the scenario asked by the user during interaction, and determine whether the scenario asked is a scarce data scenario. S200. For scenarios with scarce data, extract fault variables and causal relationships from existing fault-labeled data, use fault variables as network nodes and causal relationships as directed edges of the network to construct a fault knowledge network for scenarios with scarce data. S300: Based on physical laws and historical operation records of scarce data scenarios, a digital twin model is constructed, and a fault knowledge network is incorporated into the digital twin model; S400. Extract fault labeling data from other scenarios of the water affairs big model and filter out rich data scenarios; extract feature vectors from rich data scenarios and scarce data scenarios, use feature vectors to calculate cosine similarity with scarce data scenarios, filter candidate scenarios, and extract the fault causes from the fault labeling data of candidate scenarios. S500: Input the cause of the fault into the initialized digital twin model and output simulated labeled samples based on the fault knowledge network simulation iteration. S600. Calculate the quality score of each simulated labeled sample and the existing fault labeled data in the scarce data scenario, set a screening threshold, use the screening threshold to judge the quality score of each simulated labeled sample, and output the qualified simulated labeled dataset. S700: Define the real data loss function for existing fault-labeled data and the simulated data loss function for qualified simulated labeled samples respectively. Calculate the weights of the real data loss function and the simulated data loss function. Use the weights to combine the real data loss function and the simulated data loss function to form the total loss function. Train the system for scarce data scenarios. After training, respond to user questions.
2. The semantic interaction method based on a large water resources model according to claim 1, characterized in that: The specific steps in S100 to determine whether the query scenario is a scarce data scenario are as follows: Extract the number of fault annotation data for all scenario types. The fault annotation data represents the labeled fault records that occurred in the scenario history. For all scenarios, extract the historical data and train using the fault annotation data to output the interaction accuracy rate. The interaction accuracy rate represents the proportion of correct interactions between the historical scenario and the user to the total number of interactions. Calculate the average and standard deviation of the interaction accuracy rate for all scenarios. Subtract the standard deviation from the average to obtain the accuracy threshold. Use the number of fault annotation data for the scenario corresponding to the accuracy threshold as the normal quantity threshold. If the accuracy threshold does not correspond to a scenario, select the scenario with the closest interaction accuracy rate as the normal quantity threshold. Extract existing fault labeling data for the scenario asked during user interaction. If the existing fault labeling data is less than or equal to the normal quantity threshold, the current user question scenario is determined to be a scarce data scenario.
3. The semantic interaction method based on a large water resources model according to claim 1, characterized in that: The fault knowledge network for scarce data scenarios constructed in S200 specifically involves: By collecting existing fault-labeled data from scarce data scenarios and combining it with the experience of water industry experts, all fault-related state variables in the scarce data scenarios are extracted, and these fault-related state variables are used as network nodes; for any two network nodes v p and v q If experts determine v based on existing fault labeling data and experience p The occurrence of the effect v q If this occurs, then a directed edge v is set up on the network. p →v q ; For each directed edge of the network, utilize the network node v that appears simultaneously in all existing fault-labeled data. p and v q The number of existing fault labeling data divided by the number of network nodes v appearing in all existing fault labeling data. p The weights of the edges are calculated by counting the number of existing fault-labeled data. Fault knowledge network utilizing network nodes, directed edges, and edge weights in scenarios where data is scarce; For each network node, the fault-related state variables are required to be determined only by the parent node, which refers to all the upstream network nodes that point to the corresponding network node.
4. The semantic interaction method based on a large water resources model according to claim 1, characterized in that: The construction of the digital twin model in S300 specifically involves: Extract all state variables of the scarce data scenario and define the state vector s of the scarce data scenario at any time t. t The state vector contains all state variables; Based on physical laws and historical operation records of scarce data scenarios, a state vector is constructed from s t to s t+1 The recursive relationship is used as the state transition equation, and the state transition equation is used to construct a digital twin model; Physical consistency verification is set up. Professionals set verification rules according to the formula of each physical law. When the state variables in the digital twin model do not meet any verification rule, the simulated trajectory in the corresponding digital twin model is discarded and reconstructed. The simulated trajectory represents the state variables in the digital twin model caused by external influences. Then, through the state transition equation and all the changes in the knowledge network, the knowledge network is input into the digital twin model for integration.
5. The semantic interaction method based on a large water resources model according to claim 1, characterized in that: The specific cause of the fault in the fault labeling data of the candidate scene extracted in S400 is as follows: Extract fault labeling data from other scenarios in the water affairs big data model, count the number of fault labeling data in each scenario, and judge it as a rich data scenario when the number of fault labeling data is greater than the normal number threshold; extract feature vectors from rich data scenarios and scarce data scenarios. Calculate the cosine similarity Sim(Ω, R) of feature vectors in rich and scarce data scenarios. i ), with a preset similarity threshold τ, when Sim(Ω, R) i When ) ≥ τ, determine the rich data scenario R i For candidate scenarios, construct a candidate scenario set; when Sim(Ω, R) i When τ < τ, discard data if there is a significant difference between rich and scarce data scenarios. For each candidate scenario's fault labeling data, extract the state vectors of the last normal state before the fault occurred and the first abnormal state after the fault occurred, calculate the state difference vector, and take the average of the calculated state difference vectors of all fault labeling data as the fault cause F. i The causes of failure in all candidate scenarios are integrated into a failure cause vector.
6. The semantic interaction method based on a large water resources model according to claim 1, characterized in that: The simulated iterative output of the simulated labeled samples in S500 specifically refers to: In scenarios with scarce data, the current normal operating state vector is extracted and used as the initial state input into the digital twin model for initialization. For each candidate scenario, the cause of the failure is taken as the external influence of the state transition equation. At the simulation start time t=0 of the digital twin model, a0=F i When t>0, let a t =0, a0 represents the external impact on the scarce data scenario at the start of the simulation; a t This represents the external impact of time t on the scarce data scenario; Based on the state transition equation and knowledge network, iterative simulations are performed in the digital twin model from time t=0 to t=T-1. The simulation is repeated E times for the same fault cause, and E can be set independently. The random noise in the process is different in each simulation. Each simulation's fault cause and all the data generated during the simulation constitute a simulation labeled sample. Let the total number of simulation samples = E × the number of candidate scenarios.
7. The semantic interaction method based on a large water resources model according to claim 1, characterized in that: The specific output of the qualified simulated labeled dataset in S600 is as follows: For each simulated labeled sample, calculate the Wasserstein distance between it and all existing fault labeled data in the scarce data scenario, and extract the minimum Wasserstein distance between the simulated labeled sample and all existing fault labeled data as the quality score W. Calculate the quality score of all simulated labeled samples, extract the median Med and interquartile range (IQR) of the quality scores of all simulated labeled samples, and calculate the screening threshold δ. The formula is: δ=Med-λ×IQR, where λ represents an adjustable parameter. All simulated annotation samples are filtered using a screening threshold. When W≤δ, the corresponding simulated annotation sample is discarded, and the remaining simulated annotation samples are used as qualified simulated annotation samples to form a qualified simulated annotation dataset. The screening confidence score is calculated using the number of qualified simulated annotation samples, where the screening confidence score = number of qualified simulated annotation samples / total number of simulated annotation samples.
8. The semantic interaction method based on a large water resources model according to claim 7, characterized in that: In the S700, the loss function for real data and the loss function for simulated data are combined using weights to form a total loss function for training in the scarce data scenario. Specifically: When the water affairs big data model interacts with user semantics, let L be the real data loss function of the existing fault-labeled data defined during the training of the water affairs big data model. real The loss function for the simulated data of qualified simulated labeled samples is L. sim; The weights α(r) of the loss function based on the training epochs are calculated. The weights of the loss function for the real data are optimized using the screening confidence level. The formula is: α(r)'=α(r)×β+(1-β), where α(r)' represents the weights of the loss function for the real data after optimization. The total loss function is constructed by combining the real data loss function and the simulated data loss function using the weights of the optimized real data loss function. The formula is: L total =α(r)'×L real (1-α(r)')×L sim L total Indicates the total loss; The total loss is calculated in each round of training, and the model parameters θ are updated through backpropagation to minimize the loss; the water management big data model after training is used to respond to user questions.
9. A semantic interaction system based on a large water resources model, characterized in that: The semantic interaction system includes a current scene judgment module, a fault knowledge network module, a digital twin model module, a fault cause extraction module, a sample simulation module, a quality assessment module, and a fusion training module. The current scenario judgment module is used to extract all scenario types in the water affairs big model, statistically analyze fault labeling data for each scenario type, and calculate the normal quantity threshold of fault labeling data. Extract existing fault-labeled data for the scenarios asked during user interaction and determine whether the scenario is a scarce data scenario; The fault knowledge network module is used to extract fault variables and causal relationships from existing fault-labeled data for scarce data scenarios. Fault variables are used as network nodes and causal relationships are used as directed edges of the network to construct a fault knowledge network for scarce data scenarios. The digital twin model module is used to construct a digital twin model based on physical laws and historical operation records of scarce data scenarios, and to incorporate a fault knowledge network into the digital twin model. The fault cause extraction module is used to extract fault labeling data from other scenarios of the water affairs big model, filter out rich data scenarios, extract feature vectors from rich data scenarios and scarce data scenarios, use feature vectors to calculate cosine similarity with scarce data scenarios, filter candidate scenarios, and extract fault causes from fault labeling data of candidate scenarios. The sample simulation module is used to input the cause of the fault into the initialized digital twin model and output simulated labeled samples based on the fault knowledge network simulation iteration. The quality assessment module is used to calculate the quality score of each simulated labeled sample and the existing faulty labeled data in the scarce data scenario, set a screening threshold, use the screening threshold to judge the quality score of each simulated labeled sample, and output a qualified simulated labeled dataset. The fusion training module is used to define the real data loss function for existing fault-labeled data and the simulated data loss function for qualified simulated labeled samples, calculate the weights of the real data loss function and the simulated data loss function, and use the weights to combine the real data loss function and the simulated data loss function to form a total loss function for training in scarce data scenarios. After training is completed, it responds to user questions.
10. A semantic interaction system based on a large water resources model according to claim 9, characterized in that: The fault cause extraction module includes a candidate scenario unit and a fault cause unit; The candidate scenario unit is used to extract fault labeling data from other scenarios of the water affairs big model, and filter out rich data scenarios; extract feature vectors from rich data scenarios and scarce data scenarios, and use the feature vectors to calculate the cosine similarity with scarce data scenarios to filter candidate scenarios. The fault cause unit is used to calculate the state difference vector of all fault labeling data and take the average value as the fault cause.
