Regional water resource supply and demand balance prediction method and system driven by machine learning
By processing data from surface water, groundwater levels, and agricultural irrigation metering equipment, a standardized supply and demand data sequence is generated. The characteristics of water supply and use changes are extracted, and combined with regional water supply ceilings and water use control standards, machine learning training data is constructed. This solves the problems of real-time changes and critical state identification in water resource supply and demand forecasting in existing technologies, and improves forecast accuracy and response capability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GANSU PROVINCIAL GEOLOGICAL ENVIRONMENT MONITORING INST (GANSU PROVINCIAL INST OF GEOLOGICAL ENVIRONMENT GANSU PROVINCIAL DEPT OF NATURAL RESOURCES GEOLOGICAL DISASTER PREVENTION & CONTROL TECH GUIDANCE CENT)
- Filing Date
- 2026-01-14
- Publication Date
- 2026-04-24
AI Technical Summary
Existing water resource supply and demand forecasting technologies struggle to capture real-time changes in regional supply and demand relationships, fail to accurately respond to short-term supply and demand fluctuations, lack the ability to identify critical states, and have insufficient efficiency and adaptability in modeling input representation.
By collecting continuous observation data from surface water, groundwater levels, and agricultural irrigation metering equipment, the data format is standardized, time is aligned, and missing values are processed to generate a standardized supply and demand data sequence. The characteristics of water supply and water use changes are extracted, a driving type label sequence is established, and a supply and demand constraint state label sequence is generated by combining the regional water supply ceiling and water use control standards. The data structure required for machine learning training is constructed.
It enhanced the consistency of data fusion, improved the completeness of supply and demand information expression, strengthened the ability to identify the dynamic structure of supply and demand, improved the ability to judge risk thresholds, and improved the prediction accuracy and response capability of regional water resource supply and demand relationship.
Smart Images

Figure CN121920673A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of geological exploration technology, and in particular to a machine learning-driven method and system for predicting regional water resource supply and demand balance. Background Technology
[0002] The field of water resource supply and demand forecasting technology involves the analysis, assessment, and trend judgment of the available water resources and water demand within a region. Its core aspects include basic water resource data collection, hydrological and meteorological element processing, water use structure statistics, and supply and demand relationship modeling. This technical field constructs mathematical relationship models to correlate historical hydrological data, precipitation, runoff, water intake, and socio-economic statistical data, forming a methodological system for predicting and judging the regional water resource supply and demand status. Traditional water resource supply and demand balance forecasting refers to the technical topic of extrapolating the future water resource supply and demand relationship within a certain region based on existing hydrological and water use statistics. Its focus is on how to predict the regional water resource supply and demand relationship under the combined influence of multiple factors. Traditional schemes, based on the principle of water balance, employ linear regression analysis, time series extrapolation, empirical statistical formulas, and historical year comparisons to calculate and combine specific indicators such as precipitation, surface water resources, groundwater resources, agricultural water use, industrial water use, and domestic water use, thereby completing the technical processing process for regional water resource supply and demand balance forecasting.
[0003] Existing technologies primarily rely on traditional hydrological and water use statistics. Limited by the static and intermittent nature of data collection, they struggle to capture real-time changes in regional supply and demand, leading to predictive models lagging behind actual conditions and failing to accurately respond to short-term supply and demand fluctuations. In terms of processing methods, linear regression, time series extrapolation, and empirical formulas are commonly used for trend extrapolation, failing to fully consider the dynamic and dominant changes in supply and demand, and neglecting the switching characteristics of driving factors under multi-factor interactions, resulting in biased trend identification. Regarding boundary identification, existing schemes rarely incorporate mechanisms for judging actual water availability and controlled water use standards, lacking the ability to identify critical states and easily overlooking potential risk accumulation. Furthermore, feature expression primarily relies on static indicator combinations, failing to adjust features for specific supply and demand scenarios, reducing the efficiency and adaptability of modeling inputs. For example, in some seasonally arid regions, failure to accurately capture the contradiction between changes in the dominant water supply structure and actual water demand may lead to significant deviations between predicted results and reality, affecting the scientific nature of water resource allocation and policy formulation. These shortcomings limit the application and expansion of existing technologies in complex supply and demand contexts, necessitating systemic optimization of data processing logic and predictive mechanisms. Summary of the Invention
[0004] To address the technical problems existing in the prior art, embodiments of the present invention provide a machine learning-driven method for predicting regional water resource supply and demand balance, comprising the following steps: S1: Collect continuous observation data from surface water monitoring, groundwater level sensing, and agricultural irrigation metering equipment; complete data format unification, time alignment, and missing value processing; and generate standardized supply and demand data sequences using a preset normalization algorithm. S2: Based on the standardized supply and demand data sequence, extract the water supply and water use change characteristics of each period, compare the change magnitude and direction of the two, determine the change driving direction based on the consistency of the magnitude difference and direction, establish a driving type label sequence, and generate a supply and demand trend dominant identifier sequence. S3: Based on the supply and demand trend dominant identifier sequence and the total amount information in the standardized supply and demand data, combined with the regional water supply ceiling and water use control standards, determine whether the cycle has reached the boundary conditions and generate a supply and demand constraint status label sequence; S4: Combining the supply and demand trend dominant identifier sequence and the supply and demand constraint state label sequence, adjust the weights of water supply and water use features in the feature vector, construct the feature expression structure required for modeling input, and generate a weighted supply and demand feature set; S5: Using the weighted supply and demand feature set and the supply and demand constraint state label sequence, the periodic feature content is combined and organized to construct a data structure that meets the requirements of machine learning training, and a set of predictive modeling sample structures is generated.
[0005] As a further aspect of the present invention, the standardized supply and demand data sequence includes a surface water supply sequence, a groundwater level change sequence, and an agricultural irrigation water consumption sequence; the supply and demand trend dominant identifier sequence includes a water supply dominant identifier, a water consumption dominant identifier, and a supply and demand equilibrium identifier; the supply and demand constraint state label sequence includes an oversupply state label, an overdemand state label, and a balance state label; the weighted supply and demand feature set includes weighted water supply features, weighted water consumption features, and dynamic weight parameters; and the prediction modeling sample structure set includes a training sample structure, a validation sample structure, and a target output label.
[0006] As a further aspect of the present invention, the specific steps of S1 are as follows: S101: Acquire continuous observation data from surface water monitoring stations, groundwater level sensing devices, and agricultural irrigation metering equipment; unify the time field, unit identifier, and parameter name in the data format; remove duplicate records and values exceeding the preset physical range; fill in missing time content; and generate a standardized observation sequence value set. S102: Based on the standardized observation sequence value set, the observation data is synchronized according to the unified time index, the time node offset content is identified, the offset between the timestamp of the observation data and the unified time index is compared with the preset time offset threshold, and the data points with offsets exceeding the time offset threshold are removed to complete the merging operation and generate a time-aligned observation value sequence. S103: Based on the time-aligned observation numerical sequence, extract the maximum and minimum values of the parameters, transform all numerical parameters according to the interval range, adjust the field order to construct a unified structure, and obtain a standardized supply and demand data sequence.
[0007] As a further aspect of the present invention, the specific steps of S2 are as follows: S201: Based on the standardized supply and demand data sequence, obtain the water supply and water consumption records within the time period, divide the continuous time period into segments with a uniform cycle length, calculate the water supply and water consumption change values for each cycle, and organize the change results within the same cycle into corresponding arrays in chronological order to generate a set of water supply and water consumption change feature values. S202: Based on the set of water supply and water use change characteristics, compare the water supply change value and water use change value within the same period, make a judgment based on the difference in change magnitude and the consistency of change direction, record the dominant change source within the period, and convert the judgment result into a numerical code form to obtain a set of change driving direction marker values. S203: Call the set of change-driving direction marker values, arrange all period markers in the order of time periods, determine whether the change-driving direction markers of adjacent time periods are the same, when the marker values of adjacent time periods are the same, merge the corresponding time periods into the same continuous segment, otherwise divide them into different continuous segments, integrate the driving types corresponding to the time periods into a unified sequence structure, and establish a supply and demand trend dominant identifier sequence.
[0008] As a further aspect of the present invention, the specific steps of S3 are as follows: S301: Based on the dominant direction corresponding to the time period in the dominant identifier sequence of supply and demand trends, call the total water supply record and total water consumption record of the same time period in the normalized supply and demand data sequence group, associate the dominant direction with the total data according to the time index, calculate the change value of total supply and demand in the time period and organize it into a sequential structure together with the dominant direction to generate a set of periodic supply and demand total correlation values. S302: Based on the aforementioned periodic supply and demand total correlation value set, obtain the regional water supply upper limit value and the permitted water use control standard value, compare the total water supply of the time period with the water supply upper limit, and compare the total water use with the permitted water use control standard, determine whether the time period has reached the boundary condition based on the comparison result, and convert the judgment result into a numerical label to obtain the supply and demand boundary judgment value set. S303: Based on the supply and demand boundary judgment value set, arrange the periodic judgment results in the order of time periods, merge the judgment values of the same type into a unified coding rule to form a continuous time series structure, and establish a supply and demand constraint state label sequence.
[0009] As a further aspect of the present invention, the change value of total supply and demand over a time period is obtained by combining the differences in total water supply records and total water consumption records between adjacent time periods, respectively. This combination employs a linear superposition method using weighted summation based on consistent time indices. The supply and demand boundary determination values used for comparison, namely the upper limit of available water supply in the region and the value of the permitted water use control standard, are both fixed threshold parameters and remain unchanged within the time range corresponding to the entire supply and demand trend dominant identifier sequence. The process of converting the judgment result into a numerical label specifically involves marking the case where the total water supply during the time period exceeds the upper limit of the available water supply in the area as a first preset value, marking the case where the total water consumption exceeds the permitted water consumption control standard value as a second preset value, and marking the case where neither of the two exceeds the corresponding threshold as a third preset value. The process of merging similar judgment values under a unified coding rule specifically involves merging supply and demand boundary judgment values with the same numerical label within a continuous time period and generating a non-overlapping supply and demand constraint state label sequence in chronological order.
[0010] As a further aspect of the present invention, the specific steps of S4 are as follows: S401: Based on the combination information of the supply and demand trend dominant identifier sequence and the supply and demand constraint state label sequence, the identifier values within the time period are correlated to obtain the combination type of dominant direction and constraint state in each cycle, and are arranged into a sequence structure in chronological order to generate a supply and demand joint identifier combination sequence. S402: Based on the supply and demand joint identifier combination sequence, call the water supply change feature value and water consumption change feature value in the normalized supply and demand data sequence, adjust the numerical proportion of different features in the vector according to the combination type, and update the adjustment results periodically to obtain the supply and demand feature vector weight value set; S403: Call the supply and demand feature vector weight value set, reconstruct the vector structure of water supply feature value and water consumption feature value in each time period according to the adjusted weight value, and arrange the reconstructed vectors corresponding to all time periods into a sequence form to generate the weighted supply and demand feature set.
[0011] As a further aspect of the present invention, the specific steps of S5 are as follows: S501: Call the weighted supply and demand feature set and the supply and demand constraint status label sequence, combine each group of supply and demand feature values with the corresponding constraint labels in the order of time periods, organize the combination results into a multi-field structure, and uniformly process the field positions and arrangement rules to generate a periodic feature combination matrix value set. S502: Based on the set of periodic feature combination matrix values, determine whether there are null values, values exceeding the preset physical range, or duplicate records in the fields. Remove the detected invalid items, unify the inconsistent field formats, and merge the order of feature fields in the sample structure to obtain a well-structured sample field sequence. S503: Based on the structured sample field sequence, call the feature combination information under all periods, construct the input field matrix according to the training set input format requirements, and construct the corresponding label fields as the output sequence. Integrate the input and output parts to establish the dataset structure and generate a set of predictive modeling sample structures.
[0012] As a further aspect of the present invention, the process of combining each set of supply and demand feature values with the corresponding constraint labels is specifically defined as follows: each supply and demand feature value in the weighted supply and demand feature set is combined with a single label value in the supply and demand constraint status label sequence according to a preset field order, and the relative positions of the supply and demand feature field and the label field in the multi-field structure remain consistent in each time period. The process of determining whether a field has a null value, a value exceeding the preset physical range, or a duplicate record is specifically limited to identifying records with missing field values or values exceeding the historical value range of the supply and demand feature set after the weight adjustment as invalid items, and retaining one duplicate record with completely identical field content within the same time period. The process of constructing the input field matrix according to the training set input format requirements is specifically defined as follows: arranging the fields other than the label field in the structured sample field sequence in the order of time periods to form a two-dimensional matrix structure, and arranging the label values of the corresponding time periods in the supply and demand constraint state label sequence in the same order to form a single-column output sequence.
[0013] Machine learning-driven regional water resource supply and demand balance prediction systems include: The data standardization module is used to execute S1: acquire continuous observation data from surface water monitoring stations, groundwater level sensing devices and agricultural irrigation metering equipment, complete data format standardization, time alignment and missing data processing, and perform normalization transformation according to standard methods to generate standardized supply and demand data sequences; The trend recognition module is used to execute S2: Based on the standardized supply and demand data sequence, extract the water supply change characteristics and water use change characteristics within the period, compare the relationship between the change amplitude and direction of the two types of characteristics within the same period, determine the change driving direction based on the consistency of the amplitude difference and direction according to the comparison results, and establish a driving type label sequence for all time periods to generate a supply and demand trend dominant identification sequence. The constraint determination module is used to execute S3: based on the dominant direction of the time period in the dominant identifier sequence of supply and demand trends, combined with the total amount information in the standardized supply and demand data sequence group, and compared with the regional water supply upper limit and the permitted water use control standard, determine whether the current cycle has reached the boundary condition, and generate a supply and demand constraint status label sequence; The weight construction module is used to execute S4: based on the combined information of the supply and demand trend dominant identifier sequence and the supply and demand constraint state label sequence, adjust the proportion of water supply change features and water use change features in the feature vector, construct a feature expression structure for modeling input, and generate a weighted supply and demand feature set; The sample composition module is used to execute S5: call the weighted supply and demand feature set and the supply and demand constraint state label sequence, combine and arrange the periodic feature content, and organize it into a data structure that meets the requirements of machine learning training, and generate a set of predictive modeling sample structures.
[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by uniformly processing and normalizing multi-source monitoring data, the consistency of data fusion is enhanced, the completeness of supply and demand information is improved, the dominant trend identifier is extracted by the relationship between the magnitude and direction of supply and demand changes, the ability to identify the dynamic structure of supply and demand is strengthened, and boundary state labels are generated by combining regional water resource ceilings and water use control standards, the ability to judge risk thresholds is improved, a data structure adapted to machine learning is formed, the prediction accuracy and response capability of regional water resource supply and demand relationship are improved, and dynamic regulation and management are supported. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 This is a detailed schematic diagram of S1 of the present invention; Figure 3 This is a detailed schematic diagram of S2 of the present invention; Figure 4 This is a detailed schematic diagram of S3 of the present invention; Figure 5 This is a detailed schematic diagram of S4 of the present invention; Figure 6 This is a detailed schematic diagram of S5 of the present invention; Figure 7 This is a system module diagram of the present invention. Detailed Implementation
[0017] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0018] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0019] Please see Figure 1 This invention provides a machine learning-driven method for predicting regional water resource supply and demand balance, comprising the following steps: S1: Acquire continuous observation data from surface water monitoring stations, groundwater level sensing devices, and agricultural irrigation metering equipment; complete data format unification, time alignment, and missing data processing; and perform normalization transformation according to standard methods to generate standardized supply and demand data sequences. S2: Based on the standardized supply and demand data sequence, extract the water supply change characteristics and water use change characteristics within the cycle, compare the relationship between the change magnitude and direction of the two types of characteristics within the same cycle, determine the change driving direction based on the consistency of the magnitude difference and direction according to the comparison results, and establish a driving type label sequence for all time periods to generate a supply and demand trend dominant identifier sequence. S3: Based on the dominant direction of the time period in the supply and demand trend dominant identifier sequence, combined with the total amount information in the standardized supply and demand data sequence group, and by comparing the regional water supply upper limit and the permitted water use control standard, determine whether the current cycle has reached the boundary condition and generate a supply and demand constraint status label sequence. S4: Based on the combined information of the supply and demand trend dominant identifier sequence and the supply and demand constraint state label sequence, adjust the proportion of water supply change features and water use change features in the feature vector, construct the feature expression structure for modeling input, and generate a weighted supply and demand feature set; S5: Call the weighted supply and demand feature set and the supply and demand constraint state label sequence, combine and arrange the periodic feature content, and organize it into a data structure that meets the requirements of machine learning training, generating a set of predictive modeling sample structures.
[0020] The standardized supply and demand data sequence includes surface water supply sequence, groundwater level change sequence, and agricultural irrigation water consumption sequence. The dominant supply and demand trend indicator sequence includes water supply dominant indicator, water consumption dominant indicator, and supply and demand equilibrium indicator. The supply and demand constraint state label sequence includes oversupply state label, overdemand state label, and equilibrium state label. The weighted supply and demand feature set includes weighted water supply feature, weighted water consumption feature, and dynamic weight parameters. The predictive modeling sample structure set includes training sample structure, validation sample structure, and target output label.
[0021] Table 1. Original Sample of Observation Data
[0022] As shown in Table 1, the sample covers the same continuous time record of surface water, groundwater and irrigation metering. The calculation examples of each subsequent segment are extended based on this sample, involving operations such as time field unification, missing data completion, alignment and merging, change value calculation and boundary determination. Table 2 Threshold Boundary Weight Setting and Validation Data Table
[0023] Table 2 lists example values for thresholds, boundaries, and weights, along with their validation data based on trial operation statistics. Subsequent paragraphs will directly use these example values during text processing and compare the results with the boundaries or intervals to form corresponding serialization results. Table 3 Comparison Results of Prediction Experiments
[0024] Table 3 presents the experimental results of the control group and the implementation group. Compared with the control group, the implementation group improved the edge detection accuracy by 6.2% and reduced the average absolute error by 82 cubic meters per day. This difference is due to the changes in the feature proportion under different dominant directions and constraints and its inclusion in the training input field matrix. Please see Figure 2 The specific steps of S1 are as follows: S101: Acquire continuous observation data from surface water monitoring stations, groundwater level sensing devices, and agricultural irrigation metering equipment; unify the time field, unit identifier, and parameter name in the data format; remove duplicate records and values exceeding the preset physical range; fill in missing time content; and generate a standardized observation sequence value set. By acquiring continuous observation data from surface water monitoring stations, groundwater level sensors, and agricultural irrigation metering equipment, a data extraction operation is first performed. The timestamp, observation value, unit identifier, and parameter name fields are read according to the monitoring point number. The timestamp originates from the equipment's reported messages, with two formats: 2024-01-06 08:05:00 and 2024 / 01 / 06 08:05:00, which are uniformly converted to the same expression of year, month, day, hour, minute, and second. Then, a unified replacement of the unit identifier is performed, writing the cubic meters per second of surface water flow, the cubic meters per hour of instantaneous irrigation flow, the cubic meters of cumulative irrigation water consumption, and the meters of groundwater level depth into the unit field. Parameter names are synonymized and merged, mapping the names of flow, water level, depth, and cumulative amount to a single Chinese name according to a preset dictionary. Next, a duplicate record removal operation is performed, using the monitoring point number and timestamp as the key. If multiple records have the same key, the one with a non-empty observation value and the latest reporting time is retained. Values exceeding the preset physical measurement range are removed according to the single-point mutation rate threshold in Table 2. The observed value at a given time point is compared with the previous valid point; if the mutation rate exceeds 3.0, it is marked as abnormal and removed. For example, in Table 1, the instantaneous irrigation flow rate at 08:20:00 is 0 cubic meters per hour, which, compared to 126 cubic meters per hour at 08:15:00, exceeds the mutation rate threshold, resulting in removal and entry into the completion queue. Missing data is filled using a uniform sampling interval of 300 seconds, consistent with the common 5-minute frequency for water level monitoring. A continuous time index is generated for each monitoring point. Missing points are filled using linear interpolation of the nearest valid values. If the missing value is at the beginning or end of the sequence, the nearest valid value is used. After completing the above operations, a standardized observation sequence value set with the same field structure is output. The field order is fixed as timestamp, monitoring point number, parameter name, unit, observed value, and data quality flag.
[0025] S102: Based on the normalized observation sequence value set, the observation data is synchronized according to the unified time index, the time node offset content is identified, the offset between the timestamp of the observation data and the unified time index is compared with the preset time offset threshold, and the data points with offsets exceeding the time offset threshold are removed to complete the merging operation and generate a time-aligned observation value sequence. Synchronization processing is performed based on a standardized observation sequence set. First, a unified time index is determined, constructed with a minimum sampling interval of 300 seconds, covering the start and end times of the current processing window. Then, an alignment mapping operation is performed on each type of observation data, mapping the original timestamp to the nearest unified time node and recording the time difference before and after mapping. The time difference is recorded in seconds in the offset field. The time node offset identification operation performs a threshold comparison on the offset field, with the threshold set to 120 seconds (Table 2). If the offset exceeds 120 seconds, the point is determined to be unable to stably align with other sources within the window and is removed. The merging operation generates merged records row by row according to the unified time index. Each row, under the same timestamp, is filled with surface water flow, surface water level, groundwater depth, instantaneous irrigation flow, and cumulative irrigation water consumption. If a field is missing at a given timestamp and not covered by S101 interpolation, a missing field is marked and the field is not included in the current merge output. To ensure the consistency of the aligned values, a consistency check is further performed on the same parameters from multiple sources within the same timestamp. If surface water flow is input from two different stations in parallel, a weighted summation is first performed according to the station weights to form the regional surface water flow. The station weights are taken as the proportion of the area represented by each station's cross-section and are fixed in the ledger. In the example, cross-section A accounts for 0.55 and cross-section B accounts for 0.45. If cross-section A is 12.6 cubic meters per second and cross-section B is 11.8 cubic meters per second at the same time, the regional surface water flow is calculated as 12.24 cubic meters per second by substituting them into the weighted summation and recorded at that timestamp. After merging line by line, the time-aligned observation value sequence is output. Each record in the sequence includes an alignment offset statistics field, containing the maximum offset in seconds and the number of points to be removed, which serves as input for subsequent quality control.
[0026] S103: Based on the time-aligned observation numerical sequence, extract the maximum and minimum values of the parameters, transform all numerical parameters according to the interval range, adjust the field order to construct a unified structure, and obtain a standardized supply and demand data sequence; The maximum and minimum values of each parameter are extracted based on the time-aligned observation numerical sequence. First, an extreme value scan operation is performed on each numerical field within the current window to obtain the maximum and minimum values of surface water flow, groundwater level depth, and cumulative irrigation water consumption. The interval range conversion operation applies the same rule to all numerical parameters: the current value of a parameter is subtracted from its minimum value, and the result is then compared to the interval length of that parameter. The interval length is obtained by subtracting the maximum and minimum values, resulting in a conversion result from 0 to 1, which is then written back to the conversion field. In the example, taking the surface water flow from Table 1 as an example, the minimum value within the window is 12.4 cubic meters per second, and the maximum value is 13.1 cubic meters per second. The value of 13.0 cubic meters per second at 08:25:00 is substituted into the interval conversion operation, resulting in a converted value of 0.857, which is then written into the surface water flow converted value field. The groundwater level depth is defined by a window minimum of 8.72 meters and a maximum of 8.80 meters. The value of 8.80 meters at 08:15:00 is used in the conversion calculation, resulting in a converted value of 1.000. The field order adjustment operation arranges the converted water supply and water demand fields according to a unified structure. The water supply field is fixed as the converted surface water flow rate and surface water level, while the demand field is fixed as the converted instantaneous irrigation flow rate, cumulative irrigation water consumption, and groundwater level depth. The original value fields are then retained as bypass fields but not included in the subsequent feature calculation main chain; these bypass fields are used for example tracing. A normalized supply and demand data sequence is output. Each record in the sequence carries both the converted field and the original field index number, ensuring a one-to-one correspondence when subsequently looking up the original dimensional data by timestamp.
[0027] Please see Figure 3 The specific steps of S2 are as follows: S201: Based on the standardized supply and demand data sequence, obtain the water supply and water consumption records within a time period, divide the continuous time period into a uniform period length, calculate the water supply change value and water consumption change value for each period, and organize the change results within the same period into a corresponding array in chronological order to generate a set of water supply and water consumption change feature values. Based on standardized supply and demand data sequences, water supply and water consumption records for a given time period are obtained. Water supply records are generated by selecting the original surface water flow value from the water supply side fields and accumulating it over time to calculate the total water supply for the period. Water consumption records are generated by subtracting the original cumulative irrigation water consumption value to obtain the total water consumption for the period. A unified period length is used, with one day as the period length, dividing the continuous time period into natural days, and intraday data points are arranged sequentially at 300-second intervals. For each period, the changes in water supply and water consumption are calculated separately. The change in water supply is obtained by subtracting the total water supply of the current day from the total water supply of the previous day, and the change in water consumption is obtained by subtracting the total water consumption of the current day from the total water consumption of the previous day. The example uses January 6, 2024 as the date. Assuming the total daily water supply on January 5, 2024 was 30,500 cubic meters, the total daily water supply on January 6, 2024, is 31,200 cubic meters per day, calculated by subtracting the flow rate over five minutes each day. Substituting this into the difference calculation yields a change in water supply of 700 cubic meters per day. On the water user side, the total daily water consumption is calculated by the difference in cumulative irrigation water consumption. If the cumulative consumption at 00:00:00 on January 6, 2024 is 120,000 cubic meters, and the cumulative consumption at 24:00:00 is 148,800 cubic meters, then substituting this into the difference calculation yields a total daily water consumption of 28,800 cubic meters per day. Subtracting this from the previous day's 27,500 cubic meters per day gives a change in water consumption of 1,300 cubic meters per day. The results of changes within the same period are organized into corresponding arrays in chronological order. The array elements are the change segments of each sub-time period within that day. For example, by dividing the data into 6-hour segments, we obtain 4 water supply change segments and 4 water consumption change segments, thus generating a set of water supply and water consumption change feature values.
[0028] S202: Based on the set of characteristic values of water supply and water use changes, compare the changes in water supply and water use within the same period, make a judgment based on the difference in the magnitude of the change and the consistency of the direction of change, record the dominant source of change within the period, and convert the judgment result into a numerical code form to obtain a set of change driving direction marker values. Based on the characteristic value set of water supply and water consumption changes, a comparison operation is performed on the water supply change value and water consumption change value within the same period. First, the total change amplitude of the period is calculated for the water supply change array and water consumption change array for each period. The amplitude is obtained by summing the absolute values of the change values of each segment. For consistency of change direction judgment, the signs of the water supply change value and water consumption change value are compared for each segment. If the signs are both positive or both are negative, it is considered consistent; if the signs are opposite, it is considered inconsistent, and the proportion of consistent segments is calculated. Based on the consistency of change amplitude difference and change direction, a judgment is made. First, the water supply amplitude is subtracted from the water consumption amplitude to obtain the amplitude difference. Then, the amplitude difference is compared with a preset benchmark value. The benchmark value is the median of the amplitude difference in the historical window. In the 31-day data of 2025-12, the median is found to be 500 cubic meters per day. In the example, the water supply amplitude is 900 cubic meters per day and the water consumption amplitude is 1600 cubic meters per day. Substituting these values into the amplitude difference calculation, we get 700 cubic meters per day, which is compared with the benchmark value of 500 cubic meters per day. This satisfies the benchmark value. In the directional consistency example, three out of four segments have the same sign, accounting for 75.0%. If the consistency threshold is set to 60.0%, the threshold is met. During the comprehensive judgment, the dominant source of change is recorded as the water-using side. The judgment result is converted into a numerical code, with the coding rule fixed as follows: water supply as dominant is recorded as 1, water use as dominant is recorded as 2, and near-equilibrium on both sides is recorded as 0. The equilibrium condition is that the amplitude difference does not exceed 200 cubic meters per day and the consistency does not exceed 60.0%. This yields a set of change-driving direction marker values, and the amplitude difference, consistency percentage, and coding result are recorded in each period for direct use in subsequent continuity checks.
[0029] S203: Call the change-driven direction marker value set, arrange all period markers in the order of time periods, and judge whether the change-driven direction markers of adjacent time periods are the same. When the marker values of adjacent time periods are the same, merge the corresponding time periods into the same continuous segment; otherwise, divide them into different continuous segments. Integrate the driving types corresponding to the time periods into a unified sequence structure and establish a supply and demand trend dominant identifier sequence. The change-driven direction marker value set is called and arranged in time period order, with the arrangement key taken as the cycle start date and sorted in ascending order. A continuity check is performed on adjacent time period markers. The continuity check compares the codes of two adjacent cycles; if the codes are the same, the continuity counter is incremented by 1; if the codes are different, the previous continuous segment is encapsulated and the counter is reset. The encapsulation operation writes the start and end dates, continuous length, and segment code of the continuous segment into the segment table. To avoid frequent segment switching due to single-day noise, isolated segments of length 1 are smoothed. The smoothing rule is that if the codes before and after an isolated segment are the same and the isolated segment code is 0, then the isolated segment code is replaced with the codes before and after. In the example, 2024-01-04 is coded as 2, 2024-01-05 as 0, and 2024-01-06 as 2. Therefore, 2024-01-05 is replaced and coded as 2. The drive types corresponding to the time periods are integrated into a unified sequence structure. The sequence elements include the cycle date, drive code, continuous segment number, and segment sequence number. To ensure correlation with the standardized supply and demand data sequence, the sequence elements are additionally written with the first and last timestamps within the period. This timestamp range is then used directly for filtering when correlating total data by time index. A dominant supply and demand trend identifier sequence is established, with one dominant identifier record corresponding to each period in the sequence. This record allows for backtracking to the change array formed by S201 and the amplitude difference and consistency ratio formed by S202.
[0030] Please see Figure 4 The specific steps of S3 are as follows: S301: Based on the dominant direction corresponding to the time period in the dominant identifier sequence of supply and demand trends, call the total water supply record and total water consumption record of the same time period in the normalized supply and demand data sequence group, associate the dominant direction with the total data according to the time index, calculate the change value of total supply and demand in the time period and organize it into a sequential structure together with the dominant direction to generate a set of periodic supply and demand total correlation values. Based on the dominant direction corresponding to the time period in the dominant identifier sequence of supply and demand trends, the total water supply and total water consumption records for the same time period within the normalized supply and demand data sequence group are retrieved. The total water supply records are summarized by period as the converted surface water flow value, and the total water consumption records are summarized by period as the difference in cumulative irrigation water consumption. When associated by time index, the start and end timestamps of the period in the dominant identifier record are used as the filtering condition, and all five-minute points within that range are included in the summary. The operation to calculate the change in total supply and demand over a time period is to subtract the total water supply of the period from the total water supply of the previous period to obtain the change in total water supply value, and to subtract the total water consumption of the period from the total water consumption of the previous period to obtain the change in total water consumption value, and then organize both with the dominant direction into a sequential structure. In the example, the dominant direction code for a certain period is 2, the total water supply of the period is 31,200 cubic meters per day, and the previous period was 30,500 cubic meters per day, then substituting into the difference operation, the change in total water supply value is 700 cubic meters per day. The total water consumption for the current cycle is 28,800 cubic meters per day, and the previous cycle was 27,500 cubic meters per day. Substituting these values into the differential calculation, the change in total water consumption is 1,300 cubic meters per day. The dominant direction and the total change value are recorded in the same record, with fixed fields for the cycle date, dominant direction code, total water supply, total water consumption, change in total water supply, and change in total water consumption. A cycle supply and demand total correlation value set is generated, and the record includes the number of summary points and the number of excluded points. The number of excluded points is derived from the alignment and exclusion statistics in S102, used to identify summary deviations caused by missing measurements during subsequent boundary determination.
[0031] S302: Based on the periodic supply and demand total correlation value set, obtain the regional water supply upper limit value and the permitted water use control standard value, compare the total water supply of the time period with the water supply upper limit, and compare the total water use with the permitted water use control standard. Based on the comparison results, determine whether the time period has reached the boundary conditions, and convert the judgment results into numerical labels to obtain the supply and demand boundary judgment value set. Based on the periodic supply and demand total correlation value set, the regional water supply upper limit and the permitted water use control standard value are obtained. In this embodiment, these two values are read and implemented as daily-scale control lines according to management standards. Example values are shown in Table 2. The total water supply for a time period is compared with the water supply upper limit. The comparison logic is that if the total water supply exceeds 32,000 cubic meters per day, the water supply is considered to have reached the upper limit; otherwise, it is considered not to have reached it. The total water consumption is compared with the permitted water use control standard. The comparison logic is that if the total water consumption exceeds 30,000 cubic meters per day, the water consumption is considered to have reached the control standard; otherwise, it is considered not to have reached it. Based on the comparison results, it is determined whether the time period has reached the boundary conditions. The boundary condition combinations are fixed at four categories: water supply and water consumption reached, water supply and water consumption not reached, water supply and water consumption reached, and water supply and water consumption not reached. The judgment results are converted into numerical labels, and the labeling rule is fixed at a decreasing coding order of 3, 2, 1, 0. In the example, the periodic water supply total is 31,200 cubic meters per day, which is less than 32,000 cubic meters per day, so it is determined that the water supply has not reached the limit. The total water consumption for a given period is 31,800 cubic meters per day, which is greater than 30,000 cubic meters per day, thus indicating that water consumption has been reached. The resulting boundary combination is water supply not reached but water consumption reached, marked with a value of 1 and written to the period record. If the total water supply for a given period is 32,700 cubic meters per day and the total water consumption is 30,500 cubic meters per day, the corresponding value is marked with a value of 3. When outputting the supply and demand boundary judgment value set, the difference between the value and the upper limit and the standard are simultaneously written in. The difference is used for the continuity processing of the subsequent constraint state label sequence.
[0032] S303: Based on the supply and demand boundary judgment value set, arrange the periodic judgment results in the order of time periods, merge similar judgment values into a unified coding rule to form a continuous time series structure, and establish a supply and demand constraint state label sequence. Based on the supply and demand boundary judgment value set arranged in time period order, the period judgment results are sorted in ascending order by date to form a continuous time series structure. Similar judgment values are merged under a unified coding rule. The merging operation performs stabilization processing on critical fluctuations. When a period is marked as 2 or 1 and there is an alternation between 0 and 2 or 0 and 1 with adjacent periods, the difference field is checked. If the absolute value of the difference does not exceed 300 cubic meters per day, the period mark is replaced with the majority of adjacent marks. In the example, three consecutive days are marked as 0, 1, and 0, and the differences between the total water consumption and the control standard are -120 cubic meters per day, +80 cubic meters per day, and -150 cubic meters per day, respectively. Therefore, the absolute value of the difference on the middle day is 80 cubic meters per day, which does not exceed 300 cubic meters per day. After replacement, the result is 0, 0, and 0. When forming the continuous time series structure, a constraint status label and a constraint continuous segment number are written for each period, with the segment number increasing according to the mark change point. The label text is not output as natural language in this embodiment; numerical labels are used directly to meet the compact representation requirements when jointly coding with the dominant direction. After establishing the supply and demand constraint status label sequence, align the sequence with the periodic supply and demand total related value set by date key. If a date gap occurs, check back the missing data in S101 to fill the gap. If the gap exceeds 2 days, mark the segment as insufficient data and use the default weight in subsequent weight adjustments. The default weight is shown in Table 2.
[0033] Please see Figure 5 The specific steps of S4 are as follows: S401: Based on the combination information of the dominant indicator sequence of supply and demand trends and the label sequence of supply and demand constraints, the indicator values within the time period are correlated to obtain the combination type of dominant direction and constraint state in each cycle, and are arranged into a sequence structure in chronological order to generate a combined supply and demand indicator sequence. The association process is performed based on the combined information of the supply and demand trend dominant identifier sequence and the supply and demand constraint status label sequence. The association key is the period date, which is matched one by one. After matching, two values are obtained within the same period: the dominant direction code and the constraint status label. When obtaining the combination type of the dominant direction and constraint status in each period, the combination type adopts an ordered pair encoding rule. First, the dominant direction code is multiplied by 10 and then summed with the constraint status label to obtain the combination code. This operation does not output an equation expression, but only describes the operation action. In the example, the dominant direction code is 2 and the constraint status label is 1, so the combination code obtained by substituting into the product and summation operation is 21. If the dominant direction code is 1 and the constraint status label is 3, the combination code is 13. When organizing the data into a sequence structure in chronological order, the period date, combination code, dominant direction code, and constraint status label are written into the sequence elements, along with consecutive segment numbers. These consecutive segment numbers are derived by concatenating the segment numbers from S203 and S303. The concatenation rule is to multiply the dominant segment number by 1000 and then sum it with the constraint segment number to obtain the joint segment number, which is used to identify constraint changes within the same dominant segment or dominant changes within the same constraint segment. After generating the supply and demand joint identifier combination sequence, a consistency check is immediately performed. If the dominant direction in the combination code is 0 and the constraint status is 3, it is recorded as a conflict code, and the total water supply and total water consumption for that period are checked back. If both exceed the boundary, the dominant direction is written back as the water consumption dominant code 2. The write-back is based on the consistency priority of the water consumption boundary and the dominant direction being higher than the balance code.
[0034] S402: Based on the supply and demand joint identifier combination sequence, call the water supply change feature value and water use change feature value in the normalized supply and demand data sequence, adjust the numerical proportion of different features in the vector according to the combination type, and update the adjustment results periodically to obtain the supply and demand feature vector weight value set; Based on the supply and demand joint identifier combination sequence, the water supply change feature value and water consumption change feature value in the normalized supply and demand data sequence are called. The water supply change feature value is taken from the water supply change array statistics of S201, and the water consumption change feature value is taken from the water consumption change array statistics of S201. The statistics include the total change amplitude of the period, the maximum single segment change amplitude, and the proportion of directional consistency. When adjusting the numerical proportion of different features in the vector according to the combination type, the combination code is first mapped to the weighted recombination. The weighted recombination is given by Table 2. The water supply side proportion is 0.60, and the water consumption side proportion is 0.40 for combinations where the dominant direction is water supply and the constraint label is 0. If the dominant direction is water consumption and the constraint label is 1 or 3, then the proportions are swapped to 0.40 for the water supply side and 0.60 for the water consumption side. The adjustment operation multiplies each component of the water supply feature by the water supply side proportion and each component of the water consumption feature by the water consumption side proportion, and then concatenates them into a weighted feature vector within the same period. In the example, the total variation in water supply for a certain period is 900, the maximum segment variation is 420, and the consistency rate is 75.0%. The corresponding values on the water-using side are 1600, 700, and 75.0%, with a combination code of 21. This corresponds to a water supply side value of 0.40 and a water-using side value of 0.60. Substituting the water supply side values of 900, 420, and 75.0% into the product yields 360, 168, and 30.0%, respectively. Substituting the water-using side values of 1600, 700, and 75.0% into the product yields 960, 420, and 45.0%, respectively. These values are then written into the weight set record for that period. When updating and adjusting the results periodically, the number of weight group selections and the combination code distribution count are written into a statistical field for use in subsequent experimental comparisons to explain the coverage ratio of different weight groups.
[0035] S403: Call the weight value set of supply and demand feature vectors, reconstruct the vector structure of water supply feature values and water consumption feature values in each time period according to the adjusted weight values, and arrange the reconstructed vectors corresponding to all time periods into a sequence form to generate the weighted supply and demand feature set; The supply and demand feature vector weight value set is used to reconstruct the vector structure of water supply feature values and water consumption feature values for each time period according to the adjusted weight values. The reconstruction operation first places the three components of the water supply side in a fixed field order, then places the three components of the water consumption side, and finally places the two components of the combined code and joint segment number, forming an 8-dimensional vector structure. The number of dimensions is described in Chinese and not represented by letters in this embodiment. When the reconstructed vectors corresponding to all time periods are arranged in sequence form, the sequence index is taken as the period date, and the sequence value is the vector of that period. To ensure the stability of the fields in the input field matrix for subsequent training, a field alignment check is performed to check whether there are missing components in each vector. If there are missing components, the change array of S201 is checked back. If the array is missing due to a certain type of observation having a missing measurement of more than 20.0% in that period, the missing component is filled with 0 and a missing measurement mark of 1 is written in the quality field. In the example, the missing groundwater level depth in a certain period caused the maximum segment amplitude of the water consumption side to be unable to be calculated, so the component is filled with 0 and the quality field is written with 1. After generating the weighted supply and demand feature set, seven consecutive periods are manually reviewed. The review results are compared with the consistency of the combination code of the sequence record. If they are inconsistent, the process is backtracked to the conflict code handling of S401 and the combination code mapping table is corrected. The correction is based on minimizing the average absolute error of the test samples in Table 3.
[0036] Please see Figure 6 The specific steps of S5 are as follows: S501: Call the weighted supply and demand feature set and the supply and demand constraint status label sequence, combine each group of supply and demand feature values with the corresponding constraint labels in the order of time periods, organize the combination results into a multi-field structure, and uniformly process the field positions and arrangement rules to generate a periodic feature combination matrix value set. After weight adjustment, the supply and demand feature set and the supply and demand constraint status label sequence are combined in time period order. The combination operation extracts the feature vector and constraint label for each period and concatenates them into a multi-field structure. The fixed field order of the multi-field structure is: period date, water supply side weighted component, water use side weighted component, combination code, joint segment number, and constraint label. When unifying the field positions and arrangement rules, numerical fields are uniformly retained to 3 decimal places, and percentage fields are uniformly retained to 1 decimal place and stored in numerical form without the percent sign. When generating the period feature combination matrix value set, all period records are stacked into a matrix structure by date, with matrix rows corresponding to periods and matrix columns corresponding to fields. In the example, the vector components 360, 168, 30.0, 960, 420, 45.0, combination code 21, joint segment number 1005, and constraint label 1 of a certain period of S403 are concatenated to form the matrix row for that period and written into the matrix. Subsequently, a matrix consistency check is performed to check if the number of columns is consistent across all rows. If a row is missing a column, it is considered a structural anomaly and written to the anomaly queue. To meet the input format requirements of the subsequent training set, an additional field dictionary table is generated. The field dictionary table records the correspondence between column numbers and Chinese field names. The column numbers use Arabic numerals, and the field names use only Chinese characters.
[0037] S502: Based on the periodic feature combination matrix value set, determine whether there are null values, values exceeding the preset physical range, or duplicate records in the field. Remove invalid items detected, unify inconsistent field formats, and merge the order of feature fields in the sample structure to obtain a well-structured sample field sequence. Based on the periodic feature combination matrix value set, the system determines whether a field contains null values, values exceeding the preset physical range, or duplicate records. Null value detection scans each column row by row, marking blanks or non-numeric characters as null values. Values exceeding the preset physical range are checked against intervals derived from quantile boundaries calculated in the training window, with the boundaries being the 1st and 99th percentiles; values exceeding these boundaries are marked as abnormal. Duplicate record detection uses the periodic date as the key; if two rows contain the same date, they are considered duplicates, and the row with the better quality field is retained. The rule for determining better quality is that 0 is better than 1 for missing data, and fewer abnormal records are prioritized. When removing invalid entries, if an entire row contains null values that cannot be filled in by a lookup, the row is removed, and the date is recorded in the removal log. To unify inconsistent field formats, all numeric columns are converted to decimal text and then back to numeric values to avoid parsing differences caused by thousands separators. When merging the order of feature fields in the sample structure, they are reordered according to the column numbers in the field dictionary to ensure consistency with the field order in S501. In the example, if the water-side weighted component in a certain row contains the text "960.0 cubic meters per day", the unit character is cleared and converted to the numerical value 960.000. If this value exceeds the 99th percentile boundary of 980.000, it is retained; otherwise, it is marked as an anomaly and added to the elimination candidate. When the output structure is regularized in the sample field sequence, the number of retained rows, the number of eliminated rows, and the number of anomaly corrections are written into the statistics field for verification of the sample size during the subsequent training phase.
[0038] S503: Based on the structurally regular sample field sequence, call the feature combination information under all periods, construct the input field matrix according to the training set input format requirements, and construct the corresponding label field as the output sequence. Integrate the input and output parts to establish the dataset structure and generate a set of predictive modeling sample structures. The predictive modeling sample structure set is constructed based on the structurally regular sample field sequence. When constructing the input field matrix, the weighted components of the water supply side and the weighted components of the water use side, as well as the combined code and joint segment number, are selected from each row as input fields. The periodic date column is removed but retained as an index column. When constructing the output sequence, constraint labels are selected from each row as output fields and arranged in chronological order to form a sequence. When integrating the input and output parts to establish the dataset structure, the numerical consistency check of the input field matrix is first performed on each column. This check is based on the statistical distribution range of the weighted supply and demand feature set in historical periodic samples. That is, for each input feature column, its maximum and minimum values in the historical period are counted as the effective value boundary of the feature at the periodic scale. When it is detected that the feature value corresponding to a certain period exceeds its corresponding statistical boundary, the source component of the feature value is checked back and boundary pruning is performed to limit it to the effective value boundary range, so as to avoid abnormal fluctuations from interfering with model training. The numerical check and pruning process is only performed on the supply and demand change features and their weighting results obtained based on periodic statistics, and does not involve the interval transformation boundary determined based on the original observation data. Subsequently, the samples were divided into training and testing segments according to the training set input format requirements, with segmentation ratios of 75.0% and 25.0%, respectively, while maintaining the chronological order of the samples. The number of training sample periods (288) and the number of testing sample periods (96) were recorded in the dataset metadata. During the training phase, error statistics were performed on the model's predicted output and the actual supply and demand constraint labels. The error statistics used the mean absolute error (MAE) index, expressed in cubic meters per day. The MAE for the implementation group was 328 cubic meters per day, a decrease of 82 cubic meters per day compared to the control group's 410 cubic meters per day. Simultaneously, the consistency between the edge detection results and the actual constraint labels was compared. The accuracy rate for the implementation group was 90.6%, while that for the control group was 84.4%, representing an improvement of 6.2%. These evaluation results were recorded in the evaluation field of the sample structure set.
[0039] Please see Figure 7 Machine learning-driven regional water resource supply and demand balance prediction systems include: The data standardization module is used to execute S1: acquire continuous observation data from surface water monitoring stations, groundwater level sensing devices and agricultural irrigation metering equipment, complete data format standardization, time alignment and missing data processing, and perform normalization transformation according to standard methods to generate standardized supply and demand data sequences; The trend recognition module is used to execute S2: Based on the normalized supply and demand data sequence, extract the water supply change characteristics and water use change characteristics within the cycle, compare the relationship between the change magnitude and direction of the two types of characteristics within the same cycle, determine the change driving direction based on the consistency of the magnitude difference and direction according to the comparison results, and establish a driving type label sequence for all time periods to generate a supply and demand trend dominant identification sequence. The constraint determination module is used to execute S3: based on the dominant direction of the time period in the dominant identifier sequence of supply and demand trends, combined with the total amount information in the standardized supply and demand data sequence group, and compared with the regional water supply upper limit and the permitted water use control standard, it determines whether the current cycle has reached the boundary conditions and generates a supply and demand constraint status label sequence; The weight construction module is used to execute S4: based on the combined information of the supply and demand trend dominant identifier sequence and the supply and demand constraint state label sequence, adjust the proportion of water supply change features and water use change features in the feature vector, construct the feature expression structure for modeling input, and generate the weighted supply and demand feature set; The sample composition module is used to execute S5: call the weighted supply and demand feature set and the supply and demand constraint state label sequence, combine and arrange the periodic feature content, and organize it into a data structure that meets the requirements of machine learning training, generating a set of predictive modeling sample structures.
[0040] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A machine learning-driven method for predicting regional water resource supply and demand balance, characterized in that, Includes the following steps: S1: Collect continuous observation data from surface water monitoring, groundwater level sensing, and agricultural irrigation metering equipment; complete data format unification, time alignment, and missing value processing; and generate standardized supply and demand data sequences using a preset normalization algorithm. S2: Based on the standardized supply and demand data sequence, extract the water supply and water use change characteristics of each period, compare the change magnitude and direction of the two, determine the change driving direction based on the consistency of the magnitude difference and direction, establish a driving type label sequence, and generate a supply and demand trend dominant identifier sequence. S3: Based on the supply and demand trend dominant identifier sequence and the total amount information in the standardized supply and demand data, combined with the regional water supply ceiling and water use control standards, determine whether the cycle has reached the boundary conditions and generate a supply and demand constraint status label sequence; S4: Combining the supply and demand trend dominant identifier sequence and the supply and demand constraint state label sequence, adjust the weights of water supply and water use features in the feature vector, construct the feature expression structure required for modeling input, and generate a weighted supply and demand feature set; S5: Using the weighted supply and demand feature set and the supply and demand constraint state label sequence, the periodic feature content is combined and organized to construct a data structure that meets the requirements of machine learning training, and a set of predictive modeling sample structures is generated.
2. The machine learning-driven regional water resource supply and demand balance prediction method according to claim 1, characterized in that, The standardized supply and demand data sequence includes surface water supply sequence, groundwater level change sequence, and agricultural irrigation water consumption sequence. The supply and demand trend dominant identifier sequence includes water supply dominant identifier, water consumption dominant identifier, and supply and demand equilibrium identifier. The supply and demand constraint state label sequence includes oversupply state label, overdemand state label, and equilibrium state label. The weighted supply and demand feature set includes weighted water supply features, weighted water consumption features, and dynamic weight parameters. The prediction modeling sample structure set includes training sample structure, validation sample structure, and target output label.
3. The machine learning-driven regional water resource supply and demand balance prediction method according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Acquire continuous observation data from surface water monitoring stations, groundwater level sensing devices, and agricultural irrigation metering equipment; unify the time field, unit identifier, and parameter name in the data format; remove duplicate records and values exceeding the preset physical range; fill in missing time content; and generate a standardized observation sequence value set. S102: Based on the standardized observation sequence value set, the observation data is synchronized according to the unified time index, the time node offset content is identified, the offset between the timestamp of the observation data and the unified time index is compared with the preset time offset threshold, and the data points with offsets exceeding the time offset threshold are removed to complete the merging operation and generate a time-aligned observation value sequence. S103: Based on the time-aligned observation numerical sequence, extract the maximum and minimum values of the parameters, transform all numerical parameters according to the interval range, adjust the field order to construct a unified structure, and obtain a standardized supply and demand data sequence.
4. The machine learning-driven regional water resource supply and demand balance prediction method according to claim 3, characterized in that, The specific steps of S2 are as follows: S201: Based on the standardized supply and demand data sequence, obtain the water supply and water consumption records within the time period, divide the continuous time period into segments with a uniform cycle length, calculate the water supply and water consumption change values for each cycle, and organize the change results within the same cycle into corresponding arrays in chronological order to generate a set of water supply and water consumption change feature values. S202: Based on the set of water supply and water use change characteristics, compare the water supply change value and water use change value within the same period, make a judgment based on the difference in change magnitude and the consistency of change direction, record the dominant change source within the period, and convert the judgment result into a numerical code form to obtain a set of change driving direction marker values. S203: Call the set of change-driving direction marker values, arrange all period markers in the order of time periods, determine whether the change-driving direction markers of adjacent time periods are the same, when the marker values of adjacent time periods are the same, merge the corresponding time periods into the same continuous segment, otherwise divide them into different continuous segments, integrate the driving types corresponding to the time periods into a unified sequence structure, and establish a supply and demand trend dominant identifier sequence.
5. The machine learning-driven regional water resource supply and demand balance prediction method according to claim 4, characterized in that, The specific steps for S3 are as follows: S301: Based on the dominant direction corresponding to the time period in the dominant identifier sequence of supply and demand trends, call the total water supply record and total water consumption record of the same time period in the normalized supply and demand data sequence group, associate the dominant direction with the total data according to the time index, calculate the change value of total supply and demand in the time period and organize it into a sequential structure together with the dominant direction to generate a set of periodic supply and demand total correlation values. S302: Based on the aforementioned periodic supply and demand total correlation value set, obtain the regional water supply upper limit value and the permitted water use control standard value, compare the total water supply of the time period with the water supply upper limit, and compare the total water use with the permitted water use control standard, determine whether the time period has reached the boundary condition based on the comparison result, and convert the judgment result into a numerical label to obtain the supply and demand boundary judgment value set. S303: Based on the supply and demand boundary judgment value set, arrange the periodic judgment results in the order of time periods, merge the judgment values of the same type into a unified coding rule to form a continuous time series structure, and establish a supply and demand constraint state label sequence.
6. The machine learning-driven regional water resource supply and demand balance prediction method according to claim 5, characterized in that, The change in total supply and demand over the specified time period is obtained by combining the differences in total water supply and total water consumption recorded between adjacent time periods. This combination employs a linear superposition method using a weighted summation based on consistent time indices. The supply and demand boundary determination values used for comparison, namely the upper limit of available water supply in the region and the value of the permitted water use control standard, are both fixed threshold parameters and remain unchanged within the time range corresponding to the entire supply and demand trend dominant identifier sequence. The process of converting the judgment result into a numerical label specifically involves marking the case where the total water supply during the time period exceeds the upper limit of the available water supply in the area as a first preset value, marking the case where the total water consumption exceeds the permitted water consumption control standard value as a second preset value, and marking the case where neither of the two exceeds the corresponding threshold as a third preset value. The process of merging similar judgment values under a unified coding rule specifically involves merging supply and demand boundary judgment values with the same numerical label within a continuous time period and generating a non-overlapping supply and demand constraint state label sequence in chronological order.
7. The machine learning-driven regional water resource supply and demand balance prediction method according to claim 5, characterized in that, The specific steps of S4 are as follows: S401: Based on the combination information of the supply and demand trend dominant identifier sequence and the supply and demand constraint state label sequence, the identifier values within the time period are correlated to obtain the combination type of dominant direction and constraint state in each cycle, and are arranged into a sequence structure in chronological order to generate a supply and demand joint identifier combination sequence. S402: Based on the supply and demand joint identifier combination sequence, call the water supply change feature value and water use change feature value in the standardized supply and demand data sequence, adjust the numerical proportion of different features in the vector according to the combination type by weighted multiplication, that is, multiply each feature value by the corresponding weight parameter, and update the adjustment result periodically to obtain the supply and demand feature vector weight value set; S403: Call the supply and demand feature vector weight value set, reconstruct the vector structure of water supply feature value and water consumption feature value in each time period according to the adjusted weight value, and arrange the reconstructed vectors corresponding to all time periods into a sequence form to generate the weighted supply and demand feature set.
8. The machine learning-driven regional water resource supply and demand balance prediction method according to claim 7, characterized in that, The specific steps of S5 are as follows: S501: Call the weighted supply and demand feature set and the supply and demand constraint status label sequence, combine each group of supply and demand feature values with the corresponding constraint labels in the order of time periods, organize the combination results into a multi-field structure, and uniformly process the field positions and arrangement rules to generate a periodic feature combination matrix value set. S502: Based on the set of periodic feature combination matrix values, determine whether there are null values, values exceeding the preset physical range, or duplicate records in the fields. Remove the detected invalid items, unify the inconsistent field formats, and merge the order of feature fields in the sample structure to obtain a well-structured sample field sequence. S503: Based on the structured sample field sequence, call the feature combination information under all periods, construct the input field matrix according to the training set input format requirements, and construct the corresponding label fields as the output sequence. Integrate the input and output parts to establish the dataset structure and generate a set of predictive modeling sample structures.
9. The machine learning-driven regional water resource supply and demand balance prediction method according to claim 8, characterized in that, The process of combining each set of supply and demand feature values with the corresponding constraint labels is specifically defined as follows: each supply and demand feature value in the weighted supply and demand feature set is combined with a single label value in the supply and demand constraint status label sequence according to a preset field order, and the relative positions of the supply and demand feature field and the label field in the multi-field structure remain consistent in each time period. The process of determining whether a field has a null value, a value exceeding the preset physical range, or a duplicate record is specifically limited to identifying records with missing field values or values exceeding the historical value range of the supply and demand feature set after the weight adjustment as invalid items, and retaining one duplicate record with completely identical field content within the same time period. The process of constructing the input field matrix according to the training set input format requirements is specifically defined as follows: arranging the fields other than the label field in the structured sample field sequence in the order of time periods to form a two-dimensional matrix structure, and arranging the label values of the corresponding time periods in the supply and demand constraint state label sequence in the same order to form a single-column output sequence.
10. A machine learning-driven regional water resource supply and demand balance prediction system, characterized in that, The system is used to implement the machine learning-driven regional water resource supply and demand balance prediction method according to any one of claims 1-9, and the system includes: The data standardization module is used to execute S1: acquire continuous observation data from surface water monitoring stations, groundwater level sensing devices and agricultural irrigation metering equipment, complete data format standardization, time alignment and missing data processing, and perform normalization transformation according to standard methods to generate standardized supply and demand data sequences; The trend recognition module is used to execute S2: Based on the standardized supply and demand data sequence, extract the water supply change characteristics and water use change characteristics within the period, compare the relationship between the change amplitude and direction of the two types of characteristics within the same period, determine the change driving direction based on the consistency of the amplitude difference and direction according to the comparison results, and establish a driving type label sequence for all time periods to generate a supply and demand trend dominant identification sequence. The constraint determination module is used to execute S3: based on the dominant direction of the time period in the dominant identifier sequence of supply and demand trends, combined with the total amount information in the standardized supply and demand data sequence group, and compared with the regional water supply upper limit and the permitted water use control standard, determine whether the current cycle has reached the boundary condition, and generate a supply and demand constraint status label sequence; The weight construction module is used to execute S4: based on the combined information of the supply and demand trend dominant identifier sequence and the supply and demand constraint state label sequence, adjust the proportion of water supply change features and water use change features in the feature vector, construct a feature expression structure for modeling input, and generate a weighted supply and demand feature set; The sample composition module is used to execute S5: call the weighted supply and demand feature set and the supply and demand constraint state label sequence, combine and arrange the periodic feature content, and organize it into a data structure that meets the requirements of machine learning training, and generate a set of predictive modeling sample structures.