Water quality early warning method, device and electronic equipment
Patent Information
- Application Number
- CN202611137806.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-10-16
AI Technical Summary
该方法在实际应用中存在以下缺陷:一是忽略水质等级间由轻到重的顺序关系,导致预测准确性低;二是仅能进行单提前期预测,难以形成未来多天连续风险判断;三是缺少衡量高风险等级最早可提前多久被可信识别的指标;四是未结合可信度与提前期进行解释性预警输出,易导致高风险漏报
[0014] Fourthly, the present invention also provides a computer-readable storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the steps of the water quality early warning method in any of the above implementations.
Smart Images

Figure CN122928552A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water quality monitoring technology, specifically to water quality early warning methods, devices, and electronic equipment. Background Technology
[0002] Existing water quality early warning methods typically treat water quality levels as unordered categories for direct prediction, or predict continuous indicators first and then convert them into levels. This approach has the following drawbacks in practical applications: First, it ignores the sequential relationship between water quality levels from least to most severe, leading to low prediction accuracy; second, it can only perform single-lead-time predictions, making it difficult to form continuous risk assessments for multiple days ahead; third, it lacks indicators to measure how far in advance a high-risk level can be reliably identified; and fourth, it fails to combine reliability and lead time for interpretative early warning output, easily leading to missed high-risk warnings.
[0003] Therefore, there is an urgent need for a water quality early warning method that can consider hierarchical relationships, achieve multiple lead time predictions, quantify reliable identification time, and output early warning levels based on reliability. Summary of the Invention
[0004] To address the aforementioned issues, this application provides a water quality early warning method to improve the reliability of water body early warnings. The technical solution is as follows: In a first aspect, the present invention provides a water quality early warning method, comprising: Obtain water monitoring data for the target water body; The water quality indicators in the water monitoring data are discretized according to preset thresholds to obtain an ordered label set, which is a set of water quality grade labels with an order from light to severe. Water body monitoring data and ordered label sets are input into an ordered level prediction model to perform multi-lead-time prediction, and the probability and predicted level of the target risk level are obtained. The predicted grades under different lead times are compared with the actual grades, and the longest lead time in which the predicted grades and actual grades are consistent is determined as the target effective lead time. The warning release level for the target water body is determined based on the matching relationship between the probability of the target risk level, the effective lead time of the target, and the credibility of the target risk level.
[0005] Combining the first aspect and the above implementation methods, in some possible implementation methods, the probability and predicted level of the target risk level are obtained, including: Mapping ordered sets of labels to continuous latent variables with sequential relationships; Optimize the predictive performance of continuous latent variables to obtain optimized continuous response variables; Regression tree construction and integrated prediction are performed based on the optimized continuous response variables to obtain continuous predicted values; By mapping continuous predicted values back to the corresponding water quality levels, the probability of the target risk level and the predicted level can be obtained.
[0006] Combining the first aspect and the above implementation methods, in some possible implementation methods, the predicted level under different lead times is compared with the actual level, and the longest lead time in which the predicted level and the actual level remain consistent is determined as the target effective lead time, including: The predicted levels under different lead times are compared with the actual levels. When the predicted levels are consistent with the actual levels, the probability of the target risk level exceeds the preset threshold, and the prediction results of adjacent lead times are stable, a set of candidate lead times is determined. The longest lead time in the candidate lead time set is determined as the target effective lead time.
[0007] Combining the first aspect and the above implementation methods, in some possible implementation methods, after determining the longest lead time during which the predicted level and the actual level remain consistent as the target effective lead time, it also includes: The confidence level of the target risk level is obtained by weighting the target risk level accuracy, target risk level recall, macro average accuracy, macro average consistency coefficient, and adjacent lead time probability stability.
[0008] Combining the first aspect and the above implementation methods, in some possible implementation methods, the early warning issuance level of the target water body is determined based on the matching relationship between the probability of the target risk level, the effective lead time of the target, and the credibility of the target risk level, including: If the probability of the target risk level is not lower than the first threshold, the effective lead time of the target is not lower than the preset lead time, and the credibility of the target risk level is not lower than the credibility threshold, then the warning release level of the target water body is determined to be a warning that can be released. If the probability of the target risk level is in the middle range, or the effective lead time of the target meets the preset requirements and the credibility of the target risk level is lower than the credibility threshold, then the warning issuance level of the target water body is determined to be a warning that needs to be reviewed. If the probability of the target risk level is lower than the first threshold, the warning issuance level for the target water body is determined to be "no warning will be issued for the time being".
[0009] Combining the first aspect and the above implementation methods, in some possible implementation methods, after determining the early warning issuance level of the target water body based on the matching relationship between the target risk level probability, the target effective lead time, and the target risk level credibility, the following are included: Based on the importance of permutation features, partial dependency analysis, or sensitivity analysis, interpretable analysis of early warning issuance levels is performed to generate interpretable early warning reports.
[0010] Combining the first aspect and the above implementation methods, in some possible implementation methods, water body monitoring data and ordered label sets are input into an ordered level prediction model for multi-lead-time prediction to obtain the target risk level probability and predicted level, including: Water quality indicators from current and historical moments in water body monitoring data are extracted as input features, and labels corresponding to each future lead time in an ordered label set are extracted as target labels. The input features and target labels are time-aligned and combined to obtain supervised sample pairs; The supervised samples are used to perform multi-lead-time predictions on the input ordered level prediction model to obtain the target risk level probability and prediction level.
[0011] Combining the first aspect and the above-mentioned implementation methods, in some possible implementation methods, water body monitoring data of the target water body is obtained, including: Obtain initial water body monitoring data; The initial water monitoring data is preprocessed to obtain preprocessed water monitoring data. The data preprocessing includes time alignment, anomaly identification, interpolation, and standardization.
[0012] Secondly, the present invention also provides a water quality early warning device, comprising: The data acquisition unit is used to acquire water monitoring data of the target water body; The data partitioning unit is used to discretize the water quality indicators in the water monitoring data according to a preset threshold to obtain an ordered label set, which is a set of water quality grade labels with an order from light to heavy. The data prediction unit is used to input water body monitoring data and ordered label set into the ordered level prediction model to perform multi-lead-time prediction and obtain the target risk level probability and prediction level. The data comparison unit is used to compare the predicted level with the actual level under different lead times, and determine the longest lead time in which the predicted level and the actual level are consistent as the target effective lead time. The data matching unit is used to determine the early warning release level of the target water body based on the matching relationship between the target risk level probability, the target effective lead time, and the target risk level credibility.
[0013] Thirdly, the present invention also provides an electronic device, including a data acquisition unit, a memory, and a processor, wherein... Data acquisition devices are used to collect water monitoring data of target water bodies; Memory, used to store executable program code; The processor is used to discretize water quality indicators in water monitoring data according to preset thresholds to obtain an ordered label set; input the water monitoring data and the ordered label set into an ordered level prediction model for multi-lead-time prediction to obtain the target risk level probability and predicted level; compare the predicted level with the actual level under different lead times to determine the longest lead time in which the predicted level and the actual level are consistent as the target effective lead time; and determine the early warning release level of the target water body based on the matching relationship between the target risk level probability, the target effective lead time, and the target risk level credibility.
[0014] Fourthly, the present invention also provides a computer-readable storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the steps of the water quality early warning method in any of the above implementations.
[0015] The beneficial effects of this invention are as follows: By acquiring water monitoring data of the target water body, the water quality indicators in the water monitoring data are discretized according to preset thresholds to obtain an ordered label set. The ordered label set is a set of water quality grade labels with an order relationship from light to heavy, overcoming the defect of ignoring the order relationship and improving the prediction accuracy; by inputting the water monitoring data and the ordered label set into an ordered grade prediction model for multi-lead-time prediction, the probability and predicted grade of the target risk level are obtained, realizing continuous risk judgment with multiple lead times; by comparing the predicted grade under different lead times with the actual grade, the longest lead time in which the predicted grade and the actual grade are consistent is determined as the effective lead time of the target, solving the problem of lacking an indicator to measure how early can be reliably identified; by determining the early warning release level of the target water body based on the matching relationship between the probability of the target risk level, the effective lead time of the target, and the credibility of the target risk level, the early warning release level of the target water body is determined, thereby improving the accuracy of water body early warning. Attached Figure Description To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 A schematic flowchart of the water quality early warning method provided by the present invention; Figure 2 For the present invention Figure 1 A schematic diagram of an embodiment of S102; Figure 3 For the present invention Figure 1 A schematic diagram of an embodiment of S103; Figure 4 For the present invention Figure 1 A schematic diagram of an embodiment of S104; Figure 5 For the present invention Figure 1 A schematic diagram of an embodiment of S104; Figure 6 A comparative diagram of water body data prediction using different types of models provided by this invention; Figure 7 This is a comparison chart of the maximum accurate prediction lead time for hypertrophic states provided by this invention; Figure 8 This is a schematic diagram of the structure of the water quality early warning device provided by the present invention; Figure 9 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0017] 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 a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0018] In the description of the embodiments of the present invention, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0019] The terms "first," "second," etc., used in the embodiments of this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a technical feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature.
[0020] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0021] This application provides a water quality early warning method, the execution subject of which is a water quality early warning method device or an electronic device equipped with a water quality early warning method device. The following is a detailed description; it should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.
[0022] Please see Figure 1 , Figure 1 This is a schematic flowchart of the water quality early warning method provided in the embodiments of this application. Figure 1 As shown, the method in this application embodiment may include the following steps S101-S105: S101, Obtain water monitoring data for the target water body.
[0023] In this embodiment of the application, the target water body refers to a body of water that requires water quality monitoring and early warning, such as lakes, rivers, or reservoirs. Water monitoring data refers to time-series data reflecting the environmental conditions of aquatic bodies collected by monitoring equipment, including at least one of the following: water temperature, ammonia nitrogen, total nitrogen, total phosphorus, chlorophyll a (Chl-a), dissolved oxygen (DO), turbidity, conductivity, pH, water level, flow rate, precipitation, and air temperature.
[0024] In one feasible implementation, a multi-source acquisition architecture consisting of fixed monitoring stations, mobile monitoring vehicles, UAV-borne monitoring equipment, and sensor networks is used to acquire water monitoring data for the target water body. Specifically, fixed monitoring stations are deployed in the core area of the water body to be responsible for long-term, continuous water quality monitoring; mobile monitoring vehicles are responsible for regional mobile monitoring, covering areas not covered by fixed stations.
[0025] Unmanned aerial vehicles (UAVs) are used to monitor high altitudes and complex terrains, compensating for the obstruction issues of ground-based monitoring. Distributed sensor networks are deployed in key sewage discharge areas or border areas to achieve high-density, grid-based monitoring.
[0026] Through the above multi-source acquisition architecture, structured, semi-structured and unstructured initial water body monitoring data are collected, and the above data are extracted by an extractor. Then, the data with different formats and granularities are adapted into standard data with a unified format and granularity by a data adapter. Finally, the adapted dataset is deduplicated and despoofed, and the preprocessed water body monitoring data is stored in a relational database, thereby obtaining the water body monitoring data of the target water body.
[0027] S102, the water quality indicators in the water monitoring data are discretized according to preset thresholds to obtain an ordered label set.
[0028] In this embodiment, water quality indicators refer to specific measurement parameters used to evaluate water quality status in water monitoring data, such as ammonia nitrogen concentration and total phosphorus concentration. Preset thresholds refer to critical values set according to national or local water quality standards and historical data statistical characteristics, used to classify different water quality levels. Ordered label sets refer to a set of water quality level labels arranged in ascending order of severity, such as at least one of lake trophic status level, algal bloom risk level, and water pollution alarm level.
[0029] In one feasible implementation, a preset threshold range corresponding to each water quality indicator is determined according to water quality evaluation standards. Each water quality indicator in the water body monitoring data is compared with its corresponding preset threshold, mapping continuous water quality indicator data into discrete grade labels. Since water quality deterioration is a gradual process, the resulting grade labels have a natural sequential relationship (e.g., mild, moderate, severe), thus forming an ordered label set.
[0030] For example, if the total phosphorus concentration is below 0.02 mg / L, it is classified as Grade I; between 0.02 mg / L and 0.04 mg / L, it is classified as Grade II; and above 0.04 mg / L, it is classified as Grade III. Thus, the water quality indicator of total phosphorus is discretized into an ordered set of labels {I, II, III}.
[0031] S103, input the water body monitoring data and ordered label set into the ordered level prediction model to perform multi-lead-time prediction, and obtain the target risk level probability and prediction level.
[0032] In this application embodiment, the ordered level prediction model refers to a machine learning model capable of handling labels with sequential relationships, including ordered forests, ordered logistic regression, ordered gradient boosting models, ordered support vector machines, ordered neural networks, or ensemble models thereof. Multi-leadership prediction refers to predicting multiple different time steps in the future, such as 1 to 7 days from now. The target risk level probability refers to the probability distribution of water quality at various risk levels predicted by the model at a certain lead time in the future. The predicted level refers to the most likely water quality risk level at a certain lead time in the future, determined based on the target risk level probability.
[0033] In one feasible implementation, water quality indicators from current and historical moments in water monitoring data are first extracted as input features. Water quality change features (including at least one of the following: moving mean, moving standard deviation, daily rate of change, cumulative change, lag term, historical risk level transition features, and consecutive high-risk days) are then extracted to enhance feature representation. Simultaneously, labels corresponding to each future lead time period (e.g., 1 to 7 days from now) are extracted from an ordered label set as target labels. The input features and target labels are then input into an ordered risk level prediction model. The model uses the order relationship between the ordered labels to constrain the prediction results, outputs the probability distribution of the target risk level for each lead time period, and determines the level with the highest probability as the predicted level for that lead time period.
[0034] S104 compares the predicted level with the actual level under different lead times, and determines the longest lead time in which the predicted level and the actual level are consistent as the target effective lead time.
[0035] In this embodiment, the lead time refers to the time interval between the predicted time step and the current moment, such as the 1st day, the 2nd day, and the 7th day in the future. The true level refers to the actual water quality risk level in the future, used for post-event assessment of the prediction accuracy. The target effective lead time refers to the longest time interval that the model can predict in advance, provided that the predicted level is consistent with the true level and meets the stability requirements.
[0036] In one feasible implementation, the predicted risk level is compared with the actual risk level sequentially, from shortest to longest lead time. If the predicted risk level and the actual risk level remain consistent at a certain lead time, and the probability of the target risk level exceeds a preset threshold, while the prediction results of adjacent lead times are stable (i.e., there are no jumps), then this lead time is recorded as a candidate lead time. After traversing all lead times, the longest lead time in the candidate lead time set is determined as the target effective lead time. This indicator reflects the maximum timeliness of the model's reliable early warning.
[0037] S105. Based on the matching relationship between the target risk level probability, the target effective lead time, and the target risk level credibility, determine the early warning release level for the target water body.
[0038] In this embodiment, the credibility of the target risk level refers to a comprehensive indicator used to assess the reliability of the prediction results, determined by at least one of the following: minority level accuracy, minority level recall, macro average accuracy, macro average consistency coefficient, and probability stability of adjacent lead times. The matching relationship refers to the mapping rule between the warning release level and the three dimensions: target risk level probability, target effective lead time, and target risk level credibility. The warning release level refers to the final decision on the warning status to be released to the public or management departments, including warnings that can be released, warnings requiring review, and warnings that will not be released for the time being.
[0039] In one feasible implementation, the final warning issuance level is determined by comprehensively considering the probability of the target risk level, the length of the target's effective lead time, and the credibility of the target risk level, according to a preset matching relationship.
[0040] Specifically, if the probability of the target risk level is not lower than the first threshold, the effective lead time of the target is not lower than the preset lead time, and the credibility of the target risk level is not lower than the credibility threshold, it indicates that the risk is high, the timeliness is long, and the result is credible, then the warning issuance level is determined to be a warning that can be issued; if the probability of the target risk level is in the middle range, or the effective lead time of the target meets the preset requirements but the credibility of the target risk level is lower than the credibility threshold, it indicates that there is risk but the certainty is insufficient, then the warning issuance level is determined to be a warning that needs to be reviewed; if the probability of the target risk level is lower than the first threshold, it indicates that the risk is low, then the warning issuance level is determined to be a warning that will not be issued for the time being.
[0041] In summary, this application obtains water quality monitoring data of the target water body, discretizes the water quality indicators in the monitoring data according to preset thresholds, and obtains an ordered label set. The ordered label set is a set of water quality level labels with an order relationship from light to severe, overcoming the defect of ignoring the order relationship and improving the prediction accuracy. By inputting the water body monitoring data and the ordered label set into an ordered level prediction model for multi-lead-time prediction, the probability and predicted level of the target risk level are obtained, realizing continuous risk judgment with multiple lead times. By comparing the predicted level under different lead times with the actual level, the longest lead time in which the predicted level and the actual level are consistent is determined as the effective lead time of the target, solving the problem of lacking an indicator to measure how early can be reliably identified. By determining the early warning release level of the target water body based on the matching relationship between the probability of the target risk level, the effective lead time of the target, and the credibility of the target risk level, the early warning release level of the target water body is determined, thereby improving the accuracy of water body early warning.
[0042] Please see Figure 2 , Figure 2 For the present invention Figure 1 A schematic diagram of an embodiment of S102. (See attached diagram.) Figure 2 As shown, the method in this application embodiment may include the following steps S201-S204: S201 maps an ordered set of labels to continuous latent variables with an order relationship.
[0043] In the embodiments of this application, continuous latent variables refer to variables obtained by mapping discrete and sequentially related level labels to a continuous numerical space, which preserves the order information of the original labels and facilitates regression calculation.
[0044] In one feasible implementation, since the ranks in the ordered label set are discrete, direct regression prediction cannot utilize the order relationship between ranks. Therefore, by introducing continuous latent variables, the discrete ordered labels are mapped to continuous real values. For example, assuming the ordered label set contains K ranks, it can be mapped to K intervals on the real number axis, with each rank corresponding to an interval or split point, thereby transforming the classification problem into a regression problem on continuous latent variables.
[0045] S202, optimize the predictive performance of continuous latent variables to obtain optimized continuous response variables.
[0046] In this embodiment, predictive performance optimization refers to adjusting the distribution or parameters of continuous latent variables to enable the model to better fit data features during prediction, thereby improving prediction accuracy. The optimized continuous response variable refers to the variable used to replace the original continuous latent variable as the model's prediction target after predictive performance optimization.
[0047] In one feasible implementation, after mapping ordered labels to continuous latent variables, the distribution of these variables is optimized to improve the stability and accuracy of the model's predictions. Specifically, the split points or interval widths of the continuous latent variables can be adjusted by maximizing the likelihood function or minimizing the prediction error, making them more consistent with the actual distribution characteristics of each level in the data. This yields the optimized continuous response variable, which serves as the target value for subsequent regression tree construction.
[0048] S203, based on the optimized continuous response variables, performs regression tree construction and integrated prediction to obtain continuous predicted values.
[0049] In this embodiment, regression tree construction refers to the process of constructing a decision tree model using the optimized continuous response variable as the target variable and the characteristics of water monitoring data as input variables. Ensemble prediction refers to the method of combining the prediction results of multiple regression trees to reduce variance and overfitting risk, thereby obtaining the final prediction result. Continuous predicted value refers to the real value output by the ensemble prediction, representing an estimate of the optimized continuous response variable.
[0050] In one feasible implementation, multiple regression trees are trained using extracted water monitoring data features (such as water quality change features) as input and optimized continuous response variables as targets. During the training of each regression tree, the feature space is recursively partitioned to minimize the differences in continuous response variables among samples falling into the same leaf node. An ensemble strategy (such as Bagging in random forests or Boosting in gradient boosting) is then employed to perform a weighted average or summation of the outputs from the multiple regression trees, yielding the final continuous prediction value.
[0051] S204 maps the continuous predicted values back to the corresponding water quality levels to obtain the target risk level probability and predicted level.
[0052] In one feasible implementation, based on the mapping relationship between the continuous latent variables and the ordered label set established in S201, the continuous predicted values obtained in S203 are back-mapped back to the corresponding level intervals. The level intervals in which the continuous predicted values fall are determined, thereby obtaining the predicted level; simultaneously, based on the position of the continuous predicted values in the probability distribution or the probability distribution output by the model, the probability of each level occurring is calculated to obtain the target risk level probability.
[0053] In summary, this application transforms the classification problem into a regression problem by mapping discrete ordered labels to continuous latent variables and optimizing them. Then, it uses regression trees to integrate predictions and map them back to the levels. This not only preserves the ordered constraint of the levels but also improves the model's ability to fit continuous numerical values, thereby obtaining more accurate target risk level probabilities and predicted levels.
[0054] Please see Figure 3 , Figure 3 For the present invention Figure 1 A schematic diagram of an embodiment of S103. (See attached diagram.) Figure 3 As shown, the method in this application embodiment may include the following steps S301-S303: S301. Compare the predicted level with the actual level under different lead times. When the predicted level and the actual level are consistent, the probability of the target risk level exceeds the preset threshold, and the prediction results of adjacent lead times are stable, determine the candidate lead time set.
[0055] In this embodiment, the preset threshold refers to the lowest threshold value used to filter the probability of the target risk level for high-confidence prediction results. Stable prediction results between adjacent lead times mean that the prediction levels of two adjacent lead times (such as the 3rd and 4th day in the future) do not change or become inconsistent. The candidate lead time set refers to the collection of all lead times that meet the conditions of consistency, high probability, and stability.
[0056] In one feasible implementation, the forecast results for multiple lead times (1 to 7 days) are evaluated one by one. For lead time T, it is determined whether its predicted level is consistent with the actual level, and simultaneously, whether the probability of the target risk level corresponding to this lead time is greater than a preset threshold (e.g., 0.8), and whether the predicted level of this lead time is the same as that of the adjacent lead time (T-1 or T+1). Only when all three conditions are met is lead time T added to the candidate lead time set. In this way, reliable and stable lead times are selected.
[0057] S302, determine the longest lead time in the candidate lead time set as the target effective lead time.
[0058] In one feasible implementation, the candidate lead time set may contain multiple lead times that meet the criteria, such as {1 day, 2 days, 3 days}. To measure the model's maximum ability to provide early warnings, the lead time with the largest value from the candidate lead time set is selected as the target effective lead time. For example, if the candidate lead time set is {1, 2, 3}, then the target effective lead time is 3 days.
[0059] S303 calculates the target risk level credibility by weighting the target risk level accuracy, target risk level recall, macro average accuracy, macro average consistency coefficient, and adjacent lead time probability stability.
[0060] In this embodiment, the target risk level accuracy refers to the proportion of samples predicted as having that risk level that actually belong to that risk level. The target risk level recall refers to the proportion of samples actually having that risk level that were predicted as having that risk level. The macro-average accuracy is the arithmetic mean of the accuracy calculated for each level, used to measure the overall predictive accuracy of the model across all levels. The macro-average consistency coefficient is the arithmetic mean of the consistency coefficients calculated for each level, used to measure the degree of consistency between the model's predictions and the actual situation. The probability stability of adjacent lead times refers to the degree of change in the probability distribution of the target risk level between adjacent lead times; the smaller the change, the higher the stability.
[0061] In one feasible implementation, to comprehensively assess the reliability of the prediction results, instead of relying on a single indicator, multiple indicators are used to calculate the confidence level of the target risk level. Specifically, for each predicted target risk level, its precision and recall on the validation set are calculated. Simultaneously, the macro-average precision and macro-average consistency coefficient for all levels are calculated, and the probability stability of adjacent lead times is evaluated (e.g., by calculating the relative entropy of the probability distribution of adjacent lead times or the reciprocal of the Euclidean distance). Preset weights are assigned to each of the five indicators (the weights sum to 1), and a weighted sum is performed to obtain a target risk level confidence value between 0 and 1.
[0062] For example, the specific form of the weighted calculation formula in step S303 above can be:
[0063] in, Indicates the credibility of the target risk level. Indicates the accuracy rate of the target risk level. Indicates the recall rate of the target risk level. This represents the macro average accuracy. Represents the macro average consistency coefficient. Indicates the probability stability of adjacent lead times. , , , , Let represent the weight coefficients of the corresponding indicators, and satisfy . .
[0064] In summary, this application screens candidate lead times by setting three conditions: consistency, high probability, and stability, and determines the longest effective lead time, thus ensuring the reliability of the early warning timeliness. By calculating the credibility of the target risk level through multi-dimensional weighted indexes, the robustness and accuracy of the prediction results are comprehensively evaluated, providing a solid credibility basis for determining the early warning issuance level.
[0065] In one feasible implementation, after determining the early warning issuance level for the target water body based on the matching relationship between the target risk level probability, the target effective lead time, and the target risk level credibility, the following further steps are performed: If the probability of the target risk level is not lower than the first threshold, the effective lead time of the target is not lower than the preset lead time, and the credibility of the target risk level is not lower than the credibility threshold, then the warning release level of the target water body is determined to be a warning that can be released.
[0066] In this embodiment, the preset lead time refers to the shortest lead time for determining whether the timeliness of the early warning meets the minimum requirements. The credibility threshold refers to the lowest threshold value for determining whether the reliability of the prediction result meets the standard.
[0067] For example, the first threshold is set to 0.85, the preset lead time is 3 days, and the confidence threshold is 0.8. If in a certain prediction, the probability of the target risk level is 0.9, the effective lead time of the target is 5 days, and the confidence of the target risk level is 0.88, and all three conditions are met, then the system will be directly triggered to automatically issue a water quality early warning.
[0068] If the probability of the target risk level is in the middle range, or the effective lead time of the target meets the preset requirements and the credibility of the target risk level is lower than the credibility threshold, then the warning issuance level of the target water body is determined to be a warning that needs to be reviewed.
[0069] In this embodiment, the intermediate range refers to the probability interval between the first threshold and the low-risk threshold, indicating that there is some risk but insufficient certainty. The preset requirement refers to the minimum length limit for the effective lead time of the target. "Issuable early warning" refers to a high-level early warning status automatically issued by the system, representing high risk and reliable prediction.
[0070] For example, the intermediate range is set to 0.6 to 0.85, with a preset requirement of a lead time greater than 2 days. If the probability of the target risk level is 0.75, and the effective lead time of the target is 4 days, but the confidence level of the target risk level is only 0.65 (below 0.8), this indicates that although there is a certain risk and the lead time is sufficient, the model prediction is not stable enough. The system will mark the warning issuance level as a warning requiring review and prompt manual intervention for review.
[0071] If the probability of the target risk level is lower than the first threshold, the warning issuance level for the target water body is determined to be "no warning will be issued for the time being".
[0072] In this embodiment, the first threshold refers to the critical value for determining whether the probability of a risk level reaches the high-risk standard. "Requires review and warning" refers to a medium-level warning status that requires further manual review and confirmation, indicating that there is risk but the predictive reliability is insufficient. "No warning issued for now" refers to a low-level status where no warning is issued to the public, representing extremely low risk.
[0073] For example, the first threshold is set to 0.85. If the probability of the target risk level is 0.4, which is far below the first threshold, it indicates that the water quality risk is extremely low, and the system does not issue any warning, but only records the data.
[0074] In one feasible implementation, the system automatically calculates the probability of the target risk level, the effective lead time of the target, and the credibility of the target risk level based on the real-time input water body monitoring data, and performs logical judgment according to the above matching rules, and pushes the results to the corresponding early warning release channel, realizing automated closed-loop processing from data input to early warning release.
[0075] In summary, this application, by setting up a hierarchical matching relationship, subdivides the warning release level into warnings that can be released, warnings that require review, and warnings that will not be released for the time being. This ensures timely warnings for high-risk situations while avoiding false alarms caused by low-risk or unreliable predictions, thus achieving an organic combination of accurate warnings and manual review.
[0076] In one feasible implementation, after determining the early warning issuance level for the target water body based on the matching relationship between the target risk level probability, the target effective lead time, and the target risk level credibility, the following further steps are performed: Based on the importance of permutation features, partial dependency analysis, or sensitivity analysis, interpretable analysis of early warning issuance levels is performed to generate interpretable early warning reports.
[0077] In this application embodiment, permutation feature importance refers to a method of measuring the importance of a feature to the model's prediction by randomly shuffling the order of a feature value and observing the degree of decline in the model's predictive performance. Partial dependency analysis refers to a method of understanding the global relationship between features and the prediction target by showing the marginal effect of the model's prediction results when one or two features take different values. Sensitivity analysis refers to a method of assessing the robustness of the model to feature fluctuations by analyzing the degree of influence of small changes in input features on the model's output results. Explainable analysis refers to the process of using the above methods to decompose and explain the model's prediction logic, so that non-professional users can understand the reasons why the model makes a specific warning judgment. An explainable warning report refers to a structured document containing the warning issuance level, the key features that triggered the warning and their contribution, and the dependency graph between features and the warning level.
[0078] In one feasible implementation, after determining the warning issuance level, the model interpretation module is invoked. First, the contribution of each water quality indicator (such as total phosphorus, ammonia nitrogen, etc.) to the prediction results is calculated using the feature importance ranking method, and the top N key features are extracted. Second, for the key features, partial dependency analysis is used to plot the impact curve of feature value changes on the probability of the target risk level. Finally, sensitivity analysis is combined to assess whether small fluctuations in key features will lead to a reversal of the warning level. The above analysis results, including key driving factors, influence trends, and robustness conclusions, are automatically populated into the report template to generate a graphically interpretable warning report.
[0079] In summary, this application conducts interpretability analysis by arranging feature importance, partial dependency analysis, or sensitivity analysis, making the prediction results more interpretable. The generated interpretable early warning report provides management departments with a clear basis for decision-making.
[0080] Please see Figure 4 , Figure 4 For the present invention Figure 1 A schematic diagram of an embodiment of S104. (See attached diagram.) Figure 4 As shown, the method in this application embodiment may include the following steps S401-S404: S401, extract water quality indicators from the current and historical moments in the water body monitoring data as input features, and extract the labels corresponding to each future lead time from the ordered label set as target labels.
[0081] In this embodiment, the input features refer to the set of independent variables used for model training and prediction, including water quality indicators and water quality change characteristics within the current time and a past time window. The target label refers to the dependent variable that the model needs to predict, i.e., the actual water quality grade label corresponding to different lead times in the future.
[0082] In one feasible implementation, a historical sliding window (e.g., the past 7 days) is set for water body monitoring data in time series format. Water quality indicators for the current moment and each moment within the historical sliding window are extracted from the water body monitoring data, and water quality change characteristics such as moving mean, moving standard deviation, daily rate of change, cumulative change, lag term, historical grade transition characteristics, and number of consecutive high-risk days are calculated and concatenated to form an input feature vector. Simultaneously, grade labels for the next 1st, 2nd, up to 7th days are extracted from an ordered label set and used as prediction target labels corresponding to different lead times.
[0083] S402, the input features and target labels are time-aligned and combined to obtain supervised sample pairs.
[0084] In this embodiment, temporal alignment refers to the process of matching historical input features with future target labels in a one-to-one correspondence based on timestamps. Supervised sample pairs are tuples consisting of input features and corresponding target labels, used to supervise the training of the learning model.
[0085] In one feasible implementation, historical input features at a given time are aligned with target labels at a future time T, constructing data pairs of the form (Xt, Yt+T), where Xt represents the input feature at time t and Yt+T represents the target label at time t+T. Multiple supervised sample pairs are generated by traversing the entire time series data, forming a dataset for model training.
[0086] S403 uses supervised samples to perform multi-lead-time predictions on the input ordered level prediction model to obtain the target risk level probability and prediction level.
[0087] In one feasible implementation, the constructed supervised sample dataset is divided into a training set and a validation set. The training set is used to train the ordered risk prediction model and optimize the model parameters. During the prediction phase, the input features acquired in real time are input into the trained model, which simultaneously outputs the probability distribution of the target risk level for each lead time period from 1 to 7 days in the future, and determines the predicted level for each lead time period based on the principle of maximizing probability.
[0088] S404 maps continuous predicted values back to the corresponding water quality levels to obtain the target risk level probability and predicted level.
[0089] In one feasible implementation, for multi-lead-time prediction scenarios, the continuous predicted values output by the model at each lead time are mapped back to the corresponding water quality grade range according to the mapping rules, thereby simultaneously obtaining the target risk level probability and predicted level at multiple lead times.
[0090] In summary, this application fully explores the temporal patterns of water quality changes by extracting rich water quality change features as input features and constructing time-aligned supervised sample pairs; by combining multi-lead-time prediction with ordered-level prediction models, it achieves end-to-end multi-step prediction and improves prediction efficiency.
[0091] Please see Figure 5 , Figure 5 For the present invention Figure 1 A schematic diagram of an embodiment of S104. (See attached diagram.) Figure 5 As shown, the method in this embodiment may include the following steps S501-S502: S501, Obtain initial water body monitoring data.
[0092] In this embodiment of the application, the initial water monitoring data refers to the raw water quality data directly collected by the multi-source acquisition architecture without any processing, which may have problems such as inconsistent format, missing data or anomalies.
[0093] In one feasible implementation, raw monitoring data of the target water body is acquired through fixed monitoring stations, mobile monitoring vehicles, UAV-borne monitoring equipment, and sensor networks. This includes raw measurements of indicators such as water temperature, ammonia nitrogen, total nitrogen, total phosphorus, chlorophyll a (Chl-a), dissolved oxygen (DO), turbidity, conductivity, pH, water level, flow rate, precipitation, and air temperature, as well as corresponding timestamps and location information.
[0094] S502, perform data preprocessing on the initial water body monitoring data to obtain preprocessed water body monitoring data. Data preprocessing includes time alignment, anomaly identification, interpolation processing and standardization processing.
[0095] In this embodiment, data preprocessing refers to the process of cleaning and transforming initial water monitoring data, aiming to eliminate noise, fill in missing data, and standardize the format to meet model input requirements. Preprocessed water monitoring data refers to time series data that has met quality standards and has a unified format after preprocessing. Time alignment refers to unifying data from different monitoring devices and sampling frequencies to the same time reference. Anomaly identification refers to detecting and marking outliers in the initial data that deviate from the normal range. Imputation refers to filling in missing or removed outliers. Standardization refers to the process of converting features with different dimensions and numerical ranges to a unified magnitude.
[0096] In one feasible implementation, structured, semi-structured, and unstructured initial water body monitoring data are acquired. A data adapter is used to adapt the initial water body monitoring data of different formats and particle sizes into standard data with a unified format and particle size. The adapted standard data is then deduplicated and despoofed to obtain preprocessed water body monitoring data.
[0097] Specifically, time alignment uses an inverse distance weighted algorithm to complete the spatiotemporal registration of multi-source data; anomaly identification uses a 3-standard-deviation criterion, and samples exceeding 3 standard deviations are judged as outliers and removed; interpolation uses a linear interpolation algorithm to fill missing values and removed outliers; finally, the cleaned data is standardized (e.g., Z-score standardization) to convert the data into a distribution with a mean of 0 and a variance of 1, resulting in preprocessed water monitoring data.
[0098] In summary, this application effectively eliminates noise and missing data in the original water monitoring data by performing comprehensive data preprocessing, including time alignment, anomaly identification, interpolation, and standardization. This unifies the data format and units, providing high-quality data support for subsequent model training and prediction, and ensuring the stability of the prediction results.
[0099] It should be noted that the ordered ranking prediction model in this application refers to a machine learning model architecture specifically designed to handle labels with inherent order relationships. Specific types include, but are not limited to, ordered forests, ordered logistic regression, ordered gradient boosting models, ordered support vector machines, ordered neural networks, or ensemble models thereof. The core architecture of this type of model avoids the assumption of traditional multi-class classification models that treat each category as an unordered independent entity. Instead, it explicitly models the order dependencies between labels by introducing cumulative probability mechanisms, latent variable threshold mechanisms, or ordered penalty terms.
[0100] For example, ordered logistic regression and ordered neural network architectures are typically based on the proportional advantage assumption, deriving the probability of the target risk level by calculating the cumulative probability of sample features falling below each level threshold, thus ensuring the monotonicity of the probability distribution. Ordered forests and ordered gradient boosting models introduce ordered distance metrics into the splitting criteria of traditional decision trees, making the misclassification cost between adjacent levels much smaller than the misclassification cost across levels, thereby forcing the model to be more rigorous at the classification boundary. The ensemble architecture, by combining the outputs of the above-mentioned multiple heterogeneous base learners, further enhances the model's generalization ability and robustness under non-equilibrium water quality data, so that the final output predicted level and target risk level probability not only strictly conform to the gradual physical logic of water quality deterioration or recovery, avoiding absurd predictions of level jumps, but also have higher statistical reliability.
[0101] Please refer to the following: Figure 6 , Figure 6This is a data comparison diagram illustrating the different types of models provided by this invention for water body data prediction, such as... Figure 6 As shown: This figure consists of four subplots. The horizontal axis represents the early warning period (1-7 days), and the vertical axis corresponds to four evaluation indicators: overall accuracy, overall Kappa coefficient, macro accuracy, and macro Kappa coefficient. The curves represent the predictive performance of five different models under different early warning periods: the ordered forest model OF, namely the ordered rank prediction model, the classification random forest RF_clf, the regression random forest RF_reg, the classification extreme gradient boosting XGB_clf, and the regression extreme gradient boosting XGB_reg.
[0102] When predicting ordered risk levels of water trophic states (oligotrophic, mesotrophic, eutrophic, hypereutrophic), the ordered forest (OF) model, as an ordered level prediction model, consistently outperformed the traditional RF_clf, RF_reg, XGB_clf, and XGB_reg models across all 1-7 day lead times. All models exhibited a gradual decline in predictive performance as the lead time increased from 1 day to 7 days, reflecting a decrease in prediction timeliness with longer lead times. Traditional classification and regression models do not explicitly utilize the inherent ordered dependencies between trophic state levels, while the ordered forest (OF), relying on ordered modeling mechanisms to introduce label order constraints and employing cumulative probability modeling, is better suited for predicting ordered risk levels of water trophic states. It achieves superior prediction accuracy and consistency across different lead times, validating the advantages of ordered level prediction models in multi-level time-series prediction scenarios for water trophic state risk.
[0103] Please refer to the following: Figure 7 , Figure 7 This is a comparison chart of the maximum accurate prediction lead time for hypertrophic states provided by this invention, such as... Figure 7 As shown, the ordered forest hierarchy (OF) prediction model used in this embodiment has an average maximum accurate forecast lead time of 5.6 days, which is superior to the forecast lead time of 5.1 days for the random forest regression model (RF_reg), 4.9 days for the XGBoost classification model (XGB_clf), 4.6 days for the random forest classification model (RF_clf), and 2.6 days for the XGBoost regression model (XGB_reg). Compared to traditional algal bloom warning methods that can only output a single-day warning level, this invention can output a continuous warning level sequence for multiple days in the future and can quantify the maximum credible warning lead time, providing credible early warning decision support with practical water environment management value for high-risk situations.
[0104] The following will combine Figure 8 This application provides a detailed description of the water quality early warning device provided in its embodiments. It should be noted that... Figure 8 The water quality early warning device 800 in the present application is used to perform the functions described in this application. Figures 1-5 The methods shown in the embodiments are for illustrative purposes only, illustrating the parts relevant to the embodiments of this application. For specific technical details not disclosed, please refer to this application. Figures 1-5 In the embodiment shown, the water quality early warning device 800 may include a data acquisition unit 801, a data division unit 802, a data prediction unit 803, a data comparison unit 804, and a data matching unit 805, as detailed below: Data acquisition unit 801 is used to acquire water monitoring data of the target water body; The data partitioning unit 802 is used to discretize the water quality indicators in the water monitoring data according to a preset threshold to obtain an ordered label set, which is a set of water quality grade labels with an order from light to heavy. The data prediction unit 803 is used to input water body monitoring data and ordered label set into the ordered level prediction model to perform multi-lead-time prediction and obtain the target risk level probability and prediction level. Data comparison unit 804 is used to compare the predicted level with the actual level under different lead times, and determine the longest lead time in which the predicted level and the actual level are consistent as the target effective lead time. The data matching unit 805 is used to determine the early warning release level of the target water body based on the matching relationship between the target risk level probability, the target effective lead time, and the target risk level credibility.
[0105] The water quality early warning device 800 provided in the above embodiments can realize the technical solutions described in the above water quality early warning method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above water quality early warning method embodiments, and will not be repeated here.
[0106] like Figure 9 As shown, the present invention also provides an electronic device 900. The electronic device 900 includes a processor 901, a memory 902, a display 903, and a data acquisition device 904. Figure 9 Only some components of the electronic device 900 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0107] In some embodiments, processor 901 may be a central processing unit (CPU), microprocessor, or other data processing chip, used to run program code stored in memory 902 or process data, such as the water quality early warning method of the present invention.
[0108] In some embodiments, processor 901 may be a single server or a group of servers. The server group may be centralized or distributed. In some embodiments, processor 901 may be local or remote. In some embodiments, processor 901 may be implemented on a cloud platform. In one embodiment, the cloud platform may include a private cloud, public cloud, hybrid cloud, community cloud, distributed cloud, intranet, multi-cloud, etc., or any combination thereof.
[0109] In some embodiments, memory 902 may be an internal storage unit of electronic device 900, such as a hard disk or memory of electronic device 900. In other embodiments, memory 902 may also be an external storage device of electronic device 900, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 900.
[0110] Furthermore, the memory 902 may include both internal storage units of the electronic device 900 and external storage devices. The memory 902 is used to store application software and various types of data installed on the electronic device 900.
[0111] In some embodiments, display 903 may be an LED display, a liquid crystal display, a touch-screen liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 903 is used to display information from electronic device 900 and to display a visual user interface. Data acquisition unit 904 is used to collect water monitoring data for the target water body. Components 901-907 of electronic device 900 communicate with each other via a system bus.
[0112] In one embodiment, when the processor 901 executes the water quality early warning program in the memory 902, the following steps can be implemented: Obtain water monitoring data for the target water body; The water quality indicators in the water monitoring data are discretized according to preset thresholds to obtain an ordered label set, which is a set of water quality grade labels with an order from light to severe. Water body monitoring data and ordered label sets are input into an ordered level prediction model to perform multi-lead-time prediction, and the probability and predicted level of the target risk level are obtained. The predicted grades under different lead times are compared with the actual grades, and the longest lead time in which the predicted grades and actual grades are consistent is determined as the target effective lead time. The warning release level for the target water body is determined based on the matching relationship between the probability of the target risk level, the effective lead time of the target, and the credibility of the target risk level.
[0113] It should be understood that when the processor 901 executes the water quality early warning program in the memory 902, in addition to the functions mentioned above, it can also perform other functions, as detailed in the description of the corresponding method embodiments above.
[0114] Furthermore, this embodiment of the invention does not specifically limit the type of electronic device 900 mentioned. Electronic device 900 can be a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, or other portable electronic devices. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the invention, electronic device 900 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0115] Accordingly, this application also provides a computer-readable storage medium for storing computer-readable programs or instructions. When the programs or instructions are executed by a processor, they can implement the steps or functions of the water quality early warning methods provided in the above-described method embodiments.
[0116] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.
[0117] The water quality early warning method, device, and electronic equipment provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A water quality early warning method, characterized in that, include: Obtain water monitoring data for the target water body; The water quality indicators in the water body monitoring data are discretized according to preset thresholds to obtain an ordered label set, which is a set of water quality grade labels with an order from light to heavy. The water body monitoring data and the ordered label set are input into the ordered level prediction model to perform multi-lead-time prediction, and the target risk level probability and prediction level are obtained. The predicted level is compared with the actual level under different lead times, and the longest lead time in which the predicted level and the actual level are consistent is determined as the target effective lead time. The warning release level for the target water body is determined based on the matching relationship between the target risk level probability, the target effective lead time, and the target risk level credibility.
2. The method according to claim 1, characterized in that, The process of obtaining the target risk level probability and predicted level includes: Map the ordered set of labels to continuous latent variables with an order relationship; The predictive performance of the continuous latent variables is optimized to obtain optimized continuous response variables; Based on the optimized continuous response variables, a regression tree is constructed and integrated prediction is performed to obtain continuous predicted values; The continuous predicted values are mapped back to the corresponding water quality levels to obtain the target risk level probability and predicted level.
3. The method according to claim 1, characterized in that, The step of comparing the predicted level with the actual level under different lead times and determining the longest lead time during which the predicted level and the actual level are consistent is the target effective lead time, including: The predicted level under different lead times is compared with the actual level. When the predicted level is consistent with the actual level, the probability of the target risk level exceeds a preset threshold, and the prediction results of adjacent lead times are stable, a candidate lead time set is determined. The longest lead time in the candidate lead time set is determined as the target effective lead time.
4. The method according to claim 1, characterized in that, After determining the longest lead time during which the predicted level and the actual level remain consistent as the target effective lead time, the method further includes: The confidence level of the target risk level is obtained by weighting the target risk level accuracy, target risk level recall, macro average accuracy, macro average consistency coefficient, and adjacent lead time probability stability.
5. The method according to claim 1, characterized in that, The step of determining the early warning issuance level of the target water body based on the matching relationship between the target risk level probability, the target effective lead time, and the target risk level credibility includes: If the probability of the target risk level is not lower than the first threshold, the effective lead time of the target is not lower than the preset lead time, and the credibility of the target risk level is not lower than the credibility threshold, then the warning release level of the target water body is determined to be a releaseable warning. If the probability of the target risk level is in the middle range, or the effective lead time of the target meets the preset requirements and the credibility of the target risk level is lower than the credibility threshold, then the warning issuance level of the target water body is determined to be a warning that needs to be reviewed. If the probability of the target risk level is lower than the first threshold, then the warning issuance level for the target water body is determined to be "no warning issued for the time being".
6. The method according to claim 1, characterized in that, After determining the warning issuance level for the target water body, the method further includes: Based on the importance of permutation features, partial dependency analysis, or sensitivity analysis, the warning release level is analyzed for interpretability, and an interpretable warning report is generated.
7. The method according to claim 1, characterized in that, The step of inputting the water body monitoring data and the ordered tag set into an ordered level prediction model for multi-lead-time prediction to obtain the target risk level probability and predicted level includes: The water quality indicators at current and historical moments in the water body monitoring data are extracted as input features, and the labels corresponding to each future lead time in the ordered label set are extracted as target labels. The input features and the target labels are combined in a time-series aligned manner to obtain supervised sample pairs; The supervised samples are used to perform multi-lead-time predictions on the input ordered level prediction model to obtain the target risk level probability and the predicted level.
8. The method according to claim 1, characterized in that, The acquisition of water body monitoring data for the target water body includes: Obtain initial water body monitoring data; The initial water monitoring data is preprocessed to obtain preprocessed water monitoring data. The preprocessing includes time alignment, anomaly identification, interpolation, and standardization.
9. A water quality early warning device, characterized in that, The device includes: The data acquisition unit is used to acquire water monitoring data of the target water body; The data partitioning unit is used to discretize the water quality indicators in the water body monitoring data according to a preset threshold to obtain an ordered label set, wherein the ordered label set is a water quality level label set with an order relationship from light to heavy. The data prediction unit is used to input the water body monitoring data and the ordered label set into the ordered level prediction model to perform multiple lead time predictions and obtain the target risk level probability and prediction level. The data comparison unit is used to compare the predicted level with the actual level under different lead times, and determine the longest lead time in which the predicted level and the actual level are consistent as the target effective lead time. The data matching unit is used to determine the early warning release level of the target water body based on the matching relationship between the target risk level probability, the target effective lead time, and the target risk level credibility.
10. An electronic device, characterized in that, The electronic device includes a data acquisition unit, a memory, and a processor, wherein, The data acquisition device is used to collect water monitoring data of the target water body; The memory is used to store executable program code; The processor is configured to discretize the water quality indicators in the water body monitoring data according to preset thresholds to obtain an ordered label set; input the water body monitoring data and the ordered label set into an ordered level prediction model for multi-lead-time prediction to obtain the target risk level probability and predicted level; compare the predicted level with the actual level under different lead times to determine the longest lead time in which the predicted level and the actual level are consistent as the target effective lead time; and determine the early warning release level of the target water body based on the matching relationship between the target risk level probability, the target effective lead time, and the target risk level credibility.