A water and flood disaster prevention intelligent query system and method based on a water affair large model

CN123011986APending Publication Date: 2026-10-30SHENZHEN WATER SCI & TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611048343.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-15
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

更为隐蔽的是,部分系统通过缓存或近似查询来缩短响应时间,但本质上仍无法提供“此时此刻”的真实值

Benefits of technology

1、本发明通过动态测量系统延迟D,并利用加权线性外推预测未来D秒后的数值,向用户提供与查询时刻“准同步”的信息,满足防汛调度对实时性的严苛要求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011986A_ABST
    Figure CN123011986A_ABST
Patent Text Reader

Abstract

The application discloses a flood and drought disaster defense intelligent query system and method based on a water affair large model, relates to the technical field of water affair AI large model language query, and regards each input data as a data point, calculates the total quality score of each data point, judges pollution data and effective data to perform data cleaning, selects effective data and corresponding time stamps to calculate the average change rate of the effective data before the current system time, and predicts the future value of the effective data after reasonable delay by using the average change rate and a decay factor; when a user sends a query request to the query agent, the reasonable delay component of each data point is collected in real time, and the reasonable delay of the current user query is calculated; the future value corresponding to the user query data is displayed, and the future value calculation trace is attached, and the user verifies according to the calculation trace; the user is provided with information that is "quasi-synchronous" with the query time, and the strict requirement of real-time performance of flood control dispatching is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water resources AI large model language query technology, specifically to an intelligent query system and method for flood and drought disaster prevention based on a water resources large model. Background Technology

[0002] In recent years, with breakthroughs in large language model technology, some water utilities have begun to try to build intelligent agents based on large water models. These agents provide users with services such as water information inquiry, knowledge Q&A, and work order analysis through natural language interaction, which greatly reduces the operational threshold and improves the efficiency of information acquisition.

[0003] Despite the significant progress made in the aforementioned developments, existing systems use data from multiple sources, including sensors, manual reporting, and historical archives, directly or after simple cleaning, as the retrieval and training data for large-scale models. Hydrological sensors often produce anomalies due to lightning strikes, siltation, and drift; manual reporting contains input errors; and historical archives often contain incomplete or contradictory data. Once this "contaminated data" is learned by the large-scale model, it outputs erroneous information in fluent and confident natural language. Unlike traditional dashboards that display anomalies, large-scale models package errors as "authoritative answers," easily leading users to develop misplaced trust and make incorrect scheduling decisions. Secondly, flood and drought disaster prevention requires a response time of seconds or even sub-seconds for indicators such as reservoir water levels, river flow, and rainfall intensity. When a user queries "current water level," the system actually returns historical data from several minutes ago. Even more subtly, some systems shorten response time through caching or approximate queries, but fundamentally still cannot provide the true value "at this very moment."

[0004] In summary, the "composite illusion" generated by the superposition of pollution data and outdated data has not been identified or prevented by existing technologies, which is one of the biggest obstacles for current water management models to move from demonstration to real-world application. Summary of the Invention

[0005] The purpose of this invention is to provide an intelligent query system and method for flood and drought disaster prevention based on a large water resources model, so as to solve the problems raised in the prior art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: A smart query method for flood and drought disaster prevention based on a large-scale water resources model, the method comprising the following steps: S100. When constructing a query agent in the water affairs big data model, each input data is treated as a data point. The total quality score is calculated for each data point. Polluted data and valid data are judged and cleaned. The cleaned data is written to the cache database. Furthermore, the specific steps for writing the cleaned data into the cache database are as follows: S101. For each data point, check if there are any missing data fields. If there are no missing data fields, set an integrity score A(t). i When t is missing, the integrity score A(t) is set to 1. i The threshold value is 0; staff set physical thresholds for each data type. min L max ], L min L represents the lower limit of the physical threshold. max This represents the upper limit of the physical threshold; the physical threshold is used to judge each data point, and when the value of a data point is within the physical threshold, a physical rationality score B(t) is set. i When the value of a data point is outside the physical threshold, the physical rationality score B(t) is set to 1. i ) is 0; For data of the same type, calculate the average of the k neighboring data points for each data point, and then use this average to calculate the spatiotemporal consistency score of the corresponding data point. The formula is as follows: ; In the formula, C(t) i R(t) represents the spatiotemporal consistency score of the input data point at time i. i () represents the physical value of the input data point at time i. ϵ represents the average of the remaining k data points adjacent to the data point, and ϵ represents the minimum value to prevent division by zero; S102. After normalizing the integrity score, physical rationality score, and spatiotemporal consistency score, respectively, assign weights and sum them to obtain the total quality score for each data point. The formula is: ; In the formula, S(t) i The value represents the total quality score of the input data point at time i. w1, w2, and w3 are weighting coefficients, and their sum is 1. The weighting coefficients are adjusted and set by technicians based on experience. For example, w1=0.3, w2=0.4, and w3=0.3. Through scoring based on three dimensions of completeness, physical rationality, and spatiotemporal consistency, it can automatically identify and eliminate contaminated data caused by sensor drift, communication errors, and manual input errors, thus ensuring the reliability of subsequent predictions and queries from the source.

[0007] When S(t) i) is less than Sn, the data point is determined as polluted data, otherwise it is valid data; all polluted data are eliminated, and the valid data are written into the cache database. Sn represents a quality threshold, which is obtained by subtracting the standard deviation from the average value of the total quality scores of historical data points, and the historical data points adopt the total quality scores of data points in the past week. The quality threshold adopts the mean value of the total quality scores of historical data minus the standard deviation, which can dynamically adapt to the data fluctuations of different reservoirs and different seasons, and avoid misjudgment caused by a fixed threshold. The system automatically completes dirty data filtering, reduces the burden of operation and maintenance personnel checking item by item, and is especially suitable for the massive sensor data scenario in the water affairs field.

[0008] S200. Before the current system time, select valid data and corresponding timestamps to calculate the average change rate of the valid data, and use the average change rate and the attenuation factor to predict the future value of the valid data after a reasonable delay; Further, the specific steps of using the average change rate and the attenuation factor to predict the future value of the valid data after a reasonable delay are as follows: S201. Before the current system time, select the latest m valid data and corresponding timestamps, set the selected valid data as e-m+1 to e from front to back, and first calculate the change rate of the valid data in adjacent time intervals. The timestamp represents the actual collection time of the valid data, and the formula is: ; In the formula, r j represents the change rate of the valid data in the j-th time interval, R j represents the latter valid data in the j-th time interval, R j-1 represents the former valid data in the j-th time interval, T j represents the timestamp of the latter valid data in the j-th time interval, T j-1 represents the timestamp of the former valid data in the j-th time interval; j=e-m+2, ..., e; e represents the serial number of the last selected valid data; It is specified that when m≥3, the average change rate is continuously calculated, otherwise, the output is that prediction is not possible, please try again later; The m-1 calculated change rates are subjected to exponential weighted moving average calculation to obtain the average change rate of the valid data, and the formula is: ; In the formula, α represents the average change rate, λ represents the attenuation factor, the initial value of λ is set to 0.7, r t-k+1 represents the change rate of valid data at the system time e-k+1; adopting the exponential weighted moving average to assign a higher weight to the latest change rate can quickly respond to sudden water regimes such as sharp rise and sharp fall of water level, and is more sensitive than a simple arithmetic average.

[0009] S202. Predict the future value for each data point using the average rate of change of the effective data, using the formula: P=R t +α×D,R t This represents the current system time data point value, D represents the reasonable delay, and P represents the future value of the data point after the reasonable delay. Simultaneously calculate the radius of uncertainty for the predicted future value, using the following formula: ; In the formula, ε represents the radius of uncertainty, β represents the amplification factor, and j = e-m+2, ..., e. Instead of relying on large models to generate numerical values, it uses a lightweight sliding window for linear extrapolation, resulting in extremely fast calculation speeds (milliseconds). The prediction process is completely transparent, and users can verify the results themselves. It also outputs the prediction error range ε, preventing users from blindly trusting a single numerical value and providing a risk boundary for flood control decisions.

[0010] S300: When a user sends a query request to the query agent, the reasonable delay component of each data point is collected in real time, and the reasonable delay of the current user query is calculated. Furthermore, the specific steps for calculating the reasonable delay for the current user's query are as follows: S301. The system records the data point acquisition time, the time of entering the query agent, the time required for data cleaning, the time of writing to the cache database, the time when the user sends a query request to the query agent, and the time when the system generates the answer. The network transmission time is obtained by subtracting the data point acquisition time from the time the data point enters the query agent. The time required for data cleaning is defined as the quality verification time. The time of writing to the cache database is defined as the caching time. The response time is obtained by subtracting the time when the query request is sent from the time when the system generates the answer. The reasonable delay component includes network transmission time, quality verification time, buffer time, and response time. When a user sends a query request to the query agent, the records of the most recent n successful responses from the query agent are extracted, and the average of the n delays is calculated using the reasonable delay component as the reasonable delay. The formula is as follows: ; In the formula, D represents the reasonable delay, and d1 (i) d2 represents the network transmission time recorded in the i-th successful response record. (i) d3 represents the quality check time in the record of the i-th successful response. (i) d4 represents the cache time in the record of the i-th successful answer. (i) This represents the response time in the record of the i-th successful response. Components such as network transmission, quality verification, caching, and response are collected in real time, and the recent average value is used as a reasonable delay D to match the prediction time span with the actual system load, avoiding under-prediction or over-prediction caused by a fixed delay.

[0011] S400: Generate a quadruple for the future value of each data point, and attach a hash check value to the quadruple; Furthermore, the specific steps for attaching a hash check value to the quadruple are as follows: S401. Generate a quadruple for the future value of each data point, wherein the quadruple is (P, ε, T). target f id ), where T target T represents the future physical time corresponding to the future value. target =T q -D,T q This indicates the moment when the user sends a query request to the query agent; f id Indicates the formula number for calculating future values; The quadruple also includes a hash check value H that provides recalculation functionality, H = Hash(concat(T)). q , D, R (t i ), α, m, λ), where Hash uses a simple MD5 algorithm. The hash check value H is generated based on key parameters such as query time, latency, latest measured value, and rate of change. Modification of data at any stage will cause the hash comparison to fail, ensuring the reliability of the prediction results.

[0012] S500: Construct an illusion discrimination rule base, and use the illusion discrimination rule base to judge the quadruple of each data future value, and distinguish between the future value predicted by the query agent data and false data; Furthermore, the specific steps for distinguishing between the predicted future values ​​and false data from the query agent's data are as follows: S501, The hallucination discrimination rule base includes missing metadata, contradictory timestamps, inconsistent recalculation, unreasonable error range, and missing data source; The missing metadata means that when the output value does not have a four-tuple, it is judged as false data; The timestamp discrepancy indicates that if a certain data is displayed as a predicted future value, but T... target ≤T q The data was determined to be false. The inconsistency recomputability means that the future verification value P' is recalculated by substituting the data in the hash verification value. When |P'-P|>0.01×max(|P'|, |P|), it is judged as false data. The statement that the error range is unreasonable means that when the radius of uncertainty exceeds the maximum allowable range of physical variation of the data, it is judged as false data. The maximum allowable range of physical variation is set by professionals. The absence of a data source indicates that if a predicted future value is still output when m < 3, it is judged as false data. Through hard rules such as missing metadata, contradictory timestamps, inconsistent recalculation, excessive error, and insufficient data source, false numbers generated by the large model are accurately intercepted without mistakenly eliminating the system's normal prediction values.

[0013] S502. When the query agent answers a user's query request, for all numeric fields, it first iterates through the rules in the illusion discrimination rule base for judgment. If all rules are passed, it is judged as a future value and output; if any rule is triggered, it is judged as false data, the numeric field is deleted, and "Insufficient data to predict" is displayed instead, and an alarm is recorded. Once an illusion is detected, the system automatically replaces it with "Insufficient data to predict" and records an alarm to avoid passing error information to the user, while reminding maintenance personnel to check the large model or data source.

[0014] S600: Display the future value corresponding to the user's query data, along with the calculation traces of the future value, and the user can verify it based on the calculation traces; Furthermore, the specific steps for the user to verify based on computational traces are as follows: S601. Display the predicted future value, along with m valid data points with reasonable delays and usage, the calculation process of the average rate of change, the calculation process of the future value, and the radius of uncertainty. Directly display the m valid data points, the calculation process of the average rate of change, the prediction formula, and the error radius. Users can manually recalculate, eliminating distrust of "black box AI."

[0015] S700: After a reasonable delay, the query agent outputs the true value of the user's query data, calculates the actual error of the query data, and uses the actual error to optimize the attenuation factor.

[0016] Furthermore, the specific steps for optimizing the attenuation factor using actual errors are as follows: S701. After a reasonable delay, the query agent outputs the true value of the user's query data and calculates the actual error E of the query data, E=R(T target )-P,R(T target This indicates the actual value of the data queried by the user after a reasonable delay. The attenuation factor is optimized using the actual error, as shown in the formula: ; In the formula, λ new λ represents the optimized attenuation factor. oldλ represents the decay factor before optimization, and sign represents the decision function. When |E|>2ε, sign=1; when |E|<2ε, sign=-1; when |E|=2ε, sign=0. When the prediction error is consistently large, the decay factor λ is automatically reduced to make the sliding window consider historical data more evenly and avoid over-reliance on recent trends; conversely, λ is increased to accelerate the response to the current rate of change.

[0017] A smart query system for flood and drought disaster prevention based on a large water resources model. The smart query system for flood and drought disaster prevention includes a data quality module, a data prediction module, a reasonable delay module, a data verification module, an illusion judgment module, a display module, and a feedback optimization module. The data quality module is used to treat each input data as a data point when building a query agent in the water affairs big model, calculate the total quality score for each data point, judge the polluted data and valid data, clean the data, and write the cleaned data into the cache database. The data prediction module is used to select valid data and corresponding timestamps before the current system time, calculate the average rate of change of the valid data, and use the average rate of change and decay factor to predict the future value of the valid data after a reasonable delay. The reasonable delay module is used to collect the reasonable delay component of each data point in real time when the user sends a query request to the query agent, and calculate the reasonable delay of the current user query. The data verification module is used to generate a quadruple for the future value of each data, with a hash verification value attached to the quadruple; The hallucination judgment module is used to construct a hallucination discrimination rule base, and uses the hallucination discrimination rule base to judge the four-tuple of each data future value, distinguishing between the future value predicted by the query agent data and false data; The display module is used to display the future value corresponding to the user's query data, along with the calculation trace of the future value, which the user can verify based on the calculation trace; The feedback optimization module is used to query the agent to output the true value of the user's query data after a reasonable delay, calculate the actual error of the query data, and optimize the attenuation factor using the actual error.

[0018] The hallucination detection module includes a hallucination discrimination rule base unit and a judgment unit; The hallucination discrimination rule base unit includes missing metadata, contradictory timestamps, inconsistent recalculation, unreasonable error range, and missing data source; The judgment unit is used to judge the quadruple of each data future value using the illusion discrimination rule base, and to distinguish between the future value predicted by the query agent data and false data.

[0019] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention provides users with information that is "quasi-synchronous" with the query time by dynamically measuring the system delay D and using weighted linear extrapolation to predict the value D seconds later, thus meeting the stringent real-time requirements of flood control dispatch.

[0020] 2. Existing large models may fabricate numbers randomly when there is a lack of retrieval information. However, this invention adopts a dual guarantee of deterministic formula prediction and hard rule illusion discrimination: the predicted value comes with a recalcible formula, and the illusion discrimination rule base automatically intercepts any false values ​​that do not conform to physical logic or lack metadata, ensuring that every number seen by the user is verifiable. Attached Figure Description

[0021] Figure 1 This is a schematic diagram illustrating the steps of an intelligent query method for flood and drought disaster prevention based on a large water resources model, as proposed in this invention. Detailed Implementation

[0022] 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.

[0023] Example: Figure 1 As shown, the present invention provides a technical solution. A smart query method for flood and drought disaster prevention based on a large-scale water resources model, the method comprising the following steps: S100. When constructing a query agent in the water affairs big data model, each input data is treated as a data point. The total quality score is calculated for each data point. Polluted data and valid data are judged and cleaned. The cleaned data is written to the cache database. Furthermore, the specific steps for writing the cleaned data into the cache database are as follows: S101. For each data point, check if there are any missing data fields. If there are no missing data fields, set an integrity score A(t). i When t is missing, the integrity score A(t) is set to 1. i The threshold value is 0; staff set physical thresholds for each data type. min L max ], L min L represents the lower limit of the physical threshold. max This represents the upper limit of the physical threshold; the physical threshold is used to judge each data point, and when the value of a data point is within the physical threshold, a physical rationality score B(t) is set. i) is 1, and when the value of the data point is outside the physical threshold, the physical rationality score B(t i ) is set to 0; For the same type of data, calculate the average value of the remaining k data points adjacent to each data point, and use the average value to calculate the spatiotemporal consistency score of the corresponding data point. The formula is: ; In the formula, C(t i ) represents the spatiotemporal consistency score of the input data point at the i-th moment, R(t i ) represents the physical value of the input data point at the i-th moment, represents the average value of the remaining k data points adjacent to the data point, and ϵ represents a minimum value to prevent division by zero; S102: Normalize the completeness score, physical rationality score and spatiotemporal consistency score respectively, assign weights and sum them up to calculate the total quality score of each data point. The formula is: ; In the formula, S(t i ) represents the total quality score of the input data point at the i-th moment, w1, w2, w3 are weight coefficients with a sum of 1, which are adjusted and set by technicians according to experience. For example, w1=0.3, w2=0.4, w3=0.3 can be set; through the three-dimensional scoring of completeness, physical rationality and spatiotemporal consistency, polluted data caused by sensor drift, communication errors, manual entry errors, etc. can be automatically identified and eliminated, so as to ensure the reliability of subsequent prediction and query from the source.

[0024] When S(t i ) < Sn, the data point is judged as polluted data, otherwise it is valid data; all polluted data are eliminated, and the valid data are written into the cache database. Sn represents the quality threshold, which is obtained by subtracting the standard deviation from the average value of the total quality scores of historical data points, and the historical data points adopt the total quality scores of data points in the past week. The quality threshold adopts the mean value of the total quality scores of historical data minus the standard deviation, which can dynamically adapt to data fluctuations of different reservoirs and different seasons, and avoid misjudgment caused by fixed thresholds. The system automatically completes dirty data filtering, reducing the burden of one-by-one verification on operation and maintenance personnel, and is especially suitable for the massive sensor data scenario in the water affairs field.

[0025] S200: Before the current system time, select valid data and corresponding timestamps to calculate the average change rate of the valid data, and use the average change rate and attenuation factor to predict the future value of the valid data after a reasonable delay; Further, the specific steps of using the average change rate and the attenuation factor to predict the future value of the valid data after a reasonable delay are as follows: S201. Select the most recent m valid data points and their corresponding timestamps from before the current system time. Let the selected valid data range from e-m+1 to e. First, calculate the rate of change of valid data between adjacent time intervals. The timestamp represents the actual collection time of the valid data. The formula is: ; In the formula, r j R represents the rate of change of valid data in the j-th time interval. j R represents a valid data point after the j-th time interval. j-1 T represents the valid data preceding the j-th time interval. j T represents the timestamp of a valid data point after the j-th time interval. j-1 This represents the timestamp of the previous valid data in the j-th time interval; j = e - m + 2, ..., e; e represents the sequence number of the last valid data selected. When m≥3, continue calculating the average rate of change; otherwise, if the output cannot be predicted, please try again later. The average rate of change of the effective data is obtained by performing an exponentially weighted moving average on the calculated m-1 rates of change, using the following formula: ; In the formula, α represents the average rate of change, λ represents the decay factor, and the initial value of λ is set to 0.7. t-k+1 It represents the effective data change rate at system time e-k+1; by using an exponentially weighted moving average to give higher weight to the latest change rate, it can quickly respond to sudden water conditions such as sudden rises and falls in water level, and is more sensitive than a simple arithmetic average.

[0026] S202. Predict the future value for each data point using the average rate of change of the effective data, using the formula: P=R t +α×D,R t This represents the current system time data point value, D represents the reasonable delay, and P represents the future value of the data point after the reasonable delay. Simultaneously calculate the radius of uncertainty for the predicted future value, using the following formula: ; In the formula, ε represents the radius of uncertainty, β represents the amplification factor, and j = e-m+2, ..., e. Instead of relying on large models to generate numerical values, it uses a lightweight sliding window for linear extrapolation, resulting in extremely fast calculation speeds (milliseconds). The prediction process is completely transparent, and users can verify the results themselves. It also outputs the prediction error range ε, preventing users from blindly trusting a single numerical value and providing a risk boundary for flood control decisions.

[0027] S300: When a user sends a query request to the query agent, the reasonable delay component of each data point is collected in real time, and the reasonable delay of the current user query is calculated. Furthermore, the specific steps for calculating the reasonable delay for the current user's query are as follows: S301. The system records the data point acquisition time, the time of entering the query agent, the time required for data cleaning, the time of writing to the cache database, the time when the user sends a query request to the query agent, and the time when the system generates the answer. The network transmission time is obtained by subtracting the data point acquisition time from the time the data point enters the query agent. The time required for data cleaning is defined as the quality verification time. The time of writing to the cache database is defined as the caching time. The response time is obtained by subtracting the time when the query request is sent from the time when the system generates the answer. The reasonable delay component includes network transmission time, quality verification time, buffer time, and response time. When a user sends a query request to the query agent, the records of the most recent n successful responses from the query agent are extracted, and the average of the n delays is calculated using the reasonable delay component as the reasonable delay. The formula is as follows: ; In the formula, D represents the reasonable delay, and d1 (i) d2 represents the network transmission time recorded in the i-th successful response record. (i) d3 represents the quality check time in the record of the i-th successful response. (i) d4 represents the cache time in the record of the i-th successful answer. (i) This represents the response time in the record of the i-th successful response. Components such as network transmission, quality verification, caching, and response are collected in real time, and the recent average value is used as a reasonable delay D to match the prediction time span with the actual system load, avoiding under-prediction or over-prediction caused by a fixed delay.

[0028] S400: Generate a quadruple for the future value of each data point, and attach a hash check value to the quadruple; Furthermore, the specific steps for attaching a hash check value to the quadruple are as follows: S401. Generate a quadruple for the future value of each data point, wherein the quadruple is (P, ε, T). target f id ), where T target T represents the future physical time corresponding to the future value. target =T q -D,T q This indicates the moment when the user sends a query request to the query agent; f id Indicates the formula number for calculating future values; The quadruple also includes a hash check value H that provides recalculation functionality, H = Hash(concat(T)).q , D, R (t i ), α, m, λ), where Hash uses a simple MD5 algorithm. The hash check value H is generated based on key parameters such as query time, latency, latest measured value, and rate of change. Modification of data at any stage will cause the hash comparison to fail, ensuring the reliability of the prediction results.

[0029] S500: Construct an illusion discrimination rule base, and use the illusion discrimination rule base to judge the quadruple of each data future value, and distinguish between the future value predicted by the query agent data and false data; Furthermore, the specific steps for distinguishing between the predicted future values ​​and false data from the query agent's data are as follows: S501, The hallucination discrimination rule base includes missing metadata, contradictory timestamps, inconsistent recalculation, unreasonable error range, and missing data source; The missing metadata means that when the output value does not have a four-tuple, it is judged as false data; The timestamp discrepancy indicates that if a certain data is displayed as a predicted future value, but T... target ≤T q The data was determined to be false. The inconsistency recomputability means that the future verification value P' is recalculated by substituting the data in the hash verification value. When |P'-P|>0.01×max(|P'|, |P|), it is judged as false data. The statement that the error range is unreasonable means that when the radius of uncertainty exceeds the maximum allowable range of physical variation of the data, it is judged as false data. The maximum allowable range of physical variation is set by professionals. The absence of a data source indicates that if a predicted future value is still output when m < 3, it is judged as false data. Through hard rules such as missing metadata, contradictory timestamps, inconsistent recalculation, excessive error, and insufficient data source, false numbers generated by the large model are accurately intercepted without mistakenly eliminating the system's normal prediction values.

[0030] S502. When the query agent answers a user's query request, for all numeric fields, it first iterates through the rules in the illusion discrimination rule base for judgment. If all rules are passed, it is judged as a future value and output; if any rule is triggered, it is judged as false data, the numeric field is deleted, and "Insufficient data to predict" is displayed instead, and an alarm is recorded. Once an illusion is detected, the system automatically replaces it with "Insufficient data to predict" and records an alarm to avoid passing error information to the user, while reminding maintenance personnel to check the large model or data source.

[0031] S600: Display the future value corresponding to the user's query data, along with the calculation traces of the future value, and the user can verify it based on the calculation traces; Furthermore, the specific steps for the user to verify based on computational traces are as follows: S601. Display the predicted future value, along with m valid data points with reasonable delays and usage, the calculation process of the average rate of change, the calculation process of the future value, and the radius of uncertainty. Directly display the m valid data points, the calculation process of the average rate of change, the prediction formula, and the error radius. Users can manually recalculate, eliminating distrust of "black box AI."

[0032] S700: After a reasonable delay, the query agent outputs the true value of the user's query data, calculates the actual error of the query data, and uses the actual error to optimize the attenuation factor.

[0033] Furthermore, the specific steps for optimizing the attenuation factor using actual errors are as follows: S701. After a reasonable delay, the query agent outputs the true value of the user's query data and calculates the actual error E of the query data, E=R(T target )-P,R(T target This indicates the actual value of the data queried by the user after a reasonable delay. The attenuation factor is optimized using the actual error, as shown in the formula: ; In the formula, λ new λ represents the optimized attenuation factor. old λ represents the decay factor before optimization, and sign represents the decision function. When |E|>2ε, sign=1; when |E|<2ε, sign=-1; when |E|=2ε, sign=0. When the prediction error is consistently large, the decay factor λ is automatically reduced to make the sliding window consider historical data more evenly and avoid over-reliance on recent trends; conversely, λ is increased to accelerate the response to the current rate of change.

[0034] A smart query system for flood and drought disaster prevention based on a large water resources model. The smart query system for flood and drought disaster prevention includes a data quality module, a data prediction module, a reasonable delay module, a data verification module, an illusion judgment module, a display module, and a feedback optimization module. The data quality module is used to treat each input data as a data point when building a query agent in the water affairs big model, calculate the total quality score for each data point, judge the polluted data and valid data, clean the data, and write the cleaned data into the cache database. The data prediction module is used to select valid data and corresponding timestamps before the current system time, calculate the average rate of change of the valid data, and use the average rate of change and decay factor to predict the future value of the valid data after a reasonable delay. The reasonable delay module is used to collect the reasonable delay component of each data point in real time when the user sends a query request to the query agent, and calculate the reasonable delay of the current user query. The data verification module is used to generate a quadruple for the future value of each data, with a hash verification value attached to the quadruple; The hallucination judgment module is used to construct a hallucination discrimination rule base, and uses the hallucination discrimination rule base to judge the four-tuple of each data future value, distinguishing between the future value predicted by the query agent data and false data; The display module is used to display the future value corresponding to the user's query data, along with the calculation trace of the future value, which the user can verify based on the calculation trace; The feedback optimization module is used to query the agent to output the true value of the user's query data after a reasonable delay, calculate the actual error of the query data, and optimize the attenuation factor using the actual error.

[0035] The hallucination detection module includes a hallucination discrimination rule base unit and a judgment unit; The hallucination discrimination rule base unit includes missing metadata, contradictory timestamps, inconsistent recalculation, unreasonable error range, and missing data source; The judgment unit is used to judge the quadruple of each data future value using the illusion discrimination rule base, and to distinguish between the future value predicted by the query agent data and false data.

[0036] Example: The municipal water resources bureau has deployed the intelligent query system for flood and drought disaster prevention based on this invention. The system has been connected to the automatic water level gauge of Qinglinjing Reservoir, which collects water level data (unit: meters) every minute and transmits it to the central server via a 4G network.

[0037] Current system time: July 15, 2025, 08:30:00. At this time, a user asks via the smart agent in the WeLink mobile app: "What is the current water level of Qinglinjing Reservoir?" The system continuously performs data cleaning in the background. Among the five most recently reported data points from the water level gauge, the system calculates the total quality score for each point as 0.994, 0.991, 0.997, 0.988, and 0.985, respectively. The quality threshold is 0.91. All points with a score S > 0.91 are considered valid data and are written to the cache database. Uncontaminated data is removed.

[0038] The system records the delay components of the last 5 successful responses. The average delay D = (4.4 + 4.7 + 4.3 + 4.6 + 5.0) / 5 = 4.6 seconds. The reasonable delay for this query is D = 4.6 seconds.

[0039] Take the most recent m=5 valid data points, where j ranges from t-3 to t, with timestamps of 08:24:02, 08:25:02, 08:26:01, 08:27:00, and 08:28:03 respectively; calculate the water level change rates as 0.0004918 m / s, 0.0005085 m / s, 0.0003390 m / s, and 0.0004762 m / s respectively. m / s; the calculated average rate of change α = 0.00113372 / 2.533 = 0.0004476 m / s; the latest measured value = 31.33 m (timestamp 08:28:03); the predicted value P = 31.33 + 0.0004476 × 4.6 ≈ 31.33 + 0.002059 = 31.33206 m; ε = 1.5 × 0.00006245 × 4.6 ≈ 0.000431 m.

[0040] Before the agent generates an answer, the system intercepts all numerical fields, checks them against the rule base, and if all rules pass, the prediction is deemed valid and output is allowed.

[0041] The query agent replied: "Due to the approximately 4.6 seconds required for data transmission and processing, I cannot provide a real-time value 'at this very moment.' Based on the past 5 valid data points, the average rate of change is calculated to be 0.0004476 meters per second. The predicted water level in 4.6 seconds (approximately 08:30:04.6) is 31.332 meters, with a possible error of ±0.00043 meters. (Calculation process attached)."

[0042] 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 smart query method for flood and drought disaster prevention based on a large-scale water resources model, characterized in that: The method includes the following steps: S100. When constructing a query agent in the water affairs big data model, each input data is treated as a data point. The total quality score is calculated for each data point. Polluted data and valid data are judged and cleaned. The cleaned data is written to the cache database. S200. Before the current system time, select valid data and corresponding timestamps to calculate the average rate of change of the valid data, and use the average rate of change and decay factor to predict the future value of the valid data after a reasonable delay. S300: When a user sends a query request to the query agent, the reasonable delay component of each data point is collected in real time, and the reasonable delay of the current user query is calculated. S400: Generate a quadruple for the future value of each data point, and attach a hash check value to the quadruple; S500: Construct an illusion discrimination rule base, and use the illusion discrimination rule base to judge the quadruple of each data future value, and distinguish between the future value predicted by the query agent data and false data; S600: Display the future value corresponding to the user's query data, along with the calculation traces of the future value, and the user can verify it based on the calculation traces; S700: After a reasonable delay, the query agent outputs the true value of the user's query data, calculates the actual error of the query data, and uses the actual error to optimize the attenuation factor.

2. The intelligent query method for flood and drought disaster prevention based on a large-scale water resources model according to claim 1, characterized in that: The specific steps for data cleaning in S100, which distinguishes between contaminated and valid data, are as follows: S101. For each data point, check if there are any missing data fields. If there are no missing fields, set an integrity score A(t). i When a missing element exists, the integrity score A(t) is set to 1. i The threshold value is 0; staff set physical thresholds for each data type. min L max ], L min L represents the lower limit of the physical threshold. max This represents the upper limit of the physical threshold; the physical threshold is used to judge each data point, and when the value of a data point is within the physical threshold, a physical rationality score B(t) is set. i When the value of a data point is outside the physical threshold, the physical rationality score B(t) is set to 1. i ) is 0; In the same type of data, for each data point, calculate the average of the remaining k data points adjacent to the data point, and use the average to calculate the spatiotemporal consistency score of the corresponding data point; S102. Assign weights to the integrity score, physical rationality score and spatiotemporal consistency score respectively, and sum them to obtain the total quality score for each data point; When S(t i ) is less than Sn, the data point is determined as contaminated data; otherwise, it is valid data. All contaminated data are eliminated, and the valid data are written into a cache database. Sn represents a quality threshold, and the quality threshold is obtained by subtracting the standard deviation from the average of the total quality scores of historical data points.

3. The intelligent query method for flood and drought disaster prevention based on a large-scale water resources model according to claim 1, characterized in that: Specifically, in S200, the prediction of future values ​​of effective data after a reasonable delay using the average rate of change and the decay factor is as follows: S201. Select the most recent m valid data points and their corresponding timestamps from before the current system time. Let the selected valid data range from e-m+1 to e. First, calculate the rate of change of valid data between adjacent time intervals. The timestamp represents the actual collection time of the valid data. The formula is: ; In the formula, r j R represents the rate of change of valid data in the j-th time interval. j R represents a valid data point after the j-th time interval. j-1 T represents the valid data preceding the j-th time interval. j T represents the timestamp of a valid data point after the j-th time interval. j-1 This represents the timestamp of the previous valid data in the j-th time interval; j = e - m + 2, ..., e; e represents the sequence number of the last valid data selected. When m≥3, continue calculating the average rate of change; otherwise, if the output cannot be predicted, please try again later. The average rate of change of the effective data is obtained by performing an exponentially weighted moving average on the m-1 calculated rates of change. S202. Predict the future value for each data point using the average rate of change of the effective data, using the formula: P=R t +α×D,R t This represents the current system time data point value, D represents the reasonable delay, and P represents the future value of the data point after the reasonable delay; at the same time, the uncertainty radius of the predicted future value is calculated.

4. The intelligent query method for flood and drought disaster prevention based on a large-scale water resources model according to claim 1, characterized in that: The reasonable delay for the current user's query calculated in S300 is specifically as follows: The system records the data point acquisition time, the time of entering the query agent, the time required for data cleaning, the time of writing to the cache database, the time when the user sends a query request to the query agent, and the time when the system generates the answer. The network transmission time is obtained by subtracting the data point acquisition time from the time the data point enters the query agent. The time required for data cleaning is defined as the quality verification time, the time of writing to the cache database is defined as the caching time, and the response time is obtained by subtracting the time when the system generates the answer from the time when the query request is sent. The reasonable delay component includes network transmission time, quality verification time, buffer time, and response time. When a user sends a query request to the query agent, the records of the most recent n successful responses from the query agent are extracted, and the average delay of the n times is calculated using the reasonable delay component as the reasonable delay.

5. The intelligent query method for flood and drought disaster prevention based on a large-scale water resources model according to claim 1, characterized in that: Specifically, in S400, the hash check value is attached to the quadruple as follows: Generate a quadruple for each data point's future value, where the quadruple is (P, ε, T). target f id ), where T target T represents the future physical time corresponding to the future value. target =T q -D,T q This indicates the moment when the user sends a query request to the query agent; f id Indicates the formula number for calculating future values; The quadruple also includes a hash check value H that provides recalculation functionality, H = Hash(concat(T)). q , D, R (t i ), α, m, λ), where Hash uses a simple MD5 algorithm.

6. The intelligent query method for flood and drought disaster prevention based on a large-scale water resources model according to claim 1, characterized in that: The hallucination discrimination rule base in S500 includes missing metadata, contradictory timestamps, inconsistent recalculation, unreasonable error range, and missing data source. The missing metadata means that when the output value does not have a four-tuple, it is judged as false data; The timestamp discrepancy indicates that if a certain data is displayed as a predicted future value, but T... target ≤T q The data was determined to be false. The inconsistency recomputability means that the future verification value P' is recalculated by substituting the data in the hash verification value. When |P'-P|>0.01×max(|P'|, |P|), it is judged as false data. The statement that the error range is unreasonable means that when the radius of uncertainty exceeds the maximum allowable range of physical variation of the data, it is judged as false data. The maximum allowable range of physical variation is set by professionals. The absence of a data source indicates that if a predicted future value is still output when m < 3, it is judged as false data.

7. The intelligent query method for flood and drought disaster prevention based on a large-scale water resources model according to claim 1, characterized in that: The specific steps in S500 to distinguish between predicted future values ​​and false data from query agent data are as follows: When the query agent answers a user's query request, it first uses the rules in the illusion discrimination rule base to traverse and judge all numeric fields. If all rules are passed, it is judged as a future value and output; if any rule is triggered, it is judged as false data, the numeric field is deleted, replaced with "Insufficient data to predict" for display, and an alarm is recorded.

8. The intelligent query method for flood and drought disaster prevention based on a large-scale water resources model according to claim 1, characterized in that: The optimization of the attenuation factor using actual error in S700 specifically involves: After a reasonable delay, the query agent outputs the actual value of the user's query data and calculates the actual error E of the query data, E=R(T). target )-P,R(T target This indicates the actual value of the data queried by the user after a reasonable delay. The attenuation factor is optimized using the actual error, as shown in the formula: ; In the formula, λ new λ represents the optimized attenuation factor. old represents the decay factor before optimization, and sign represents the decision function. When |E|>2ε, sign=1; when |E|<2ε, sign=-1; when |E|=2ε, sign=0.

9. A smart query system for flood and drought disaster prevention based on a large-scale water resources model, characterized in that: The intelligent query system for flood and drought disaster prevention includes a data quality module, a data prediction module, a reasonable delay module, a data verification module, an illusion judgment module, a display module, and a feedback optimization module. The data quality module is used to treat each input data as a data point when building a query agent in the water affairs big model, calculate the total quality score for each data point, judge the polluted data and valid data, clean the data, and write the cleaned data into the cache database. The data prediction module is used to select valid data and corresponding timestamps before the current system time, calculate the average rate of change of the valid data, and use the average rate of change and decay factor to predict the future value of the valid data after a reasonable delay. The reasonable delay module is used to collect the reasonable delay component of each data point in real time when the user sends a query request to the query agent, and calculate the reasonable delay of the current user query. The data verification module is used to generate a quadruple for the future value of each data, with a hash verification value attached to the quadruple; The hallucination judgment module is used to construct a hallucination discrimination rule base, and uses the hallucination discrimination rule base to judge the four-tuple of each data future value, distinguishing between the future value predicted by the query agent data and false data; The display module is used to display the future value corresponding to the user's query data, along with the calculation trace of the future value, which the user can verify based on the calculation trace; The feedback optimization module is used to query the agent to output the true value of the user's query data after a reasonable delay, calculate the actual error of the query data, and optimize the attenuation factor using the actual error.

10. The intelligent query system for flood and drought disaster prevention based on a large-scale water resources model according to claim 9, characterized in that: The hallucination judgment module includes a hallucination discrimination rule base unit and a judgment unit; The hallucination discrimination rule base unit includes missing metadata, contradictory timestamps, inconsistent recalculation, unreasonable error range, and missing data source; The judgment unit is used to judge the quadruple of each data future value using the illusion discrimination rule base, and to distinguish between the future value predicted by the query agent data and false data.