A rural decentralized wastewater treatment method and system

CN122608207APending Publication Date: 2026-08-21WEIFANG CHENMING ENVIRONMENTAL PROTECTION EQUIPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611017418.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-09
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

这种固定阈值方式难以兼容光伏功率随气象条件快速波动、储能容量限制和负荷需求时变的复杂工况

Benefits of technology

[0018]This method generates an energy-load state tensor by folding multidimensional energy time series data into a state tensor, and then calculates the dynamic trigger threshold using an elastic tolerance boundary model. It extracts sub-tensors with fixed time windows from historical photovoltaic power generation, energy storage state of charge, and grid connection status time series data. These are then segmented along the time dimension to obtain multiple time slice matrices, and their modulus sequences are calculated. An intermediate state matrix is ​​generated by the outer product of the modulus sequences and the time dimension index, and then folded with the spatial dimension tensor to obtain the energy-load state tensor. The energy-load state tensor is projected along two dimensions to form energy supply trend vectors and load demand trend vectors, and the dynamic time curvature distance between them is calculated. After nonlinear mapping and inverse normalization, the dynamic trigger threshold is obtained. Compared to a fixed threshold, this threshold changes in real time with the morphological differences between the energy supply trend and the load demand trend. It provides early warning boundaries when photovoltaic power slowly declines and avoids false triggering under instantaneous fluctuations caused by short-term cloud cover, ensuring that the triggering timing is consistent with actual energy supply capacity changes, reducing unnecessary equipment start-up and shutdown switching, and maintaining the continuity of the processing flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122608207A_ABST
    Figure CN122608207A_ABST
Patent Text Reader

Abstract

The application discloses a kind of rural decentralized sewage treatment method and system, belong to sewage treatment technical field.The method includes: obtaining photovoltaic power generation power, energy storage state of charge and the time series of power supply access state, constructs multidimensional energy time series data;State tensor folding is carried out to multidimensional energy time series data, and energy-load state tensor is generated;Energy-load state tensor is input into elastic tolerance boundary model, and dynamic trigger threshold is calculated;When real-time energy supply parameter is lower than dynamic trigger threshold, activate task time slice generator;Task time slice generator generates a plurality of discrete sewage treatment task execution time slices according to the modular multiplication decomposition result of energy-load state tensor;According to the start-stop sequence of aeration equipment, booster pump and reflux pump, execution time slice is dynamically arranged.The application realizes the adaptive operation scheduling of rural decentralized sewage treatment system under fluctuating energy supply.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wastewater treatment technology, specifically to a decentralized wastewater treatment method and system for rural areas. Background Technology

[0002] Rural decentralized wastewater treatment plants are often equipped with a power supply structure that complements photovoltaic power generation, energy storage batteries, and grid power to address the problem of weak power grids in remote areas. The operation scheduling of major power-consuming loads such as aeration equipment, booster pumps, and return pumps in these plants requires decisions based on the real-time status of energy supply. Existing operation scheduling methods mostly adopt preset schedules or start-stop control based on a single power threshold, such as setting a time limit to suspend some equipment when the energy storage charge level falls below a certain fixed percentage. This fixed threshold method is difficult to accommodate the complex operating conditions of rapid fluctuations in photovoltaic power due to weather conditions, limitations in energy storage capacity, and time-varying load demand.

[0003] Fixed threshold scheduling strategies often lead to frequent equipment start-ups and shutdowns or interruptions in critical processing stages when photovoltaic output drops sharply or load surges, affecting the stability of effluent water quality and equipment lifespan. Some methods incorporate power prediction, but their threshold adjustments rely on offline optimization or simple rules, lacking real-time awareness of the dynamic matching relationship between energy supply and load demand trends. Furthermore, during periods of limited energy supply, how to segment and schedule intermittent operating segments while ensuring basic processing requirements is a problem that existing time-slicing methods have failed to effectively address. Conventional equal-length time-slice allocation or simple triggers based on pool level do not consider the pattern information implicit in the multidimensional energy state tensor, resulting in a disconnect between task allocation and actual energy supply elasticity, leading to energy waste or insufficient processing capacity.

[0004] The problem this invention aims to solve is how to extract dynamic trigger thresholds in real time from multi-dimensional energy time-series data in a scenario where photovoltaic, energy storage and grid power complement each other, so as to accurately identify the state of energy supply tension and activate the intermittent operation mode, and on this basis, how to generate suitable discrete task execution time slices according to the structural characteristics of the energy-load state tensor, so as to deeply couple the equipment start-up and shutdown sequence with the fluctuating energy supply. Summary of the Invention

[0005] This invention provides a method and system for decentralized rural sewage treatment, aiming to achieve real-time perception of the elastic boundary of energy supply based on multi-dimensional energy time-series data, and generate dynamic task time slices accordingly to arrange the start-up and shutdown sequence of power-consuming equipment, so that the decentralized rural sewage treatment station can operate stably and adaptively under the condition of mixed power supply of photovoltaic, energy storage and grid power.

[0006] The objective of this invention can be achieved through the following technical solutions:

[0007] This invention discloses a decentralized rural sewage treatment method, comprising: acquiring the time series of photovoltaic power generation, energy storage state of charge, and grid connection status of the sewage treatment station to construct multidimensional energy time series data; performing state tensor folding on the multidimensional energy time series data to generate the energy-load state tensor at the current moment; inputting the energy-load state tensor into a pre-constructed elastic tolerance boundary model to calculate the dynamic trigger threshold under the current energy supply state; when the real-time energy supply parameter is detected to be lower than the dynamic trigger threshold, activating a task time slice generator, which generates multiple discrete sewage treatment task execution time slices based on the modular multiplication decomposition result of the energy-load state tensor; and dynamically arranging the start-stop sequence of aeration equipment, booster pumps, and return pumps in the sewage treatment station according to the multiple discrete sewage treatment task execution time slices. By folding multi-source data from photovoltaics, energy storage, and grid power into an energy-load state tensor and dynamically generating trigger thresholds using an elastic tolerance boundary model, the start-up and shutdown scheduling of wastewater treatment tasks can adapt to the volatility of renewable energy in real time, avoiding the forced activation of high-energy-consuming equipment during periods of tight energy supply, thus ensuring the stability and safety of system operation.

[0008] As a technical solution of this invention, when constructing multidimensional energy time series data, photovoltaic power generation values ​​recorded at fixed sampling intervals within the past natural day are collected to form a photovoltaic power generation time series. Simultaneously, the remaining battery charge percentage and mains power supply interface on / off status flags recorded at the same fixed sampling interval within the same time period are collected to form energy storage charge state time series and mains power access state time series, respectively. These three types of time series are aligned by time index and stacked in the time dimension to generate a three-dimensional tensor data structure. This data construction method ensures the synchronous alignment of heterogeneous energy information in both time and feature dimensions, providing an accurate and compact data foundation for subsequent state tensor folding and model inference.

[0009] In the processing of state tensor folding, preferably, a sub-tensor with a fixed time window length ending at the current time is extracted from the multidimensional energy time series data. This sub-tensor is then divided into multiple time slice matrices along the time dimension. The modulus of each time slice matrix is ​​calculated to obtain a modulus sequence. The modulus sequence is then outer-producted with the time dimension index of the sub-tensor to generate a two-dimensional intermediate state matrix. Finally, this intermediate state matrix is ​​tensor-folded with the spatial dimension of the sub-tensor to obtain the energy-load state tensor. This folding operation can compress the complex energy change trends within the time window into a compact high-order state representation, effectively preserving the temporal correlation characteristics between energy supply and load demand, without needing to store the entire historical sequence, thus reducing computational and storage overhead.

[0010] When processing the energy-load state tensor, the elastic tolerance boundary model preferably projects along the first and second dimensions to obtain the energy supply trend vector and the load demand trend vector, respectively. The dynamic time curvature distance between these two vectors is calculated, and this distance is input into a nonlinear mapping function. The output value, after inverse normalization, serves as the dynamic trigger threshold. The elastic tolerance boundary model employs a recurrent neural network structure based on gated recurrent units, pre-trained with historical energy-load state tensor sequences as input and corresponding dynamic trigger threshold labels as training targets. The dynamic time curvature distance measures the similarity between supply and demand trends, and the recurrent neural network learns the nonlinear mapping relationship, enabling the trigger threshold to adaptively adjust in real-time according to the source-load change trend. When supply is abundant, the threshold is appropriately lowered to increase wastewater treatment capacity; when supply is tight, the threshold is raised to protect energy storage equipment and prevent excessive grid power supplementation.

[0011] When the real-time energy supply parameters are detected to be lower than the dynamic trigger threshold, the preferred method is to acquire the instantaneous photovoltaic power generation, instantaneous battery discharge power, and instantaneous mains power replenishment power in real time, perform a weighted summation, and compare the weighted result with the dynamic trigger threshold. If the result is lower than the threshold, a high-level activation signal is generated to activate the task time slice generator. This weighted summation method comprehensively reflects the actual available energy support capacity of the site. Working in conjunction with the dynamic trigger threshold, it can accurately determine whether a new round of task time slice scheduling should be initiated, preventing false triggering or missed triggering during multi-source energy switching.

[0012] In the process of generating task time slices, preferably, the energy-load state tensor is decomposed using modular multiplication to obtain multiple factor matrices and a core tensor. The set of position indices of non-zero elements is extracted from the core tensor, and a position index is randomly selected as the starting time slice anchor point. Starting from this anchor point, multiple time slice anchor points are obtained by skipping along the time axis according to a preset step size. The execution duration is determined based on the numerical value of each anchor point in the core tensor, thus generating multiple discrete wastewater treatment task execution time slices. The preset step size can be calculated in real time based on the liquid level change rate of the equalization tank within the wastewater treatment plant. Utilizing tensor modular multiplication to extract the core structure and generate skipped time slices allows the wastewater treatment task to automatically focus on periods of high energy-load coupling strength. This ensures timely response to changes in the equalization tank liquid level and fully utilizes periods of high photovoltaic power generation and sufficient energy storage, thereby increasing the proportion of direct renewable energy consumption.

[0013] When dynamically scheduling the start-stop sequence of equipment, preferably, the start time and duration of the first time slice are obtained. Upon arrival of the start time, a start command is generated and sent to the aeration equipment and lift pump, and a stop command is generated after the duration ends. Upon arrival of the start time of the second time slice, a start command is generated and sent to the return pump, while the aeration equipment and lift pump remain in a stopped state. A stop command is generated after the duration ends. By scheduling the start-stop of different equipment in a time-sharing and segmented manner, high-energy-consuming aeration and lift operations are concentrated in periods with strong energy support, while the return pump operates independently in another time slice. This effectively avoids peak power loads, reduces peak power demand, and extends the lifespan of the energy storage battery.

[0014] As a further preferred solution, during the execution of each time slice, the real-time current value of the return pump is continuously collected. When the real-time current value exceeds a preset high current threshold, an interruption stop command is immediately generated to stop the return pump and record the current interruption time. A compensation time slice is generated based on the current interruption time and the remaining duration of the current execution time slice, and this compensation time slice is inserted at the end of the execution time slices of multiple discrete wastewater treatment tasks. When the start time of the compensation time slice arrives, a new start command is generated and sent to the return pump, and the pump stops after the compensation time expires. Through real-time monitoring of abnormal current and dynamic insertion of compensation time slices, protective temporary shutdown can be performed when the equipment experiences brief stalling or excessive load, and the processing time can be automatically supplemented, avoiding incomplete treatment cycles and fluctuations in effluent water quality caused by protective shutdowns.

[0015] After completing a full execution cycle, the preferred method is to obtain the actual wastewater treatment volume and total energy consumption, calculate the ratio between the two to obtain the energy efficiency coefficient. If this coefficient is lower than the preset efficiency benchmark value, the parameter update process of the elastic tolerance boundary model is triggered, the weight matrix of the gated cyclic unit within the model is adjusted, and an updated model is generated for the dynamic trigger threshold calculation in the next cycle. Through a closed-loop feedback mechanism, the model can continuously iterate and optimize based on the operating results, so that the threshold generation strategy gradually approaches the optimal value, continuously improving the system's energy efficiency performance under varying weather conditions and drainage loads.

[0016] The present invention also provides a rural decentralized sewage treatment system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the rural decentralized sewage treatment method, and has the same technical effect as the above method. It enables decentralized sewage treatment stations to automatically optimize operation under the combined power supply conditions of photovoltaic, energy storage and mains power.

[0017] The beneficial effects of this invention are:

[0018] This method generates an energy-load state tensor by folding multidimensional energy time series data into a state tensor, and then calculates the dynamic trigger threshold using an elastic tolerance boundary model. It extracts sub-tensors with fixed time windows from historical photovoltaic power generation, energy storage state of charge, and grid connection status time series data. These are then segmented along the time dimension to obtain multiple time slice matrices, and their modulus sequences are calculated. An intermediate state matrix is ​​generated by the outer product of the modulus sequences and the time dimension index, and then folded with the spatial dimension tensor to obtain the energy-load state tensor. The energy-load state tensor is projected along two dimensions to form energy supply trend vectors and load demand trend vectors, and the dynamic time curvature distance between them is calculated. After nonlinear mapping and inverse normalization, the dynamic trigger threshold is obtained. Compared to a fixed threshold, this threshold changes in real time with the morphological differences between the energy supply trend and the load demand trend. It provides early warning boundaries when photovoltaic power slowly declines and avoids false triggering under instantaneous fluctuations caused by short-term cloud cover, ensuring that the triggering timing is consistent with actual energy supply capacity changes, reducing unnecessary equipment start-up and shutdown switching, and maintaining the continuity of the processing flow.

[0019] After the task time slice generator is activated, it performs modular multiplication decomposition on the energy-load state tensor to obtain a factor matrix and a core tensor. Starting time slice anchor points are randomly selected from the non-zero element indexes of the core tensor, and then selected in a jump-like manner on the time axis with a step size calculated in real-time based on the liquid level change rate in the equalization tank. The execution duration of each time slice anchor point is determined according to the corresponding value in the core tensor, forming discrete wastewater treatment task execution time slices. The distribution and length of the execution time slices are directly determined by the potential energy-load coupling structure revealed by the tensor decomposition. Priority is given to scheduling the load in periods corresponding to abundant energy supply, and the liquid level change rate in the equalization tank synchronously adjusts the time slice intervals to balance the equalization tank's storage capacity and energy supply gaps. The start and stop of aeration equipment, booster pumps, and return pumps are alternately scheduled according to the generated time slices, ensuring that the equipment actions in intermittent operation mode are consistent with the inherent pattern of the multidimensional energy state. This maintains the continuity of wastewater treatment function while reducing ineffective idling energy consumption during periods of energy constraint. Attached Figure Description

[0020] The invention will now be further described with reference to the accompanying drawings.

[0021] Figure 1 This is a schematic diagram of a decentralized wastewater treatment method in rural areas;

[0022] Figure 2 This is a flowchart of the energy-load state tensor generation process;

[0023] Figure 3 This is a flowchart of the dynamic trigger threshold generation and elastic tolerance boundary model training process. Detailed Implementation

[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] See Figure 1 This invention provides a decentralized rural wastewater treatment method, comprising the following steps: Acquiring time series data of photovoltaic power generation, energy storage state of charge, and grid connection status at the wastewater treatment plant to construct multidimensional energy time series data. Folding the multidimensional energy time series data into a state tensor to generate an energy-load state tensor for the current moment. Inputting the energy-load state tensor into a pre-constructed elastic tolerance boundary model to calculate the dynamic trigger threshold under the current energy supply state. When the real-time energy supply parameter is detected to be lower than the dynamic trigger threshold, a task time slice generator is activated. The task time slice generator generates multiple discrete wastewater treatment task execution time slices based on the modular multiplication decomposition results of the energy-load state tensor. Dynamically scheduling the start-stop sequences of aeration equipment, booster pumps, and return pumps within the wastewater treatment plant according to these multiple discrete wastewater treatment task execution time slices.

[0026] In specific implementation, please refer to Figure 2 The system collects photovoltaic (PV) power generation data at fixed sampling intervals of 15 minutes over the past calendar day. The collected PV power generation data are arranged in time index order to form a PV power generation time series. Simultaneously, at the same 15-minute fixed sampling interval, the remaining battery charge percentage is recorded and arranged in time index order to form a storage charge state time series. Also simultaneously, at the same 15-minute fixed sampling interval, the on / off status flag of the mains power supply interface is recorded. When the mains power supply interface is on, the flag is set to 1; when it is off, the flag is set to 0. The on / off status flags are arranged in time index order to form a mains power access status time series.

[0027] The time series data of photovoltaic power generation, energy storage state of charge, and grid connection status are aligned using the same time index and stacked along the time dimension to generate a three-dimensional tensor data structure, serving as multidimensional energy time series data. The three dimensions of this multidimensional energy time series data are time, energy parameter type, and numerical value. The energy parameter type dimension includes three types: photovoltaic power generation, energy storage state of charge, and grid connection status. The numerical value dimension has a size of 1.

[0028] In practice, a sub-tensor with the current time as the endpoint and a fixed time window length is extracted from the multidimensional energy time series data. The fixed time window length is preset based on the energy fluctuation characteristics of the wastewater treatment plant, and the fixed time window length corresponds to the number of sampling points for 2 hours. Since the fixed sampling interval is 15 minutes and the fixed time window length is 8 sampling points, the extracted sub-tensor has a dimension of 8×3×1.

[0029] The subtensor is divided along the time dimension. The time dimension of the subtensor corresponds to the first dimension of the subtensor, resulting in 8 time slice matrices. Each time slice matrix is ​​a 3×1 two-dimensional matrix, and each row of the time slice matrix corresponds to the value of the photovoltaic power generation, the energy storage state of charge, and the grid connection status flag at the corresponding time.

[0030] For each time slice matrix obtained from the segmentation, calculate the modulus of the time slice matrix. For the ... Time slice matrix ,in The index number of the time slice matrix. Time slice matrix Length of the module The Frobenius norm is used for calculation, and the formula is as follows:

[0031]

[0032] in, Indicates the first Time slice matrix The Middle Line number The numerical values ​​of the column elements. An index for the energy parameter type dimension. Corresponding photovoltaic power generation value, Corresponding energy storage state of charge value, Corresponding to the mains power access status flag, This is the index for the numerical dimension, with a fixed value of 1. It is determined by the modulus of all time slice matrices. The modulus sequence is obtained by combining the sequences according to their time indices.

[0033] Perform an outer product operation between the modulus sequence and the time dimension index of the subtensor. The time dimension index of the subtensor is a column vector composed of the time step numbers extracted from the subtensor. The modulus sequence is a column vector. For vectors sum vector Performing the outer product operation yields an 8×8 two-dimensional matrix, which is the two-dimensional intermediate state matrix.

[0034] Tensor simplification is performed on the spatial dimensions of the two-dimensional intermediate state matrix and the subtensor. The spatial dimensions of the subtensor are the two remaining dimensions after removing the time dimension, namely the energy parameter type dimension and the numerical dimension, forming a 3×1 space. The specific operation of tensor simplification is as follows: First, the subtensor is transformed into an 8×3 time-parameter matrix by removing the numerical dimension and adding the energy parameter type dimension as a column; then, the two-dimensional intermediate state matrix and the time-parameter matrix are multiplied to obtain an 8×3 result matrix; finally, the result matrix is ​​restored to an 8×3×1 three-dimensional tensor by expanding each row of the result matrix by one dimension. This three-dimensional tensor is the energy-load state tensor.

[0035] In specific implementation, please refer to Figure 3 The energy-load state tensor generated by the state tensor folding operation is obtained. The energy-load state tensor has a dimension of 8×3×1, where the first dimension is the time dimension with a size of 8, the second dimension is the energy parameter type dimension with a size of 3, and the third dimension is the numerical dimension with a size of 1. The energy-load state tensor is projected along the first dimension. The specific method of the projection operation is as follows: fix each time index position in the first dimension, calculate the average of the three elements in the second dimension, and use the value of the third dimension as the scalar value of the element, thus obtaining a vector of length 8. This vector is the energy supply trend vector. Each component in the energy supply trend vector corresponds to the comprehensive supply level of three energy parameters—photovoltaic power generation, energy storage state of charge, and grid connection status—at a time step.

[0036] The energy-load state tensor is projected along the second dimension. The specific projection operation is as follows: fix the index position of each energy parameter type in the second dimension, calculate the average value of the eight time step elements in the first dimension, and use the value of the third dimension as the scalar value of the element, thereby obtaining a vector of length 3. This vector is the load demand trend vector. Each component in the load demand trend vector corresponds to the average demand intensity of a certain energy parameter type within a fixed time window.

[0037] Calculate the dynamic time curvature distance between the energy supply trend vector and the load demand trend vector. The energy supply trend vector is... express, , The first term in the energy supply trend vector represents the... The overall supply level at each time step Load demand trend vector express, However, the load demand trend vector has a length of 3. In order to calculate the dynamic time bending distance with the energy supply trend vector, the load demand trend vector needs to be extended along the time axis. The extension method is to copy the load demand trend vector in the time dimension and concatenate it with itself to generate an extended load demand trend vector with a length of 8. ,in The calculation method is as follows: when When the remainder when divided by 3 is 1, When the remainder is 2, When the remainder is 0, .calculate and The dynamic time bending distance between them is used to obtain the dynamic time bending distance value. Dynamic time bending distance Through the cumulative distance matrix The cumulative distance matrix is ​​obtained through recursive calculation. The Middle Line number Column elements The calculation formula is as follows:

[0038]

[0039] in, Energy supply trend vector index, ; To expand the load demand trend vector index, ; express and The absolute difference; This indicates that the minimum value is taken from the three adjacent cumulative distance values ​​on the left, bottom, and diagonal. For the index in the cumulative distance matrix The element value; For the index in the cumulative distance matrix The element value; For the index in the cumulative distance matrix The element value. When and hour, .when or hour, and Set to positive infinity. Final dynamic time-warping distance. .

[0040] Dynamic time warping distance The input is fed into a nonlinear mapping function. The nonlinear mapping function is an S-shaped growth curve function, expressed as follows: ,in The slope factor is set to a constant value of 0.5. The center offset is set to a constant value of 10. The output value of the nonlinear mapping function. It is a scalar value between 0 and 1. Regarding this output value... Perform denormalization, which involves converting the output value... Multiply by the pre-set upper limit of the dynamic trigger threshold To obtain the dynamic trigger threshold Dynamic trigger threshold upper limit It is set at 70% of the sum of the rated power of the aeration equipment, lift pump and return pump in the sewage treatment plant.

[0041] The resilient tolerance boundary model employs a recurrent neural network structure based on gated recurrent units (ROUs). The network architecture consists of an input layer, a gated recurrent unit layer, a fully connected layer, and an output layer connected sequentially. The input layer has a dimension of 24 and receives a 24-dimensional vector obtained by expanding a single energy-load state tensor. The gated recurrent unit layer contains 128 hidden units and incorporates three gating mechanisms: an update gate, a reset gate, and candidate hidden states. The update gate controls the degree to which the previous hidden state is incorporated into the current state, while the reset gate controls the degree to which the previous hidden state is ignored. The fully connected layer has 32 neurons, and the activation function is a linear rectified unit function. The output layer contains one neuron, has no activation function, and directly outputs the dynamic trigger threshold value.

[0042] The specific training steps for the elastic tolerance boundary model are as follows: Collect a sequence of energy-load state tensors for each time window within a historical time period as training input samples. Each training input sample is a continuous sequence of 10 time windows. For each training input sample, obtain the dynamic trigger threshold label value corresponding to the last time window through manual annotation or simulation calculation based on the optimal start-stop strategy. Expand each energy-load state tensor in the training input sample into a 24-dimensional vector, and then feed it sequentially into a gated recurrent unit (GRU) layer in chronological order. The hidden state output by the GRU layer at the last time step is fed into a fully connected layer. The output of the fully connected layer is fed into the output layer, and the output layer outputs the predicted dynamic trigger threshold. The difference between the predicted dynamic trigger threshold and the dynamic trigger threshold label value is calculated using a mean squared error loss function. ,in For training sample batch size, For the first The dynamic trigger threshold for prediction of each sample. For the first The dynamic trigger threshold label value of each sample is determined. An adaptive moment estimation optimizer is used to update the weight matrices within the gated recurrent unit layer, fully connected layer, and output layer, with a learning rate of 0.001 and 200 training iterations. After training, the weight matrix parameters of the gated recurrent unit layer, fully connected layer, and output layer are saved, resulting in a pre-trained elastic tolerance boundary model.

[0043] In practical implementation, the instantaneous power data of photovoltaic power generation at the current moment is read in real time through the communication interface of the photovoltaic inverter, and the read value is recorded as... The instantaneous discharge power data of the energy storage battery is read in real time through the energy storage battery management system, and the read value is recorded as follows. The instantaneous supplementary power data of the mains power is read in real time by a power sensor installed on the mains power access line, and the read value is recorded as follows: Instantaneous power of photovoltaic power generation Instantaneous discharge power of energy storage battery and instantaneous supplemental power from mains power A weighted summation is performed, with the weighting coefficients pre-set according to energy priority. The weighting coefficient for the instantaneous power of photovoltaic power generation is also included. The weighting coefficient for the instantaneous discharge power of the energy storage battery is set to 0.5. The weighting coefficient for instantaneous mains power replenishment is set to 0.3. The weighting coefficient is set to 0.2, which satisfies the following conditions. The weighted summation calculation process is as follows: Multiply , Multiply , Multiply The results are then added together to obtain a real number, which serves as the real-time energy supply parameter. .

[0044] Real-time energy supply parameters With dynamic trigger threshold The values ​​are fed into the comparator module for comparison. Dynamically triggered threshold. The calculation is performed and output at each time step by the elastic tolerance boundary model. The comparator module uses a subtraction comparison mechanism, when... The value is less than When the value is specified, the output level of the comparator module flips from low to high, generating a high-level activation signal. This high-level activation signal is sent to the enable port of the task time slice generator. Upon detecting the rising edge transition, the enable port of the task time slice generator activates its internal timing logic, thereby turning on the task time slice generator.

[0045] Once activated, the task time slice generator receives the energy-load state tensor as input. The generator then performs a modular multiplication decomposition on the energy-load state tensor using the Tucker decomposition algorithm. (Energy-load state tensor) The dimension is Tucker decomposes Decomposed into a core tensor And three factor matrices, which are factor matrices along the time dimension. Factor matrix along the energy parameter type dimension and factor matrix along the numerical dimension , where the factor matrix The size is Factor matrix The size is Factor matrix The size is Core tensor Dimensions and Same, for Modular multiplication decomposition is solved iteratively using alternating least squares, with the original tensor as the solution. The convergence of the Frobenius norm error between the reconstructed tensor and the reconstructed tensor is used as the stopping condition.

[0046] From the core tensor Extract the index of the non-zero element. Traverse the core tensor. All elements, with absolute values ​​greater than a preset threshold. Elements are considered non-zero elements, with a preset threshold. The value is taken as the core tensor. 0.1 times the absolute value of the largest element in the core tensor. For each non-zero element, record the non-zero element's position in the core tensor. The time dimension index and energy parameter type dimension index are combined to form a location index pair, since the numerical dimension size is 1 and the numerical dimension index is fixed at 1. All non-zero element-corresponding location index pairs constitute the location index set.

[0047] A location index pair is randomly selected from the location index set, and the time dimension index of the selected location index pair is used as the anchor point of the starting time slice. The random selection method is to use the current system timestamp as the seed of the pseudo-random number generator to generate a uniformly distributed random integer. The random integer is then moduloed by the total number of elements in the location index set, and the location index pair corresponding to the modulo result is the selected location index pair.

[0048] Starting from the initial time slice anchor point, the selection is performed in a skip-like fashion along the timeline according to a preset step size. The preset step size... The calculation is based on the real-time liquid level change rate in the equalization tank of the wastewater treatment plant, and the calculation formula is as follows:

[0049]

[0050] in, This indicates the absolute change in the level of the regulating tank within the most recent sampling interval, expressed in centimeters per 15 minutes. The volume factor for the equalization tank is taken as the reciprocal of the effective volume of the equalization tank. The effective volume of the equalization tank is fixed at 50 cubic meters. Therefore... The value is 0.02; This represents the floor function; This means that the calculation result will be compared with 1 and the larger value will be taken to ensure that the step size is at least 1 time slice unit.

[0051] Starting from the initial time slice anchor point, within the time index range of the current time window, the step size is increased each time. Perform jumps to obtain multiple time-slice anchor points. Based on the core tensor of each time-slice anchor point... The value of the corresponding element determines the execution duration for each time slice anchor. For time slice anchors with index... The time slice, in the core tensor The corresponding element value is Execution time according to Calculation, where The base execution time is set to 10 minutes. For core tensor The maximum absolute value of all non-zero elements is calculated. The calculated execution duration is rounded down to an integer execution duration in minutes. The time index of each time slice anchor point is converted into the actual start time based on the current time, and combined with the execution duration to generate multiple discrete wastewater treatment task execution time slices. Each time slice contains two attributes: start time and duration.

[0052] In practical implementation, from the multiple discrete wastewater treatment task execution time slice sequences output by the task time slice generator, the wastewater treatment task execution time slice with the first index in the sequence is read and denoted as the first time slice. The start time attribute value and duration attribute value of the first time slice are extracted. The start time of the first time slice is represented by the symbol... The duration of the first time slice is indicated by the symbol. express, The unit is minutes. When the system clock reaches... At a specific time, the central control unit generates a high-level start command through the digital output module, and simultaneously sends this high-level start command to the enable terminals of the aeration equipment driver and the lift pump driver, causing the aeration equipment and the lift pump to start operating. This occurs when the system clock... From that moment on Minutes later, the central control unit generates a low-level stop command, which is simultaneously sent to the enable terminals of the aeration equipment driver and the lift pump driver, causing the aeration equipment to stop running and the lift pump to stop running.

[0053] After the first time slice completes, the central control unit reads the second wastewater treatment task execution time slice from a sequence of multiple discrete wastewater treatment task execution time slices, denoted as the second time slice. The start time and duration attribute values ​​of the second time slice are extracted. The start time of the second time slice is represented by a symbol... The duration of the second time slice is indicated by the symbol. Indicates. When the system clock arrives... At a certain time, the central control unit generates a high-level start command and sends it to the enable terminal of the return pump driver, causing the return pump to start running. Simultaneously, the enable terminals of the aeration equipment driver and the lift pump driver remain at a low level, meaning the aeration equipment and lift pump remain in a stopped state. This occurs when the system clock... From that moment on Minutes later, the central control unit generates a low-level stop command and sends the low-level stop command to the enable terminal of the return pump driver, causing the return pump to stop running.

[0054] During the execution of each wastewater treatment task time slice, the central control unit continuously collects the real-time current value of the return pump via an analog input module, at a frequency of once per second. Each collected real-time current value is compared with a preset high-current threshold, which is set based on the rated current of the return pump. The rated current of the return pump is 15 amps, and the high-current threshold is set to 1.2 times the rated current, i.e., 18 amps. If, during a current collection, the collected real-time current value of the return pump exceeds 18 amps, the central control unit immediately generates a low-level interrupt stop command via a digital output module and sends this command to the enable terminal of the return pump driver, causing the return pump to stop immediately. Simultaneously, the central control unit records the system clock time at which the interrupt stop command is generated, marking it as the current interrupt time point, denoted by the symbol... Indicated. Based on the current interruption time point. Given the start time and duration of the current wastewater treatment task's execution time slice, calculate the remaining duration of the current execution time slice. The remaining duration is denoted as [remainder / description]. , It is calculated using the following formula:

[0055]

[0056] in, This indicates the total duration of the currently executing wastewater treatment task, in minutes. This indicates the start time of the current wastewater treatment task's execution time slice; Indicates the current interruption time; This indicates the actual runtime from the start of the current time slice to the moment the interruption occurred, in minutes. and The difference is the remaining duration, which serves as the duration of the compensation time slice. The central control unit generates a compensation time slice, the duration of which is equal to... The start time attribute value of the compensation time slice is temporarily set to null. The compensation time slice is added to the end of the sequence of multiple discrete wastewater treatment task execution time slices.

[0057] After inserting the compensation time slice at the end of multiple discrete wastewater treatment task execution time slice sequences, the central control unit waits for the originally planned wastewater treatment task execution time slice sequence to complete before reading the duration of the last compensation time slice. And obtain the current time of the system clock as the start time of the compensation time slice, denoted as . When the system clock arrives... At a certain time, the central control unit regenerates a high-level start command and sends it to the enable pin of the return pump driver, causing the return pump to restart. This occurs when the system clock... From that moment on Minutes later, the central control unit generates a low-level stop command and sends it to the enable pin of the recirculation pump driver, causing the recirculation pump to stop operating. After the compensation time slice has been executed, the central control unit clears the currently stored interrupt time point. Record the data and compensation time slices, and restore the task time slice monitoring status to normal.

[0058] In practical implementation, after the central control unit completes the equipment start-up and shutdown scheduling according to multiple discrete wastewater treatment task execution time slots for a complete execution cycle, a complete execution cycle is defined as the time range from the start of the first wastewater treatment task execution time slot to the end of the last compensation time slot. The central control unit reads the cumulative flow value through an electromagnetic flow meter installed on the effluent pipeline of the wastewater treatment plant to obtain the actual wastewater treatment volume after a complete execution cycle. The actual wastewater treatment volume is represented by the symbol... express, The unit is cubic meters. The central control unit reads the cumulative energy consumption value through the multi-functional energy meter deployed in the distribution cabinet to obtain the total energy consumption within the same complete execution cycle. The total energy consumption is represented by the symbol... express, The unit is kilowatt-hour.

[0059] The central control unit calculates the actual wastewater treatment volume. With total energy consumption The ratio of the two values ​​is used to obtain the energy efficiency coefficient, which is represented by the symbol. express, The unit is cubic meters per kilowatt-hour. The central control unit will calculate the energy efficiency coefficient. It is compared with a preset efficiency benchmark, which is denoted by a symbol. express. The settings are determined based on the design daily treatment capacity and the rated total power of the equipment at the wastewater treatment plant. The design daily treatment capacity is 100 cubic meters, and the rated total power of the aeration equipment, lift pump, and return pump is 5 kilowatts, estimated based on continuous 24-hour operation. Values For ease of comparison, cubic meters per kilowatt-hour Rounded down to 0.8 cubic meters per kilowatt-hour.

[0060] If the calculation result Less than The central control unit triggers the parameter update process of the elastic tolerance boundary model. The core architecture of the elastic tolerance boundary model remains consistent with the training phase, consisting of an input layer, a gated recurrent unit layer, a fully connected layer, and an output layer connected sequentially. The input layer receives a 24-dimensional vector obtained by expanding a single energy-load state tensor. The gated recurrent unit layer contains 128 hidden units, with update and reset gate mechanisms. The update gate controls the proportion of the previous hidden state passed to the current state, and the reset gate controls the degree to which the previous hidden state is ignored. The fully connected layer contains 32 neurons, using a linear correction unit as the activation function. The output layer contains one neuron, directly outputting the dynamic trigger threshold value.

[0061] During the parameter update process, the central control unit (CCU) uses the energy-load state tensor sequence collected within the current complete execution cycle as update samples. This sequence consists of one energy-load state tensor generated at each time step, arranged chronologically. The CCU takes the last energy-load state tensor in the sequence as input and performs forward propagation through the elastic tolerance boundary model to obtain the predicted dynamic trigger threshold. Then, the CCU constructs a loss function with the energy efficiency coefficient as the optimization objective. loss function The calculation formula is as follows:

[0062]

[0063] in, The preset efficiency benchmark value, The energy efficiency coefficient is calculated for the current complete execution cycle. The central control unit uses the loss function... The weight matrix within the gated recurrent unit (ROU) layer is updated. The weight matrix of the gated ROU layer includes the weight matrix input to the update gate. The weight matrix input to the reset gate and the weight matrix input to the candidate state And their respective bias vectors. Gradient descent is used to update all three types of weight matrices, with the update rule being... ,in Represents any weight matrix, The learning rate, set to 0.0005 during the parameter update process, is chosen to prevent drastic weight fluctuations in a single update, which could corrupt the learned feature representation. Gradient The gradient calculation chain is performed using the backpropagation algorithm. It propagates from the output layer through the fully connected layer to the gated recurrent unit (ROU) layer, and then backpropagates along the time steps within the ROU layer, ultimately obtaining the partial derivatives with respect to the three types of weight matrices. After the weight matrices are updated, the weight matrices and bias vectors of the fully connected layer are also updated using the same gradient descent method. Once the parameter update process is complete, the central control unit saves the updated weight matrices of the gated ROU layer, the fully connected layer, and their respective bias vectors, generating an updated elastic tolerance boundary model. This updated elastic tolerance boundary model is loaded into the real-time computing module for calculating the dynamic trigger threshold in the next complete execution cycle.

[0064] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A decentralized rural sewage treatment method, characterized in that, Includes the following steps: The time series of photovoltaic power generation, energy storage state of charge, and grid connection status of wastewater treatment plants are obtained to construct multi-dimensional energy time series data. The multidimensional energy time series data is folded into a state tensor to generate the energy-load state tensor at the current moment; The energy-load state tensor is input into a pre-constructed elastic tolerance boundary model to calculate the dynamic trigger threshold under the current energy supply state. When the real-time energy supply parameter is detected to be lower than the dynamic trigger threshold, the task time slice generator is activated. The task time slice generator generates multiple discrete wastewater treatment task execution time slices based on the modular multiplication decomposition results of the energy-load state tensor. Based on the execution time slices of the multiple discrete wastewater treatment tasks, the start-up and shutdown sequences of aeration equipment, booster pumps, and return pumps within the wastewater treatment plant are dynamically arranged.

2. The rural decentralized sewage treatment method according to claim 1, characterized in that, In the step of acquiring the time series of photovoltaic power generation, energy storage state of charge, and grid connection status of the wastewater treatment plant to construct multi-dimensional energy time series data: The photovoltaic power generation data recorded at fixed sampling intervals over the past natural day are used to form the photovoltaic power generation time series. The remaining percentage of energy capacity of the energy storage battery is collected synchronously at the same fixed sampling interval within the past natural day to form the energy storage state of charge time series. The on / off status flags of the mains power supply interface, recorded at the same fixed sampling interval within the past natural day, are synchronously collected to form the mains access status time series. The photovoltaic power generation time series, the energy storage state of charge time series, and the grid connection state time series are aligned by time index and stacked in the time dimension to generate a three-dimensional tensor data structure, which serves as the multidimensional energy time series data.

3. The rural decentralized sewage treatment method according to claim 2, characterized in that, In the step of performing state tensor folding on the multidimensional energy time series data to generate the energy-load state tensor at the current moment: Extract sub-tensors from the multidimensional energy time series data, with the current time as the endpoint and a fixed time window length; The subtensor is divided along the time dimension to obtain multiple time slice matrices; Calculate the modulus of each time slice matrix to obtain a modulus sequence; The outer product operation is performed between the modulus sequence and the time dimension index of the sub-tensor to generate a two-dimensional intermediate state matrix. The energy-load state tensor is obtained by tensor simplification of the spatial dimension of the two-dimensional intermediate state matrix and the sub-tensor.

4. The rural decentralized sewage treatment method according to claim 3, characterized in that, In the step of inputting the energy-load state tensor into a pre-constructed elastic tolerance boundary model to calculate the dynamic triggering threshold under the current energy supply state: Projecting the energy-load state tensor along its first dimension yields the energy supply trend vector. Projecting the energy-load state tensor along its second dimension yields the load demand trend vector. Calculate the dynamic time curvature distance between the energy supply trend vector and the load demand trend vector; The dynamic time bending distance is input into a nonlinear mapping function, and the output value of the nonlinear mapping function is used as the dynamic trigger threshold after inverse normalization.

5. A decentralized rural sewage treatment method according to claim 4, characterized in that, The elastic tolerance boundary model adopts a recurrent neural network structure based on gated recurrent units, and is pre-trained with the historical energy-load state tensor sequence as input and the corresponding dynamic trigger threshold label as the training target.

6. A rural decentralized sewage treatment method according to claim 4, characterized in that, In the step of activating the task time slice generator when the real-time energy supply parameter is detected to be lower than the dynamic trigger threshold: The instantaneous power of photovoltaic power generation, the instantaneous discharge power of energy storage battery, and the instantaneous supplementary power of mains power are acquired in real time. The instantaneous power of photovoltaic power generation, the instantaneous discharge power of energy storage battery, and the instantaneous supplementary power of mains power are weighted and summed to obtain the real-time energy supply parameters. Compare the real-time energy supply parameters with the dynamic trigger threshold; If the value of the real-time energy supply parameter is less than the value of the dynamic trigger threshold, a high-level activation signal is generated. The high-level activation signal is sent to the enable port of the task time slice generator to activate the task time slice generator.

7. A rural decentralized sewage treatment method according to claim 6, characterized in that, In the step where the task time slice generator generates multiple discrete wastewater treatment task execution time slices based on the modular multiplication decomposition result of the energy-load state tensor: The energy-load state tensor is decomposed by modular multiplication to obtain multiple factor matrices and a core tensor; Extract the position indices of non-zero elements from the core tensor to form a position index set; Randomly select a location index from the set of location indices as the starting time slice anchor point; Starting from the initial time slice anchor point, multiple time slice anchor points are obtained by skipping along the time axis according to a preset step size. Based on the numerical value corresponding to each time slice anchor point in the core tensor, the execution duration corresponding to each time slice anchor point is determined, and the multiple discrete wastewater treatment task execution time slices are generated.

8. A decentralized rural sewage treatment method according to claim 7, characterized in that, The preset step size is calculated in real time based on the liquid level change rate in the equalization tank within the wastewater treatment plant.

9. A decentralized rural sewage treatment method according to claim 7, characterized in that, The steps involved in dynamically scheduling the start-up and shutdown sequences of aeration equipment, booster pumps, and return pumps within a wastewater treatment plant, based on the execution time slices of the multiple discrete wastewater treatment tasks, are as follows: Obtain the start time and duration of the first time slice in the execution time slices of the multiple discrete wastewater treatment tasks; When the start time is reached, a start command is generated and sent to the aeration device, and a start command is generated and sent to the lift pump. After the duration of the first time slice ends, a stop command is generated and sent to the aeration device, and a stop command is also generated and sent to the lift pump. Obtain the start time and duration of the second time slice in the execution time slices of the multiple discrete wastewater treatment tasks; When the start time of the second time slice arrives, a start command is generated and sent to the return pump, while the aeration equipment and the lift pump remain in a stopped state. After the duration of the second time slice ends, a stop command is generated and sent to the reflux pump.

10. A rural decentralized sewage treatment system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the rural decentralized sewage treatment method according to any one of claims 1-9.