A water level warning method, electronic device, and storage medium

By performing scene recognition and dynamically adjusting water level warning conditions based on water level data, and combining cumulative and median absolute deviation algorithms, the problem of high false alarm rate in water level warning technology under different hydrological scenarios has been solved, achieving high accuracy and real-time water level warning.

CN122245057APending Publication Date: 2026-06-19ZHEJIANG DAHUA TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2026-03-11
Publication Date
2026-06-19

Smart Images

  • Figure CN122245057A_ABST
    Figure CN122245057A_ABST
Patent Text Reader

Abstract

This application discloses a water level early warning method, electronic device, and storage medium. The method includes: acquiring a target water level data sequence for a target water area, wherein the target water level data sequence includes target water level data for the target water area at different times; performing scene recognition using the target water level data sequence to obtain a predicted hydrological scene for the target water area; adjusting water level early warning conditions based on the predicted hydrological scene; and determining whether to issue a water level early warning for the target water area using the adjusted water level early warning conditions. This solution can improve the accuracy of water level early warnings.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of water level early warning technology, and in particular to a water level early warning method, electronic device, and storage medium. Background Technology

[0002] Water level early warning refers to the analysis of water level data, such as the status of water resources and water conservancy facilities, using various technical means to issue early warnings for abnormal water level data. Among related water level early warning technologies, various hydrological scenarios typically rely on a uniformly preset early warning water level line for data analysis. However, the corresponding early warning water level lines often differ across seasons and hydrological scenarios, leading to a significant increase in the false alarm rate of these technologies. Summary of the Invention

[0003] This application provides at least one water level early warning method, electronic device, and storage medium, which can improve the accuracy of water level early warning.

[0004] The first aspect of this application provides a water level early warning method, which includes: acquiring a target water level data sequence of a target water area, wherein the target water level data sequence includes target water level data of the target water area at different times; using the target water level data sequence to perform scene recognition to obtain a predicted hydrological scene of the target water area; adjusting the water level early warning conditions based on the predicted hydrological scene; and using the adjusted water level early warning conditions to determine whether to issue a water level early warning for the target water area.

[0005] The adjustment of water level warning conditions based on predicted hydrological scenarios includes: adjusting the water level warning threshold range of the target water area to the water level threshold range corresponding to the predicted hydrological scenario in response to the predicted hydrological scenario being one of several preset hydrological scenarios; and / or, adjusting the water level warning conditions includes adjusting the water level warning threshold range; and determining whether to issue a water level warning for the target water area using the adjusted water level warning conditions includes: issuing a water level warning for the target water area in response to the target water level data exceeding the adjusted water level warning threshold range for a preset time.

[0006] The step of adjusting the water level warning conditions is performed when the predicted hydrological scenario is one of several preset hydrological scenarios. After using the target water level data sequence to perform scenario recognition and obtain the predicted hydrological scenario of the target water area, the method further includes: in response to the predicted hydrological scenario being an abnormal hydrological scenario, using at least one preset mutation detection algorithm to perform mutation detection on the target water level data of the target water area, obtaining the detection results corresponding to each preset mutation detection algorithm, and the detection results characterizing whether the target water area is in a mutation event.

[0007] The process involves using at least one preset mutation detection algorithm to detect mutations in the target water level data of the target water area, obtaining detection results corresponding to each preset mutation detection algorithm. This includes: using several first target water level data of the target water area to statistically obtain first reference water level data and second reference water level data; using the second target water level data and the first reference water level data of the target water area to determine the water level deviation of the target water area; determining the hydrological judgment scenario of the target water area, and adjusting the second reference water level data accordingly based on the hydrological judgment scenario to obtain a deviation threshold that matches the judgment scenario; and comparing the magnitude of the water level deviation and the deviation threshold to obtain the detection result.

[0008] Wherein, at least one preset mutation detection algorithm includes a cumulative sum algorithm; the first reference water level data and the second reference water level data corresponding to the cumulative sum algorithm are respectively the mean and standard deviation of a first number of first target water level data; the second target water level data is the target water level data of the target water area at the target time, the water level deviation corresponding to the target time is the maximum value between the cumulative deviation and the reference value, the cumulative deviation is the sum of the water level deviation corresponding to the previous time and the deviation value corresponding to the target time, and the deviation value corresponding to the target time is the difference between the second target water level data, the first reference water level data, and the deviation adjustment parameter; comparing the magnitude of the water level deviation with the deviation threshold, a detection result is obtained, including: in response to the water level deviation corresponding to the target time exceeding the deviation threshold, determining that the target water area is in a mutation event, otherwise determining that the target water area is in a calm event; and / or, to The missing preset mutation detection algorithm includes a median absolute deviation algorithm. The first reference water level data corresponding to the median absolute deviation algorithm is the median of the water level of a second number of first target water level data. The second reference water level data is the median deviation of the absolute deviation between each first target water level data and the median water level, wherein the first number is less than the second number. The second target water level data includes each first target water level data, and the water level deviation corresponding to each first target water level data is the absolute deviation between the first target water level data and the first reference water level data. The detection result is obtained by comparing the magnitude of the water level deviation with the deviation threshold, including: in response to the existence of a third consecutive number of first target water level data whose corresponding water level deviation exceeds the deviation threshold, it is determined that the target water area is in a mutation event; otherwise, it is determined that the target water area is in a calm event, wherein the third number is less than the second number.

[0009] The determination of the hydrological assessment scenario for the target water area includes at least one of the following steps: When the preset mutation detection algorithm is the cumulative sum algorithm, in response to the water level deviation of the target water area at the target time exceeding a first multiple of the second reference water level data corresponding to the cumulative sum algorithm, the hydrological assessment scenario for the target water area is determined to be a mutation scenario; when the preset mutation detection algorithm is the median absolute deviation algorithm, in response to the existence of a fourth consecutive number of first target water level data with water level deviations exceeding a second multiple of the second reference water level data corresponding to the median absolute deviation algorithm, the hydrological assessment scenario for the target water area is determined to be a mutation scenario; when the hydrological assessment scenario preceding the target water area is a mutation scenario, in response to the existence of a fifth consecutive number of first target water level data with water level deviations exceeding a second multiple of the second reference water level data corresponding to the median absolute deviation algorithm, the hydrological assessment scenario for the target water area is determined to be a mutation scenario; If the absolute deviation between a number of third target water level data and third reference water level data is less than a third multiple of the fourth reference water level data, the hydrological judgment scenario for the target water area is switched to a calm scenario, wherein the third multiple is less than 1, and the third and fourth reference water level data are the mean and standard deviation corresponding to the sixth number of fourth target water level data, respectively; and / or, the second reference water level data is adjusted accordingly based on the hydrological judgment scenario to obtain a deviation threshold matching the judgment scenario, including: in response to a sudden change in the hydrological judgment scenario, the deviation threshold is adjusted to a fourth multiple of the second reference water level data; in response to a calm hydrological judgment scenario, the deviation threshold is adjusted to a fifth multiple of the second reference water level data, wherein the fourth multiple is greater than the fifth multiple.

[0010] The method includes at least one preset mutation detection algorithm, which includes a cumulative sum algorithm and a median absolute deviation algorithm. After performing mutation detection on the target water level data of the target water area using at least one preset mutation detection algorithm and obtaining the detection results corresponding to each preset mutation detection algorithm, the method further includes at least one of the following steps: issuing a notification in response to the detection results corresponding to both the cumulative sum algorithm and the median absolute deviation algorithm being characterized as mutation events; expanding the filtering window from a first window value to a second window value in response to the detection result corresponding to the cumulative sum algorithm being characterized as a mutation event, wherein the filtering window is used to filter the original water level data detected in the target water area to obtain the corresponding target water level data; and indicating that there is a systematic shift in the water level data in response to the detection result corresponding to the median absolute deviation algorithm being characterized as a mutation event.

[0011] Before acquiring the water level data sequence of the target water area, the method further includes: acquiring the raw water level data obtained from monitoring the target water area; performing at least one preprocessing on the raw water level data to obtain the corresponding target water level data. The at least one preprocessing includes at least one of filtering and normalization. In the case where at least one preprocessing includes filtering, the filtering window of the filter is dynamically adjusted when the target water area is in a sudden change scenario.

[0012] The filtering of the raw water level data includes: using the raw water level data as the current water level data, and acquiring several raw water level data within the filtering window of the current water level data, the several raw water level data including the current water level data and at least one raw water level data adjacent to the current water level data; replacing the current water level data with the central tendency statistics of the several raw water level data; and / or, the method further includes: detecting that the target water area is in a sudden change scenario using the water level data of the target water area, and expanding the filtering window from a first window value to a second window value, wherein the triggering condition for the target water area to be in a sudden change scenario includes the existence of a seventh consecutive number of raw water level data in the target water area with a change rate greater than a preset change rate.

[0013] The predicted hydrological scenarios include several preset hydrological scenarios and abnormal hydrological scenarios. Abnormal hydrological scenarios represent other hydrological scenarios besides the preset hydrological scenarios. The preset hydrological scenarios include at least one of calm hydrological scenarios, rainstorm hydrological scenarios, tidal hydrological scenarios, and wave hydrological scenarios. After obtaining the predicted hydrological scenario of the target water area by using water level data sequences for scenario identification, the method further includes at least one of the following steps: in response to the predicted hydrological scenario being a calm hydrological scenario, no alarm action is taken for the predicted hydrological scenario; in response to the predicted hydrological scenario being a rainstorm hydrological scenario, a rainstorm alarm is triggered; in response to the predicted hydrological scenario being a tidal hydrological scenario, tidal data is recorded; in response to the predicted hydrological scenario being a wave hydrological scenario, a wave warning is triggered; and in response to the predicted hydrological scenario being an abnormal hydrological scenario, an abnormal alarm is triggered.

[0014] The second aspect of this application provides an electronic device including a memory and a processor coupled to each other, the processor being used to execute program instructions stored in the memory to implement the hydrological early warning method of the first aspect described above.

[0015] A third aspect of this application provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the hydrological early warning method described in the first aspect above.

[0016] The above scheme utilizes the acquired target water level data sequence of the target water area for scene identification to determine the current predicted hydrological scene corresponding to the target water area. Then, based on the determined predicted hydrological scene, the water level warning conditions are dynamically adjusted. Next, the target water level data at different times in the target water level data sequence is analyzed according to the adjusted water level warning conditions to determine whether the target water level data at the current time meets the water level warning conditions. If it does, a warning is issued. This scheme, by classifying predicted hydrological scenes and dynamically adjusting water level warning conditions, can adapt to different seasons and hydrological scenes, thereby improving the accuracy of water temperature warnings.

[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.

[0019] Figure 1 This is a flowchart illustrating an embodiment of the hydrological early warning method of this application; Figure 2 This is a schematic diagram of the framework of an embodiment of the hydrological early warning system of this application; Figure 3 This is a flowchart illustrating another embodiment of the hydrological early warning method of this application; Figure 4 This is a schematic diagram of the framework of an embodiment of the hydrological early warning device of this application; Figure 5 This is a schematic diagram of the framework of an embodiment of the electronic device of this application; Figure 6 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application. Detailed Implementation

[0020] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0021] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.

[0022] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. Moreover, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0023] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the hydrological early warning method of this application. Specifically, it may include the following steps: Step S110: Obtain the target water level data sequence of the target water area, wherein the target water level data sequence includes the target water level data of the target water area at different times.

[0024] This application is mainly applied to the field of water level early warning. By analyzing the target water level data sequence, the current hydrological scenario is determined, and the water level early warning conditions are dynamically adjusted according to the hydrological scenario to adapt to different hydrological scenarios, thereby making the hydrological early warning more accurate.

[0025] Furthermore, the hydrological early warning system in this embodiment is based on the existing video surveillance facilities deployed at hydrological stations on small and medium-sized rivers, and is rapidly built using an external equipment integration model. The core advantage of this solution lies in maximizing the reuse of existing hardware and software resources, significantly reducing new investment costs; it also possesses high reliability and high real-time performance, accurately locating areas of abnormal water levels and simultaneously triggering efficient early warning and alarm mechanisms, providing a low-cost, high-performance solution for water level monitoring in small and medium-sized rivers. Further, the hydrological early warning system can be deployed using a combination of edge computing architecture (embedded terminal deployment) and an 8-bit quantization model, reducing the latency of the hydrological early warning system from >8 seconds in traditional cloud solutions to <100ms, thus meeting the real-time requirements of flood control early warnings.

[0026] Please refer to the following: Figure 2 , Figure 2 This is a schematic diagram of the framework of an embodiment of the hydrological early warning system 200 of this application. The hydrological early warning system 200 (hereinafter referred to as the system) includes three parts: a data acquisition layer 210, a host processing layer 220, and a resource support layer 230. Each layer works together to collect, analyze, and make decisions on water level and related information. The logic is rigorous and conforms to the scientific process of hydrological monitoring. Data acquisition layer 210: Sensors 1 to N (such as water level sensors, flow velocity sensors, etc.), GPS (positioning module), and spectrometer (which can be used for spectral characteristic analysis of hydrology or water quality) collect meteorological and hydrological information through a "network or physical interface" to provide multi-source raw data input for the hydrological early warning system 200. The hydrological information includes water level lines, early warning lines, location parameters, and angle parameters, etc.

[0027] Host Processing Layer 220: Centered around the host, the host processing layer 220 processes and analyzes the received data after receiving information from the data acquisition layer 210, utilizing peripheral modules, recording modules, overlay modules, intelligent analysis modules, convergence and fusion modules, and early warning decision-making modules. The peripheral modules are responsible for interactive control with external devices; the recording module records and stores monitoring footage; the overlay module overlays water level, location, and other monitoring data with video footage in real time, achieving data visualization. These three modules work together to record, interact with, and intuitively display information. The intelligent analysis module intelligently interprets multi-source raw data and identifies abnormal water level characteristics; the convergence and fusion module integrates scattered data from different sensors and devices to form a unified dataset; and the early warning decision-making module generates precise early warning commands and decision suggestions based on the analysis results. These three modules work together to achieve in-depth data processing, feature recognition, and decision output.

[0028] Resource Support Layer 230: The "Resources" module integrates core capabilities such as AI (Artificial Intelligence) analysis (enhancing the ability to intelligently interpret data), video acquisition (reusing existing hydrological station video monitoring resources), fusion computing (fusion processing of multi-dimensional data), and interconnection communication (ensuring information exchange between the system and external systems). It provides technical support for the host processing layer 220 and forms bidirectional data interaction with the host to ensure the integrity and scalability of system functions.

[0029] In one embodiment, the real-time water level data obtained by sensors or devices contains noise. Therefore, in order to improve the accuracy of the early warning results, the obtained water level data needs to be preprocessed.

[0030] Specifically, raw water level data from monitoring the target water area is acquired. Then, the raw water level data undergoes at least one preprocessing step to obtain the corresponding target water level data. This preprocessing step includes at least one of filtering and normalization. Where filtering is included in the preprocessing step, the filtering window is dynamically adjusted in the event of a sudden change in the target water area.

[0031] The filtering method for the raw water level data is as follows: the raw water level data is used as the current water level data, and several raw water level data points located within the filtering window of the current water level data are obtained. These raw water level data points include the current water level data and at least one raw water level data point adjacent to the current water level data. Then, the current water level data is replaced with the central tendency statistical value of the several raw water level data points.

[0032] By dynamically adjusting the filtering window, the system can effectively suppress noise interference caused by sudden changes in the actual water level in abrupt scenarios, avoiding misjudging sudden water level changes such as rainstorms as abnormal data, thereby significantly reducing the false alarm rate.

[0033] In one specific embodiment, a combination of filtering and normalization can be used to preprocess the raw water level data. The system receives a real-time water level data sequence { },in This represents the raw water level data at time t, and these data are stored in a circular buffer of length N to form a data pool. Then, a dynamic moving average filter is used for noise reduction, with an initial window size set to W=5 (i.e., the current water level data + the two raw water level data points immediately before and after the current water level data). The filtered output is calculated as follows: (1) use Replace original water level data Eliminate transient noise.

[0034] Then, the filtered raw water level data is mapped to the [0, 1] interval using linear normalization: (2) in, and Dynamic updates based on water gauge range or historical extreme water levels eliminate data discrepancies across different ranges and provide standardized input for subsequent scene classification and anomaly detection. This results in the target water level data sequence. }

[0035] Furthermore, during the filtering process of the raw water level data, if the target water area is detected to be in a sudden change scenario using the target water area's water level data, the filtering window is expanded from a first window value to a second window value. The triggering condition for the target water area to be in a sudden change scenario includes the presence of a seventh consecutive set of raw water level data with a rate of change greater than a preset rate of change. For example, this can be determined by the rate of change of three consecutive raw water level data. When the change threshold (configurable by the system, e.g., 5 cm / s) is reached, the system automatically expands the filter window from the first window value W=5 to the second window value W=10 to enhance the smoothing effect. The recovery condition is that after 10 consecutive original water level change rates return to the normal range, the filter window returns to W=5.

[0036] Step S120: Use the target water level data sequence to perform scene recognition and obtain the predicted hydrological scene of the target water area.

[0037] Among them, the predicted hydrological scenarios include several preset hydrological scenarios and abnormal hydrological scenarios. Abnormal hydrological scenarios represent other hydrological scenarios besides the preset hydrological scenarios. The preset hydrological scenarios include at least one of calm hydrological scenarios, rainstorm hydrological scenarios, tidal hydrological scenarios, and wave hydrological scenarios.

[0038] In one implementation, a calm hydrological scenario refers to a normal state where the fluctuation rate of water level data is consistently below 5 cm / s; a rainstorm hydrological scenario refers to a sudden rise in water level with a rate of change exceeding 5 cm / s; a tidal hydrological scenario refers to periodic fluctuations in water level caused by lunar gravity; a wave hydrological scenario refers to short-term, high-frequency fluctuations in water level caused by wind; and an abnormal hydrological scenario refers to a water level state that cannot match the preset scenario. In this embodiment, an STM32F407 microcontroller can be used to deploy a hybrid model of 1D-CNN (Convolutional Neural Network) and LSTM (Long Short-Term Memory) for scenario classification. The model is quantized to 8-bit and supports real-time processing. Alternatively, other edge devices such as Raspberry Pi combined with lightweight neural networks can be used for alternative implementation. The scenario classification output probability is judged by a threshold and then directly triggers the corresponding action to ensure that the system response dynamically matches the hydrological characteristics.

[0039] The performance of the early warning system is significantly improved by scene-adaptive action execution, avoiding the high false alarm rate caused by traditional fixed thresholds in tidal hydrological scenarios; timely alarm triggering in rainstorm hydrological scenarios improves flood control response efficiency; direct alarms in abnormal hydrological scenarios prevent data omissions; the overall system false alarm rate is reduced by more than 90%, meeting the needs of real-time and accurate early warning.

[0040] In one embodiment, scene recognition can be performed on the acquired target water level data sequence to determine the current hydrological scene. Furthermore, to accurately identify the current hydrological scene, target water level data within a preset time range (e.g., 60 seconds, 5 minutes, etc.) from the current moment can be analyzed.

[0041] Specifically, a lightweight 1D-CNN+LSTM hybrid model (with fewer than 50KB of parameters) can be used to analyze the target water level data sequence over the past 60 seconds. Scene recognition was performed to obtain the probability distribution of five scene categories. (Calm hydrological scenario / heavy rain hydrological scenario / tidal hydrological scenario / wave hydrological scenario / abnormal hydrological scenario). The obtained scenario probability is compared with a preset probability threshold. If the scenario probability is greater than or equal to the preset probability threshold, the predicted hydrological scenario is the corresponding hydrological scenario. For example, the preset probability threshold can be set to 0.7. If so, the predicted hydrological scenario is a calm hydrological scenario; if If so, the predicted hydrological scenario is a rainstorm hydrological scenario; if If so, the predicted hydrological scenario is a tidal hydrological scenario; if If so, the predicted hydrological scenario is a wave hydrological scenario; if If the probability of any other scenario is less than 0.7, then the predicted hydrological scenario is an abnormal hydrological scenario.

[0042] Furthermore, corresponding early warning methods can be used to issue warnings when the predicted hydrological scenario is determined. If the predicted hydrological scenario is calm, no alarm action will be taken; if the predicted hydrological scenario is heavy rainfall, a heavy rainfall alarm will be triggered; if the predicted hydrological scenario is tidal, tidal data will be recorded; if the predicted hydrological scenario is wave, a wave warning will be triggered; and if the predicted hydrological scenario is abnormal, an abnormality alarm will be triggered. For details, please refer to the table below:

[0043] In one embodiment, when the predicted hydrological scenario is determined to be an anomalous hydrological scenario, further confirmation of the anomalous event is required. Therefore, a mutation detection mechanism can be used for anomalous event confirmation: in response to the predicted hydrological scenario being an anomalous hydrological scenario, at least one preset mutation detection algorithm is used to perform mutation detection on the target water level data of the target water area, obtaining the detection results corresponding to each preset mutation detection algorithm. The detection results characterize whether the target water area is experiencing a mutation event. The target water level data at this time includes the target water level data corresponding to the current moment and past target water level data. The method for obtaining the detection results can be found in steps S121 to S124.

[0044] Step S121: Using several first target water level data of the target water area, statistically obtain first reference water level data and second reference water level data.

[0045] Step S122: Use the second target water level data and the first reference water level data of the target water area to determine the water level deviation of the target water area.

[0046] In one embodiment, at least one preset mutation detection algorithm includes a cumulative sum algorithm (CUSUM). The first reference water level data and the second reference water level data corresponding to the cumulative sum algorithm are the mean and standard deviation of a first number of first target water level data, respectively. The second target water level data is the target water level data of the target water area at the target time. The water level deviation corresponding to the target time is the maximum value between the cumulative deviation and the reference value. The cumulative deviation is the sum of the water level deviation corresponding to the previous time and the deviation value corresponding to the target time. The deviation value corresponding to the target time is the difference between the second target water level data, the first reference water level data, and the deviation adjustment parameter. Specifically, refer to the following formula: (3) (4) Where M is the first quantity, μ is the first reference water level data (i.e., the mean of the first quantity of first target water level data), and σ is the second reference water level data (i.e., the standard deviation of the first quantity of first target water level data). For the first target water level data, This is the second target water level data (i.e., the target water level data of the target water area at the target time).

[0047] Next, calculate the water level deviation corresponding to the target time: (5) Where 0 is a reference value. K represents the water level deviation corresponding to the previous time step at the target time, and K is the deviation adjustment parameter, which is generally set to 0.5σ.

[0048] Next, let the deviation threshold in CUSUM be... Response to the water level deviation at the target time Exceeding the deviation threshold If the target water area is determined to be in a sudden event, then the target water area is determined to be in a calm event.

[0049] In one embodiment, at least one preset mutation detection algorithm includes a median absolute deviation algorithm (MAD). The first reference water level data corresponding to the median absolute deviation algorithm is the median of a second number of first target water level data. The second reference water level data is the median deviation of the absolute deviations between each first target water level data and the median water level, wherein the first number is less than the second number. The second target water level data includes each first target water level data, and the water level deviation corresponding to each first target water level data is the absolute deviation between the first target water level data and the first reference water level data. Specifically, refer to the following formula: (6) (7) (8) Med represents the first reference water level data (i.e., the median of the second number of first target water level data). The absolute deviation between the first target water level data and the median water level. This is the second reference water level data, and L is the second quantity.

[0050] Let the deviation threshold in MAD be... Therefore, in response to the existence of a third consecutive number of first target water level data corresponding to water level deviations exceeding the deviation threshold... The target water area is determined to be in a sudden event if it is in an abrupt change event, otherwise it is determined to be in a calm event. The third quantity is less than the second quantity. For example, the third quantity could be 5, if five consecutive target water level data points (i.e., including the target water level data at the current time and the four target water level data points adjacent to the current time in the past) all satisfy the condition... This determines that the target water area is experiencing a sudden change event. For example, this includes the target water level data at the current moment, as well as the target water level data of the four adjacent and subsequent points in time that exceed the deviation threshold. If so, then the target water area is determined to be in a sudden change event.

[0051] In another embodiment, the preset mutation detection algorithm may include both the cumulative sum algorithm (CUSUM) and the median absolute deviation algorithm (MAD). CUSUM and MAD are used to simultaneously detect mutations in the target water level data of the target water area to obtain the water level deviation of the target water area.

[0052] By simultaneously applying the cumulative sum algorithm and the median absolute deviation algorithm for two-level detection, the system can effectively distinguish between real water level changes and noise interference, significantly reducing the false alarm rate. When the cumulative sum algorithm detects a sudden event, it expands the filtering window, enhancing the smoothing capability of short-term changes while maintaining real-time performance and avoiding false alarms caused by noise. When the median absolute deviation algorithm detects a systematic shift, it provides a prompt, promptly identifying long-term issues such as sensor drift, avoiding misjudging normal trends as dangerous situations, improving the accuracy of early warnings and the reliability of the system, and ensuring accurate and stable early warning information in complex hydrological scenarios such as heavy rain and tides.

[0053] In this embodiment, the CUSUM and MAD algorithms are integrated. The CUSUM algorithm is used to detect short-term abrupt events, such as sudden rises in water level caused by heavy rainfall, while the MAD algorithm is used to detect long-term trend anomalies, such as sensor drift. The CUSUM algorithm can be used with a sliding window of 30 target water level data points and a cumulative deviation threshold of 1.5 times the standard deviation. The MAD algorithm can be used with a calculation window of 90 target water level data points and a median absolute deviation threshold of 3 times the MAD value. The synergistic operation of the cumulative sum algorithm and the median absolute deviation algorithm significantly improves the accuracy and robustness of water level abrupt change detection.

[0054] The cumulative sum algorithm is highly sensitive to short-term abrupt events (such as sudden rises in water levels due to heavy rainfall), enabling rapid identification of sudden anomalies. The median absolute deviation algorithm is robust to long-term trend anomalies (such as sensor drift or tidal periodic changes), effectively filtering out slowly varying interference. The combination of these two algorithms allows the system to distinguish between real abrupt events and noise fluctuations, avoiding the high false alarm rate caused by traditional fixed threshold methods. In flood warning applications, this dynamic detection mechanism reduces the false alarm rate by more than 90% while ensuring timely response to critical events (such as heavy rainfall). The derivation process is as follows: the cumulative sum algorithm adapts to short-term fluctuations based on dynamic thresholds of mean and standard deviation, while the median absolute deviation algorithm adapts to long-term trends based on the robust statistical properties of the median and the median absolute deviation. These two algorithms complement each other, covering anomalies at different time scales, forming a closed-loop detection mechanism that significantly improves the system's reliability in complex hydrological environments.

[0055] Step S123: Determine the hydrological judgment scenario of the target water area, and adjust the second reference water level data accordingly based on the hydrological judgment scenario to obtain the deviation threshold that matches the judgment scenario.

[0056] In one embodiment, to further reduce the false alarm rate, a dynamic threshold adjustment mechanism can be used to judge the obtained water level deviation in order to determine the deviation threshold that matches the judgment scenario.

[0057] Therefore, it is necessary to first determine the hydrological assessment scenario. With the preset mutation detection algorithm being the cumulative sum algorithm, the hydrological assessment scenario for the target water area is determined to be a mutation scenario when the water level deviation at the target time exceeds a first multiple of the second reference water level data corresponding to the cumulative sum algorithm.

[0058] When the preset mutation detection algorithm is the median absolute deviation algorithm, in response to the fact that the water level deviation of the fourth consecutive number of first target water level data in the target water area exceeds the second multiple of the second reference water level data corresponding to the median absolute deviation algorithm, the hydrological judgment scenario of the target water area is determined to be a mutation scenario.

[0059] Furthermore, both the cumulative sum algorithm and the median absolute deviation algorithm can recover from a sudden change scenario to a calm scenario under certain conditions. When the hydrological determination scenario prior to the target water area is a sudden change scenario, in response to the existence of a fifth consecutive set of absolute deviations between the third target water level data and the third reference water level data being less than a third multiple of the fourth reference water level data, the hydrological determination scenario for the target water area is determined to switch to a calm scenario. Here, the third multiple is less than 1, and the third and fourth reference water level data are the mean and standard deviation corresponding to the sixth set of fourth target water level data, respectively.

[0060] The cumulative sum algorithm calculates historical mean and standard deviation. When the water level deviation exceeds a first multiple (e.g., 2.5 times the standard deviation) of the second reference water level data (e.g., historical mean), it is identified as a sudden change scenario, suitable for sudden water level changes such as heavy rain. The median absolute deviation algorithm estimates the median and standard deviation. When the deviation of the fourth consecutive set of target water level data exceeds a second multiple (e.g., 3 times the MAD) of the second reference water level data, it is identified as a sudden change scenario, used to identify gradual anomalies such as sensor drift. In a sudden change scenario, the system switches to a calm scenario when the absolute deviation of the fifth consecutive set of data points is less than a third multiple (e.g., 0.8 times the standard deviation) of the fourth reference data (standard deviation), where the third reference data is the mean and the fourth reference data is the standard deviation. In the embodiment, the fourth set can be set to 5 (corresponding to 5 consecutive points detected by MAD), the fifth set can be set to 10 (corresponding to 10 consecutive points for the recovery condition), and the third multiple can be set to 0.8 (less than 1). These parameters can be dynamically adjusted according to actual hydrological data. Regarding threshold adjustment, the deviation threshold is set to the fourth multiple of the second reference water level data in the case of sudden changes, and to the fifth multiple in the case of calm periods. The fourth multiple is greater than the fifth multiple to ensure that monitoring is relaxed during the sudden change period and tightened during the calm period, effectively distinguishing between short-term sudden changes and long-term trends.

[0061] The dynamic threshold adjustment mechanism significantly reduces the false alarm rate, achieving a reduction of over 90% compared to traditional fixed threshold methods under complex hydrological conditions such as heavy rain and tides. This design, through scenario adaptation, ensures that false alarms caused by minor fluctuations are avoided during calm periods, while responding promptly during abrupt changes, thus improving the accuracy and reliability of early warnings. The collaborative work of the cumulative sum algorithm and the median absolute deviation algorithm effectively distinguishes between short-term abrupt changes (such as heavy rain) and long-term trend anomalies (such as sensor drift), enhancing the system's ability to detect slowly changing anomalies while meeting the real-time requirements of flood warnings (end-to-end latency less than 100 milliseconds).

[0062] Furthermore, after determining the hydrological assessment scenario, in response to a sudden change scenario, the deviation threshold is adjusted to a fourth multiple of the second reference water level data. In response to a calm hydrological assessment scenario, the deviation threshold is adjusted to a fifth multiple of the second reference water level data, where the fourth multiple is greater than the fifth multiple.

[0063] For example, in the case of the cumulative sum algorithm, assuming the first multiple is 3, the hydrological scenario determination conditions are as follows: (9) The fifth number is 10. This is the third reference water level data. It can be obtained through the above formula (3), This is the fourth reference water level data. It can be obtained through the above formula (4) that 0.2 is the third multiple.

[0064] The formula for the deviation threshold of the cumulative sum algorithm is: (10) in, It is the fourth multiple, and 1.5 is the fifth multiple.

[0065] At the initial time t=1, the default hydrological assessment scenario is a calm scenario; therefore, the deviation threshold corresponding to time t=1 is 1.5σ. Next, the water level deviation at time t=1 is used... Substituting into formula (9), if the obtained hydrological judgment scenario is a sudden change scenario, then the default hydrological judgment scenario corresponding to time t=2 is a sudden change scenario; if the obtained hydrological judgment scenario is a calm scenario, then the default hydrological judgment scenario corresponding to time t=2 is a calm scenario.

[0066] For example, in the case of the median absolute deviation algorithm, assuming the second multiple is 2, the hydrological scenario determination conditions under the median absolute deviation algorithm are as follows: (11) The fourth quantity is 5, meaning that the absolute deviation of 5 consecutive target water level data from the first reference water level exceeds [a certain threshold]. .

[0067] The deviation threshold formula for the median absolute deviation algorithm is: (12) Among them, 2 is the fifth multiple and 3 is the fourth multiple.

[0068] It is understood that Med and MAD in the above formulas (11) and (12) are calculated at the current target time. The first to fourth quantities and the first to fifth multiples can be set according to the actual situation, and no specific limitation is made here.

[0069] Step S124: Compare the magnitude of the water level deviation with the deviation threshold to obtain the detection result.

[0070] In one embodiment, in the case of a cumulative sum algorithm, formulas (3), (4), (5), (9) and formula (10) above can be combined. The water level deviation of the target water area is calculated at the initial time t=1. = At this time, the default hydrological judgment scenario is a calm scenario, and the deviation threshold corresponding to the calm scenario is... , = > At this time, The event will also = Substitute into formula (9) to determine the scene. = > If this is the case, then the hydrological scenario is determined to be a calm scenario. At time t=2, the corresponding... Its default scenario is a mutation scenario. This is a calm event, and at the same time... Substitute into formula (9) to determine the scene. < If so, the hydrological scenario is determined to be a calm scenario. At time t=3, the corresponding... Its default scene is a calm scene. This is a sudden event... The default hydrological determination scenario for the current target time is determined by the determination of the previous time.

[0071] In another implementation, in the case of the median absolute deviation algorithm, formulas (6), (7), (8), (11), and (12) above can be combined. At the initial time t=5, the default hydrological judgment scenario is a calm scenario. Then, for the calculation of time t=1, 2, 3, 4, 5, does the condition be satisfied: i=1, 2, 3, 4, 5? If the conditions are met, it is a mutation event, and at the same time The default scenario is a mutation scenario. At t=6, If so, it is a calm event, and at the same time... The default scenario is a mutation scenario. At t=7, Then, for the calculation of times t=3, 4, 5, 6, does the condition satisfy: i=3, 4, 5, 6, 7? If the conditions are met, then it is a mutation event... In one embodiment, at least one preset mutation detection algorithm includes a cumulative sum algorithm and a median absolute deviation algorithm. After obtaining the detection results, prompts can be made based on the detection results. Specifically, in response to the detection results corresponding to both the cumulative sum algorithm and the median absolute deviation algorithm being characterized as mutation events, a notification is issued; in response to the detection result corresponding to the cumulative sum algorithm being characterized as a mutation event, the filtering window is expanded from a first window value to a second window value, wherein the filtering window is used to filter the raw water level data detected in the target water area to obtain the corresponding target water level data; in response to the detection result corresponding to the median absolute deviation algorithm being characterized as a mutation event, a prompt is made indicating that there is a systematic shift in the water level data.

[0072] The cumulative sum algorithm is used to detect short-term water level abrupt events, such as rapid water level changes caused by heavy rainfall. It determines whether the data exceeds a threshold by calculating the cumulative deviation. The median absolute deviation algorithm is used to detect long-term trend anomalies, such as systematic shifts caused by sensor drift. It determines trend changes by analyzing the absolute deviation of the data from the median. When both algorithms detect abrupt events, it indicates that the system may be in a seriously abnormal state, requiring manual intervention, and therefore a notification is issued. When only the cumulative sum algorithm detects abrupt events, the filtering window is expanded from its initial value to enhance smoothing, for example, from 5 target water level data points to 10 target water level data points, reducing instantaneous noise interference. When only the median absolute deviation algorithm detects an anomaly, it indicates a systematic shift, facilitating equipment calibration. In this embodiment, the initial window value can be 5, and the second window value can be 10. The rate of change threshold can be set to 5 cm / s to trigger window expansion. The window parameters can be dynamically adjusted based on historical water level data to adapt to different hydrological environments.

[0073] By simultaneously applying the cumulative sum algorithm and the median absolute deviation algorithm for two-level detection, the system can effectively distinguish between real water level changes and noise interference, significantly reducing the false alarm rate by more than 90% compared to traditional single-algorithm methods. When the cumulative sum algorithm detects a sudden event, it expands the filtering window, enhancing the smoothing capability of short-term changes while maintaining real-time performance (delay less than 100 milliseconds), avoiding false alarms caused by noise. When the median absolute deviation algorithm detects a systematic shift, it provides a prompt, promptly identifying long-term issues such as sensor drift, avoiding misjudging normal trends as dangerous situations, improving the accuracy of early warnings and the reliability of the system, and ensuring accurate and stable early warning information in complex hydrological scenarios such as heavy rain and tides.

[0074] Step S130: Adjust the water level warning conditions based on the predicted hydrological scenario.

[0075] The steps for adjusting water level warning conditions are performed when the predicted hydrological scenario is one of several preset hydrological scenarios.

[0076] In one embodiment, in response to the predicted hydrological scenario being one of several preset hydrological scenarios, the water level warning threshold range of the target water area is adjusted to the water level threshold range corresponding to the predicted hydrological scenario. Specifically, adjusting the water level warning conditions includes adjusting the water level warning threshold range.

[0077] For example, when a predicted hydrological scenario is detected as a calm hydrological scenario, the water level warning threshold range for the calm hydrological scenario is adjusted by ±5cm; when a predicted hydrological scenario is detected as a rainstorm hydrological scenario, the water level warning threshold range for the rainstorm hydrological scenario is adjusted by ±10cm; when a predicted hydrological scenario is detected as a tidal hydrological scenario, the water level warning threshold range for the tidal hydrological scenario is adjusted by ±15cm; and when a predicted hydrological scenario is detected as a wave hydrological scenario, the water level warning threshold range for the wave hydrological scenario is adjusted by ±20cm.

[0078] Step S140: Determine whether to issue a water level warning for the target water area using the adjusted water level warning conditions.

[0079] In one embodiment, the water level warning condition is to adjust the water level warning threshold range. A water level warning is issued for the target water area when the target water level data exceeds the adjusted water level warning threshold range for a preset time. For example, in a heavy rain hydrological scenario, if the target water level data exceeds the water level warning threshold range adjusted by ±10cm for 3 seconds, a water level warning is issued. The target water level data that lasts for the preset time is the adjusted target water level data.

[0080] The duration verification mechanism further filters out instantaneous noise interference, ensuring that the warning only targets real hydrological anomalies, while the system delay is controlled within 100 milliseconds to meet the real-time requirements of flood warning.

[0081] In addition, if there are invalid target water level data (such as water level data = 0) in the target water level data sequence, the Kalman filter algorithm can be used to predict the water level of the invalid target water level data based on historical data. After recovery, the prediction error can be corrected by the real data of the most recent 10 seconds. At the same time, linear interpolation is used to quickly fill short-term missing data (<5 seconds), forming a "prediction-calibration" closed loop.

[0082] Please see Figure 3 , Figure 3 This is a flowchart illustrating another embodiment of the hydrological early warning method of this application. Specifically, it may include the following steps: Step S310: Obtain the target water level data sequence of the target water area.

[0083] This step is the same as step S110 above, and will not be repeated here.

[0084] Step S320: Use the target water level data sequence to perform scene recognition and obtain the predicted hydrological scene of the target water area.

[0085] This step is the same as step S120 above, and will not be repeated here.

[0086] Step S330: Validate the predicted hydrological scenario and obtain the validation results.

[0087] In one embodiment, after obtaining the predicted hydrological scene, it is verified. If the predicted hydrological scene is one of the preset hydrological scenes, the target water level data sequence is further filtered, and scene identification is performed using the filtered target water level data sequence. If the two predicted hydrological scenes are the same, the verification is successful. If the predicted hydrological scene is an abnormal hydrological scene, specifically, if the preset mutation detection algorithm used is CUSUM, then the parameters K and ... in the CUSUM algorithm are... Set different threshold values ​​and perform the calculation again. The verification is considered successful if the result meets the following conditions: A smaller K value indicates greater sensitivity to smaller offsets, but may also increase false alarms. Smaller size: alarms are triggered faster, but false alarms increase.

[0088] If the preset mutation detection algorithm used is MAD, a set of clean data is generated, and then several extreme values ​​are added before running the test. If the error between the result after adding the extreme values ​​and the result of running the test with the clean data is within the allowable range, then the verification result is considered to be passed.

[0089] Step S340: In response to the verification result being verified as passed, adjust the water level warning conditions based on the predicted hydrological scenario.

[0090] This step is the same as step S130 above, and will not be repeated here.

[0091] Step S350: Determine whether to issue a water level warning for the target water area using the adjusted water level warning conditions.

[0092] This step is the same as step S140 above, and will not be repeated here.

[0093] This application integrates multiple technologies such as dynamic filtering, scene classification, anomaly detection, and dynamic threshold adjustment, and achieves end-to-end low latency and low false alarm warnings through a lightweight scheduling strategy of embedded terminals. Specifically, this application dynamically adjusts the window size and warning threshold of the moving average filter based on real-time hydrological scene classification results (including calm hydrological scenes, heavy rainfall hydrological scenes, tidal hydrological scenes, wave hydrological scenes, or abnormal hydrological scenes), significantly reducing the false alarm rate in complex environments.

[0094] The 1D-CNN+LSTM scene classifier, along with dynamic filtering and anomaly detection mechanisms, are all deployed on edge computing terminals, eliminating cloud dependency and achieving an end-to-end latency of <100ms from data acquisition to early warning response. Hardware costs are reduced to 1 / 30th of traditional solutions. 1D-CNN is used to extract local fluctuation features, and LSTM captures temporal dependencies. 8-bit quantization and pruning techniques compress the model to <50KB, enabling real-time classification of five hydrological scenarios (calm / heavy rain / tidal / wave / anomaly) on a low-cost MCU (accuracy >95%).

[0095] This application also uses the CUSUM algorithm to detect short-term mutation events, combines the MAD algorithm to identify long-term trend anomalies, and dynamically sets warning thresholds (such as ±15cm for tides and ±10cm for rainstorms) based on the scene classification results, thus solving the problem of high false alarm rate caused by traditional fixed thresholds.

[0096] Furthermore, when the sensor fails and the collected water level data becomes unavailable, the current water level can be predicted based on Kalman filtering and historical data. After communication is restored, the output is corrected by weighted fusion (weight 0.7:0.3) of the real data and the predicted value from the most recent 10 seconds, ensuring data continuity and avoiding the defect of noise directly causing output jumps in traditional solutions.

[0097] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0098] Please see Figure 4 , Figure 4 This is a schematic diagram of a framework of an embodiment of the hydrological early warning device 400 of this application. The hydrological early warning device 400 includes an acquisition module 410, a scene recognition module 420, an adjustment module 430, and an early warning module 440. The acquisition module 410 acquires a target water level data sequence for a target water area, wherein the target water level data sequence includes target water level data for the target water area at different times. The scene recognition module 420 performs scene recognition using the target water level data sequence to obtain a predicted hydrological scene for the target water area. The adjustment module 430 adjusts the water level early warning conditions based on the predicted hydrological scene. The early warning module 440 uses the adjusted water level early warning conditions to determine whether to issue a water level early warning for the target water area.

[0099] In one embodiment, the adjustment module 430 performs an adjustment of water level warning conditions based on a predicted hydrological scenario, including: adjusting the water level warning threshold range of the target water area to the water level threshold range corresponding to the predicted hydrological scenario in response to the predicted hydrological scenario being one of several preset hydrological scenarios; and / or, adjusting the water level warning conditions includes adjusting the water level warning threshold range; determining whether to issue a water level warning for the target water area using the adjusted water level warning conditions includes: issuing a water level warning for the target water area in response to the target water level data exceeding the adjusted water level warning threshold range for a preset time.

[0100] In one embodiment, the step of the scene recognition module 420 in performing the adjustment of water level warning conditions is performed when the predicted hydrological scene is one of several preset hydrological scenes; after using the target water level data sequence to perform scene recognition and obtain the predicted hydrological scene of the target water area, the method further includes: in response to the predicted hydrological scene being an abnormal hydrological scene, using at least one preset mutation detection algorithm to perform mutation detection on the target water level data of the target water area respectively, and obtaining the detection results corresponding to various preset mutation detection algorithms, wherein the detection results characterize whether the target water area is in a mutation event.

[0101] In one embodiment, the scene recognition module 420 performs mutation detection on the target water level data of the target water area using at least one preset mutation detection algorithm, and obtains the detection results corresponding to each preset mutation detection algorithm. This includes: using several first target water level data of the target water area to statistically obtain first reference water level data and second reference water level data; using the second target water level data and the first reference water level data of the target water area to determine the water level deviation of the target water area; determining the hydrological judgment scenario of the target water area, and adjusting the second reference water level data accordingly based on the hydrological judgment scenario to obtain a deviation threshold that matches the judgment scenario; and comparing the magnitude relationship between the water level deviation and the deviation threshold to obtain the detection result.

[0102] In one embodiment, the scene recognition module 420 executes at least one preset mutation detection algorithm, including a cumulative sum algorithm; the first reference water level data and the second reference water level data corresponding to the cumulative sum algorithm are respectively the mean and standard deviation of a first number of first target water level data; the second target water level data is the target water level data of the target water area at the target time, the water level deviation corresponding to the target time is the maximum value between the cumulative deviation and the reference value, the cumulative deviation is the sum of the water level deviation corresponding to the previous time and the deviation value corresponding to the target time, and the deviation value corresponding to the target time is the difference between the second target water level data, the first reference water level data, and the deviation adjustment parameter; comparing the magnitude of the water level deviation with the deviation threshold, a detection result is obtained, including: in response to the water level deviation corresponding to the target time exceeding the deviation threshold, determining that the target water area is in a mutation event, otherwise determining that the target water area is calm. The event; and / or, at least one preset mutation detection algorithm includes a median absolute deviation algorithm, wherein the first reference water level data corresponding to the median absolute deviation algorithm is the median of the water level of a second number of first target water level data, and the second reference water level data is the median deviation of the absolute deviation between each first target water level data and the median water level, wherein the first number is less than the second number; the second target water level data includes each first target water level data, and the water level deviation corresponding to each first target water level data is the absolute deviation between the first target water level data and the first reference water level data; comparing the magnitude relationship between the water level deviation and the deviation threshold to obtain a detection result, including: in response to the existence of a third consecutive number of first target water level data corresponding to a water level deviation exceeding the deviation threshold, determining that the target water area is in a mutation event, otherwise determining that the target water area is in a calm event, wherein the third number is less than the second number.

[0103] In one embodiment, the scene recognition module 420 performs the determination of the hydrological determination scene of the target water area, including at least the following steps: when the preset mutation detection algorithm is the cumulative sum algorithm, in response to the water level deviation of the target water area at the target time exceeding a first multiple of the second reference water level data corresponding to the cumulative sum algorithm, the hydrological determination scene of the target water area is determined to be a mutation scene; when the preset mutation detection algorithm is the median absolute deviation algorithm, in response to the water level deviation of the target water area exceeding a second multiple of the second reference water level data corresponding to the median absolute deviation algorithm for a fourth consecutive number of first target water level data, the hydrological determination scene of the target water area is determined to be a mutation scene; when the hydrological determination scene before the target water area is a mutation scene, in response to the target water... If the absolute deviation between the third target water level data and the third reference water level data for a fifth consecutive number of times is less than a third multiple of the fourth reference water level data, the hydrological judgment scenario for the target water area is switched to a calm scenario, wherein the third multiple is less than 1, and the third and fourth reference water level data are the mean and standard deviation corresponding to the sixth number of fourth target water level data, respectively; and / or, the second reference water level data is adjusted accordingly based on the hydrological judgment scenario to obtain a deviation threshold matching the judgment scenario, including: in response to the hydrological judgment scenario being a sudden change scenario, the deviation threshold is adjusted to a fourth multiple of the second reference water level data; in response to the hydrological judgment scenario being a calm scenario, the deviation threshold is adjusted to a fifth multiple of the second reference water level data, wherein the fourth multiple is greater than the fifth multiple.

[0104] In one embodiment, the scene recognition module 420 executes at least one preset mutation detection algorithm, including a cumulative sum algorithm and a median absolute deviation algorithm. After performing mutation detection on the target water level data of the target water area using at least one preset mutation detection algorithm and obtaining the detection results corresponding to each preset mutation detection algorithm, the module further includes at least one of the following steps: issuing a notification in response to the detection results corresponding to both the cumulative sum algorithm and the median absolute deviation algorithm being characterized as mutation events; expanding the filtering window from a first window value to a second window value in response to the detection result corresponding to the cumulative sum algorithm being characterized as a mutation event, wherein the filtering window is used to filter the original water level data detected in the target water area to obtain the corresponding target water level data; and indicating that there is a systematic shift in the water level data in response to the detection result corresponding to the median absolute deviation algorithm being characterized as a mutation event.

[0105] In one embodiment, before acquiring the water level data sequence of the target water area, the acquisition module 410 further includes: acquiring the raw water level data obtained from monitoring the target water area; performing at least one preprocessing on the raw water level data to obtain the corresponding target water level data, wherein the at least one preprocessing includes at least one of filtering and normalization, wherein, when the at least one preprocessing includes filtering, the filtering window of the filter is dynamically adjusted when the target water area is in a sudden change scenario.

[0106] In one embodiment, the acquisition module 410 performs filtering on the raw water level data, including: using the raw water level data as the current water level data, and acquiring a plurality of raw water level data located in the filtering window of the current water level data, the plurality of raw water level data including the current water level data and at least one raw water level data adjacent to the current water level data; replacing the current water level data with the central tendency statistical value of the plurality of raw water level data; and / or, the method further includes: detecting that the target water area is in a sudden change scenario using the water level data of the target water area, and expanding the filtering window of the filter from a first window value to a second window value, wherein the triggering condition for the target water area to be in a sudden change scenario includes that the rate of change of the seventh consecutive number of raw water level data in the target water area is greater than a preset rate of change.

[0107] In one embodiment, the acquisition module 410 predicts hydrological scenarios including a plurality of preset hydrological scenarios and abnormal hydrological scenarios. Abnormal hydrological scenarios represent other hydrological scenarios besides the plurality of preset hydrological scenarios. The plurality of preset hydrological scenarios include at least one of calm hydrological scenarios, rainstorm hydrological scenarios, tidal hydrological scenarios, and wave hydrological scenarios. After obtaining the predicted hydrological scenario of the target water area by using water level data sequences for scenario identification, the module further includes at least one of the following steps: in response to the predicted hydrological scenario being a calm hydrological scenario, no alarm action is taken for the predicted hydrological scenario; in response to the predicted hydrological scenario being a rainstorm hydrological scenario, a rainstorm alarm is triggered; in response to the predicted hydrological scenario being a tidal hydrological scenario, tidal data is recorded; in response to the predicted hydrological scenario being a wave hydrological scenario, a wave warning is triggered; and in response to the predicted hydrological scenario being an abnormal hydrological scenario, an abnormal alarm is triggered.

[0108] Please see Figure 5 , Figure 5 This is a schematic diagram of the framework of one embodiment of the electronic device 50 of this application. The electronic device 50 includes a memory 51 and a processor 52 coupled to each other. The processor 52 is used to execute program instructions stored in the memory 51 to implement the steps in any of the above-described water level warning method embodiments. In a specific implementation scenario, the electronic device 50 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 50 may also include mobile devices such as laptops and tablets, which are not limited here.

[0109] Specifically, processor 52 controls itself and memory 51 to implement the steps in any of the above-described water level warning method embodiments. Processor 52 can also be referred to as a CPU (Central Processing Unit). Processor 52 may be an integrated circuit chip with signal processing capabilities. Processor 52 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 52 can be implemented using integrated circuit chips.

[0110] Please see Figure 6 , Figure 6 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium 60 of this application. The computer-readable storage medium 60 stores program instructions 601 that can be executed by a processor. The program instructions 601 are used to implement the steps in any of the above-described water level early warning method embodiments.

[0111] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0112] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.

[0113] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0114] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0115] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A water level warning method, characterized by, include: Obtain a target water level data sequence for a target water area, wherein the target water level data sequence includes target water level data for the target water area at different times; The target water level data sequence is used for scene recognition to obtain the predicted hydrological scene of the target water area; Based on the predicted hydrological scenario, adjust the water level warning conditions; The adjusted water level warning conditions are used to determine whether to issue a water level warning for the target water area.

2. The method of claim 1, wherein, The adjustment of water level warning conditions based on the predicted hydrological scenario includes: In response to the fact that the predicted hydrological scenario is one of several preset hydrological scenarios, the water level warning threshold range of the target water area is adjusted to the water level threshold range corresponding to the predicted hydrological scenario. And / or, the adjustment of water level warning conditions includes adjusting the water level warning threshold range; the step of determining whether to issue a water level warning for the target water area using the adjusted water level warning conditions includes: In response to the target water level data of the target water area exceeding the adjusted water level warning threshold range for a preset time, a water level warning is issued for the target water area.

3. The method of claim 1, wherein, The step of adjusting the water level early warning conditions is performed when the predicted hydrological scenario is one of several preset hydrological scenarios; After performing scene recognition using the target water level data sequence to obtain the predicted hydrological scene of the target water area, the method further includes: In response to the predicted hydrological scenario being an abnormal hydrological scenario, at least one preset mutation detection algorithm is used to perform mutation detection on the target water level data of the target water area, and the detection results corresponding to the various preset mutation detection algorithms are obtained. The detection results indicate whether the target water area is in a mutation event.

4. The method of claim 3, wherein, The step involves using at least one preset mutation detection algorithm to detect mutations in the target water level data of the target water area, obtaining detection results corresponding to various preset mutation detection algorithms, including: Using several first target water level data of the target water area, first reference water level data and second reference water level data are statistically obtained; The water level deviation of the target water area is determined by using the second target water level data and the first reference water level data of the target water area; Determine the hydrological judgment scenario of the target water area, and adjust the second reference water level data accordingly based on the hydrological judgment scenario to obtain a deviation threshold that matches the judgment scenario; The detection result is obtained by comparing the magnitude of the water level deviation with the deviation threshold.

5. The method according to claim 4, characterized in that, The at least one preset mutation detection algorithm includes a cumulative sum algorithm; the first reference water level data and the second reference water level data corresponding to the cumulative sum algorithm are respectively the mean and standard deviation of a first number of first target water level data; the second target water level data is the target water level data of the target water area at the target time, the water level deviation corresponding to the target time is the maximum value between the cumulative deviation and the reference value, the cumulative deviation is the sum of the water level deviation corresponding to the previous time of the target time and the deviation value corresponding to the target time, and the deviation value corresponding to the target time is the difference between the second target water level data, the first reference water level data, and the deviation adjustment parameter; the step of comparing the magnitude relationship between the water level deviation and the deviation threshold to obtain the detection result includes: If the water level deviation at the target time exceeds the deviation threshold, the target water area is determined to be in a sudden event; otherwise, the target water area is determined to be in a calm event. And / or, the at least one preset mutation detection algorithm includes a median absolute deviation algorithm, wherein the first reference water level data corresponding to the median absolute deviation algorithm is the median of the water level of a second number of first target water level data, and the second reference water level data is the median deviation of the absolute deviation between each first target water level data and the median water level, wherein the first number is less than the second number; the second target water level data includes each first target water level data, and the water level deviation corresponding to each first target water level data is the absolute deviation between the first target water level data and the first reference water level data; the step of comparing the magnitude of the water level deviation with the deviation threshold to obtain the detection result includes: In response to the existence of a third consecutive number of first target water level data corresponding to water level deviations exceeding a deviation threshold, the target water area is determined to be in a sudden event; otherwise, the target water area is determined to be in a calm event, wherein the third number is less than the second number.

6. The method according to claim 4, characterized in that, The process of determining the hydrological conditions of the target water area includes at least one of the following steps: When the preset mutation detection algorithm is the cumulative sum algorithm, in response to the water level deviation of the target water area at the target time exceeding the first multiple of the second reference water level data corresponding to the cumulative sum algorithm, the hydrological judgment scenario of the target water area is determined to be a mutation scenario. When the preset mutation detection algorithm is the median absolute deviation algorithm, in response to the fact that the water level deviation of the fourth consecutive number of first target water level data in the target water area exceeds the second multiple of the second reference water level data corresponding to the median absolute deviation algorithm, the hydrological judgment scenario of the target water area is determined to be a mutation scenario. If the hydrological determination scenario before the target water area is a sudden change scenario, in response to the fact that the absolute deviation between the third target water level data and the third reference water level data of the target water area is less than the third multiple of the fourth reference water level data for a fifth consecutive number of times, the hydrological determination scenario of the target water area is determined to be switched to a calm scenario, wherein the third multiple is less than 1, and the third reference water level data and the fourth reference water level data are the mean and standard deviation corresponding to the sixth number of fourth target water level data, respectively. And / or, the step of adjusting the second reference water level data accordingly based on the hydrological determination scenario to obtain a deviation threshold matching the determination scenario includes: In response to the hydrological determination scenario being a sudden change scenario, the deviation threshold is adjusted to a fourth multiple of the second reference water level data; In response to the hydrological determination scenario being a calm scenario, the deviation threshold is adjusted to a fifth multiple of the second reference water level data, wherein the fourth multiple is greater than the fifth multiple.

7. The method according to claim 3, characterized in that, The at least one preset mutation detection algorithm includes a cumulative sum algorithm and a median absolute deviation algorithm; After performing mutation detection on the target water level data of the target water area using at least one preset mutation detection algorithm to obtain the detection results corresponding to each preset mutation detection algorithm, the method further includes at least one of the following steps: A notification is issued in response to the fact that the detection results corresponding to the cumulative sum algorithm and the median absolute deviation algorithm are both characterized as a mutation event; In response to the detection result corresponding to the cumulative sum algorithm being characterized as a mutation event, the filtering window is expanded from a first window value to a second window value, wherein the filtering window is used to filter the raw water level data detected in the target water area to obtain the corresponding target water level data; The detection result corresponding to the median absolute deviation algorithm is characterized as a sudden event, indicating that there is a systematic shift in the water level data.

8. The method according to claim 1, characterized in that, Before acquiring the water level data sequence of the target water area, the following is also included: Obtain the raw water level data from monitoring the target water area; The original water level data is subjected to at least one preprocessing step to obtain the corresponding target water level data. The at least one preprocessing step includes at least one of filtering and normalization. When the at least one preprocessing step includes filtering, the filtering window of the filter is dynamically adjusted when the target water area is in a sudden change scenario.

9. The method according to claim 8, characterized in that, The filtering of the original water level data includes: The original water level data is used as the current water level data, and several original water level data located in the filter window of the current water level data are obtained. The several original water level data include the current water level data and at least one original water level data adjacent to the current water level data. Replace the current water level data with the central tendency statistical value of the several original water level data; And / or, the method further includes: The target water area is detected to be in a sudden change scenario using the water level data of the target water area. The filtering window of the filter is expanded from a first window value to a second window value. The triggering condition for the target water area to be in a sudden change scenario includes the existence of a seventh consecutive set of original water level data with a change rate greater than a preset change rate.

10. The method according to claim 1, characterized in that, The predicted hydrological scenarios include several preset hydrological scenarios and abnormal hydrological scenarios. The abnormal hydrological scenarios represent other hydrological scenarios besides the several preset hydrological scenarios. The several preset hydrological scenarios include at least one of calm hydrological scenarios, rainstorm hydrological scenarios, tidal hydrological scenarios, and wave hydrological scenarios. After using the water level data sequence to perform scene recognition and obtain the predicted hydrological scene of the target water area, the method further includes at least one of the following steps: If the predicted hydrological scenario is the calm hydrological scenario, no alarm action will be taken for the predicted hydrological scenario. In response to the predicted hydrological scenario being the rainstorm hydrological scenario, a rainstorm warning is triggered; In response to the predicted hydrological scenario being the tidal hydrological scenario, tidal data is recorded; In response to the predicted hydrological scenario being the wave hydrological scenario, a wave warning is triggered; In response to the predicted hydrological scenario being the abnormal hydrological scenario, an abnormal alarm is triggered.

11. An electronic device, characterized in that, The method includes a memory and a processor coupled to each other, the processor being used to execute program instructions stored in the memory to implement the water level early warning method according to any one of claims 1 to 10.

12. A computer-readable storage medium having program instructions stored thereon, characterized in that, When the program instructions are executed by the processor, they implement the water level early warning method according to any one of claims 1 to 10.