Water level data acquisition and processing system based on Internet of Things
Through the trend identification and dynamic sampling frequency adjustment of the IoT water level data acquisition system, combined with timestamp index and two-way mapping structure, the problem of response lag in water level data acquisition and processing is solved, efficient water level data processing and sudden abnormal identification are achieved, and the real-time and reliability of the data are improved.
Patent Information
- Application Number
- CN202511004153.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-07-21
AI Technical Summary
The existing water level data acquisition and processing systems lack real-time judgment of water level fluctuations, resulting in lagging responses, difficulty in capturing key data signals in time, and the data structure is loose and processing efficiency is low. It is impossible to locate abnormal points in time and effectively isolate and mark the data, which can easily lead to early warning failure and reduce data reliability.
The water level data acquisition and processing system based on the Internet of Things is adopted, and the water level change trend is analyzed through the trend identification module, the sampling frequency is dynamically adjusted, and the water level data packaging format is constructed based on the timestamp indexing mechanism and the two-way mapping structure. The abnormality removal module is used to identify mutation breakpoints for segmentation storage to generate the IoT water level acquisition and processing mapping table.
It improves the response sensitivity of water level data and the timeliness of data acquisition, enhances the integrity of water level data structure and the convenience of index management, improves adaptability and response efficiency to sudden abnormalities, and ensures data continuity and processing efficiency.
Smart Images

Figure CN120508683A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water level data processing, and in particular to a water level data acquisition and processing system based on the Internet of Things. Background Art
[0002] The field of water level data processing technology involves real-time perception, data collection, data transmission and subsequent processing and analysis of water level information in natural water bodies or artificial waters, including water level change monitoring, precise collection of water level data, optimization of water level information transmission paths and comprehensive analysis of environmental parameters. It is widely used in flood prevention and early warning, water resources scheduling, water conservancy project supervision and other scenarios. Among them, the traditional water level data acquisition and processing system refers to the collection of water level height signals through specific equipment such as pressure water level sensors or ultrasonic water level sensors, and the lower computer controller regularly transmits the collected data to the upper computer platform through serial communication for processing and storage. Generally, the sensor ranging feedback signal acquisition method and the timed polling data transmission mechanism are used to complete the acquisition and synchronous update of water level data.
[0003] In the existing water level data collection and processing process, fixed-interval sampling is performed through a timed polling mechanism, which lacks the ability to judge the water level fluctuation trend in real time, resulting in delayed response when the water level changes drastically or suddenly, and difficulty in capturing key data signals in a timely manner. At the same time, the sensor collection results are directly uploaded to the host computer through serial communication. There is a lack of intermediate processing links to screen and encapsulate the data, resulting in a loose data structure and low processing efficiency. When there are sudden jumps or abnormal fluctuations, it is impossible to locate abnormal points in time and effectively isolate and mark the data, which can easily cause subsequent analysis deviations. In scenarios such as flood control monitoring that require high real-time and accuracy, it is easy to cause warning failures and reduced data reliability. Summary of the Invention
[0004] The purpose of the present invention is to solve the shortcomings of the prior art and propose a water level data acquisition and processing system based on the Internet of Things.
[0005] In order to achieve the above objectives, the present invention adopts the following technical solutions: The water level data acquisition and processing system based on the Internet of Things includes: The trend identification module obtains the water level values of three consecutive time points recorded by the water level collection node in the natural water body, calculates the difference direction of two adjacent groups of water level values, marks a unidirectional trend or an oscillating trend, and obtains a trend direction determination identifier; The sampling frequency modulation module is based on the trend direction determination identifier and the current sampling interval time value. If the trend direction is a unidirectional trend, the sampling interval and the adaptive sampling rate adjustment coefficient are multiplied and written into the timing register. If the trend direction is an oscillating trend, the sampling interval and the steady-state holding coefficient are multiplied and written into the timing register to obtain a sampling frequency adjustment record. The data encapsulation module adjusts the recording control of each water level value generated by the sampling frequency in the acquisition node, binds the timestamp in sequence according to the sampling time and establishes a sequential index, constructs a bidirectional mapping structure between the water level value and the index, and compresses it into a structured data block to generate a water level data structure unit; The abnormality elimination module calculates the amplitude difference between two adjacent points based on the water level data structure unit, and determines whether the amplitude difference exceeds the hydrological mutation threshold. If it exceeds, the corresponding index position is marked as a breakpoint, and a sudden breakpoint segment index set is generated.
[0006] As a further solution of the present invention, the trend direction determination identifier includes trend category, change continuity, and directional stability; the sampling frequency adjustment record includes frequency modulation coefficient type, frequency modulation result value, and register status; the water level data structure unit includes time index structure, water level mapping relationship, and compressed data block; the sudden breakpoint segment index set includes breakpoint position mark record, mutation amplitude level, and segmented storage index.
[0007] As a further solution of the present invention, the trend identification module includes: The water level difference calculation submodule obtains the water level values of three time points continuously recorded by the water level acquisition node in the natural water body, calculates the difference between the water level values of the first and second time points, and the second and third time points, calculates two water level differences in sequence, and classifies the differences in direction to generate a water level difference sequence; The water level difference direction judgment submodule judges the positive and negative directions of the two sets of differences based on the water level difference sequence. If the difference is positive, it is marked as rising; if it is negative, it is marked as falling. The two direction judgment results are combined to generate a difference direction identification pair; The trend direction determination submodule determines whether the two direction identifications are consistent based on the difference direction identification pair. If the directions are consistent, it is determined to be a unidirectional trend. If the directions are opposite, it is determined to be an oscillating trend. The trend direction determination result is marked to obtain the trend direction determination identification.
[0008] As a further solution of the present invention, the sampling frequency modulation module includes: The trend screening submodule determines the trend direction based on the identification, reads the identification value by collection point classification, determines whether each trend identification is a unidirectional trend or an oscillating trend, classifies the record identified as a unidirectional trend with a classification number of 1, and classifies the record identified as an oscillating trend with a classification number of 0, and generates a classification index to finally obtain the trend classification identification result; The sampling interval adjustment submodule matches the corresponding adjustment strategy according to the trend classification identification result. If the trend is a unidirectional trend, it combines the current sampling interval value with the loop response time increment for combined calculation. If the trend is an oscillating trend, it introduces the trend judgment window and fluctuation density, performs overall dynamic division adjustment, calculates and obtains the adjusted sampling interval, and maps the corresponding interval value with the original sampling record one by one according to the trend type to obtain the sampling interval adjustment record; The sampling writing submodule adjusts the sampling interval record based on the sampling interval, writes the timing register synchronously, updates the adjustment value list one by one by matching the acquisition node ID and writing the adjustment value to each record unit, and updates and establishes the sampling frequency adjustment record.
[0009] As a further solution of the present invention, the data encapsulation module includes: The time binding submodule adjusts each water level value generated under the recording control according to the sampling frequency, pairs the sampling time with the water level value one by one, sets the sequential index using fixed-step auto-increment logic, determines the logical position of the binding structure in the sequence, and generates a water level binding index structure; The mapping construction submodule establishes a bidirectional mapping list according to the water level value and the sequential index in the water level binding index structure, establishes the mapping structure in a hash table manner, generates a forward mapping with the sequential index as the key and the water level value as the value, and generates a reverse mapping with the water level value as the key and the sequential index as the value, calculates and obtains the compressed mapping index value of each sampling record, and structurally integrates the index value with the corresponding water level record to obtain a compressed mapping coding table; The structure compression submodule reads each compression index value and the corresponding original water level value according to the compression index sequence in the compression mapping code table, combines them into structural units, divides the sequence into fixed-length structural blocks, combines all structural blocks into a whole block of structural data, and obtains the water level data structural unit.
[0010] As a further solution of the present invention, the abnormality elimination module includes: The amplitude difference extraction submodule extracts the water level values and sampling times corresponding to any two adjacent sampling points in sequence based on the water level values of all continuous time periods in the water level data structure unit, and establishes an amplitude difference sequence. It sorts all adjacent water level difference values, records their position indexes in the original data, and establishes a corresponding relationship between the amplitude difference and its time span to obtain an amplitude change sequence; The mutation judgment submodule performs a judgment operation based on the amplitude difference information of all records in the amplitude change sequence and the hydrological mutation threshold, detecting whether each water level difference exceeds the threshold. If the mutation condition is met, the location is marked as the mutation location, and the location information is uniformly collected and sorted to finally obtain a sudden change index list; The breakpoint marking submodule reads the corresponding water level structure number and time field in sequence according to all the mutation positions in the sudden change index list, identifies the start and end positions of the segment where each mutation point is located, and uses the mutation point as the cutting node to construct an inter-segment grouping index for the water level data. The correspondence between all the divided segment numbers and the original data is uniformly recorded and archived to establish a sudden breakpoint segment index set.
[0011] As a further embodiment of the present invention, the system further comprises: The instruction linkage module is based on all the structural positions in the sudden breakpoint segment index set, combined with the task cache table in the water level acquisition node controller, and injects the sampling interval and data read and write status identifier according to the structure number corresponding to each segment to generate the Internet of Things water level acquisition and processing mapping table; The Internet of Things water level collection and processing mapping table includes task number mapping results, read and write status control records, and sampling frequency injection information.
[0012] As a further solution of the present invention, the instruction linkage module includes: The structure number extraction submodule sequentially reads the start and end positions of each breakpoint segment based on all structure positions in the sudden breakpoint segment index set, extracts the corresponding structure number set, and sorts the structure numbers according to the order of appearance in the sampling sequence, merges and marks the continuous number sequences, and generates a segment structure number list; The task parameter binding submodule connects to the task cache table of the water level acquisition node controller according to each number segment sequence in the segment structure number list, identifies the task record position corresponding to each structure number in the cache table, extracts the sampling interval, data writing status and communication response status for comparison, performs field binding operations on task items that are missing or to be updated, sets the update strategy according to the segment attribute information corresponding to the structure number, and generates a control task injection parameter set; The information mapping generation submodule establishes a task field mapping dictionary based on each structure number and corresponding parameter information recorded in the control task injection parameter set, with the structure number as the primary key, aggregates the sampling interval identifier, data reading and writing status, and communication response status, and establishes an index sequence table to obtain the Internet of Things water level collection and processing mapping table.
[0013] Compared with the prior art, the advantages and positive effects of the present invention are: In the present invention, trend identification is achieved by analyzing the trend of continuous water level changes and the sampling frequency is dynamically adjusted, so that the sampling interval matches the actual water level fluctuation state, thereby improving the response sensitivity of water level data and the timeliness of data acquisition. A timestamp index mechanism and a bidirectional mapping structure are used to construct a unified encapsulation format, thereby enhancing the integrity of the water level data structure and the convenience of index management. The sudden change breakpoints are identified by the water level amplitude difference and the data is stored in segments, thereby improving data stability and the ability to identify emergencies, thereby overall improving the adaptability of water level information processing, the level of data continuity maintenance and the efficiency of responding to sudden anomalies. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 is a system flow chart of the present invention; Figure 2 This is a flow chart of the trend identification module of the present invention; Figure 3 This is a flow chart of the sampling frequency modulation module of the present invention; Figure 4 This is a flow chart of the data encapsulation module of the present invention; Figure 5 This is a flow chart of the abnormality elimination module of the present invention; Figure 6 This is a flow chart of the instruction linkage module of the present invention. DETAILED DESCRIPTION
[0015] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0016] In the description of the present invention, it should be understood that the terms "length," "width," "up," "down," "front," "back," "left," "right," "vertical," "horizontal," "top," "bottom," "inside," "outside," and the like, indicating positions or relationships, are based on the positions or relationships shown in the accompanying drawings and are intended only to facilitate the description of the present invention and simplify the description. They do not indicate or imply that the devices or elements referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limiting the present invention. Furthermore, in the description of the present invention, "plurality" means two or more, unless otherwise expressly and specifically defined.
[0017] See also Figure 1 ,The water level data acquisition and processing system based on the Internet of Things includes: The trend identification module obtains the water level values continuously recorded at three time points by the water level collection node in the natural water body, calculates the difference direction of two adjacent sets of water level values, and compares the two sets of difference directions. When both directions are positive or both are negative, it is marked as a unidirectional trend. If one is positive and the other is negative, it is marked as an oscillating trend, and the trend direction determination mark is obtained; The sampling frequency modulation module determines the trend direction based on the current sampling interval time value. If the trend direction is a unidirectional trend, the sampling interval and the adaptive sampling rate adjustment coefficient (in accordance with the "Hydrological Monitoring Data Communication Protocol") are multiplied and written into the timing register. If the trend direction is an oscillating trend, the sampling interval and the steady-state holding coefficient (refer to the "Geographic Information Positioning Service" standard) are multiplied and written into the timing register to obtain the sampling frequency adjustment record. The data encapsulation module binds the timestamps of each water level value generated by the sampling frequency adjustment record control in the acquisition node in sequence according to the sampling time and establishes a sequential index. It constructs a bidirectional mapping structure between the water level value and the index, compresses it into a structured data block, and generates a water level data structure unit. The abnormal rejection module calculates the amplitude difference between two adjacent points based on the water level values of all continuous time periods in the water level data structure unit, and determines whether the amplitude difference exceeds the hydrological mutation threshold (set as ±10cm / 5min according to GB / T50138-2010). If it exceeds, the corresponding index position is marked as a breakpoint, the breakpoint position is recorded, and the water level data before and after it are segmented and stored to generate an index set of the sudden breakpoint segment; The instruction linkage module concentrates all structure positions based on the sudden breakpoint segment index, combines with the task cache table in the water level acquisition node controller, injects the sampling interval and data read and write status identifier according to the structure number corresponding to each segment, and generates the Internet of Things water level acquisition and processing mapping table.
[0018] The trend direction determination identifier includes trend category, change continuity, and directional stability. The sampling frequency adjustment record includes the frequency modulation coefficient type, frequency modulation result value, and register status. The water level data structure unit includes the time index structure, water level mapping relationship, and compressed data block. The sudden breakpoint segment index set includes the breakpoint position mark record, mutation amplitude level, and segmented storage index. The Internet of Things water level collection and processing mapping table includes the task number mapping result, read and write status control record, and sampling frequency injection information.
[0019] See also Figure 2 , the trend identification module includes: The water level difference calculation submodule obtains the water level values of three time points continuously recorded by the water level acquisition node in the natural water body, calculates the difference between the water level values of the first and second time points, and the second and third time points, calculates two water level differences in sequence, and classifies the differences in direction to generate a water level difference sequence; Get the water level values of three time points continuously recorded by the water level collection node in the natural water body. First, take the monitoring time of July 1, 2024 as an example. Set the sampling time to 06:00, 12:00 and 18:00 at the collection points A01, A02 and A03 respectively. Sampling and reading the water level values recorded at each collection point. Suppose the water level values of the three time points of A01 are 2.35 meters, 2.42 meters, and 2.50 meters, A02 are 2.48 meters, 2.46 meters, and 2.43 meters, and A03 are 2.41 meters, 2.47 meters, and 2.49 meters. By subtracting the water level values at time point 1 from time point 2, the first group of water level differences are obtained. Subtracting the water level values at time point 2 from time point 3, the second group of water level differences are obtained. For example, the first group of differences of A01 is 2.42-2.35=0.07 meters, and the second group of differences is 2.50-2.42=0.08 meters, indicating that the water level continues to rise. The first group of differences of A02 is 2.46-2.48=-0.02 meters, and the second group of differences is 2.43-2.46=-0.03 meters, indicating that the water level continues to fall. The first group of differences of A03 is 2.47-2.41=0.06 meters, and the second group of differences is 2.49-2.47=0.02 meters, also showing an upward trend. Each group of differences here should be accurate to 0.01 meter units, and the original water level values are required to be continuously collected by the water level sensor and uploaded to the system for processing. The recording and calculation process can be completed in batches through scripts on the data platform side, and the difference results are generated in sequence and summarized to form a difference sequence, as shown in the following table.
[0020] Table 1 Water level difference calculation table
[0021] As shown in Table 1, the system completes the continuous change analysis according to the water level difference at each time point, forms a water level difference sequence for each collection point, and finally generates a water level difference sequence.
[0022] The water level difference direction judgment submodule judges the positive and negative directions of the two sets of differences based on the water level difference sequence. If the difference is positive, it is marked as rising; if it is negative, it is marked as falling. The two direction judgment results are combined to generate a difference direction identification pair; According to the water level difference sequence, the direction of the two sets of differences at each collection point is judged. When the difference is positive, it is marked as rising, and when the difference is negative, it is marked as falling. For example, in Table 1, the difference 1 and difference 2 of A01 are both positive, 0.07 meters and 0.08 meters respectively, and are judged as "rising-rising"; the two differences of A02 are both negative, and are judged as "falling-falling"; the two differences of A03 are also both positive, and are judged as "rising-rising". During the execution process, the direction judgment should be implemented by determining the positive and negative attributes of the difference. Conditional statements or interval logic are used for assignment conversion. The judgment logic needs to strictly divide the difference into three categories: if it is greater than 0, it is marked as rising; if it is less than 0, it is marked as falling; if it is equal to 0, it is marked as flat. For example, when the difference 1 is 0.00 meters, it can be regarded as the water level unchanged, and the direction is "stable". In the actual system, it is recommended to retain two decimal places for the difference and the accuracy is at the centimeter level. The subsequent system combines the two direction identifiers to form a pair of direction marks to reflect the continuous change direction of the collection point in the two time periods, as shown in Table 2.
[0023] Table 2 Difference direction judgment table
[0024] As shown in Table 2, through this directional conversion and combination, the system completes the directional expression of the water level change behavior and finally generates a difference direction identification pair.
[0025] The trend direction determination submodule determines whether the two direction identifications are consistent based on the difference direction identification pair. If the directions are consistent, it is determined to be a unidirectional trend. If the directions are opposite, it is determined to be an oscillating trend. The trend direction determination result is marked to obtain the trend direction determination identification; Based on the difference direction identification pair, the trend type of the direction combination of each collection point is judged. The judgment basis is whether the two direction identifications are consistent. If they are consistent, that is, the "rising-rising" or "falling-falling" type, it is judged as a unidirectional trend. If the directions are inconsistent, such as "rising-falling" or "falling-rising", it is an oscillating trend. In A01 and A03, the direction is "rising-rising", A02 is "falling-falling", and all three are unidirectional trends. If A04 is "rising-falling", it is judged as an oscillating trend. During the execution process, it is recommended to set up a pre-judgment condition table and set a one-to-one mapping between the direction combination category and the trend type. For example, "rising-falling" is mapped as oscillation, "falling-rising" is mapped as oscillation, and the remaining combinations are mapped as unidirectional. The system compares the collection points one by one and outputs the trend type. The results of all collection points are summarized to form a trend judgment list, as shown in Table 3.
[0026] Table 3 Trend direction determination table
[0027] As shown in Table 3, based on the combined relationship of water level change directions, the system completes the classification judgment of trend types and finally obtains the trend direction judgment identifier.
[0028] See also Figure 3 , the sampling frequency modulation module includes: The trend screening submodule determines the trend direction based on the identification, reads the identification value by collection point, and determines whether each trend identification is a unidirectional trend or an oscillating trend. The records marked as unidirectional trends are classified as 1, and the records marked as oscillating trends are classified as 0. The classification index is generated and the trend classification identification result is finally obtained. Based on the trend direction determination identifier, trend categories are extracted for all sampling points. The system reads the trend determination result field from the upstream module. The field values include "one-way trend" and "oscillating trend". During the execution process, the system judges the trend status of each node by string matching. If the result field is "one-way trend", it is assigned a value of 1, otherwise it is assigned a value of 0 and recorded as the classification identifier. During the implementation process, the trend identification results of sampling points A01, A02, and A03 are respectively "one-way trend", "oscillating trend", and "one-way trend". The system automatically sets their corresponding classification identifiers to 1, 0, and 1 in sequence. This operation is completed by traversing the trend identifier list and conditional judgment logic. For example, in Python, the classification mapping operation can be executed in batches through the if conditional structure to form the trend identifier classification structure shown in the table below, which is used for subsequent sampling strategy branch path selection.
[0029] Table 4 Trend classification identification table
[0030] As shown in Table 4, the trend classification identification value will be used in the sampling strategy switching condition judgment node to finally generate the trend classification identification result.
[0031] The sampling interval adjustment submodule matches the corresponding adjustment strategy according to the trend classification identification results. If the trend is a unidirectional trend, it combines the current sampling interval value and the loop response time increment for combined calculation. If the trend is an oscillating trend, it introduces the trend judgment window and fluctuation density to perform overall dynamic division adjustment using the formula: ; The adjusted sampling interval is obtained by calculation, and the corresponding interval value is mapped to the original sampling record one by one according to the trend type to obtain the sampling interval adjustment record, where: Indicates the interval value after the sampling frequency is adjusted, in seconds. Indicates the current sampling interval. Its value is dynamically set by the sampling device based on the current system status or the sampling feedback of the previous cycle. The unit is also seconds. Indicates the time difference between the current sampling point and the reference point in the loop window. This value can be obtained by recording the timestamp of the sampling point and subtracting it from the timestamp of the reference point. The unit is seconds.
[0032] If the current sampling timestamp is 15.8 seconds and the reference sampling point is 13.7 seconds, then , Measured over the past several cycles Assume that the system obtains the time increment sequence {1.5, 1.6, 1.4, 1.3, 1.7, 1.5, 1.5, 1.6, 1.4, 1.3} in 10 cycles, and the sum is 15.8. The average value is , It represents the fluctuation density of data points per unit time. Its source is the square of the standard deviation of the sampled signal data within the unit time period. For example, 20 data points {3.1, 3.4, 3.2, 3.3, ...} are collected within 1 second, and their average value is 3.2. Then the standard deviation , squared to , for example, calculated , and then calculate the average value for multiple time periods , For example, the statistical results in the previous 10 seconds are {1.2, 1.4, 1.6, 1.5, 1.8, 1.9, 1.7, 1.6, 1.3, 1.5}, and the average is , put the above values into the formula and the calculation process is as follows: First, find , then ask , and then we get the square root result , finally put all the values into the formula to get: The results show that when the current time increment at a sampling point is slightly greater than the historical mean and the data fluctuation density is also slightly higher than the historical mean, the sampling system automatically adjusts the original sampling interval from 1.2 seconds to approximately 1.481 seconds, thereby adapting to the sampling timing strategy recommended by the trend state classification node. The adjusted sampling interval is the interval value obtained by dynamically modifying the original fixed sampling time based on the current sampling node's operating state, trend type, response characteristics, and data fluctuation characteristics. This interval reflects the sampling system's ability to adaptively adjust data update frequency under different trend scenarios. Essentially, it calculates the combined effect of the sampling interval and device response delay, and weights the data fluctuation intensity and trend persistence to obtain a time correction value. This value can be used to control the trigger frequency of the acquisition module, thereby adjusting the sampling frequency accordingly when the system faces rapid unidirectional changes or oscillatory stabilization phases, ensuring that data acquisition behavior is synchronized with the dynamic characteristics of the external environment. This interval is then periodically written to the timing register, directly driving the subsequent automatic sampling process.
[0033] The overall operation logic of the formula is based on the needs of the trend adaptive sampling strategy. The purpose is to dynamically adjust the difference between the current sampling behavior and the historical statistical behavior during the real-time sampling process. First, the formula uses multiplication to convert the current sampling interval Combined with the subsequent standardized adjustment factor, it means that the current sampling interval is enlarged or reduced by a set of unitless change ratios. The adjustment factor consists of two standardized indicators, where the numerator is Indicates the relative change between the current sampling time increment and the mean of the historical time increment. If the current increment is significantly greater than the historical average, it means that the current sampling point deviates far from the trend reference time and the sampling may not be dense enough. Therefore, the sampling period should be shortened appropriately. When it is smaller, it means that the change is slow and the sampling rhythm can be slowed down appropriately. In the denominator It represents the scaling of the change amplitude of the volatility density. Since the volatility density is essentially calculated based on the variance, it is measured using the squared standard deviation. However, in order to avoid excessive impact and amplification of outliers, the proportional term is structurally processed with a square root to slow down its growth, so that the sampling interval will not be over-compressed when the fluctuation is severe. The square root operation has a buffering effect, making the adjustment behavior smoother and more stable. Finally, by dividing the time difference normalization factor by the volatility density factor, an overall adjustment ratio is formed, which represents the relative proportion of "sampling time lag effect" and "data volatility". After multiplying this ratio by the current sampling interval, the update adjustment of the current sampling period is completed, so that the entire formula structurally integrates the dual control logic of "time delay trend" and "volatility trend", thereby meeting the dynamic adjustment requirements of real-time adaptive sampling.
[0034] The sampling writing submodule adjusts the record based on the sampling interval, writes it synchronously to the timing register, updates it one by one by matching the acquisition node ID with the adjustment value list, writes the adjustment value to each record unit, and updates and establishes the sampling frequency adjustment record; According to the sampling interval adjustment record, the write update operation is performed on the timing register of each collection point. The system traverses the collection point ID list at the execution layer, retrieves the corresponding sampling interval adjustment value one by one, and writes it to the timing trigger configuration area through the register interface. For example, if the interval corresponding to node A01 is 108.67 seconds, the original 10-second value is replaced with 108.67 seconds. The system records the log content after executing the write operation. The write format includes three fields: timestamp, collection point number, interval before update, and interval after update. The update is completed after the node operation is confirmed to be correct. This operation is executed in a loop in the periodic sampling module. After each round of interval configuration update, a record index is synchronously established for data frequency modulation review or trend repair identification, and finally a sampling frequency adjustment record is established.
[0035] See also Figure 4 , the data encapsulation module includes: The time binding submodule adjusts each water level value generated under the record control according to the sampling frequency, pairs the sampling time with the water level value one by one, and uses the fixed step-size auto-increment logic to set the sequential index to determine the logical position of the binding structure in the sequence and generate the water level binding index structure; According to the sampling frequency adjustment record control of each water level value generated, the system synchronously extracts the water level sequence and time series in the records of each collection node. The system matches the corresponding sampling time field and water level field for each record in turn, and generates a logical number index based on the timestamp sequence. The sampling time field uses a unified period trigger. Taking the water level sampling every 10 seconds in node A01 as an example, the system collects 5 samples to form a time series T=[0, 10, 20, 30, 40] seconds, and the corresponding water level values are V=[3.10, 3.12, 3.14, 3.11, 3.13] meters. The system packages each pair of <time, water level> information in chronological order and generates a sequential index G=[1, 2, 3, 4, 5] to indicate the arrangement position of the data in the logical sequence. By establishing a structured table mapping, the system expresses each record as a record unit in the form of <sampling sequence number, water level value, index G, sampling time>. The results are shown in Table 5, which serves as the basic input for subsequent mapping construction: Table 5 Water level binding index structure table
[0036] As shown in Table 5, the system has established a timestamp binding structure and a sequential number identifier for each sampling record, and obtained a water level binding index structure.
[0037] The mapping construction submodule establishes a bidirectional mapping list based on the water level value and the sequential index in the water level binding index structure, and uses a hash table to establish the mapping structure. It generates a forward mapping with the sequential index as the key and the water level value as the value, and generates a reverse mapping with the water level value as the key and the sequential index as the value, and uses the formula: ; The operation obtains the compression mapping index value of each sampling record, and structurally integrates the index value with the corresponding water level record to obtain the compression mapping coding table, where: Indicates the The compressed mapping index value of the sampling record, in meters per second, Indicates the Water level value, in meters, Indicates the The sequential index is a dimensionless natural number. represents the average of the sequential index, Indicates the The time offset of the sampling time relative to the reference time, in seconds. Indicates the total number of sampling records; According to the water level value and index value G obtained in Table 6, the system constructs a forward hash map with G as the key, such as {1: 3.10, 2: 3.12, 3: 3.14, 4: 3.11, 5: 3.13}, and constructs a reverse map {3.10: 1, 3.12: 2, ...}, and then calculates the compressed index code for each record. Let the water level value of the third record be meters, corresponding index , time series seconds, the system first calculates the index average.
[0038] ; Then calculate the index variance term and the time sum of squares: ; ; Substitute into the formula: ; calculate: ; ; This value represents the normalized mapping index value of the record under the water level intensity and sequence distribution. Other sampling records are substituted into their respective 、 、 By participating in the calculation, a complete compression index list can be formed, and finally a compression mapping encoding table can be obtained.
[0039] The compression mapping index value refers to the normalized strength index calculated during the water level data encapsulation process, combining the numerical size of each water level record, the degree of its position offset in the sequence, and the corresponding sampling time. This index reflects the structural importance of the data in the overall sampling distribution by multiplying the water level value by the discreteness of the index sequence in which it is located. At the same time, it is normalized using the sum of the squares of all sampling times as the time series scale standard, so that records under different time spans are comparable during compression processing. Finally, this value is used as a scalar result after one-dimensional compression to construct an index mapping table, and is used as a positioning code input in the subsequent structural compression process, providing a unified measurement basis for the structural reorganization of the original water level data.
[0040] The numerator part of the formula Represents the current water level value The combined weight of the offset degree of the index sequence where the value is located, the index offset It reflects the degree of dispersion of each record relative to the average position in the sequence distribution. The square and sum of the squares reflect the overall fluctuation trend. The square root of the dispersion is then taken to eliminate the amplification caused by the square, and finally multiplied by the current water level value. Get the structural strength term; the denominator Represents the square root of the sum of all sampling time points, forming a normalized scale factor of the time axis. If the sampling interval is uniform, the denominator can stably measure the degree of change in the time span. The final overall ratio is processed by absolute value and a positive structure index value is output. , reflecting the joint response characteristics of water level changes and sampling structure under sequence distribution and time distribution.
[0041] The structure compression submodule reads each compressed index value and the corresponding original water level value according to the compressed index sequence in the compression mapping code table, combines them into structural units, divides the sequence into fixed-length structural blocks, combines all structural blocks into a whole block of structural data, and obtains the water level data structural unit; According to the index value and water level value of each record in the compression mapping code table, the system converts it into the structural unit format <compressed index value, water level value> and performs a structure packing operation. Suppose the five records are <0.1730, 3.10>, <0.1776, 3.12>, <0.1813, 3.14>, <0.1760, 3.11>, and <0.1798, 3.13>, and the structural unit length is set to 16 bytes. The system splices every two groups of units into a structural block and marks the starting index address to form a binary structure segment. It also appends empty bytes to pad data that is less than one structural block to ensure block size consistency. In this example, five records will generate two complete blocks and one padding block containing one record. The structure block will eventually be written to the storage medium structure page as the water level compressed data area, and finally the water level data structure unit is obtained.
[0042] See also Figure 5 , the exception rejection module includes: The amplitude difference extraction submodule extracts the water level values and sampling times corresponding to any two adjacent sampling points in sequence based on the water level values of all continuous time periods in the water level data structure unit, and establishes an amplitude difference sequence. It sorts all adjacent water level difference values, records their position index in the original data, and establishes a corresponding relationship between the amplitude difference and its time span to obtain an amplitude change sequence. Based on the water level values of all continuous time periods in the water level data structure unit, the system reads the water level sequence and the sampling time sequence in sequence, extracts the water level pairs of all adjacent sampling points by sequential traversal, obtains the difference between the water level values corresponding to the previous time point and the next time point, records the time period number and data position index information corresponding to the difference, and judges whether the current water level change direction is rising or falling, and adds a trend label to each water level difference to further form a change trend sequence. The system integrates all water level differences, trend types, time period numbers, data indexes and other information to generate structured data units, and finally obtains a complete amplitude change table. Taking a certain monitoring point as an example, the sampling time interval is fixed at 5 minutes, and the water level values are 3.12 meters, 3.14 meters, 3.21 meters, 3.28 meters, 3.35 meters, and 3.33 meters, respectively, and the corresponding times are 0 seconds, 300 seconds, 600 seconds, 900 seconds, 1200 seconds and 1500 seconds, respectively. The water level change data after system identification is as follows: Table 6 Water level amplitude change table
[0043] As shown in Table 6, the system has generated a standard amplitude difference data set based on the original water level records. Combined with the sampling time and trend direction, a complete water level change information sequence is established, and finally an amplitude change sequence is obtained.
[0044] The mutation judgment submodule performs a judgment operation based on the amplitude difference information of all records in the amplitude change sequence and the hydrological mutation threshold, detecting whether each water level difference exceeds the threshold. If the mutation condition is met, the location is marked as the mutation location, and the location information is uniformly collected and sorted to finally obtain the sudden change index list; Based on the water level difference and trend information recorded in the amplitude change sequence, the system reads the amplitude difference value and the time period number in each record in turn, and compares each amplitude difference value with the preset hydrological mutation judgment benchmark. According to the national standard GB / T50138-2010, the hydrological mutation judgment threshold is set to ±0.10 meters / 5 minutes. The system judgment condition is whether the current amplitude difference value exceeds the threshold. If it exceeds, the system marks the index position corresponding to the starting position of the time period. The system further extracts the water level values before and after the mutation segment and the corresponding time points to determine whether the mutation feature is continuous. If two consecutive amplitude differences exceed the threshold, it is considered a continuous mutation segment. The system regards its starting point as the sudden jump starting point and adds it to the sudden jump record list. During the judgment process, the system judges all amplitude segment records in turn and updates the sudden jump identification information one by one, eventually forming a sudden jump segment sequence. For example, in the above data, assuming that a monitoring point has an amplitude difference of 0.13 meters, the system identifies the record where the difference is located as the sudden jump point and outputs its position sequence number and time information. The integrated sudden jump position record is as follows: Table 7 Sudden jump change position table
[0045] As shown in Table 7, multiple sudden change segments are determined, and their start and end times, amplitude differences, and sequence number information are registered, and finally a sudden change index list is obtained.
[0046] The breakpoint annotation submodule reads the corresponding water level structure number and time field in sequence according to all mutation positions in the sudden change index list, identifies the start and end positions of each segment where the mutation point is located, and uses the mutation point as the cutting node to build an inter-segment grouping index for the water level data. The correspondence between all divided segment numbers and the original data is uniformly recorded and archived to establish a sudden breakpoint segment index set; According to the jump sequence position in the jump change index list, the system calls the corresponding water level structure data in sequence and performs data segmentation according to the jump starting point number. The system uses the jump point as the segment boundary to split the water level original data front and back to form two continuous and non-overlapping data segments. For each segment of data, a segment index number is generated and its time number and start and end structure position information are recorded. When reconstructing the structure segment, the system retains the original sampling order and generates a segment number for each segment. Combined with the jump position, a segment mapping table is generated to record the correspondence between the segment number and the original sequence number. The resulting structure is as follows: Table 8 Sudden breakpoint segment index table
[0047] As shown in Table 8, a breakpoint segmentation structure is constructed based on the location of the sudden jump point. The segment number has established an index mapping relationship with the original water level data, and finally the sudden jump breakpoint segment index set is established.
[0048] See also Figure 6 , the instruction linkage module includes: The structure number extraction submodule reads the start and end positions of each breakpoint segment based on all the structure positions in the sudden breakpoint segment index set, extracts the corresponding structure number set, and sorts the structure numbers according to the order of appearance in the sampling sequence, merges and marks the continuous number sequences, and generates a segment structure number list; Based on all the structural positions in the sudden breakpoint segment index set, the system reads the segment's start number and end number fields in sequence, and extracts the structure numbers one by one within the number interval. The extracted number set is checked for continuity. If the numbers are continuous, they are marked as valid number segments. The number of numbers contained in each number segment is further counted, and a number density information table is constructed. The number density is obtained by dividing the total number of each segment by its number span. The system then establishes segment number indexes for all valid number segments in sequence, and generates a structure number list in structural order. Combined with the sampling node task scheduling structure mapping standard, the segment number segments are aligned with the sampling controller mapping table to generate a number mapping field. For example, the monitoring segment A01 starts with 101 and ends with 150, with a total of 50 records. The segment A02 starts with 201 and ends with 250, with a total of 50 records. The segment A03 starts with 301 and ends with 350, with a total of 50 records. The number extraction structure finally output by the system is as follows: Table 9 Segment structure number table
[0049] As shown in Table 9, the system has completed continuity identification and number statistics during the segment number extraction process, formed the basis for task field alignment through structured organization of number density and segment position, and finally generated a segment structure number list.
[0050] The task parameter binding submodule connects to the task cache table of the water level acquisition node controller according to each number segment sequence in the segment structure number list, identifies the task record position corresponding to each structure number in the cache table, extracts the sampling interval, data writing status and communication response status for comparison, performs field binding operations on task items that are missing or to be updated, sets the update strategy according to the segment attribute information corresponding to the structure number, and generates a set of control task injection parameters; According to the structure number content in the segment structure number list, the system reads the number one by one and indexes it to the corresponding row in the controller task cache table. It extracts the sampling interval field, data read and write identification field and communication response status field in the task field in turn, performs field integrity check operations, and identifies and fills in the missing field records. The filling value comes from the joint judgment result of the structure number density, sampling priority, cache scheduling status and current timestamp. If the structure number density is 1.0, the segment is A01, and the current control state is ready, the sampling interval field is set to 60 seconds, the data read and write status is set to writable, and the communication status is set to synchronous valid. The system injects field values 60, writable, and synchronous into numbers 101, 102, and 103 respectively, and injects the number segments in sequence, updates the corresponding row of the task cache table, and constructs a number-field pair combination structure. The task injection fields are sorted and output in the number sequence, as shown in the following table: Table 10 Control Task Injection Fields
[0051] As shown in Table 10, the number segment task field has been injected and mapped according to the structure number to form the task control field update structure, and finally generate the control task injection parameter set.
[0052] The information mapping generation submodule establishes a task field mapping dictionary based on each structure number and corresponding parameter information recorded in the control task injection parameter set, with the structure number as the primary key. It aggregates the sampling interval identifier, data read and write status, and communication response status, and establishes an index sequence table to obtain the IoT water level collection and processing mapping table. According to all the task field values in the control task injection parameter set, the system uses the structure number as the main index, and the sampling interval, data status, and communication status as the associated fields to build a task information mapping structure. The system generates a structure number mapping table unit in the memory mapping space. Each structure number corresponds to a task field structure record. The record is marked with the injection status identifier, field source identifier, and update timestamp field. The structure numbers are arranged in ascending order to generate a mapping table structure. The system calls the task scheduling module mapping area and writes the above form as a whole to the mapping area. At the same time, the total number of structure number mapping entries is registered. The system performs data integrity verification operations to eliminate missing field items or invalid number items. Finally, the task field structure entries are written and the task mapping output table is generated, as shown below: Table 11 Water level collection and processing mapping table
[0053] As shown in Table 11, the water level collection task has completed the construction of the linkage mapping table through the structure number and field content. The structure number and the field form a one-to-one correspondence. The system task scheduling area successfully establishes the Internet of Things water level collection and processing mapping table.
[0054] The above are merely preferred embodiments of the present invention and do not limit the present invention in any other form. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of protection of the technical solution of the present invention.
Claims
1. The water level data acquisition and processing system based on the Internet of Things is characterized by: The system comprises: The trend identification module obtains the water level values of three consecutive time points recorded by the water level collection node in the natural water body, calculates the difference direction of two adjacent groups of water level values, marks a unidirectional trend or an oscillating trend, and obtains a trend direction determination identifier; The sampling frequency modulation module is based on the trend direction determination identifier and the current sampling interval time value. If the trend direction is a unidirectional trend, the sampling interval and the adaptive sampling rate adjustment coefficient are multiplied and written into the timing register. If the trend direction is an oscillating trend, the sampling interval and the steady-state holding coefficient are multiplied and written into the timing register to obtain a sampling frequency adjustment record. The data encapsulation module adjusts the recording control of each water level value generated by the sampling frequency in the acquisition node, binds the timestamp in sequence according to the sampling time and establishes a sequential index, constructs a bidirectional mapping structure between the water level value and the index, and compresses it into a structured data block to generate a water level data structure unit; The abnormality elimination module calculates the amplitude difference between two adjacent points based on the water level data structure unit, and determines whether the amplitude difference exceeds the hydrological mutation threshold. If it exceeds, the corresponding index position is marked as a breakpoint, and a sudden breakpoint segment index set is generated.
2. The water level data acquisition and processing system based on the Internet of Things according to claim 1 is characterized in that: The trend direction determination identifier includes trend category, change continuity, and directional stability; the sampling frequency adjustment record includes frequency modulation coefficient type, frequency modulation result value, and register status; the water level data structure unit includes time index structure, water level mapping relationship, and compressed data block; the sudden breakpoint segment index set includes breakpoint position mark record, mutation amplitude level, and segmented storage index.
3. The water level data acquisition and processing system based on the Internet of Things according to claim 1 is characterized in that: The trend identification module includes: The water level difference calculation submodule obtains the water level values of three time points continuously recorded by the water level acquisition node in the natural water body, calculates the difference between the water level values of the first and second time points, and the second and third time points, calculates two water level differences in sequence, and classifies the differences in direction to generate a water level difference sequence; The water level difference direction judgment submodule judges the positive and negative directions of the two sets of differences based on the water level difference sequence. If the difference is positive, it is marked as rising; if it is negative, it is marked as falling. The two direction judgment results are combined to generate a difference direction identification pair; The trend direction determination submodule determines whether the two direction identifications are consistent based on the difference direction identification pair. If the directions are consistent, it is determined to be a unidirectional trend. If the directions are opposite, it is determined to be an oscillating trend. The trend direction determination result is marked to obtain the trend direction determination identification.
4. The water level data acquisition and processing system based on the Internet of Things according to claim 1 is characterized in that: The sampling frequency modulation module includes: The trend screening submodule determines the trend direction based on the identification, reads the identification value by collection point classification, determines whether each trend identification is a unidirectional trend or an oscillating trend, classifies the record identified as a unidirectional trend with a classification number of 1, and classifies the record identified as an oscillating trend with a classification number of 0, and generates a classification index to finally obtain the trend classification identification result; The sampling interval adjustment submodule matches the corresponding adjustment strategy according to the trend classification identification result. If the trend is a unidirectional trend, it combines the current sampling interval value with the loop response time increment for combined calculation. If the trend is an oscillating trend, it introduces the trend judgment window and fluctuation density, performs overall dynamic division adjustment, calculates and obtains the adjusted sampling interval, and maps the corresponding interval value with the original sampling record one by one according to the trend type to obtain the sampling interval adjustment record; The sampling writing submodule adjusts the sampling interval record based on the sampling interval, writes the timing register synchronously, updates the adjustment value list one by one by matching the acquisition node ID and writing the adjustment value to each record unit, and updates and establishes the sampling frequency adjustment record.
5. The water level data acquisition and processing system based on the Internet of Things according to claim 1 is characterized in that: The data encapsulation module includes: The time binding submodule adjusts each water level value generated under the recording control according to the sampling frequency, pairs the sampling time with the water level value one by one, sets the sequential index using fixed-step auto-increment logic, determines the logical position of the binding structure in the sequence, and generates a water level binding index structure; The mapping construction submodule establishes a bidirectional mapping list according to the water level value and the sequential index in the water level binding index structure, establishes the mapping structure in a hash table manner, generates a forward mapping with the sequential index as the key and the water level value as the value, and generates a reverse mapping with the water level value as the key and the sequential index as the value, calculates and obtains the compressed mapping index value of each sampling record, and structurally integrates the index value with the corresponding water level record to obtain a compressed mapping coding table; The structure compression submodule reads each compression index value and the corresponding original water level value according to the compression index sequence in the compression mapping code table, combines them into structural units, divides the sequence into fixed-length structural blocks, combines all structural blocks into a whole block of structural data, and obtains the water level data structural unit.
6. The water level data acquisition and processing system based on the Internet of Things according to claim 1 is characterized in that: The abnormality elimination module includes: The amplitude difference extraction submodule extracts the water level values and sampling times corresponding to any two adjacent sampling points in sequence based on the water level values of all continuous time periods in the water level data structure unit, and establishes an amplitude difference sequence. It sorts all adjacent water level difference values, records their position indexes in the original data, and establishes a corresponding relationship between the amplitude difference and its time span to obtain an amplitude change sequence; The mutation judgment submodule performs a judgment operation based on the amplitude difference information of all records in the amplitude change sequence and the hydrological mutation threshold, detecting whether each water level difference exceeds the threshold. If the mutation condition is met, the location is marked as the mutation location, and the location information is uniformly collected and sorted to finally obtain a sudden change index list; The breakpoint marking submodule reads the corresponding water level structure number and time field in sequence according to all the mutation positions in the sudden change index list, identifies the start and end positions of the segment where each mutation point is located, and uses the mutation point as the cutting node to construct an inter-segment grouping index for the water level data. The correspondence between all the divided segment numbers and the original data is uniformly recorded and archived to establish a sudden breakpoint segment index set.
7. The water level data acquisition and processing system based on the Internet of Things according to claim 1 is characterized in that: The system further comprises: The instruction linkage module is based on all the structural positions in the sudden breakpoint segment index set, combined with the task cache table in the water level acquisition node controller, and injects the sampling interval and data read and write status identifier according to the structure number corresponding to each segment to generate the Internet of Things water level acquisition and processing mapping table; The Internet of Things water level collection and processing mapping table includes task number mapping results, read and write status control records, and sampling frequency injection information.
8. The water level data acquisition and processing system based on the Internet of Things according to claim 7 is characterized in that: The instruction linkage module includes: The structure number extraction submodule sequentially reads the start and end positions of each breakpoint segment based on all structure positions in the sudden breakpoint segment index set, extracts the corresponding structure number set, and sorts the structure numbers according to the order of appearance in the sampling sequence, merges and marks the continuous number sequences, and generates a segment structure number list; The task parameter binding submodule connects to the task cache table of the water level acquisition node controller according to each number segment sequence in the segment structure number list, identifies the task record position corresponding to each structure number in the cache table, extracts the sampling interval, data writing status and communication response status for comparison, performs field binding operations on task items that are missing or to be updated, sets the update strategy according to the segment attribute information corresponding to the structure number, and generates a control task injection parameter set; The information mapping generation submodule establishes a task field mapping dictionary based on each structure number and corresponding parameter information recorded in the control task injection parameter set, with the structure number as the primary key, aggregates the sampling interval identifier, data reading and writing status, and communication response status, and establishes an index sequence table to obtain the Internet of Things water level collection and processing mapping table.
Citation Information
Patent Citations
Water conservancy project flow dividing type flood control prediction system and method
CN120260223A
Multifunctional metering detection system
CN120277595A
Water consumption monitoring system based on cloud platform
CN120343070A
Method and system for early prediction and warning of mine disasters through on-site monitoring
JP7617680B1
System for predicting abnormal signs of a surveillance target using a sensor module and a transmission / reception method including an IoT laser water level meter
KR102825597B1
Cited By
Multi-modal AI model attack behavior detection and blocking system
CN120979775A
Data storage and acquisition method and system based on point location identification
CN121560893A
A data storage and acquisition method and system based on point location identification
CN121560893B