Coastal water level monitoring method, medium and system based on dynamic threshold algorithm

Through the coastal water level monitoring method based on the dynamic threshold algorithm, combined with tidal dynamics and hydro-meteorological coupling equations, the warning value is dynamically adjusted, which solves the problems of false alarms and missed alarms in extreme meteorological conditions caused by the traditional fixed threshold method, improves the monitoring accuracy and warning timeliness, and supports coastal disaster prevention and mitigation work.

CN120593866AInactive Publication Date: 2025-09-05QINGDAO HUAXING HAIYANG ENG TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202511079774.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-04
Publication Date
2025-09-05
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional coastal water level monitoring systems use a fixed threshold method, which cannot adapt to complex and changing environmental conditions, resulting in false alarms or missed alarms under extreme weather conditions, affecting the reliability and practicality of the early warning system, and making it difficult to achieve early and accurate identification of abnormal water level fluctuations.

Method used

A coastal water level monitoring method based on a dynamic threshold algorithm is adopted. By deploying a water level sensor array and an environmental monitoring module, data is collected in real time and a water level basic matrix is ​​constructed. The dynamic warning value is calculated by combining the tidal dynamics equation and the hydro-meteorological coupling equation group. The edge computing gateway is used for resource scheduling and self-learning, and the weight parameters are dynamically adjusted to output real-time water level monitoring data and the prediction curve for the next 24 hours.

Benefits of technology

It realizes dynamic adjustment of water level changes, improves the system's monitoring accuracy and early warning timeliness in complex and changing environments, reduces false alarm and missed alarm rates, and provides scientific technical support for disaster prevention and mitigation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120593866A_ABST
    Figure CN120593866A_ABST
Patent Text Reader

Abstract

The invention provides a coastal water level monitoring method based on a dynamic threshold algorithm, a medium and a system, and belongs to the technical field of coastal water level monitoring. The coastal water level monitoring method based on the dynamic threshold algorithm comprises the steps that data are collected through a water level sensor array, and a water level basic matrix and a floating matrix are constructed; a dynamic warning value is calculated by applying a tidal kinetic equation and a hydrometeorological coupling equation set, efficient resource scheduling is realized by utilizing a calculation jump matrix, self-learning optimization and water level prediction are performed based on a hydrological space-time network model, and water level monitoring and prediction data are output. Early warning of different levels is triggered according to the fact that the water level reaches the minimum range or the maximum range of the dynamic warning value, warning information is pushed to the disaster management platform through the edge computing gateway, a comprehensive warning report is finally generated for emergency decision making, and intelligent monitoring and accurate early warning of the coastal water level are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of coastal water level monitoring, and in particular relates to a coastal water level monitoring method, medium and system based on a dynamic threshold algorithm. Background Art

[0002] The present invention relates to coastal water level monitoring, specifically an intelligent early warning technology based on dynamic thresholds. Traditional coastal water level monitoring systems use a fixed threshold method. By analyzing historical extreme water level data, single or graded fixed early warning thresholds are set. Alarms are triggered when the measured water level exceeds the preset threshold. This method is simple to implement and can meet basic monitoring needs under normal meteorological conditions.

[0003] However, traditional fixed-threshold monitoring methods fail to account for dynamic factors such as tidal cycles, seasonality, and sudden changes in meteorological conditions, leading to a high number of false alarms or missed alerts under complex weather conditions. This is particularly true in extreme weather conditions such as typhoons and storm surges, where the combined effects of tidal forces and meteorological factors create highly nonlinear water level fluctuations. Fixed-threshold methods struggle to accurately capture abnormal water level fluctuations, severely impacting the reliability and practicality of early warning systems.

[0004] Traditional fixed-threshold monitoring technology struggles to address the complex and changing environmental factors involved in coastal water level monitoring, the strong interactions among factors influencing water levels, and the difficulty in balancing both accuracy and timeliness in early warnings. Especially under extreme weather conditions, the inability to accurately identify abnormal water level fluctuations early on can delay disaster prevention and mitigation efforts, posing a significant safety hazard. Summary of the Invention

[0005] In view of this, the present invention provides a coastal water level monitoring method, medium and system based on a dynamic threshold algorithm, which can solve the technical problem in the prior art that the coastal water level monitoring threshold setting is static and fixed, and cannot adapt to complex and changeable environmental conditions, resulting in low warning accuracy.

[0006] The present invention is implemented as follows: In the first aspect, the present invention provides a coastal water level monitoring method based on a dynamic threshold algorithm, comprising: collecting water level data, meteorological data and tidal cycle data in real time through a water level sensor array and an environmental monitoring module deployed at key coastal points, and transmitting the data to an edge computing gateway for preprocessing; constructing a water level basic matrix, which includes historical water level data, tidal cycle models and meteorological warning levels, and storing the matrix in the 128GB of the edge computing gateway. In SSD, a water level floating matrix is ​​generated, and a correlation model is established between the tidal phase and meteorological factors in the water level basic matrix through the tidal dynamics equation. The weight coefficient of water level change under different environmental conditions is calculated. The weight coefficient includes the weight coefficient of the tidal cycle and the weight coefficient of the meteorological factor, while considering the influence of seabed topography on water level fluctuations. The dynamic warning value is calculated according to the hydro-meteorological coupling equation group composed of the tidal prediction equation, storm surge response equation, rainfall runoff equation and comprehensive risk assessment equation. The GPU in the edge computing gateway is responsible for video data processing, and the CPU is responsible for communication and threshold calculation, forming a calculation jump matrix to achieve efficient resource scheduling, and at the same time establishing a memory and video memory sharing mechanism to optimize data interaction efficiency. The system performs self-learning according to the parameter correlation function, uses the pre-trained hydrological spatiotemporal network model to analyze historical data, predict future water level change trends, and dynamically adjust the weight parameters; outputs real-time water level monitoring data and the water level forecast curve for the next 24 hours.

[0007] The water level basic matrix refers to a multidimensional data set containing historical water level time series data, tidal cycle models and meteorological warning levels, which is used to store historical data characteristics of monitoring points.

[0008] The water level fluctuation matrix refers to a weight coefficient matrix that changes dynamically according to tidal cycles and meteorological conditions, and is used to quantify the degree of influence of different environmental factors on water level changes.

[0009] The computational jump matrix refers to a set of rules for task allocation and resource scheduling between the CPU and GPU, defining the timing and path for switching different computational tasks between processors.

[0010] This also includes triggering a yellow warning when the real-time water level reaches the minimum range of the dynamic warning value; activating a red alert when the real-time water level reaches the maximum range of the dynamic warning value; and the disaster management platform receives alarm information pushed by the edge computing gateway and generates a comprehensive alarm report.

[0011] Among them, the hydrological spatiotemporal network model refers to a spatiotemporal series prediction neural network based on the Transformer architecture, which includes a time encoding layer, a multi-head spatial attention mechanism layer, a residual connection layer, a feedforward neural network layer and an output projection layer, and is used to predict coastal water level change trends.

[0012] Among them, the parameters of the multi-head spatial attention mechanism in the hydrological spatiotemporal network model are dynamically adjusted according to the historical alarm accuracy, dynamic threshold deviation rate and the degree of mutation of environmental factors, and a data hierarchical storage function is used to store persistent data in the memory and temporary data in the video memory.

[0013] Among them, the data fusion mechanism refers to an algorithm framework that integrates persistent data in the main memory and temporary data in the video memory during the water level prediction process. By establishing a shared memory mapping area between the main memory and the video memory, the dynamic fusion of persistent data and temporary data is achieved through weight calculation of the multi-head spatial attention mechanism.

[0014] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions. When the program instructions are run in a computer, the program instructions are used to execute the above-mentioned coastal water level monitoring method based on the dynamic threshold algorithm.

[0015] The third aspect of the present invention provides a coastal water level monitoring system based on a dynamic threshold algorithm, comprising the above-mentioned computer-readable storage medium, wherein the system is any one of a computer, a server, and a single-chip microcomputer, and the computer-readable storage medium is arranged in the system, and the system is provided with a microprocessor for executing program instructions stored in the computer-readable storage medium.

[0016] The present invention realizes adaptive calculation of dynamic warning values ​​by constructing a water level basic matrix and a water level floating matrix, combining tidal dynamics equations with hydrological and meteorological coupling equations, and uses a hydrological spatiotemporal network model for trend prediction and self-learning optimization.

[0017] This invention addresses the shortcomings of traditional fixed threshold technology. By introducing weighting coefficients for the influence of tidal cycles and meteorological factors, it quantifies the contribution of different environmental factors to water level fluctuations and enables dynamic adjustment of warning thresholds. Furthermore, by employing a hierarchical data storage and fusion mechanism, it effectively integrates persistent and temporary data, improving the system's ability to identify abnormal water level fluctuations and the timeliness of warnings, significantly reducing false alarm and missed alarm rates.

[0018] The present invention successfully solves the technical problem of statically fixing the coastal water level monitoring threshold setting. By establishing a dynamic correlation model between multi-dimensional environmental factors and water level changes, it realizes adaptive adjustment and optimization of the warning threshold, improves the monitoring accuracy and reliability of the system in complex and changing environments, and provides scientific and effective technical support for coastal disaster prevention and mitigation work. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of the method of the present invention.

[0020] Figure 2This is the system architecture diagram in Example 2, used to show the data flow and module connection relationship.

[0021] Figure 3 This is a schematic diagram of the hardware connection in Example 2. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0023] like Figure 1 FIG. 1 is a flow chart of a coastal water level monitoring method based on a dynamic threshold algorithm according to the first aspect of the present invention. The method comprises the following steps: S01, through the water level sensor array and environmental monitoring module deployed at key points along the coast, real-time water level data, meteorological data and tidal cycle data are collected and transmitted to the edge computing gateway for pre-processing; S02. Build a basic water level matrix, including historical water level data, tidal cycle models, and meteorological warning levels. Store it in the 128GB SSD of the edge computing gateway to provide basic data support for dynamic threshold calculations. S03. Generate a water level fluctuation matrix, analyze the tidal phase and meteorological factors in the water level basic matrix through the tidal dynamics equation to establish a correlation model, and calculate the weight coefficients of water level changes under different environmental conditions. The weight coefficients include the weight coefficients of the influence of the tidal cycle and the weight coefficients of the influence of meteorological factors, while considering the influence of seabed topography on water level fluctuations; wherein, the correlation model uses a multivariate regression analysis method to weight the tidal phase angle, meteorological warning level, wind speed and direction data, air pressure change rate and rainfall to generate influence coefficients to represent the contribution of different factors to water level changes; S04. Calculate the dynamic warning value based on the hydrometeorological coupled equation system consisting of the tide prediction equation, storm surge response equation, rainfall runoff equation, and comprehensive risk assessment equation. The tide prediction equation inputs geographic location parameters, moon phase angle parameters, historical tide cycle parameters, solar gravity parameters, and Earth rotation parameters. The storm surge response equation inputs wind speed vector parameters, wind duration parameters, coastline shape parameters, water depth distribution parameters, and friction coefficient parameters. The rainfall runoff equation inputs rainfall intensity parameters, watershed area parameters, surface permeability parameters, river network density parameters, and surface slope parameters. The comprehensive risk assessment equation inputs tidal base water level parameters, storm surge increment parameters, rainfall runoff parameters, historical extreme water level parameters, and flood control facility load parameters. S05. Use the GPU in the edge computing gateway to process video data, and the CPU to handle communication and threshold calculations, forming a computational jump matrix to achieve efficient resource scheduling. At the same time, establish a memory and video memory sharing mechanism to optimize data interaction efficiency. S06. The system performs self-learning based on parameter correlation functions, uses pre-trained hydrological spatiotemporal network models to analyze historical data, predict future water level trends, and dynamically adjust weight parameters in the water level base matrix, water level floating matrix, and calculation jump matrix to improve threshold accuracy. S07. Output real-time water level monitoring data and the water level forecast curve for the next 24 hours, including the measured water level value, the forecast value, the minimum range of the dynamic warning value, and the maximum range of the dynamic warning value, to form a visual chart; S08. When the real-time water level reaches the minimum range of the dynamic warning value, a yellow warning is triggered. The system automatically calls the preset point camera, uses the OpenCV library to overlay the water level data on the upper left corner of the video, and compresses it through H265 encoding; S09: When the real-time water level reaches the maximum range of the dynamic warning value, a red alarm is activated. The edge computing gateway pushes the alarm information to the disaster management platform through the 4G Beidou communication module and activates all-round video surveillance. S10. The disaster management platform receives the alarm information pushed by the edge computing gateway and generates a comprehensive alarm report containing water level data, on-site video with superimposed timestamps, and warning levels for emergency decision-making. The water level basic matrix refers to a multidimensional data set containing historical water level time series data, tidal cycle models, and meteorological warning levels, which is used to store the historical data characteristics of monitoring points; The water level fluctuation matrix refers to a weight coefficient matrix that changes dynamically according to tidal cycles and meteorological conditions, and is used to quantify the degree of influence of different environmental factors on water level changes. The computational jump matrix refers to a set of rules for task allocation and resource scheduling between the CPU and GPU, defining the timing and paths for switching different computational tasks between processors. The dynamic warning value refers to the water level warning threshold value that is dynamically calculated based on real-time environmental conditions, tidal cycles, and historical data. It changes with time, season, and meteorological conditions. Different from the traditional static threshold value, it can adapt to the complex and changing coastal environment. The minimum range of dynamic warning values ​​refers to the water level range that triggers an early warning but does not reach an emergency state, and is usually set between 80% and 100% of the dynamic warning value; The maximum range of dynamic warning values ​​refers to the water level range where an emergency situation has been reached and flood control measures must be taken immediately. It is usually set when the dynamic warning value is exceeded and continues to rise. The parameter correlation function refers to a mathematical model that describes the mutual influence relationship between various system parameters. It is dynamically adjusted as the environment changes, and machine learning methods are used to optimize the accuracy of early warning. The tidal dynamics equation refers to an equation describing the laws of tidal motion based on Newton's theory of gravity and the principles of fluid mechanics, taking into account the combined effects of celestial gravitational parameters, seabed topography parameters, boundary condition parameters, seawater density parameters, and atmospheric pressure gradient parameters on water levels. The hydrological spatiotemporal network model refers to a spatiotemporal series prediction neural network based on the Transformer architecture, which includes a time encoding layer, a multi-head spatial attention mechanism layer, a residual connection layer, a feedforward neural network layer, and an output projection layer. It is used to predict coastal water level trends. The parameters of the multi-head spatial attention mechanism in the hydrological spatiotemporal network model are dynamically adjusted according to the historical alarm accuracy, the dynamic threshold deviation rate, and the degree of mutation of environmental factors. A data hierarchical storage function is used to store persistent data in memory and temporary data in video memory. The data fusion mechanism is used to call the fusion in real time during the prediction process. The data hierarchical storage function refers to an algorithm that classifies data in the neural network according to the data time span, update frequency, access frequency and importance. The basic tidal data, historical extreme water level data and terrain parameter data with long time span, low update frequency and low access frequency but high importance are defined as persistent data and stored in the memory. The real-time water level data, meteorological data and alarm status data with short time span, high update frequency and high access frequency are defined as temporary data and stored in the video memory. The data fusion mechanism refers to an algorithmic framework that integrates persistent data in memory and temporary data in video memory during the water level prediction process. By establishing a shared memory mapping area between the memory and video memory, the dynamic fusion of persistent and temporary data is achieved through weight calculation of the multi-head spatial attention mechanism. Persistent data provides the basis for historical trends, and temporary data provides real-time fluctuation characteristics. The fusion results are used to update the internal state of the hydrological spatiotemporal network model. Among them, the tidal cycle influence weight coefficient refers to the numerical value that quantifies the influence of the tidal cycle on water level changes, which is calculated through the tidal dynamics equation; among them, the meteorological factor influence weight coefficient refers to the numerical value that quantifies the influence of wind speed, air pressure, and rainfall on water level changes, which is calculated through the correlation model.

[0024] The specific implementation of the above steps is described in detail below.

[0025] The specific implementation method of step S01 is to deploy water level sensor arrays and environmental monitoring modules at key points along the coast to conduct real-time data collection and preprocessing. The water level sensor array can collect water levels by ultrasonic water level gauges, pressure water level gauges, or radar water level gauges according to the actual use environment. The sampling frequency is once every 15 seconds, and the measurement accuracy is ±2 cm. The environmental monitoring module includes a wind speed and direction sensor, a barometer, a rain gauge, and a thermometer to collect meteorological data with a sampling frequency of once every 5 minutes. The tidal cycle data is calculated based on the position of the moon phase using an astronomical algorithm. The edge computing gateway uses an ARM architecture multi-core processor to denoise the collected data, uses the Kalman filter algorithm to eliminate random fluctuations, and formats and timestamps the data in preparation for subsequent analysis. The purpose of this step is to establish a reliable data collection foundation to ensure that the monitoring system obtains high-quality raw data.

[0026] The specific implementation of step S02 is to construct a basic water level matrix to provide basic data support for dynamic threshold calculation. The basic water level matrix contains historical water level time series data for the past five years, stored at 15-minute intervals, forming a dataset containing 175,200 time series records. The tidal cycle model is based on harmonic analysis methods and uses Fourier transform to extract the main tidal components, including the amplitude and phase information of semi-diurnal tides, diurnal tides, and long-period tides. Meteorological warning levels are divided into five levels: normal (Level 1), caution (Level 2), alert (Level 3), danger (Level 4), and emergency (Level 5), and are updated in real time based on warning information issued by the meteorological department. All data is stored in the edge computing gateway's 128GB SSD, using a columnar storage format to accelerate query efficiency and establish a dual index based on time and geographic location. The purpose of this step is to establish a structured historical database, providing a reliable data foundation for subsequent dynamic threshold calculation.

[0027] The specific implementation of step S03 involves generating a water level fluctuation matrix and analyzing the weight coefficients of water level changes using tidal dynamics equations. First, a multivariate regression analysis method is used to establish a correlation model between tidal phase and meteorological factors. Variables such as tidal phase angle (0-360 degrees), meteorological warning level (1-5), wind speed (0-70 m / s), wind direction (0-359 degrees), air pressure change rate (-10-10 hPa / h), and rainfall (0-300 mm / 24 hours) are mapped into influence coefficients. The weight coefficients of the tidal cycle's influence are calculated using the tidal dynamics equation, which considers the combined effects of celestial gravitational parameters, seafloor topography parameters, boundary condition parameters, seawater density parameters, and atmospheric pressure gradient parameters on the water level. The weight coefficients range from 0.3 to 0.7. The weight coefficients of meteorological factors are calculated using the correlation model and range from 0.1 to 0.6. Seabed topography is adjusted by introducing a topography correction factor, with a correction factor of 1.0 for flat seabed areas and a correction factor of 1.2 to 1.5 for steep seabed areas. This step aims to quantify the impact of various environmental factors on water level changes and provide a scientific basis for calculating dynamic warning values.

[0028] The specific implementation of step S04 involves calculating a dynamic warning value based on a set of hydro-meteorological coupled equations. This set of equations consists of four sub-equations: the tidal prediction equation inputs geographic location parameters (latitude and longitude), lunar phase angle parameters (0-360 degrees), historical tidal cycle parameters, solar gravitational parameters, and Earth rotation parameters to calculate the theoretical tidal water level; the storm surge response equation inputs wind speed vector parameters, wind duration parameters, coastline shape parameters, water depth distribution parameters, and friction coefficient parameters to calculate storm surge water level increase; the rainfall runoff equation inputs rainfall intensity parameters, watershed area parameters, surface permeability parameters, river network density parameters, and surface slope parameters to calculate the contribution of rainfall to the water level; and the comprehensive risk assessment equation inputs tidal base water level parameters, storm surge increment parameters, rainfall runoff parameters, historical extreme water level parameters, and flood control facility load parameters to generate a dynamic warning value. The dynamic warning value is calculated using a weighted summation method, adding the contribution values ​​of each factor according to the weight coefficient and comparing and correcting them with historical data for the same period. The purpose of this step is to integrate multiple environmental factors to accurately calculate the water level warning threshold that conforms to the actual situation.

[0029] The specific implementation of step S05 utilizes an edge computing gateway for efficient resource scheduling. The edge computing gateway is equipped with a 64-core ARM processor and an NVIDIA embedded GPU, utilizing a heterogeneous computing architecture. The GPU is responsible for video data processing, including image enhancement, object detection, and waterline extraction, utilizing CUDA parallel computing to accelerate the process. The CPU is responsible for communication and threshold calculation, processing sensor data, executing warning logic, and maintaining the database. The computational jump matrix defines the allocation rules for different computing tasks between the CPU and GPU, dynamically adjusting based on task priority, computational complexity, and resource utilization. The memory and video memory sharing mechanism utilizes unified memory access technology, establishing a 4GB shared memory pool to reduce data transmission overhead. Resource scheduling utilizes a task queue priority algorithm, with emergency tasks assigned priority 1, warning tasks assigned priority 2, and routine monitoring tasks assigned priority 3. Lower priority values ​​indicate higher priority. This step aims to optimize computing resource utilization and ensure efficient system operation within limited hardware conditions.

[0030] The specific implementation of step S06 involves system self-learning and dynamic adjustment. First, a pre-trained hydrological spatiotemporal network model is used to analyze historical data and predict future water level trends. This model, based on the Transformer architecture, comprises a time encoding layer, a multi-head spatial attention mechanism layer, a residual connection layer, a feedforward neural network layer, and an output projection layer. Every 24 hours, the system calculates the accuracy of the parameter correlation function based on the error between the actual and predicted water levels. When the cumulative error exceeds a threshold (typically set at 5%), the parameter self-optimization process is triggered. This parameter self-optimization utilizes a gradient descent algorithm to adjust the weights of historical data in the water level base matrix, the weight coefficients for tidal cycles and meteorological factors in the water level fluctuation matrix, and the task priorities and resource allocation ratios in the jump matrix. The self-learning process is performed during off-peak hours to avoid impacting real-time monitoring capabilities. The purpose of this step is to continuously improve system accuracy through self-learning mechanisms and adapt to environmental and seasonal variations.

[0031] The specific implementation of step S07 is to output real-time water level monitoring data and prediction curves. The system integrates the real-time collected water level data with the water level change trends for the next 24 hours predicted by the hydrological spatiotemporal network model to generate a visual chart. The chart contains four curves: the measured water level curve (red solid line), the predicted value curve (blue dashed line), the dynamic warning value minimum range curve (yellow solid line), and the dynamic warning value maximum range curve (red solid line). The measured value curve displays historical water level data for the past 24 hours, and the predicted value curve displays predicted water level data for the next 24 hours. The dynamic warning value minimum range is set to 80% of the dynamic warning value, and the dynamic warning value maximum range is set to 100% of the dynamic warning value. The visual chart is drawn in SVG format, supports zooming and time window adjustment, and annotates the values ​​of key time points. The purpose of this step is to intuitively display water level change trends and warning thresholds, allowing decision makers to quickly judge the degree of risk.

[0032] The specific implementation of step S08 involves triggering a blue alert and video monitoring. When the real-time water level reaches the minimum dynamic warning value (80% of the dynamic warning value), the system triggers a blue alert. Once the alert is triggered, the system automatically uses a pre-set camera for on-site monitoring. The camera uses 1080P resolution, 25 frames per second, and a 120-degree field of view, covering the critical water area. The system uses the cvPutText function in the OpenCV library to overlay water level data, timestamp, GPS coordinates, and alert level information on the upper left corner of the video. The text is 3% of the video height and colored yellow (RGB: 255, 255, 0). The video data is compressed using H265 encoding with a compression ratio of 30:1 and a bit rate of 2 Mbps, ensuring high-quality video streaming even under limited bandwidth conditions. The compressed video is stored in the local cache of the edge computing gateway, retaining the last 72 hours of monitoring records. The purpose of this step is to provide on-site video monitoring during the early warning phase to assist decision makers in assessing the actual situation.

[0033] The specific implementation of step S09 involves initiating a red alert and data push. When the real-time water level reaches the maximum dynamic alert value range (100% of the dynamic alert value) and persists for more than 30 minutes, the system initiates a red alert. Once the red alert is triggered, the edge computing gateway pushes the alarm information to the disaster management platform via the 4G Beidou communication module. This communication uses encrypted JSON-formatted data packets containing the monitoring point ID, GPS coordinates, water level data, alarm level, trigger time, and a predicted water level trend for the next three hours. Data packet size is kept below 10KB to ensure fast transmission even under low-bandwidth conditions. Simultaneously, the system activates all-around video surveillance, activating multiple cameras to monitor the water area from different angles. Video data is transmitted to the disaster management platform in real time at a bitrate of 5Mbps. The communication module sends a heartbeat packet every five minutes to ensure a stable connection and automatically switches to a backup communication channel if a communication interruption is detected. This step ensures that in emergencies, alarm information is promptly transmitted to the higher-level platform, providing a basis for emergency response.

[0034] The specific implementation of step S10 involves the disaster management platform receiving, processing, and generating a comprehensive alarm report. The disaster management platform receives alarm information pushed by the edge computing gateway and, after data verification and integrity checks, generates a comprehensive alarm report. The alarm report includes a table of water level data (including measured values ​​for the last 24 hours and predicted values ​​for the next 12 hours), a time-stamped live video feed (1080p resolution, 25fps), and warning level information. The report is generated in accordance with the standard format of the National Flood Control and Drought Relief Command System and is divided into basic information, data analysis, and emergency recommendations. The basic information section includes basic information about the monitoring points and the current warning status; the data analysis section includes water level data charts and trend analysis; and the emergency recommendations section provides flood control measures based on the risk assessment results. The generated report is displayed on a web interface and automatically sent to the mobile devices of the relevant responsible individuals. The purpose of this step is to integrate multi-source data to generate intuitive and comprehensive decision-making support information, providing a scientific basis for emergency response.

[0035] The detailed structure of the hydrological spatiotemporal network model is designed using the Transformer architecture and mainly includes the following modules: the time encoding layer converts time series data into high-dimensional feature representation, uses position encoding to capture time information, and has an input dimension of 24 (representing 24-hour water level data); the multi-head spatial attention mechanism layer uses 8 attention heads, each with a dimension of 64, and captures the spatial correlation between different monitoring points through the self-attention mechanism; the residual connection layer retains the original feature information through jump connections to alleviate the gradient disappearance problem; the feedforward neural network layer uses a two-layer fully connected network with 512 hidden layer neurons, and uses the ReLU activation function to increase nonlinear characteristics; the output projection layer maps high-dimensional features back to water level prediction values, and has an output dimension of 24 (representing the water level prediction for the next 24 hours). The process of establishing the training dataset includes: collecting historical water level data from the past five years with a time granularity of 15 minutes; collecting meteorological data for the corresponding time period, including wind speed, wind direction, air pressure and rainfall; collecting tidal astronomical data for the corresponding time period, including the position of the moon phase and the sun; processing the data in a sliding window manner, with each sample containing 24 consecutive hours of input and 24 consecutive hours of output; dividing the dataset into training set, validation set and test set in a ratio of 8:1:1; standardizing the data to make the magnitude of each feature consistent; using the mean square error loss function and Adam optimizer for model training, with the learning rate set to 0.001 and the batch size of 64; when the validation set loss no longer decreases for 10 consecutive cycles, the early stopping strategy is used to terminate the training; the final model has a root mean square error of less than 5 cm on the test set, which meets the requirements of practical applications.

[0036] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions. When the program instructions are run in a computer, the program instructions are used to execute the above-mentioned coastal water level monitoring method based on the dynamic threshold algorithm.

[0037] The third aspect of the present invention provides a coastal water level monitoring system based on a dynamic threshold algorithm, comprising the above-mentioned computer-readable storage medium, wherein the system is any one of a computer, a server, and a single-chip microcomputer, and the computer-readable storage medium is arranged in the system, and the system is provided with a microprocessor for executing program instructions stored in the computer-readable storage medium.

[0038] The mathematical model or calculation process involved in the present invention is described in detail below.

[0039] The tidal dynamics equation is based on Newton's theory of gravity and the principles of fluid mechanics. It describes the laws of tidal motion and takes into account the combined effects of celestial gravity, seabed topography, boundary conditions, seawater density, and atmospheric pressure gradient on water level. It is specifically expressed as follows: ; Where, For time and location The water level at the location, in meters; is the mean sea level in meters; For the The amplitude of a tidal component, in meters; For the The angular frequency of a tidal component in radians per hour; is the time in hours; For the The phase of a partial tide, in radians; is the change in water level caused by atmospheric pressure, in meters; is the water level correction caused by seabed topography, in meters; is the error term, with a range of ±0.05 m.

[0040] The parameter acquisition method is: The average value is obtained through long-term water level observation data. For monitoring points with large water level changes, the average value is calculated using at least 5 years of historical data. Whether the water level change is large is determined based on expert experience. and It is obtained through harmonic analysis method, and the specific steps are as follows: (1) Fourier transform the long-term water level data; (2) extract the amplitude and phase of the main tidal components (usually including M2, S2, N2, K2, K1, O1, P1, Q1, etc.); (3) apply the least squares method to fit and optimize the amplitude and phase parameters; According to astronomical calculations, the angular frequency of the semidiurnal tide M2 ​​is , the angular frequency of the daily tide K1 is ; Calculated by the anti-air pressure effect: ; in is the real-time atmospheric pressure in Pascal; is the standard atmospheric pressure, which is 101325 Pascals; is the density of seawater, ranging from 1020 to 1030 kg / m³; is the acceleration due to gravity, which is 9.8m / s²; Calculated by terrain correction factor: ; in is the terrain correction factor, which is 1.0 for flat seabed areas and 1.2-1.5 for steep seabed areas; is the maximum water depth of the area, in meters; is the local water depth in meters.

[0041] The tidal dynamics equation uses power and cosine functions because tides are essentially formed by the superposition of multiple sine waves, and the cosine function accurately describes periodic changes. The terrain correction uses an inverse relationship to reflect the tidal amplification effect in shallow waters: as the water depth decreases, tidal waves of the same energy produce greater water level changes. The atmospheric pressure correction uses an inverse linear relationship, consistent with the physical principle of the inverse barometric effect: for every 1 hPa increase in atmospheric pressure, the sea level drops by approximately 1 cm. This equation comprehensively considers astronomical gravity, topography, and meteorological factors, accurately predicting normal tidal variations and providing a basis for dynamic threshold calculations.

[0042] The water level fluctuation matrix is ​​generated by the correlation model between tidal phase and meteorological factors, which quantifies the impact of different environmental factors on water level changes. The specific expression is as follows: ; Where, is the water level floating matrix; For the The environmental factors in The impact weight coefficient of each monitoring point, dimensionless; is the number of environmental factors; is the number of monitoring points.

[0043] The impact weight coefficient of each environmental factor is calculated as follows: ; Where, The tidal cycle is The influence weight coefficient of each monitoring point ranges from 0.3 to 0.7 and is dimensionless; is the tidal amplitude parameter, ranging from 0.15 to 0.25, dimensionless; is the tidal phase angle, ranging from 0 to 360 degrees; is the phase adjustment parameter, the value range is 0-90 degrees; is the basic influence coefficient, which is 0.4 and dimensionless.

[0044] ; Where, For wind power The influence weight coefficient of each monitoring point is in the range of 0.1-0.5 and is dimensionless; is the wind influence coefficient, which is 0.01 and dimensionless; is the wind speed in meters per second, ranging from 0 to 70 meters per second; is the wind direction angle, ranging from 0 to 359 degrees; For the The coastline direction angle of each monitoring point ranges from 0 to 359 degrees; is the gust influence coefficient, which is 0.2 and dimensionless; is the gust factor, which is defined as the ratio of the maximum gust to the average wind speed minus 1. It ranges from 0 to 1 and is dimensionless.

[0045] ; Where, The air pressure is The influence weight coefficient of each monitoring point ranges from 0.05 to 0.3 and is dimensionless; is the air pressure influence coefficient, which is 0.02 and dimensionless; is the rate of change of air pressure in hPa / h, with a value range of -10 to 10 hPa / h; is the pressure deviation attenuation coefficient, which is 0.001 and dimensionless; is the current air pressure in hPa; is the standard atmospheric pressure, which is 1013.25 hPa.

[0046] ; Where, For rainfall in The influence weight coefficient of each monitoring point ranges from 0.05 to 0.4 and is dimensionless; is the rainfall basic influence coefficient, which is 0.03 and dimensionless; is the rainfall intensity in mm / h, with a value range of 0-50 mm / h; is the rainfall intensity index, with a value of 0.7 and dimensionless; is the rainfall duration influence coefficient, which is 0.05 and dimensionless; Duration of rainfall in hours, ranging from 0 to 72 hours.

[0047] ; Where, The current water level is The influence weight coefficient of each monitoring point ranges from 0.1 to 0.4 and is dimensionless; is the water level deviation influence coefficient, which is 0.2 and dimensionless; is the current water level in meters; is the average water level during the same period in history, in meters; is the historical highest water level, in meters; is the historical lowest water level in meters; is the basic influence coefficient, which is 0.1 and dimensionless.

[0048] ; Where, For the seabed topography The influence weight coefficient of each monitoring point is in the range of 1.0-1.5 and is dimensionless; is the terrain correction factor, which is 1.0 for flat seabed areas and 1.2-1.5 for steep seabed areas, dimensionless; is the difference between the calculation point and the average water depth of the surrounding area, in meters; is the average water depth of the area in meters.

[0049] The total impact weight coefficient is calculated as follows: ; Where, For the The total impact weight coefficient of each monitoring point, dimensionless.

[0050] The hydro-meteorological coupled equations consist of four sub-equations, which integrate multiple environmental factors to accurately calculate the water level warning threshold.

[0051] The tidal prediction equation is specifically expressed as follows: ; Where, For time and location Tidal level at , in meters; is the mean sea level in meters; For the The node factor of each tidal component, dimensionless; For the The amplitude of a tidal component, in meters; For the The angular frequency of a tidal component in radians per hour; is the time in hours; For the The astronomical phase of a partial tide, in radians; For the The tidal delay angle of each minute tide, in radians; The number of tidal components involved in the calculation is generally 8-16 main tidal components.

[0052] Parameter acquisition method: Obtained through long-term water level observation data, at least 5 years of continuous observation data are required to calculate the average value; Calculated by astronomical algorithms, related to the lunar orbital inclination, such as the main diurnal tides The calculation formula of the node factor is ,in is the orbital angle of the lunar ascending node; and Obtained by performing harmonic analysis on historical water level data, the least squares method was used to fit at least 369 days of continuous observation data; and Obtained through astronomical calculations, e.g. Angular frequency of the tide , astronomical phase ,in 、 、 They are the lunar hour angle, lunar longitude and solar longitude respectively.

[0053] The storm surge response equation is specifically expressed as follows: ; Where, is the height of the storm surge, in meters; is the wind effect coefficient, ranging from 0.7 to 1.3, dimensionless; is the air density, which is 1.29 kg / m³; is the density of seawater, which is 1025 kg / m³; is the wind stress drag coefficient, which ranges from 0.001 to 0.004, is dimensionless, and increases with increasing wind speed. The calculation formula is: ; is the wind speed in meters per second; is the acceleration due to gravity, which is 9.8 m / s²; is the local water depth in meters; is the length of the wind zone in kilometers; is the wind direction angle, in degrees; is the angle of the coastline direction, in degrees; is the wind duration influence coefficient, which is 0.1 and dimensionless; is the wind duration in hours; is the pressure effect coefficient, ranging from 0.9 to 1.1, dimensionless; is the standard atmospheric pressure, which is 1013.25 hPa; is the storm center pressure in hectopascals; is the distance to the center of the storm in kilometers; is the maximum wind speed radius, in kilometers; is the error term, with a range of ±0.2 meters.

[0054] Parameter acquisition method: and Calibrated with historical storm surge event data, a multiple regression analysis method was used; The distance from the monitoring point to the land along the wind direction was calculated by geographic information system; By extracting coastline data, the average direction of the coastline near the monitoring point is calculated; 、 and Obtained through tropical cyclone monitoring data provided by meteorological departments.

[0055] Varies with wind speed. When the wind speed is less than 33 m / s, use the formula Calculation: When the wind speed is greater than 33 m / s, take a fixed value of 0.0029.

[0056] The rainfall runoff equation is specifically expressed as follows: ; Where, is the rise in water level due to rainfall, in meters; is the rainfall runoff coefficient, ranging from 0.01 to 0.05, with the unit of 1 / mm; is the rainfall intensity in mm / h; is the catchment area in square kilometers; is the surface permeability, ranging from 0.1 to 0.5, dimensionless; is the river network density, in km / km2; is the average surface slope in degrees; is the rainfall cumulative effect coefficient, which is 0.05 and dimensionless; is the duration of rainfall in hours; is the runoff attenuation coefficient, which is 0.02 and dimensionless; is the runoff delay time, in hours; is the error term with a range of ±0.15 m.

[0057] Parameter acquisition method: Calibrated with historical rainfall events and water level response data, using a linear regression approach; 、 and Obtained through geographic information system and digital elevation model (DEM) analysis; Determined based on soil type and vegetation cover, obtained through soil sample testing or reference to standard soil permeability tables; The calculation formula is estimated by the distance from the catchment area to the monitoring point and the river flow velocity: ; in is the length of the water flow path in kilometers; is the average flow velocity of the river in kilometers per hour.

[0058] The comprehensive risk assessment equation is specifically expressed as follows: ; Where, is the dynamic warning water level, in meters; is the tidal water level in meters; is the storm surge water increase, in meters; is the rainfall runoff increase, in meters; The highest water level in the same period in history (month m day d), in meters; is the safety margin factor, ranging from 0.1 to 0.2, dimensionless; is the correction factor for flood control facilities, ranging from 0.9 to 1.1, dimensionless; is the error term with a range of ±0.25 m.

[0059] The dynamic warning value range is calculated as follows: ; ; Where, The minimum range of dynamic warning value, in meters; The maximum range of dynamic warning value, in meters.

[0060] Parameter acquisition method: By querying the historical water level database, the historical highest water level records at the monitoring point on the month and day are extracted; According to the risk assessment, the higher value of 0.2 is used in high-risk areas, and the lower value of 0.1 is used in low-risk areas; Obtained through flood control facility capacity assessment, the calculation formula is: ; in Design water level for flood control facilities, in meters; This is the historical highest water level, in meters.

[0061] The hydrometeorological coupling equations employ a variety of functional relationships: the square relationship in the storm surge equation reflects the quadratic relationship between wind stress and wind speed, conforming to the fundamental laws of fluid dynamics; the exponential decay function describes the impact of wind duration and typhoon distance, stabilizing as duration increases or distance decreases; the exponential accumulation and decay functions in the rainfall-runoff equation reflect the cumulative effect and delayed nature of rainfall on water levels; and the comprehensive risk assessment equation utilizes a maximum function to ensure that the warning water level does not fall below the larger of the historical empirical value and the current forecast, thereby increasing the system's safety margin. These relationships, derived from fluid dynamics theory and extensive historical data analysis, accurately reflect the mechanisms by which various factors influence water levels.

[0062] The parameter correlation function describes the mutual influence between the system parameters, dynamically adjusts as the environment changes, and uses machine learning methods to optimize the warning accuracy. The specific expression is as follows: ; Where, Output value of parameter correlation function, dimensionless; is the environmental parameter vector, which includes all monitoring and prediction parameters; is the weight parameter vector; For time; For the The time-varying weight coefficient of the influence of a single parameter, dimensionless; For the A single-parameter influence function; For parameters and parameters The time-varying weight coefficient of the interaction effect, dimensionless; For parameters and parameters The interaction effect function of is the total number of parameters; is the error term, with a range of ±0.1.

[0063] The single parameter influence function adopts normalization processing: ; Where, and The parameters are The minimum and maximum values ​​of .

[0064] The interaction influence function takes into account the nonlinear relationship between parameters: ; Where, 、 and are the interaction coefficients, reflecting the product effect, difference effect, and short board effect respectively. Their values ​​range from -1 to 1 and are dimensionless.

[0065] The time-varying weight coefficients are updated through a self-learning mechanism: ; ; Where, is the time step in hours; is the weight attenuation coefficient, which is 0.001 and dimensionless; is the learning rate, which is 0.01 and dimensionless; is the warning error function, which is defined as the weighted sum of the mean square error between the predicted water level and the actual water level.

[0066] The error function is specifically expressed as: ; Where, For the The predicted water level for each time step, in meters; For the The actual water level in meters at each time step; is the time weight coefficient, recent data has a higher weight, and the calculation formula is ,in is the time attenuation coefficient, which is 0.05 and dimensionless; is the number of time steps.

[0067] Method for obtaining the coefficients in the parameter correlation function: 、 and It is obtained through historical data training and optimized using the gradient descent method, with the initial value set to 0.5; and The optimal value is determined by cross validation and a grid search method is used in and Find the combination that minimizes the error of the validation set within the range.

[0068] The multi-head spatial attention mechanism in the hydrological spatiotemporal network model is a key component responsible for capturing the correlation between different monitoring points and time points. The specific calculation process is as follows: ; Where, is the query matrix, with dimension ; is the key matrix with dimension ; is a value matrix with dimension ; The dimension of query and key is 64; The dimension of the value is 64; is the query sequence length; The length of the key / value sequence.

[0069] The multi-head attention mechanism divides the input into Parallel computing: ; Where, ; For the The query weight matrix of each head has the dimension ; For the The key weight matrix of each head has the dimension ; For the The value weight matrix of each head has the dimension ; is the output projection matrix, with dimensions ; is the model dimension, the value is 512; is the number of attention heads, which is 8.

[0070] The dynamic adjustment method of the weight matrix is: ; ; Where, is the updated weight matrix; is the current weight matrix; is the weight adjustment amount; is the attention learning rate, which is 0.001 and dimensionless; is the impact weight of alarm accuracy, with a value of 0.3 and dimensionless; is the alarm accuracy gradient; is the dynamic threshold deviation rate influence weight, which is 0.4 and dimensionless; is the dynamic threshold deviation rate gradient; is the influence weight of the mutation degree of environmental factors, with a value of 0.3 and dimensionless; is the gradient of the degree of mutation of environmental factors.

[0071] The gradient is calculated as: ; ; ; Where, is the alarm accuracy, which is defined as the number of correct alarms divided by the total number of alarms; is the dynamic threshold deviation rate, which is defined as the relative error between the predicted threshold and the actual threshold; is the degree of mutation of environmental factors, which is defined as the weighted sum of the rates of change of environmental parameters.

[0072] The multi-head spatial attention mechanism uses scaled dot product attention calculation, divided by The goal is to control the gradient size and prevent the vanishing gradient problem at higher dimensions. The softmax function normalizes the attention scores into a probability distribution, highlighting important associations and suppressing weak ones. The multi-head design allows the model to simultaneously focus on information from different representation subspaces, enhancing its expressive power. The dynamic weight adjustment mechanism continuously optimizes attention allocation based on early warning feedback, improving the model's ability to capture key patterns. This attention mechanism is particularly well-suited for water level monitoring scenarios, effectively identifying spatial correlations between different monitoring points and key patterns of change in time series.

[0073] The data hierarchical storage function classifies the data in the neural network according to the data characteristics and optimizes the storage strategy. The specific expression is as follows: ; Where, For data Storage location decision; is the time span weight, which is 0.3 and dimensionless; is the normalized value of the data time span, dimensionless; is the update frequency weight, which is 0.25 and dimensionless; is the normalized value of data update frequency, dimensionless; is the access frequency weight, which is 0.25 and dimensionless; is the normalized value of data access frequency, dimensionless; is the importance weight, with a value of 0.2 and dimensionless; is the normalized value of the importance of the data, dimensionless; is the storage decision threshold, which is 0.6 and dimensionless.

[0074] Each normalized value is calculated as follows: ; ; ; ; Where, For data The time span of , in days; For data The update frequency, in times / day; For data The access frequency, in times / hour; For data The importance rating ranges from 1 to 10; and Represent the minimum and maximum values ​​of the corresponding parameters respectively.

[0075] Parameter acquisition method: Calculated by the difference between the earliest time point and the latest time point of the data; Statistics of the number of data updates recorded by the monitoring system; Through system access log analysis; Automatically assess the impact of data on prediction accuracy through expert scoring or based on data.

[0076] The data tiered storage function uses a threshold decision method, storing data with a comprehensive score above the threshold in memory and data below the threshold in video memory. Scoring is calculated using a weighted summation method, balancing four key characteristics. Normalization ensures consistent dimensionality across all characteristics, and weights reflect their relative importance. This tiered storage strategy optimizes computing resource utilization by placing long-term, important data in memory and frequently changing, fast-access data in video memory, improving overall system efficiency.

[0077] The data fusion mechanism integrates the persistent data in the memory and the temporary data in the video memory for the water level prediction process. The specific representation is as follows: ; Where, is the fused data; For persistent data; This is temporary data; is the weight of the long space attention mechanism; is the fusion function.

[0078] The fusion function is further expressed as: ; Where, is the fusion balance coefficient, ranging from 0.3 to 0.7, dimensionless; Query matrix generated for ad hoc data; The key matrix generated for persistent data; The matrix of values ​​generated for the persistent data.

[0079] The calculation method is: ; Where, is the sigmoid function, ; is the bias term, which takes the value of 0 and is dimensionless; is the coefficient of variation of temporary data, which is 2 and dimensionless; is the degree of variability of the temporary data, calculated as the standard deviation divided by the mean; is the time difference coefficient, which is -0.5 and dimensionless; The difference between the latest time of persistent data and the current time, in days; is the historical error coefficient, which is -1 and dimensionless; is the normalized error of the previous period's forecast.

[0080] The shared memory mapping area is implemented by establishing a bidirectional buffer between the main memory and the video memory. The size is 16MB and the ring buffer structure is used. The update strategy is: ; Where, For time Buffer update strategy; The full update cycle is 24 hours. Incremental update period, set to 5 minutes.

[0081] The multi-head spatial attention mechanism weight calculation dynamically integrates the weight of persistent data and temporary data: ; Where, is the fusion weight matrix, which represents the degree of attention of temporary data to each persistent data.

[0082] Parameter acquisition method: 、 、 and By optimizing the gradient descent method, the prediction error after fusion is minimized; Obtained by calculating the coefficient of variation of temporary data, ,in is the temporary data standard deviation, is the temporary data mean; Obtained by comparing the persistent data timestamp with the current system time; Obtained by comparing the previous cycle's prediction results with the actual water level, .

[0083] The data fusion mechanism uses the attention mechanism as its core, which enables temporary data to selectively focus on relevant information in persistent data; the fusion balance coefficient Dynamic adjustments are achieved through the sigmoid function. When temporary data is highly variable, persistent data is fresh, or historical predictions are accurate, the historical patterns provided by persistent data are preferred. A hierarchical update strategy is used in the shared memory mapping area to balance real-time performance with system load. This fusion mechanism effectively integrates long-term trends and real-time fluctuations, improving the prediction model's responsiveness to abnormal water level changes.

[0084] Specifically, the core principle of the present invention is to build a dynamic threshold calculation framework, which achieves adaptive adjustment of warning thresholds through multi-source data fusion and coupled modeling of environmental factors. First, the present invention breaks through the limitations of traditional static thresholds and introduces tidal dynamics equations to analyze the relationship between water level, tidal phase, and meteorological factors. It quantifies the contribution of different environmental factors to water level changes, establishes a water level fluctuation matrix, and realizes dynamic threshold calculation.

[0085] Secondly, the present invention uses a coupled hydrometeorological equation system to calculate dynamic warning values. This system integrates tidal prediction equations, storm surge response equations, rainfall-runoff equations, and comprehensive risk assessment equations. It comprehensively considers multiple parameters such as geographic location, lunar phase angle, wind speed vector, and rainfall intensity to accurately calculate water level warning thresholds. Especially under extreme meteorological conditions, the coupling between these equations can accurately reflect the combined impact of changing environmental factors on water levels, improving warning accuracy.

[0086] Third, the present invention applies a hydrological spatiotemporal network model for water level trend forecasting and self-learning optimization. This model, based on the Transformer architecture and incorporating time encoding and multi-head spatial attention mechanisms, effectively captures the spatiotemporal dependencies of water level variations. A hierarchical data storage function divides data into persistent and temporary data, and a data fusion mechanism dynamically integrates them. This effectively integrates long-term trends with short-term fluctuations, significantly improving the model's ability to identify water level anomalies.

[0087] Since the present invention establishes a dynamic correlation model between environmental factors and water level changes, and realizes efficient scheduling of data processing and computing resources through the edge computing gateway, it can realize adaptive adjustment of the warning threshold under complex and changeable environmental conditions, solves the technical problem of static fixed setting of coastal water level monitoring thresholds, and improves the accuracy and reliability of the early warning system.

[0088] A specific embodiment 1 of the present invention is provided below. The specific implementation of each step in this embodiment 1 is described in detail as follows.

[0089] The specific implementation of step S01 is the same as above. In this embodiment, the Kalman filter algorithm is used to eliminate random fluctuations. The state equation of the Kalman filter algorithm is: , the observation equation is ,in is the state vector at time k, is the observation vector, is the state transition matrix, is the observation matrix, and are process noise and observation noise, respectively, both obey normal distribution, and the noise covariance thresholds are 0.01 and 0.02, respectively.

[0090] The specific implementation of step S02 is the same as above. In this embodiment, the Fourier transform formula is: ,in is the time domain water level data, is the frequency domain result, is the angular frequency, For time, The time index granularity is 1 hour, and the location index grid size is 1×1 km.

[0091] The specific implementation of step S03 is to generate a water level fluctuation matrix and analyze the weight coefficient of water level change through the tidal dynamics equation. First, a correlation model between tidal phase and meteorological factors is established using multivariate regression analysis. Variables such as tidal phase angle, meteorological warning level, wind speed, wind direction, air pressure change rate, and rainfall are mapped into influence coefficients. The water level fluctuation matrix is ​​generated through the correlation model between tidal phase and meteorological factors, and its expression is: ; in is the water level floating matrix, For the The environmental factors in The influence weight coefficient of each monitoring point. The influence weight coefficient of the tidal cycle is calculated by the formula Calculate, where is the tidal amplitude parameter (range: 0.15 to 0.25), is the tidal phase angle (0 to 360 degrees), is the phase adjustment parameter (0 to 90 degrees), is the basic influence coefficient (fixed value 0.4). The wind influence weight coefficient calculation formula is: ; in is the wind influence coefficient (value is 0.01), is the wind speed (0-70 m / s), is the wind direction angle (0 to 359 degrees), is the angle of the coastline direction, is the gust influence coefficient (value is 0.2), is the gust factor (range: 0 to 1). The air pressure influence weight coefficient calculation formula is: ; in is the air pressure influence coefficient (value is 0.02), is the rate of change of air pressure (-10 to 10 hPa / h), is the pressure deviation attenuation coefficient (value is 0.001), is the current air pressure, is the standard atmospheric pressure (1013.25 hPa). The calculation formula for the rainfall impact weight coefficient is: ; in is the rainfall basic influence coefficient (value is 0.03), is the rainfall intensity (0-50 mm / h), is the rainfall intensity index (value is 0.7), is the rainfall duration influence coefficient (value is 0.05), is the duration of rainfall (0 to 72 hours). The seabed topography factor is adjusted by introducing the topography correction coefficient, and the calculation formula is: ; in is the terrain correction coefficient, which is 1.0 in flat seabed areas and 1.2 to 1.5 in steep seabed areas. is the difference between the calculation point and the average water depth of the surrounding area, is the average water depth of the region. The total impact weight coefficient is calculated as follows: .

[0092] The purpose of this step is to quantify the impact of various environmental factors on water level changes and provide a scientific basis for the calculation of dynamic warning values.

[0093] The specific implementation of step S04 is to calculate the dynamic warning value based on the hydro-meteorological coupling equations. The hydro-meteorological coupling equations include four sub-equations: the tide prediction equation, the storm surge response equation, the rainfall runoff equation, and the comprehensive risk assessment equation. The tide prediction equation is expressed as: ; in is the mean sea level, is the node factor, is the tidal amplitude, is the angular frequency, Astronomical phase, is the lag angle, and 8 to 16 main tidal components are usually considered. The storm surge response equation is expressed as: ; in is the wind effect coefficient (range 0.7 to 1.3), is the density of air (1.29 kg / m³), is the density of seawater (1025 kg / m³), is the wind stress drag coefficient (range 0.001 to 0.004), The local water depth, is the length of the wind zone, is the wind duration influence coefficient (value is 0.1), is the wind duration, is the air pressure effect coefficient (value ranges from 0.9 to 1.1), is the storm center pressure, is the distance to the center of the storm, is the maximum wind speed radius, is the error term (±0.2 meters). The rainfall runoff equation is expressed as: ; in is the rainfall runoff coefficient (range 0.01 to 0.05), is the rainfall intensity, is the catchment area, is the surface permeability (range 0.1 to 0.5), is the river network density, is the average surface slope, is the rainfall cumulative effect coefficient (value is 0.05), is the duration of rainfall, is the runoff attenuation coefficient (value is 0.02), is the runoff delay time, is the error term (±0.15 m). The comprehensive risk assessment equation is expressed as: ; in This is the highest water level in history. is the safety margin factor (value ranges from 0.1 to 0.2), is the correction coefficient for flood control facilities (range 0.9 to 1.1), is the error term (±0.25 meters). The minimum and maximum ranges of the dynamic warning values ​​are and The purpose of this step is to comprehensively consider various environmental factors and accurately calculate the water level warning threshold that conforms to the actual situation.

[0094] The specific implementation of step S05 is the same as above and will not be described in detail here.

[0095] The specific implementation of step S06 is system self-learning and dynamic adjustment. First, the pre-trained hydrological spatiotemporal network model is used to analyze historical data and predict future water level trends. The parameter correlation function describes the mutual influence relationship between the various system parameters, and its expression is: ; in is the environmental parameter vector, is the weight parameter vector, is the time-varying weight coefficient of the single parameter influence, is a single parameter influence function, is the time-varying weight coefficient of parameter interaction, is the parameter interaction function, is the error term (±0.1). The time-varying weight coefficient is updated through the self-learning mechanism: and ,in is the weight attenuation coefficient (value is 0.001), is the learning rate (value is 0.01), is the warning error function, defined as ,in is the time weight coefficient, is the time decay coefficient (valued at 0.05). Every 24 hours, the system calculates the accuracy of the parameter correlation function based on the error between the actual and predicted water levels. When the cumulative error exceeds a threshold (set at 5%), the parameter self-optimization process is triggered. This step aims to continuously improve system accuracy through self-learning mechanisms to adapt to environmental and seasonal changes.

[0096] The specific implementation of step S07 is the same as above and will not be described in detail here.

[0097] The specific implementation of step S10 involves the disaster management platform receiving, processing, and generating a comprehensive alarm report. The disaster management platform receives alarm information pushed by the edge computing gateway and, after data verification and integrity checks, generates a comprehensive alarm report. The alarm report includes a table of water level data (including measured values ​​for the last 24 hours and predicted values ​​for the next 12 hours), a time-stamped live video (1080P resolution, 25fps), and warning level information. The report is generated according to the standard format of the National Flood Control and Drought Relief Command System and is divided into basic information, data analysis, and emergency recommendations. A data hierarchical storage function classifies data in the neural network based on its characteristics. The generated report is displayed through a web interface and automatically sent to the mobile devices of the relevant responsible individuals. The purpose of this step is to integrate multi-source data to generate intuitive and comprehensive decision-making support information, providing a scientific basis for emergency response.

[0098] Furthermore, in this embodiment, the hydrological spatiotemporal network model uses an improved Transformer architecture, which is designed specifically to capture the spatiotemporal characteristics of water level data. The model consists of six key layers: Time encoding layer: Converts the original time series water level data (input dimension 24, representing a 24-hour water level record) into a 512-dimensional high-dimensional feature representation. This layer uses the sine-cosine position encoding method to generate a time representation with periodic characteristics, which can effectively capture the periodic changes of tides. Encoding function: ; ; in is the time position, is the dimension index, is the model dimension.

[0099] Multi-head spatial attention mechanism layer: This layer consists of eight attention heads, each with a dimension of 64 (a total of 512 dimensions). It uses a self-attention mechanism to calculate correlations between different monitoring points and time points. This mechanism enables the model to simultaneously focus on different spatial locations and time scales, particularly water level patterns during periods of sudden tidal changes, before storm surges, or under unusual meteorological conditions. Attention weights are dynamically adjusted based on historical alarm accuracy (weight 0.3), dynamic threshold deviation rate (weight 0.4), and the degree of environmental factor mutation (weight 0.3), ensuring that the model focuses on the most relevant historical patterns.

[0100] Residual Connection Layer: Preserves original feature information through skip connections, effectively alleviating the vanishing gradient problem in deep networks. Layer normalization uses a parameterized approach to standardize each feature dimension and maintain numerical stability.

[0101] Feedforward neural network layer: It consists of two fully connected layers. The first layer dimension is expanded from 512 to 2048, and the second layer is compressed from 2048 back to 512, forming an expansion-compression structure. The activation function uses GELU (Gaussian Error Linear Unit), which is expressed as .

[0102] Multi-layer encoder stacking: The above structure (multi-head attention + residual connection + feedforward network) is repeatedly stacked in 6 layers to form a deep encoder. The parameters of each layer are learned independently, which can capture hierarchical features from low-level spatiotemporal associations to high-level complex patterns.

[0103] Output projection layer: This layer uses a linear transformation to map the 512-dimensional features back to a 24-dimensional output space (representing the water level forecast for the next 24 hours). Min-Max normalization is then applied to scale the predicted values ​​to a reasonable range. This layer uses a residual connection mechanism and incorporates historical water level data from the same period as a baseline forecast to improve the model's prediction stability under normal conditions.

[0104] The data processing in the model uses a hierarchical storage strategy, storing persistent data (basic tidal data, historical extreme water levels, and terrain parameters) in memory and temporary data (real-time water levels, meteorological data, and alarm status) in video memory. A data fusion mechanism is implemented through a shared memory mapping area, maintaining a 16MB circular buffer for data exchange. Temporary data is updated every 5 minutes, and persistent data is updated every 7 days. The model uses the ADAM optimizer for weight updates, with a learning rate of 0.0005. , , and adopts the learning rate decay strategy, decaying by 10% every 50 cycles.

[0105] The establishment of the training data set adopts a systematic multi-source data collection and processing process to ensure that the model can learn the complex hydrological and meteorological coupling relationship: First, a basic historical data set is constructed to collect water level data of key coastal points in the past five years (2020-2025), with a time granularity of 15 minutes, and a total of approximately 175,200 records / monitoring points. Data sources include measured data from ocean monitoring stations (accounting for 65%), satellite remote sensing data (accounting for 25%), and numerical simulation results (accounting for 10%). To ensure data quality, a triple verification mechanism is applied: equipment self-verification, data consistency verification, and physical constraint verification, and outliers (exceeding the historical average for the same period) are eliminated. times the standard deviation) and correct missing data by linear interpolation (the missing rate is controlled below 0.5%).

[0106] Secondly, the meteorological data set was integrated, including wind speed and direction data (resolution of 0.5m / s and ), air pressure data (resolution of 0.1hPa), rainfall data (resolution of 0.1mm) and temperature data (resolution of ), with a sampling frequency of 5 minutes. A spatial mapping relationship between the weather station and the water level monitoring point is established, and the weather station data is interpolated to the water level monitoring point location using the distance weighted average method (IDW). At the same time, tidal astronomical data, including the moon phase position (accurate to ), the position of the sun and the rotation parameters of the earth, and establish the corresponding relationship between the astronomical gravity model and water level changes.

[0107] The data preprocessing process includes: (1) time alignment, uniformly converting to UTC+8 time zone to eliminate the impact of daylight saving time; (2) feature engineering, generating 16 types of derived features from the original data, including tidal cycle phase, air pressure change rate, storm surge index, etc.; (3) data enhancement, by adding Gaussian noise ( ), time scale perturbations ( minutes) and extreme event resampling (increasing the sample ratio of extreme events such as typhoons and storm surges to three times the original) to enhance the model's generalization ability.

[0108] Training samples were constructed using a sliding window method with a 48-hour window size and a 1-hour step size. Each sample consisted of a 24-hour input sequence and a 24-hour target sequence, generating approximately 43,800 training samples. The dataset was split chronologically: data from 2020–2023 was used for training (80%), data from 2023–2024 was used for validation (10%), and data from 2024–2025 was used for testing (10%), ensuring temporal forward-looking model evaluation. To eliminate differences in feature magnitude, all data were Z-score normalized to a mean of 0 and a standard deviation of 1.

[0109] The model was trained using a two-stage strategy. In the first stage, baseline training used a mean squared error (RMSE) loss function, with a learning rate of 0.001, a batch size of 128, and 200 epochs of training. In the second stage, a custom loss function was introduced to increase the penalty for extreme event predictions. The learning rate was reduced to 0.0002, the batch size was reduced to 64, and training was performed for 100 epochs. An early stopping strategy was applied, terminating training after 15 consecutive epochs of no improvement in the validation set loss. The final model achieved a root mean squared error (RMSE) of 3.8 cm on the test set and a mean absolute error of 6.2 cm under extreme meteorological conditions (above the 95th percentile). The warning accuracy reached 92.7%, with a false alarm rate below 7.5%, meeting practical application requirements.

[0110] To better understand and implement the present invention, Example 2 of a specific application scenario is provided below: Researchers deployed a coastal water level monitoring system based on a dynamic threshold algorithm in the Beidaihe waters of Qinhuangdao City, Hebei Province, achieving accurate prediction and early warning of sea levels during typhoon season. The system covers 28 kilometers of Beidaihe's main tourist areas and the surrounding important coastline. By deploying 12 water level monitoring points, a complete early warning network was established, effectively enhancing local flood control and typhoon mitigation capabilities.

[0111] System monitoring points are located according to the attached Figure 2 The system architecture shown in the figure is deployed. Each monitoring point is equipped with an environmental monitoring module consisting of a radar water level sensor (accuracy ±0.2cm), a wind speed and direction sensor, a barometer, a rain gauge, and a thermometer. Data collection is set to occur every 15 seconds for water level and every 5 minutes for meteorological data. This data is transmitted to the edge computing gateway via RS-485 and Modbus communication protocols. Each monitoring point utilizes an IP68 waterproof enclosure design and built-in electromagnetic shielding to ensure stable operation in salt spray environments. The edge computing gateway uses an ARM Cortex-A78AE hexa-core processor and features 128GB of onboard SSD storage, capable of caching 30 days of historical data.

[0112] By real-time analysis of tidal cycles, meteorological conditions and historical water level data, a dynamic warning value that meets the current environment is calculated. Tidal cycle impact weight coefficient According to the formula: Calculate, where The value is 0.20, The value is 45 degrees. Fixed to 0.4. Wind influence weight coefficient According to the formula Calculate, where The value is 0.01, The value is 0.2. Actual monitoring in the Beidaihe waters shows that during summer typhoons, the average wind speed ranges from 5 to 20 m / s, with maximum gusts reaching 35 m / s.

[0113] The historical tidal data of the area and the measured data during the test are shown in Table 1: Table 1 Tidal characteristics data of Beidaihe sea area

[0114] The system uses the hydro-meteorological coupled equations to calculate the dynamic warning value. The tidal prediction equation uses , considering 8 main tidal components (M2, S2, N2, K2, K1, O1, P1, Q1). The storm surge response equation and rainfall runoff equation are respectively ; calculate.

[0115] During the entire test period, the system recorded water level changes under three typical meteorological conditions. The system response is shown in Table 2: Table 2 System response under different meteorological conditions

[0116] On August 23, 2024, when the outer edge of Typhoon Lingling was affecting Qinhuangdao, the system triggered a red alert. At that time, the wind speed reached 22m / s and the air pressure dropped to 985hPa. The system predicted a maximum water level of 2.35m, but the actual maximum water level reached 2.33m, with a prediction error of only 2cm. The edge computing gateway successfully pushed the alarm information to the disaster management platform through the 4G Beidou communication module and activated all-round video surveillance. The system followed the attached Figure 3 The hardware connection method shown in the figure automatically calls the preset point camera through the video linkage unit, uses the cvPutText function of the OpenCV library to overlay water level data, timestamp, GPS coordinates, and warning level information on the upper left corner of the video, and pushes it to the disaster management platform after H.265 encoding compression. The average data transmission delay is 0.76 seconds, and the video call success rate reaches 99.3%.

[0117] The performance of the system in typhoon prevention work is shown in Table 3: Table 3 System performance data during Typhoon Lingling

[0118] Historical data recorded by the system shows that during the period of Typhoon Lingling's peripheral influence, the interaction coefficient of wind speed and air pressure changes It is 0.76, which is much higher than 0.32 under normal meteorological conditions. This data reflects the strong coupling characteristics of environmental factors under extreme meteorological conditions.

[0119] The multi-head spatial attention mechanism of the hydrological spatiotemporal network model adopted by the system is and Calculation, under the synergy of 8 attention heads, can simultaneously capture the spatial correlation between different monitoring points and the key change patterns in the time series. The system automatically adjusts the attention weights in the following way: and , The value is 0.001, 、 、 They are 0.3, 0.4 and 0.3 respectively.

[0120] The system's data processing capability and warning threshold calculation efficiency are shown in Table 4: Table 4 System data processing performance

[0121] In actual operation, the system uses data hierarchical storage function:

[0122] Optimize data storage, 、 、 、 They are 0.3, 0.25, 0.25, and 0.2 respectively. The value is 0.6. Tidal basic data, historical extreme water level data, and terrain parameter data are stored in the memory as persistent data, and real-time water level data, meteorological data, and alarm status data are stored in the video memory as temporary data. ,in , and realized the dynamic fusion of persistent data and temporary data in the prediction process.

[0123] Traditional coastal water level monitoring systems often use static thresholds, setting fixed warning levels based on historical data. This approach is ill-suited to complex and volatile marine environments, particularly during extreme weather conditions like typhoons, and often results in missed or false alarms. In the Qinhuangdao waters, the static thresholds of these traditional systems have a historical false alarm rate of 22% and a missed alarm rate of approximately 18%, and warning lead times are typically less than two hours.

[0124] The dynamic threshold algorithm of the present invention fully considers the combined influence of tidal cycles, meteorological conditions and historical water level data, so that the warning value can be dynamically adjusted according to the actual environmental conditions. In actual applications, the system's false alarm rate is reduced to 4.6%, the missed alarm rate is reduced to 2.1%, and the average advance warning time is increased to 4.2 hours. Especially under extreme meteorological conditions, the system has shown significant advantages. For example, during the impact of Typhoon Lingling, it successfully issued an accurate warning 4.8 hours in advance, which won valuable time for disaster prevention and mitigation work. In addition, the system's edge computing architecture significantly reduces the load on the central server, and the data processing delay of a single monitoring point is reduced from 1.2 seconds of the traditional system to 0.24 seconds. At the same time, the system reliability is improved from 99.2% to 99.95%. Through the pre-trained hydrological spatiotemporal network model and self-learning mechanism, the system can also continuously optimize the prediction accuracy and adapt to seasonal changes and long-term trends in the environment.

[0125] It should be noted that the variables involved in the present invention are explained in detail as shown in Tables 5, 6, 7 and 8 below.

[0126] Table 5 Variable Explanation Table (Part I)

[0127] Table 6 Variable Explanation Table (Part II)

[0128] Table 7 Variable Explanation Table (Part 3)

[0129] Table 8 Variable Explanation Table (Part 4)

[0130] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be covered by the scope of protection of the present invention.

Claims

1. A coastal water level monitoring method based on a dynamic threshold algorithm, characterized in that: include: Water level sensor arrays and environmental monitoring modules deployed at key coastal locations collect real-time water level data, meteorological data, and tidal cycle data, which are then transmitted to the edge computing gateway for preprocessing. A basic water level matrix, including historical water level data, tidal cycle models, and meteorological warning levels, is constructed and stored in the edge computing gateway's 128GB SSD. Generate a water level floating matrix, analyze the tidal phase and meteorological factors in the water level basic matrix through the tidal dynamics equation to establish a correlation model, calculate the weight coefficient of water level changes under different environmental conditions, the weight coefficient includes the weight coefficient of tidal cycle influence and the weight coefficient of meteorological factor influence, and consider the influence of seabed topography on water level fluctuation; calculate the dynamic warning value according to the hydro-meteorological coupling equation group composed of tidal prediction equation, storm surge response equation, rainfall runoff equation and comprehensive risk assessment equation; use the GPU in the edge computing gateway to process video data, and the CPU to calculate communication and threshold value, forming a calculation jump matrix to achieve efficient resource scheduling, and establish a memory and video memory sharing mechanism to optimize data interaction efficiency; the system performs self-learning according to the parameter correlation function, uses the pre-trained hydrological spatiotemporal network model to analyze historical data, predict future water level change trends, and dynamically adjust the weight parameters; outputs real-time water level monitoring data and the water level forecast curve for the next 24 hours.

2. The method according to claim 1, characterized in that The water level basic matrix refers to a multidimensional data set containing historical water level time series data, tidal cycle models and meteorological warning levels, and is used to store historical data characteristics of monitoring points.

3. The method according to claim 2, characterized in that The water level fluctuation matrix refers to a weight coefficient matrix that changes dynamically according to tidal cycles and meteorological conditions, and is used to quantify the degree of influence of different environmental factors on water level changes.

4. The method according to claim 3, characterized in that The computation jump matrix refers to a set of rules for task allocation and resource scheduling between the CPU and GPU, defining the switching timing and paths of different computation tasks between processors.

5. The method according to claim 4, characterized in that It also includes triggering a yellow warning when the real-time water level reaches the minimum range of the dynamic warning value; activating a red alert when the real-time water level reaches the maximum range of the dynamic warning value; the disaster management platform receives alarm information pushed by the edge computing gateway and generates a comprehensive alarm report.

6. The method according to claim 5, characterized in that The hydrological spatiotemporal network model refers to a spatiotemporal series prediction neural network based on the Transformer architecture, which includes a time encoding layer, a multi-head spatial attention mechanism layer, a residual connection layer, a feedforward neural network layer, and an output projection layer, and is used to predict coastal water level change trends.

7. The method according to claim 6, characterized in that The parameters of the multi-head spatial attention mechanism in the hydrological spatiotemporal network model are dynamically adjusted according to the historical alarm accuracy, the dynamic threshold deviation rate and the degree of mutation of environmental factors. A data hierarchical storage function is used to store persistent data in the memory and temporary data in the video memory.

8. The method according to claim 7, characterized in that The data fusion mechanism refers to an algorithm framework that integrates persistent data in the main memory and temporary data in the video memory during the water level prediction process. By establishing a shared memory mapping area between the main memory and the video memory, the dynamic fusion of persistent data and temporary data is achieved through weight calculation of the multi-head spatial attention mechanism.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores program instructions, and when the program instructions are run in a computer, they are used to execute the coastal water level monitoring method based on a dynamic threshold algorithm according to any one of claims 1 to 8.

10. A coastal water level monitoring system based on a dynamic threshold algorithm, characterized in that: The computer-readable storage medium according to claim 9 is included, the system is any one of a computer, a server, and a single-chip microcomputer, the computer-readable storage medium is arranged in the system, and the system is provided with a microprocessor for executing program instructions stored in the computer-readable storage medium.

Citation Information

Cited By

  • Sea surface tide level real-time monitoring method based on multi-frequency laser radar

    CN121186805A

  • River and lake ecological water supplement prediction method based on intelligent perception

    CN121390420A

  • A river and lake ecological water supplement prediction method based on intelligent sensing

    CN121390420B

  • Coastal water level prediction method based on multi-modal observation data

    CN121430769A

  • A coastal water level prediction method based on multi-modal observation data

    CN121430769B