Water conservancy information monitoring system and method thereof
By combining GNSS time synchronization and vector timestamps, the water conservancy information monitoring system achieves data consistency reconstruction and accuracy improvement in weak coverage environments, solving the problems of data loss and false alarms/missed reports in existing technologies, and providing online calibration capabilities to ensure the stable operation of the system.
Patent Information
- Application Number
- CN202511731826.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-03-03
AI Technical Summary
Existing water conservancy information monitoring systems are prone to data lag or loss in environments with weak coverage. Data across sites is difficult to maintain a strict sequential relationship, and there is a lack of an accurate insertion mechanism during periods of disconnection, leading to false alarms and missed alarms. Furthermore, there is a lack of online calibration capabilities based on early warning results and time parameters.
Using GNSS time synchronization, multi-source acquisition, vector timestamps and breakpoint resume, combined with causal consistent time series reconstruction and topology sorting, a global time series is generated, and closed-loop updates are performed through event triggering and risk scoring.
Significantly improves monitoring timeliness and accuracy under weak network conditions, ensures the integrity of record-level sequence, reduces false alarms and missed alarms, and enables online calibration to maintain high system availability and reliable early warning.
Smart Images

Figure CN121594839A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water conservancy information technology, and in particular to a water conservancy information monitoring system and method. Background Technology
[0002] Existing water conservancy information monitoring systems mostly adopt an architecture of fixed-period data collection and centralized aggregation. The front end mainly consists of sensors for rainfall, water level, flow velocity, and water quality, transmitting data back via cellular networks or low-power wide area networks. The back end stores data and sets threshold alarms using a unified timestamp. To reduce energy consumption and communication costs, some systems introduce local caching and batch reporting. However, in weak coverage environments such as mountainous valleys and reservoir areas, link jitter and interruptions occur frequently, and data during critical periods is prone to lag or loss. At the same time, the coexistence of multiple stations' independent time synchronization and local clock drift makes it difficult to maintain a strict sequential relationship between cross-site data. Common methods of aligning data by reception time or a single absolute time are insufficient to reconstruct the true process.
[0003] In existing technologies, network unreachability typically relies solely on local clocks, lacking a mechanism to link events across multiple sites. Data generated during the disconnection period cannot be accurately inserted back into the global timeline after network recovery. Even when a single site uses satellite time synchronization, cross-site merging often results in peak time misalignment and phase inversion. Furthermore, retransmission primarily relies on simple retransmissions, lacking record-level causal constraints and local reordering strategies, easily leading to full reordering, latency aggregation, and secondary congestion. On the alarm side, fixed thresholds and single-point indicator judgments are commonly used, making it difficult to consider seasonality, water flow patterns, and consistency across multiple sources. In weak network scenarios, robust triggering based on globally consistent timing is lacking, resulting in both false alarms and missed alarms. Moreover, existing systems are mostly one-way reporting modes, lacking the closed-loop capability to perform online calibration of terminals based on warning results and time parameters. Time mapping and judgment threshold updates are not timely, and the problems of drift accumulation and threshold rigidity become more prominent after long-term operation.
[0004] Therefore, how to provide a water conservancy information monitoring system and method is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] One objective of this invention is to propose a water conservancy information monitoring system and method. The water conservancy information monitoring system of this invention integrates GNSS time synchronization, multi-source acquisition, vector timestamps and breakpoint resume transmission, obtains global time series based on causal consistent time series reconstruction and topology sorting, and combines event triggering and risk scoring with downlink closed-loop updates, which significantly improves the monitoring timeliness and accuracy under weak network conditions.
[0006] A water conservancy information monitoring system and method according to an embodiment of the present invention includes the following steps:
[0007] Time synchronization and initialization are performed on the edge terminal, and an absolute time reference is established based on the GNSS pulses per second to generate time reference data;
[0008] Multi-source hydrological observations were collected based on time reference data, and each record was labeled with a monotonic sequence number and a local logical clock to form time-stamped observation data;
[0009] For time-stamped observation data that could not be reported, record vector timestamps and add the corresponding records to the breakpoint resume queue to obtain a set of vector timestamps and a breakpoint resume queue.
[0010] The interrupted transmission queue is resumed. The receiving end merges the station and sequence number to form the receiving end time sequence record. The local time and reference time samples are extracted from the receiving process to obtain the time synchronization sample set. At the same time, the vector timestamp set is retained.
[0011] A causal consistency time series reconstruction method using GNSS and vector timestamps is employed. Based on the time synchronization sample set and the vector timestamp set, the time offset and drift rate are calculated, and the time synchronization parameters and the absolute time series aligned to the records are output.
[0012] During the causal replay phase, a directed acyclic graph of events is constructed using a set of reference vector timestamps. Under causal constraints, a topological sort with minimum exchange cost is implemented to locally rearrange the time series records at the receiving end and output a causally consistent global time series.
[0013] Based on global time series data, perform event triggering and risk scoring to generate early warning results;
[0014] Based on the warning results and time synchronization parameters, a downlink configuration is generated and sent to the terminal for updating time synchronization and judgment thresholds.
[0015] Optionally, the generation of the time base data specifically includes:
[0016] Start the edge terminal, initialize the GNSS receiver, enable pulses per second and set it to one second, enable rising edge interrupt, start the local oscillator and read the nominal frequency, clear the clock counter, read the UTC time and date, continuously collect satellite time and local count paired samples until time synchronization lock, and output the original time synchronization sample set;
[0017] The original time synchronization sample set is processed, the local time is converted from the local count and the nominal frequency, the corresponding satellite time is subtracted to obtain the phase deviation sequence, the difference between adjacent deviations is obtained to obtain the frequency deviation sequence, the proportional factor and time offset are gradually corrected according to the proportional gain and integral gain, the moving average is smoothed, abnormal samples are removed and resampled, and the stable proportional factor, time offset and health indicators are output.
[0018] A linear mapping from local time to absolute time is established based on the stability scaling factor and time offset. The mapping relationship, reference epoch, health flag and site metadata are packaged into a time base dataset. When the time synchronization is lost, the hold mode is switched, the most recent parameters are used for continuous output, and the hold flag and the time stamp of the lost lock are marked.
[0019] Optionally, the formation of the time-stamped observation data specifically includes:
[0020] Read the mapping relationship, reference epoch, health indicator and site metadata from the time reference dataset, complete the alignment verification with the local clock of the edge terminal, set the fixed sampling period and the backup sampling period, configure the multi-source hydrological channel list, including rainfall, water level, flow velocity, turbidity, conductivity and water temperature, load the range and zero point calibration parameters of each channel, enable sensor power-on self-test, jitter removal and anti-aliasing preprocessing, initialize the logic clock to the starting value and clear the monotonic sequence counter, and generate the acquisition configuration set;
[0021] The synchronous sampling task is started according to the acquisition configuration set. When each sampling period arrives, the instantaneous value of each channel is read, the current local time is recorded, and the scale is converted according to the mapping relationship. At the same time, the time offset is superimposed to obtain the absolute time. The current record is assigned a monotonically increasing sequence number and the logic clock is advanced. It is then encapsulated as a recording unit.
[0022] Integrity verification and threshold validity checks are performed on the recording units. Those that pass are written to the circular buffer and added to the sliding window, while those that fail are marked as pending re-sampling. The time-stamped observation dataset is generated in the order of writing, and the current sliding window view and record status are output at the same time.
[0023] Optionally, the process of obtaining the vector timestamp set and the breakpoint resume queue specifically includes:
[0024] Read records one by one from the time-stamped observation data, send connectivity probe messages according to the probe cycle of the acquisition configuration set and listen for confirmation messages. If the link is unreachable or the confirmation is not received after timeout, mark the current record as not reported. At the same time, extract the absolute time, logical clock value and monotonic sequence number of the record to generate a candidate list of not reported records.
[0025] For each record in the unreported candidate list, perform a local vector clock update, increment the current station component by one to indicate that a local event has occurred, and when a payload containing time synchronization status and vector count information is received, take the larger value and merge it to obtain a vector clock status consistent with the external reference, and generate a vector timestamp entry containing vector clock, monotonic number, logical clock value and absolute time, and aggregate it in ascending order of monotonic number to obtain a vector timestamp set;
[0026] Unreported records are bound to their corresponding vector timestamp entries as resume queue elements. A resume queue is constructed by enqueuing at the tail of the queue. The head and tail indices are maintained. The order of monotonic number and absolute time is used as the sorting key. Duplicate elements are removed and intervals are merged when adjacent numbers are consecutive. After all unreported records in the current period are processed, the resume queue is output.
[0027] Optionally, the time-series sample set specifically includes:
[0028] Read the resumed elements from the breakpoint resume queue and extract the corresponding vector timestamp entries synchronously. Merge them according to the continuous range of monotonically increasing sequence numbers to generate a resumed batch and register the start and end sequence numbers and the planned sending time.
[0029] For each batch of resumed transmissions, a reporting unit is constructed. The station identifier, monotonically increasing sequence number, absolute time, and vector timestamp are written into the message header. The message is sent through the active communication interface and a timeout timer is bound. The confirmation flag and reception time are recorded according to whether an acknowledgment message is received within the timeout period.
[0030] On the receiving side, the reporting unit is decoded and its validity is verified. The station identifier and monotonically increasing sequence number are used as keys to perform deduplication and merging. The station identifier is sorted and the monotonically increasing sequence number is sorted within the same station to form a set of receiving end time sequence records.
[0031] The absolute time of each record is extracted from the time sequence record set at the receiving end and paired with the processing time at the receiving side to form a time-matching sample set. At the same time, the vector timestamp set is retained and transmitted. The processing time at the receiving side is provided by the local monotonic timer at the receiving side.
[0032] Optionally, the output of the time synchronization parameters and the absolute time series specifically includes:
[0033] Read the time sample set, vector timestamp set, and receiver time record set. Based on causal consistency time series reconstruction using GNSS and vector timestamp collaboration, and using the reference epoch as a reference, subtract the reference epoch from the absolute time of the transmitter and the processing time of the receiver in each sample to obtain relative time pairs. Determine the order constraints between samples based on the relationship between the magnitudes of the vector timestamp components. If a pair of samples does not meet the order constraints, then the current sample is labeled with zero weight; otherwise, it is labeled with unit weight, thus forming a weighted sample set.
[0034] Robust time estimation is adopted, which stipulates that there is a linear correspondence between the relative time of the transmitter and the relative time of the receiver. The time scale factor and time offset are used as parameters to be estimated. The residual adopts a piecewise linear quadratic robust loss function. On the weighted sample set, the robust objective function is minimized to simultaneously estimate the time scale factor and time offset. After completing one solution, the initial parameters including the time scale factor and time offset are output.
[0035] An anomaly removal and iterative convergence method is adopted. Based on the initial parameters, the absolute value of the residual of each sample is calculated. The samples that exceed the limit are removed according to the preset residual threshold. The samples that do not exceed the limit are retained and the robust objective function is minimized again. The removal and solution are repeated until the changes of the time scale factor and time bias obtained in two adjacent solutions are less than the preset convergence threshold. The final time scale factor, time bias and the drift rate obtained by subtracting one from the time scale factor are used as the time-pairing parameters for output.
[0036] Using the time sequence record set of the receiving end as input, the absolute time of the sending end is substituted into the final linear correspondence one by one according to the record order. The absolute time of the sending end is proportionally converted by the time scale factor, and the time offset is added to restore the absolute time aligned with the reference epoch. The calculated absolute times are then collected into an absolute time series aligned with the records according to the record order.
[0037] Optionally, the output process of the global time series specifically includes:
[0038] In the causal playback stage of causal consistent time series reconstruction using GNSS and vector timestamps, the absolute time series is read, the range of record indexes to be played back is determined, an event node is established for each record and a set of event nodes is formed, and a retrieval index based on station identifier and monotonic number is prepared for subsequent sorting.
[0039] Based on the relationship between the size of the vector timestamp components and the monotonic sequence number relationship within the same site, the order of events is determined pairwise for the event node set. Under the condition that each component of the vector timestamp is not less than the relationship, directed edges with time chronological order are established. Within the same site, directed edges are established in ascending order of monotonic sequence number. After completion, an event directed graph without loops is obtained, and a loop detection and edge correction are performed to confirm that it remains acyclic.
[0040] Using the absolute time series aligned by records as the baseline order, an initial sequence is generated arranged from early to late absolute time. The partial order relationship obtained by comparing components based on vector timestamps and the order relationship of monotonic numbers within the same station are used as causal constraints. The initial sequence is locally evaluated under the causal constraints. For each pair of adjacent nodes that violate the causal constraints, the exchange cost is calculated. The exchange cost is set according to the principle that the smaller the absolute time difference between the two, the higher the priority for exchange, and the adjacent numbers within the station are kept unchanged. Without destroying the established directed edges, the adjacent pair with the smallest exchange cost is selected to perform an adjacent exchange. The evaluation and exchange are repeated until there are no more adjacent pairs that violate the causal constraints in the sequence, resulting in a topological sequence that satisfies the causal constraints and has the least modification to the initial sequence.
[0041] The receiving end time series record set is locally rearranged according to the obtained topological sequence. Only at positions with causal conflicts are the fewest adjacent exchanges performed. The rearranged records are written with a rearrangement flag, the number of rearrangements, and the original position index. At the same time, a causally consistent global time series arranged according to the topological sequence is output.
[0042] Optionally, the process of generating the early warning result specifically includes:
[0043] Based on global time series, the current values, time-varying rates of change, and extreme value locations of rainfall, water level, and flow velocity are calculated using a fixed-length rolling window. Using timestamps as gating, feature vectors and window states are generated for the ordered data.
[0044] The observations and their rate of change over time within the window are normalized. At the same time, a graded threshold is used to map the risk score to no warning, blue, yellow, and red levels. The warning level, start and end time are output only during the period when the trigger flag is valid, and the warning result is generated.
[0045] Optionally, the downlink configuration is formed as follows:
[0046] Read the warning, time synchronization parameter set and current time mapping parameters, estimate and perform time scale scaling based on the time scale factor in the time synchronization parameters, and perform time axis translation based on the time offset estimate. Generate a new scaling factor and a new time offset, specify the effective time and version number, and form a time mapping update item.
[0047] Combining the level, duration and trigger stability in the early warning results, and superimposing the magnitude and direction of the drift rate in the time parameters, the rainfall trigger and receding thresholds, water level trigger and receding thresholds, and the change rate thresholds of each observation are adaptively adjusted according to the strategy. The time mapping update item and the updated thresholds are encapsulated into a downlink configuration, and timeout and retransmission parameters are set. The configuration is then sent through the current active communication interface and the sending status is registered.
[0048] The terminal receives the downlink configuration and completes the integrity and validity verification. On the next rising edge of the pulse per second, it switches to the new scaling factor and the new time offset, and replaces the updated thresholds. It writes the effective parameters into non-volatile storage and sends back an acknowledgment message. After receiving the acknowledgment, it outputs the downlink configuration status and the set of effective parameters for subsequent data collection and judgment.
[0049] A water conservancy information monitoring system according to an embodiment of the present invention includes the following modules:
[0050] The timing acquisition module is used to complete GNSS timing and local oscillator alignment based on pulses per second, generate time mapping and reference epochs, synchronously acquire multi-source hydrological data and mark monotonic numbers and logic clocks.
[0051] Vector timestamp and fault tolerance module: When the link is unreachable or timeout is not confirmed, a vector timestamp is generated for the record, a timestamp set is maintained, and the record is bound to the breakpoint resume queue.
[0052] The continuation and reassembly module is used to merge continuation batches according to consecutive sequence numbers, send reports and record confirmations, and the receiving side deduplicates and merges them according to station and sequence number to generate receiving end time sequence records and time synchronization samples.
[0053] Robust Time Alignment Module: Used for weighted robust minimization based on causal consistency weighting, to obtain the time scale factor and time bias, calculate the drift rate, and output the absolute time series aligned to records;
[0054] Causal replay module: used to construct a directed acyclic graph with vector timestamps and station serial numbers, perform minimum exchange cost sorting under causal constraints, and obtain the global time series through local rearrangement;
[0055] Events and Risks Module: Used to calculate current values and rates of change on a global time series, jointly determine triggers and pullbacks, summarize risk scores by weight and generate tiered warnings;
[0056] Downlink encapsulation module: used to update time mapping and thresholds through early warning and time synchronization parameters, encapsulate downlink configuration and send it out.
[0057] The beneficial effects of this invention are:
[0058] This invention is based on a time reference constructed by GNSS timing and local oscillator maintenance. Combined with the collaborative processing of vector timestamps and receiver-side time synchronization samples, the data during the disconnection period still retains the sequential relationship across sites. After network restoration, the time scale factor and time offset are obtained through weighted robust solution, and the absolute time series aligned by record is restored accordingly, which significantly reduces the time scale deviation caused by clock drift and link jitter.
[0059] In the causal replay stage, this invention uses the vector timestamp partial order and the monotonic sequence number within the station as hard constraints, and only performs local rearrangement with the minimum exchange cost on conflicting segments. This allows the global time series to be as close as possible to the physical time axis while ensuring causal consistency, avoiding the delay and secondary congestion caused by full rearrangement, and making the rearrangement traceable, which is convenient for post-event auditing and review.
[0060] This invention solidifies the early warning results and downlink timing parameters into a new time mapping and threshold configuration, forming an online closed-loop optimization mechanism. The terminal can automatically apply the update in the next cycle, maintaining the consistency and freshness of timing and judgment criteria under long-term operation, thereby achieving high availability monitoring, reproducible time sequence reconstruction, and reliable early warning release under weak network conditions. Attached Figure Description
[0061] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0062] Figure 1 This is a flowchart of a water conservancy information monitoring system and method proposed in this invention;
[0063] Figure 2 This is a schematic diagram of the algorithm structure of a water conservancy information monitoring system and method proposed in this invention. Detailed Implementation
[0064] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0065] refer to Figure 1-2 A water conservancy information monitoring system and method, comprising the following steps:
[0066] Time synchronization and initialization are performed on the edge terminal, and an absolute time reference is established based on the GNSS pulses per second to generate time reference data;
[0067] Multi-source hydrological observations were collected based on time reference data, and each record was labeled with a monotonic sequence number and a local logical clock to form time-stamped observation data;
[0068] For time-stamped observation data that could not be reported, record vector timestamps and add the corresponding records to the breakpoint resume queue to obtain a set of vector timestamps and a breakpoint resume queue.
[0069] The interrupted transmission queue is resumed. The receiving end merges the station and sequence number to form the receiving end time sequence record. The local time and reference time samples are extracted from the receiving process to obtain the time synchronization sample set. At the same time, the vector timestamp set is retained.
[0070] A causal consistency time series reconstruction method using GNSS and vector timestamps is employed. Based on the time synchronization sample set and the vector timestamp set, the time offset and drift rate are calculated, and the time synchronization parameters and the absolute time series aligned to the records are output.
[0071] During the causal replay phase, a directed acyclic graph of events is constructed using a set of reference vector timestamps. Under causal constraints, a topological sort with minimum exchange cost is implemented to locally rearrange the time series records at the receiving end and output a causally consistent global time series.
[0072] Based on global time series data, perform event triggering and risk scoring to generate early warning results;
[0073] Based on the warning results and time synchronization parameters, a downlink configuration is generated and sent to the terminal for updating time synchronization and judgment thresholds.
[0074] This invention, through the overall process design of GNSS time synchronization, vector timestamps, and breakpoint resume transmission, can maintain the sequence of records and data integrity and reduce false alarms and missed alarms even under weak network conditions.
[0075] In this embodiment, the generation of the time reference data specifically includes:
[0076] Start the edge terminal, initialize the GNSS receiver, enable pulses per second and set it to one second, enable rising edge interrupt, start the local oscillator and read the nominal frequency, clear the clock counter, read the UTC time and date, continuously collect satellite time and local count paired samples until time synchronization lock, and output the original time synchronization sample set;
[0077] The original time synchronization sample set is processed, the local time is converted from the local count and the nominal frequency, the corresponding satellite time is subtracted to obtain the phase deviation sequence, the difference between adjacent deviations is obtained to obtain the frequency deviation sequence, the proportional factor and time offset are gradually corrected according to the proportional gain and integral gain, the moving average is smoothed, abnormal samples are removed and resampled, and the stable proportional factor, time offset and health indicators are output.
[0078] A linear mapping from local time to absolute time is established based on the stability scaling factor and time offset. The mapping relationship, reference epoch, health flag and site metadata are packaged into a time base dataset. When the time synchronization is lost, the hold mode is switched, the most recent parameters are used for continuous output, and the hold flag and the time stamp of the lost lock are marked.
[0079] This invention calibrates the local oscillator with pulses per second and outputs a stable scaling factor and time offset, which significantly suppresses the impact of terminal clock drift on time scale accuracy and provides a reliable time reference for subsequent reconstruction.
[0080] In this embodiment, the formation of the time-stamped observation data specifically includes:
[0081] Read the mapping relationship, reference epoch, health indicator and site metadata from the time reference dataset, complete the alignment verification with the local clock of the edge terminal, set the fixed sampling period and the backup sampling period, configure the multi-source hydrological channel list, including rainfall, water level, flow velocity, turbidity, conductivity and water temperature, load the range and zero point calibration parameters of each channel, enable sensor power-on self-test, jitter removal and anti-aliasing preprocessing, initialize the logic clock to the starting value and clear the monotonic sequence counter, and generate the acquisition configuration set;
[0082] The synchronous sampling task is started according to the acquisition configuration set. When each sampling period arrives, the instantaneous value of each channel is read, the current local time is recorded, and the scale is converted according to the mapping relationship. At the same time, the time offset is superimposed to obtain the absolute time. The current record is assigned a monotonically increasing sequence number and the logic clock is advanced. It is then encapsulated as a recording unit.
[0083] Integrity verification and threshold validity checks are performed on the recording units. Those that pass are written to the circular buffer and added to the sliding window, while those that fail are marked as pending re-sampling. The time-stamped observation dataset is generated in the order of writing, and the current sliding window view and record status are output at the same time.
[0084] This invention labels each observation with a monotonic sequence number and a logical clock at the acquisition end, forming a traceable time-stamped data stream, which avoids out-of-order and duplicate entries from the source and improves the efficiency of on-site anomaly location.
[0085] In this embodiment, the process of obtaining the vector timestamp set and the breakpoint resume queue specifically includes:
[0086] Read records one by one from the time-stamped observation data, send connectivity probe messages according to the probe cycle of the acquisition configuration set and listen for confirmation messages. If the link is unreachable or the confirmation is not received after timeout, mark the current record as not reported. At the same time, extract the absolute time, logical clock value and monotonic sequence number of the record to generate a candidate list of not reported records.
[0087] For each record in the unreported candidate list, perform a local vector clock update, increment the current station component by one to indicate that a local event has occurred, and when a payload containing time synchronization status and vector count information is received, take the larger value and merge it to obtain a vector clock status consistent with the external reference, and generate a vector timestamp entry containing vector clock, monotonic number, logical clock value and absolute time, and aggregate it in ascending order of monotonic number to obtain a vector timestamp set;
[0088] Unreported records are bound to their corresponding vector timestamp entries as resume queue elements. A resume queue is constructed by enqueuing at the tail of the queue. The head and tail indices are maintained. The order of monotonic number and absolute time is used as the sorting key. Duplicate elements are removed and intervals are merged when adjacent numbers are consecutive. After all unreported records in the current period are processed, the resume queue is output.
[0089] This invention generates vector timestamps and constructs a breakpoint resume queue when a link fails. After network recovery, the data is re-uploaded in sequence and deduplicated using keying, significantly improving the success rate of data re-upload and reducing recovery latency.
[0090] In this embodiment, the time-synchronized sample set specifically includes:
[0091] Read the resumed elements from the breakpoint resume queue and extract the corresponding vector timestamp entries synchronously. Merge them according to the continuous range of monotonically increasing sequence numbers to generate a resumed batch and register the start and end sequence numbers and the planned sending time.
[0092] For each batch of resumed transmissions, a reporting unit is constructed. The station identifier, monotonically increasing sequence number, absolute time, and vector timestamp are written into the message header. The message is sent through the active communication interface and a timeout timer is bound. The confirmation flag and reception time are recorded according to whether an acknowledgment message is received within the timeout period.
[0093] On the receiving side, the reporting unit is decoded and its validity is verified. The station identifier and monotonically increasing sequence number are used as keys to perform deduplication and merging. The station identifier is sorted and the monotonically increasing sequence number is sorted within the same station to form a set of receiving end time sequence records.
[0094] The absolute time of each record is extracted from the time sequence record set at the receiving end and paired with the processing time at the receiving side to form a time-matching sample set. At the same time, the vector timestamp set is retained and transmitted. The processing time at the receiving side is provided by the local monotonic timer at the receiving side.
[0095] This invention uses batch merging and receiving-side compilation to obtain time synchronization samples, reducing invalid retransmissions and secondary congestion, ensuring rapid cross-site data alignment and improving the continuity of the entire process.
[0096] In this embodiment, the output of the time synchronization parameter and the absolute time series specifically includes:
[0097] Read the time sample set, vector timestamp set, and receiver time record set. Based on causal consistency time series reconstruction using GNSS and vector timestamp collaboration, and using the reference epoch as a reference, subtract the reference epoch from the absolute time of the transmitter and the processing time of the receiver in each sample to obtain relative time pairs. Determine the order constraints between samples based on the relationship between the magnitudes of the vector timestamp components. If a pair of samples does not meet the order constraints, then the current sample is labeled with zero weight; otherwise, it is labeled with unit weight, thus forming a weighted sample set.
[0098] Robust time estimation is employed, stipulating a linear correspondence between the relative time at the transmitting end and the relative time at the receiving end. The time scale factor and time offset are used as parameters to be estimated. The residuals employ a piecewise linear quadratic robust loss function. On a weighted sample set, the robust objective function is minimized to simultaneously estimate the time scale factor and time offset.
[0099] ;
[0100] in, Represents the time sample set, Indicates the sample index. Indicates the first The relative time of the receiving side of each sample Indicates the first The relative time of the sending end of each sample. This represents the time scale factor to be estimated. This indicates the time bias to be estimated. Indicates the first The weight of each sample Indicates the first The residuals of the sample These represent the estimated values of the time scale factor and the time bias, respectively. Represents the robust loss function. The operator represents the minimization operator, with weights determined by the sequential constraints. The robust loss uses a quadratic form where the residuals are small and a linear form where the residuals are large to reduce the impact of outliers. After completing one solution, the output includes the initial parameters, including the time scale factor and time bias.
[0101] An anomaly removal and iterative convergence method is adopted. Based on the initial parameters, the absolute value of the residual of each sample is calculated. The samples that exceed the limit are removed according to the preset residual threshold. The samples that do not exceed the limit are retained and the robust objective function is minimized again. The removal and solution are repeated until the changes of the time scale factor and time bias obtained in two adjacent solutions are less than the preset convergence threshold. The final time scale factor, time bias and the drift rate obtained by subtracting one from the time scale factor are used as the time-pairing parameters for output.
[0102] Using the time sequence record set of the receiving end as input, the absolute time of the sending end is substituted into the final linear correspondence one by one according to the record order. The absolute time of the sending end is proportionally converted by the time scale factor, and the time offset is added to restore the absolute time aligned with the reference epoch. The calculated absolute times are then collected into an absolute time series aligned with the records according to the record order.
[0103] This invention employs causal consistency, cooperative time synchronization, and robust estimation iteration to accurately obtain the time scale factor and time bias, and calculate the drift rate, thereby outputting a high-precision absolute time series for analysis.
[0104] In this embodiment, the output process of the global time series specifically includes:
[0105] In the causal playback stage of causal consistent time series reconstruction using GNSS and vector timestamps, the absolute time series is read, the range of record indexes to be played back is determined, an event node is established for each record and a set of event nodes is formed, and a retrieval index based on station identifier and monotonic number is prepared for subsequent sorting.
[0106] Based on the relationship between the size of the vector timestamp components and the monotonic sequence number relationship within the same site, the order of events is determined pairwise for the event node set. Under the condition that each component of the vector timestamp is not less than the relationship, directed edges with time chronological order are established. Within the same site, directed edges are established in ascending order of monotonic sequence number. After completion, an event directed graph without loops is obtained, and a loop detection and edge correction are performed to confirm that it remains acyclic.
[0107] Using the absolute time series aligned by records as the baseline order, an initial sequence is generated arranged from early to late absolute time. The partial order relationship obtained by comparing components based on vector timestamps and the order relationship of monotonic numbers within the same station are used as causal constraints. The initial sequence is locally evaluated under the causal constraints. For each pair of adjacent nodes that violate the causal constraints, the exchange cost is calculated. The exchange cost is set according to the principle that the smaller the absolute time difference between the two, the higher the priority for exchange, and the adjacent numbers within the station are kept unchanged. Without destroying the established directed edges, the adjacent pair with the smallest exchange cost is selected to perform an adjacent exchange. The evaluation and exchange are repeated until there are no more adjacent pairs that violate the causal constraints in the sequence, resulting in a topological sequence that satisfies the causal constraints and has the least modification to the initial sequence.
[0108] The receiving end time series record set is locally rearranged according to the obtained topological sequence. Only at positions with causal conflicts are the fewest adjacent exchanges performed. The rearranged records are written with a rearrangement flag, the number of rearrangements, and the original position index. At the same time, a causally consistent global time series arranged according to the topological sequence is output.
[0109] This invention constructs a directed event graph using vector timestamp partial order and station sequence number and performs sorting with minimum exchange cost, obtaining a causally consistent global time series by only locally rearranging at the point of conflict.
[0110] In this embodiment, the process of generating the early warning result specifically includes:
[0111] Based on global time series, the current values, time-varying rates of change, and extreme value locations of rainfall, water level, and flow velocity are calculated using a fixed-length rolling window. Using timestamps as gating, feature vectors and window states are generated for the ordered data.
[0112] The observations and their rate of change over time within the window are normalized. At the same time, a graded threshold is used to map the risk score to no warning, blue, yellow, and red levels. The warning level, start and end time are output only during the period when the trigger flag is valid, and the warning result is generated.
[0113] This invention uses the current value and rate of change to trigger and score risk on a global time series, which significantly improves the early warning lead time and stability and reduces the false alarm rate compared to a fixed threshold strategy.
[0114] In this embodiment, the downlink configuration is formed as follows:
[0115] Read the warning, time synchronization parameter set and current time mapping parameters, estimate and perform time scale scaling based on the time scale factor in the time synchronization parameters, and perform time axis translation based on the time offset estimate. Generate a new scaling factor and a new time offset, specify the effective time and version number, and form a time mapping update item.
[0116] Combining the level, duration and trigger stability in the early warning results, and superimposing the magnitude and direction of the drift rate in the time parameters, the rainfall trigger and receding thresholds, water level trigger and receding thresholds, and the change rate thresholds of each observation are adaptively adjusted according to the strategy. The time mapping update item and the updated thresholds are encapsulated into a downlink configuration, and timeout and retransmission parameters are set. The configuration is then sent through the current active communication interface and the sending status is registered.
[0117] The terminal receives the downlink configuration and completes the integrity and validity verification. On the next rising edge of the pulse per second, it switches to the new scaling factor and the new time offset, and replaces the updated thresholds. It writes the effective parameters into non-volatile storage and sends back an acknowledgment message. After receiving the acknowledgment, it outputs the downlink configuration status and the set of effective parameters for subsequent data collection and judgment.
[0118] This invention dynamically issues time mapping and threshold update items based on early warning and timing parameters. The terminal switches and solidifies the effect at the pulse edge, realizing online closed-loop calibration and long-term stable operation.
[0119] A water conservancy information monitoring system, comprising:
[0120] The timing acquisition module is used to complete GNSS timing and local oscillator alignment based on pulses per second, generate time mapping and reference epochs, synchronously acquire multi-source hydrological data and mark monotonic numbers and logic clocks.
[0121] Vector timestamp and fault tolerance module: When the link is unreachable or timeout is not confirmed, a vector timestamp is generated for the record, a timestamp set is maintained, and the record is bound to the breakpoint resume queue.
[0122] The continuation and reassembly module is used to merge continuation batches according to consecutive sequence numbers, send reports and record confirmations, and the receiving side deduplicates and merges them according to station and sequence number to generate receiving end time sequence records and time synchronization samples.
[0123] Robust Time Alignment Module: Used for weighted robust minimization based on causal consistency weighting, to obtain the time scale factor and time bias, calculate the drift rate, and output the absolute time series aligned to records;
[0124] Causal replay module: used to construct a directed acyclic graph with vector timestamps and station serial numbers, perform minimum exchange cost sorting under causal constraints, and obtain the global time series through local rearrangement;
[0125] Events and Risks Module: Used to calculate current values and rates of change on a global time series, jointly determine triggers and pullbacks, summarize risk scores by weight and generate tiered warnings;
[0126] Downlink encapsulation module: used to update time mapping and thresholds through early warning and time synchronization parameters, encapsulate downlink configuration and send it out.
[0127] The system of this invention implements time synchronization acquisition, fault-tolerant retransmission, robust time synchronization, causal playback and downlink encapsulation in a modular manner. It has low deployment cost, good scalability and can be quickly replicated and applied in multi-site and multi-link scenarios.
[0128] Example 1:
[0129] To verify the feasibility of this invention in practice, it was applied to a monitoring scenario of a small to medium-sized river in a typical piedmont-plain transition zone. Five edge terminals were deployed within the watershed, located at the upstream, canyon mouth, plain sluice gate area, city entrance section, and reservoir entrance section, respectively, where there are significant elevation differences and communication obstructions. Each terminal was equipped with rainfall, water level, flow velocity, and water quality sensors. Link jitter and intermittent interruptions are common in this area. Traditional solutions typically collect data at fixed intervals, simply splice the data based on the receiving time, and use fixed thresholds for alarms. In the event of weak network conditions, only retransmission or discarding is performed. This lacks causal constraints and time correction, and is prone to out-of-order transmission, drift, false alarms, and missed alarms.
[0130] In this scenario, the terminal first establishes an absolute time reference using pulses per second and generates a time map and reference epoch. Then, it synchronously collects multi-source hydrological data at a fixed sampling period, labeling each record with a monotonic sequence number and logical clock. When the link is normal, it reports directly; when the link is unreachable or timeouts occur without confirmation, the record is written to a vector timestamp set and entered into a breakpoint resumption queue. After connectivity is restored, the resumed batches are merged and sent according to consecutive sequence numbers. The receiving side deduplicates and merges records by station and sequence number, and simultaneously latches the receiving processing time at the decoding enqueue point, pairing it with the absolute time of the sending end to form a time synchronization sample. By employing causal consistency weighting and robust objective solving in the time synchronization process, the time scale factor and time offset are obtained, and the absolute time series aligned by record is recovered accordingly. Subsequently, using the vector timestamp offset and the monotonic sequence number within the station as hard constraints, adjacent exchanges with minimum exchange cost are performed only at conflict points to obtain a causally consistent global time series. Finally, the current value and rate of change are used together in a scrolling window for triggering and scoring, and a graded warning is output. The platform will send out the time parameters and threshold update items, and the terminal will automatically take effect on the pulse edge of the next second to achieve online self-calibration.
[0131] To verify the superiority of this invention, comparative data of key indicators within the same experimental period are provided, as shown in Table 1:
[0132] Table 1. Comparison of key performance indicators between the present invention and conventional solutions.
[0133] Indicator Item Traditional solution Invention Solution illustrate Cross-site event alignment median error (seconds) 22.6 0.9 Alignment precision Extreme value deviation 95th percentile (seconds) 138 11 Peak alignment Peak values reversed (times) after network reopening. 4 0 Sequence Consistency Record-level repetition rate (per mille) 2.3 0.7 Deduplication effect Gap filling rate (%) 96.8 99.3 Disconnection recovery Median convergence time (minutes) >20 or non-convergent 3.8 Resumption of network stability Median lead time for early warning (seconds) 21 56 Rapid rise in water level False alarms / missed alarms (times) 8 / 3 2 / 1 Same criterion sample
[0134] As shown in Table 1, this invention significantly improves timing alignment and stability: the median error of cross-site event alignment decreased from 22.6 seconds to 0.9 seconds, a reduction of approximately 96%; the 95th percentile error of peak alignment decreased from 138 seconds to 11 seconds, a reduction of approximately 92%; and the number of peak inversions after network restoration decreased from 4 to 0. Data quality and recovery capabilities are simultaneously enhanced: the record-level duplication rate decreased from 2.3‰ to 0.7‰, a reduction of approximately 70%; and the gap recovery rate increased from 96.8% to 99.3%. Faster convergence and more timely warnings are achieved: the median convergence time decreased from more than 20 minutes to 3.8 minutes; the lead time for rapid flood warnings increased from 21 seconds to 56 seconds, while the number of false alarms / missed alarms decreased from 8 / 3 to 2 / 1, demonstrating that this invention possesses higher reliability and practicality under weak network and multi-site conditions.
[0135] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for monitoring water conservancy information, characterized in that, Includes the following steps: Time synchronization and initialization are performed on the edge terminal, and an absolute time reference is established based on the GNSS pulses per second to generate time reference data; Multi-source hydrological observations were collected based on time reference data, and each record was labeled with a monotonic sequence number and a local logical clock to form time-stamped observation data; For time-stamped observation data that could not be reported, record the vector timestamp and add it to the breakpoint resume queue to obtain the vector timestamp set and the breakpoint resume queue. Resume transmission from the breakpoint resume queue. The receiving end merges the data by station and sequence number to form the receiving end time sequence record, and extracts local time and reference time samples to obtain the time synchronization sample set. Causal consistency time series reconstruction using GNSS and vector timestamps is employed to calculate time offset and drift rate, and output time synchronization parameters and absolute time series. During the causal replay phase, a directed acyclic graph of events is constructed using a set of reference vector timestamps. Under causal constraints, a topological sort with minimum exchange cost is implemented to locally rearrange the time series records at the receiving end and output the global time series. Based on global time series data, perform event triggering and risk scoring to generate early warning results; Based on the warning results and time synchronization parameters, a downlink configuration is generated and sent to the terminal for updating time synchronization and judgment thresholds.
2. The water conservancy information monitoring method according to claim 1, characterized in that, The generation of the time base data specifically includes: Start the edge terminal, initialize the GNSS receiver, enable pulses per second and set it to one second, start the local oscillator and read the nominal frequency, continuously collect satellite time and local count paired samples until time synchronization is locked, and output the original time synchronization sample set; The original time synchronization sample set is processed, the local time is converted from the local count and the nominal frequency, the corresponding satellite time is subtracted to obtain the phase deviation sequence, the difference between adjacent deviations is obtained to obtain the frequency deviation sequence, the moving average is smoothed, abnormal samples are removed and resampled, and the stability scaling factor, time offset and health indicators are output. A linear mapping from local time to absolute time is established based on the stability scaling factor and time offset. The mapping relationship, reference epoch, health indicator and site metadata are packaged into a time reference dataset.
3. The water conservancy information monitoring method according to claim 1, characterized in that, The formation of the time-stamped observation data specifically includes: Read the mapping relationship, reference epoch, health indicator and site metadata from the time reference dataset, complete the alignment verification with the local clock of the edge terminal, set the fixed sampling period and the backup sampling period, configure the multi-source hydrological channel list, load the range and zero-point calibration parameters of each channel, and generate the acquisition configuration set. The synchronous sampling task is started according to the acquisition configuration set. When each sampling period arrives, the instantaneous value of each channel is read, the current local time is recorded, and the scale is converted according to the mapping relationship. At the same time, the time offset is superimposed to obtain the absolute time. The current record is assigned a monotonically increasing sequence number and the logic clock is advanced. It is then encapsulated as a recording unit. Perform integrity checks and threshold validity checks on the recording units, and generate a time-stamped observation dataset in the order of writing.
4. The water conservancy information monitoring method according to claim 1, characterized in that, The process of obtaining the vector timestamp set and the breakpoint resume queue specifically includes: Read records one by one from the time-stamped observation data, send connectivity detection messages according to the detection period of the acquisition configuration set and listen for confirmation messages to generate a list of unreported candidates; For each record in the unreported candidate list, perform a local vector clock update and generate a vector timestamp entry. Then, aggregate the entries in ascending order of monotonic number to obtain a vector timestamp set. Bind the unreported records to the corresponding vector timestamp entries as resume queue elements, construct the breakpoint resume queue by enqueuing at the tail of the queue, maintain the head and tail indices, remove duplicate elements and merge intervals when adjacent sequence numbers are consecutive, and output the breakpoint resume queue after processing all unreported records in the current period.
5. The water conservancy information monitoring method according to claim 1, characterized in that, The time-synchronization sample set specifically includes: Read the resumed elements from the breakpoint resume queue and extract the corresponding vector timestamp entries synchronously. Merge them according to the continuous range of monotonically increasing sequence numbers to generate a resumed batch and register the start and end sequence numbers and the planned sending time. For each batch of resumed transmissions, a reporting unit is constructed, and the station identifier, monotonically increasing sequence number, absolute time, and vector timestamp are written into the message header. The message is then sent through the active communication interface and bound to a timeout timer. On the receiving side, the reporting units are decoded and their legality is verified. They are sorted by station identifier and then sorted by monotonically increasing sequence number within the same station to form a set of receiving end time sequence records. The absolute time of each record is extracted from the time sequence record set at the receiving end and paired with the processing time at the receiving side to form a time synchronization sample set.
6. The water conservancy information monitoring method according to claim 1, characterized in that, The output of the time synchronization parameters and the absolute time series specifically includes: Read the time sample set, vector timestamp set, and receiver time record set. Based on causal consistency time reconstruction using GNSS and vector timestamp collaboration, and using the reference epoch as a reference, subtract the reference epoch from the absolute time of the transmitter and the processing time of the receiver in each sample to obtain relative time pairs. Determine the order constraints between samples based on the magnitude relationship of the vector timestamp components to form a weighted sample set. Robust time estimation is adopted, which stipulates that there is a linear correspondence between the relative time of the transmitter and the relative time of the receiver. The time scale factor and time offset are used as parameters to be estimated. The residual adopts a piecewise linear quadratic robust loss function. On the weighted sample set, the robust objective function is minimized to simultaneously estimate the time scale factor and time offset. After completing one solution, the initial parameters including the time scale factor and time offset are output. An anomaly removal and iterative convergence method is adopted. Based on the initial parameters, the absolute value of the residual of each sample is calculated. The samples that exceed the limit are removed according to the preset residual threshold. The samples that do not exceed the limit are retained and the robust objective function is minimized again. The removal and solution are repeated until the changes of the time scale factor and time bias obtained in two adjacent solutions are less than the preset convergence threshold. The final time scale factor, time bias and the drift rate obtained by subtracting one from the time scale factor are used as the time-pairing parameters for output. Using the time sequence record set of the receiving end as input, the absolute time of the sending end is substituted into the final linear correspondence one by one according to the record order. The absolute time of the sending end is proportionally converted by the time scale factor, and the time offset is added to restore the absolute time aligned with the reference epoch. The calculated absolute times are then collected into an absolute time series aligned with the records according to the record order.
7. The water conservancy information monitoring method according to claim 1, characterized in that, The output process of the global time series specifically includes: In the causal playback stage of causal consistent time series reconstruction using GNSS and vector timestamps, the absolute time series is read, the record index range to be played back is determined, an event node is established for each record, and a set of event nodes is formed. Based on the relationship between the magnitude of the vector timestamp components and the monotonic sequence number within the same site, the order of events is determined for each pair of event nodes. Directed edges are established with the time sequence as the topology. Within the same site, directed edges are established in ascending order of the monotonic sequence number. After completion, an event directed graph is obtained. Using the absolute time series aligned by records as the baseline order, an initial sequence is generated arranged from early to late absolute time. The partial order relationship obtained by comparing components based on vector timestamps and the order relationship of monotonic numbers within the same station are used as causal constraints. The initial sequence is locally evaluated under the causal constraints. For each pair of adjacent nodes that violate the causal constraints, the exchange cost is calculated. The exchange cost is set according to the principle that the smaller the absolute time difference between the two, the higher the priority for exchange, and the adjacent numbers within the station are kept unchanged. Without destroying the established directed edges, the adjacent pair with the smallest exchange cost is selected to perform an adjacent exchange. The evaluation and exchange are repeated until there are no more adjacent pairs that violate the causal constraints in the sequence, resulting in a topological sequence that satisfies the causal constraints and has the least modification to the initial sequence. The receiving end time series record set is locally rearranged according to the obtained topological sequence. Only at positions with causal conflicts are the fewest adjacent exchanges performed. The rearranged records are written with a rearrangement flag, the number of rearrangements, and the original position index. At the same time, a causally consistent global time series arranged according to the topological sequence is output.
8. A water conservancy information monitoring method according to claim 1, characterized in that, The process of generating the early warning result specifically includes: Based on global time series, the current values, time-varying rates of change, and extreme value locations of rainfall, water level, and flow velocity are calculated using a fixed-length rolling window. Using timestamps as gating, feature vectors and window states are generated for the ordered data. The observations and their rate of change over time within the window are normalized. At the same time, a graded threshold is used to map the risk score to no warning, blue, yellow, and red levels. The warning level, start and end time are output only during the period when the trigger flag is valid, and the warning result is generated.
9. A water conservancy information monitoring method according to claim 1, characterized in that, The formation of the downlink configuration: Read the warning, time synchronization parameter set and current time mapping parameters, estimate and perform time scale scaling based on the time scale factor in the time synchronization parameters, and perform time axis translation based on the time offset estimate. Generate a new scaling factor and a new time offset, specify the effective time and version number, and form a time mapping update item. Combining the level, duration and trigger stability in the early warning results, the rainfall trigger and receding thresholds, water level trigger and receding thresholds and the change rate thresholds of each observation are adaptively adjusted according to the strategy, and the time mapping update item and the updated thresholds are encapsulated into a downlink configuration. The terminal receives the downlink configuration and verifies its integrity and validity. It writes the effective parameters into non-volatile storage and sends back an acknowledgment message. After receiving the acknowledgment, it outputs the downlink configuration status and the set of effective parameters.
10. A water conservancy information monitoring system, comprising the water conservancy information monitoring method according to any one of claims 1 to 9, characterized in that, include: The timing acquisition module is used to complete GNSS timing and local oscillator alignment based on pulses per second, generate time mapping and reference epochs, synchronously acquire multi-source hydrological data and mark monotonic numbers and logic clocks. Vector timestamp and fault tolerance module: When the link is unreachable or timeout is not confirmed, a vector timestamp is generated for the record, a timestamp set is maintained, and the record is bound to the breakpoint resume queue. The continuation and reassembly module is used to merge continuation batches according to consecutive sequence numbers, send reports and record confirmations, and the receiving side deduplicates and merges them according to station and sequence number to generate receiving end time sequence records and time synchronization samples. Robust Time Alignment Module: Used for weighted robust minimization based on causal consistency weighting, to obtain the time scale factor and time bias, calculate the drift rate, and output the absolute time series aligned to records; Causal replay module: used to construct a directed acyclic graph with vector timestamps and station serial numbers, perform minimum exchange cost sorting under causal constraints, and obtain the global time series through local rearrangement; Events and Risks Module: Used to calculate current values and rates of change on a global time series, jointly determine triggers and pullbacks, summarize risk scores by weight and generate tiered warnings; Downlink encapsulation module: used to update time mapping and thresholds through early warning and time synchronization parameters, encapsulate downlink configuration and send it out.