Sewage treatment abnormity early warning method and system based on big data analysis
By constructing a causal relationship structure diagram and designing a causal association loss function, combined with the LSTM algorithm to train the sewage treatment index prediction network, the problem of insufficient understanding of the causal structure in the existing technology is solved, and accurate prediction and timely warning of the sewage treatment process are achieved.
Patent Information
- Application Number
- CN202511034786.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-07-25
AI Technical Summary
The existing LSTM-based sewage treatment prediction method cannot effectively understand the causal structure of the sewage treatment process, resulting in a delayed response to dynamic changes in upstream parameters and an inability to accurately predict downstream water quality changes, especially under dynamic conditions, with low prediction accuracy.
By constructing a causal relationship structure diagram, calculating the theoretical sensitivity and fitting sensitivity between nodes, designing a causal association loss function, and combining the LSTM algorithm to train the sewage treatment index prediction network, the ability to analyze downstream link data changes caused by upstream link data changes is enhanced.
The accuracy and robustness of the sewage treatment index prediction network have been improved, which can provide timely warnings of abnormal situations and improve the prediction accuracy under dynamic conditions.
Smart Images

Figure CN120804996A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing, in particular to a sewage treatment abnormality early warning method and system based on big data analysis. BACKGROUND
[0002] Sewage treatment is a key facility for environmental safety and public health, and its core is to ensure that the effluent quality (such as COD, ammonia nitrogen, etc.) meets the standards. Early and accurate prediction of water quality changes and early warning are crucial for monitoring the treatment process.
[0003] In recent years, data-driven water quality prediction has become mainstream. Long short-term memory network (LSTM) is widely used because it is good at capturing the long-term dependence of time series data. It learns the historical data of the target water quality indicator to predict future trends.
[0004] However, when LSTM is applied to the sewage treatment scenario, there are obvious limitations: first, it regards the sewage treatment process as a "black box", only learns the surface correlation of the data, ignores the internal process and causal mechanism, and cannot distinguish between direct and indirect effects and transmission processes of different levels of variables; second, it is not sensitive to the "dynamic changes" of upstream parameters, and the prediction response is lagging, only capturing the consequences of parameter changes, and cannot understand the forward-looking information of the changes themselves. For example, the operator reduces the frequency of the fan, the model knows that the ammonia nitrogen will eventually rise, but it will not judge until it observes the decrease in DO concentration, and it does not understand the quantitative relationship between them, resulting in delayed early warning and a significant decrease in prediction accuracy under dynamic conditions.
[0005] Therefore, there is an urgent need for new methods in this field to understand the internal causal structure of sewage treatment and to establish a quantitative relationship between the "dynamic changes" of upstream parameters and the "dynamic response" of downstream water quality, and to constrain model training based on this, fundamentally improving the prediction accuracy under dynamic conditions. This is the core problem to be solved by the present application. SUMMARY
[0006] In order to solve the problem of how to make the prediction network learn the causal information of the sewage treatment process and improve the accuracy of sewage treatment prediction, the present application provides a sewage treatment abnormality early warning method and system based on big data analysis.
[0007] In a first aspect, the present application provides a sewage treatment abnormality early warning method based on big data analysis, which adopts the following technical solution: The sewage treatment abnormality early warning method based on big data analysis comprises the following steps: Obtain a historical operation data set, wherein each sample in the historical operation data set contains a time period of sewage treatment operation data segments of several types; The wastewater treatment operation data of each type is taken as a node, a directed edge between nodes is constructed according to the correlation of wastewater treatment operation data of different types, and a weight corresponding to the directed edge is obtained, to obtain a causal relationship structure diagram; and a theoretical sensitivity between two nodes is calculated based on the causal relationship structure diagram, and the theoretical sensitivity is positively correlated with the weight of the directed edge of the path between the two nodes. The wastewater treatment index prediction network is constructed based on the LSTM algorithm, all types of wastewater treatment operation data segments in each sample in the historical operation data set are input into the wastewater treatment index prediction network, output data corresponding to each node of the type is obtained, a fitting sensitivity of two nodes is calculated based on the change correlation between the output data of the type corresponding to the latter node and the output data of the type corresponding to the former node in the two nodes; a causal correlation loss function is constructed, and the causal correlation loss function is positively correlated with the difference between the fitting sensitivity and the theoretical sensitivity; The training of the wastewater treatment index prediction network is completed based on the causal correlation loss function and the loss function provided by the LSTM algorithm, so as to realize the wastewater treatment abnormality early warning.
[0008] The causal correlation loss function is designed to enable the wastewater treatment index prediction network to learn the causal correlation information of each link in the wastewater treatment process, thereby enhancing the analysis capability of the wastewater treatment index prediction network on the change of the downstream link data caused by the change of the upstream link data in the wastewater treatment process, and improving the accuracy and robustness of the wastewater treatment index prediction network; further, when designing the causal correlation loss function, the theoretical sensitivity is introduced to accurately reflect the correlation between two links in the wastewater treatment process obtained from experience information; when designing the causal correlation loss function, the fitting sensitivity is introduced to accurately reflect the correlation information between two links in the wastewater treatment process fitted by the wastewater treatment index prediction network; further, by analyzing the difference between the fitting sensitivity and the theoretical sensitivity, the difference between the correlation between different links in the wastewater treatment process fitted by the wastewater treatment index prediction network and the correlation between two links in the wastewater process obtained from experience is reflected, so that the correlation between different links in the wastewater treatment process fitted by the wastewater treatment index prediction network tends to be close to the correlation between two links in the wastewater process obtained from experience, and the wastewater treatment index prediction network learns the correlation information of different links in the wastewater treatment process.
[0009] Preferably, the wastewater treatment operation data of each type is taken as a node, a directed edge between nodes is constructed according to the correlation of wastewater treatment operation data of different types, and a weight corresponding to the directed edge is obtained, to obtain a causal relationship structure diagram, including: Based on the process flow, the directed edges of the nodes corresponding to different types of sewage treatment data are constructed; the time sequence of sewage treatment operation data of each node is obtained; the misplacement time length of the time sequence of sewage treatment operation data of two adjacent nodes is calculated, the change sensitivity of the directed edge corresponding to the two adjacent nodes is calculated based on the time sequence relationship of the time sequence of sewage treatment operation data of the two adjacent nodes under the misplacement time length, and the change sensitivity of the two adjacent nodes is taken as the weight of the directed edge corresponding to the two adjacent nodes; the obtained graph structure is recorded as a causal relationship structure graph.
[0010] The present application reflects the correlation of different links in the sewage treatment process more accurately through the causal relationship structure graph.
[0011] Preferably, the misplacement time length of the time sequence of sewage treatment operation data of two adjacent nodes comprises: The time sequence of sewage treatment operation data of the previous node relative to the subsequent node in the two adjacent nodes is sequentially misplaced by one time, the correlation of the time sequence of sewage treatment operation data of the two adjacent nodes after misplacement is calculated once after each misplacement by one time, and the number of misplacement time corresponding to the maximum correlation is taken as the misplacement time length of the time sequence of sewage treatment operation data of the two adjacent nodes.
[0012] The present application more accurately obtains the misplacement time length through misplacement correlation analysis.
[0013] Preferably, the change sensitivity of the directed edge corresponding to the two adjacent nodes is calculated based on the time sequence relationship of the time sequence of sewage treatment operation data of the two adjacent nodes under the misplacement time length, comprising: The difference between each data and the previous data in the time sequence of sewage treatment operation data of each node is taken as the change of each data; The change of any data in the time sequence of sewage treatment operation data of the subsequent node in the two adjacent nodes is divided by the cumulative sum of the change of the data at the corresponding time under the misplacement time length in the time sequence of sewage treatment data of the previous node and the anti-zero parameter as the change sensitivity of the data; The average of the change sensitivity of all data in the time sequence of sewage treatment operation data of the subsequent node in the two adjacent nodes is taken as the change sensitivity of the two adjacent nodes.
[0014] The present application accurately reflects the change sensitivity of the two adjacent nodes through the correlation information of the data change of the two adjacent nodes.
[0015] Preferably, the theoretical sensitivity between the two nodes is calculated based on the causal relationship structure graph, comprising: All paths between the two nodes are obtained in the causal relationship structure graph, and the product of the weights of all directed edges on any path of the two nodes is taken as the theoretical sensitivity of the path; The sum of the theoretical sensitivities of all paths between two nodes is taken as the theoretical sensitivity between the two nodes.
[0016] The theoretical sensitivity of the present application accurately reflects the correlation between nodes based on experience.
[0017] Preferably, the fitting sensitivity of the two nodes is calculated based on the variation correlation of the output data of the corresponding type of the latter node and the output data of the corresponding type of the former node, comprising:
[0018] wherein, denotes the partial derivative of the output data of the corresponding type of the jth node at the hth moment, denotes the partial derivative of the output data of the corresponding type of the ith node at the kth moment, denotes the time corresponding weight of the output data of the corresponding type of the jth node at the hth moment and the output data of the corresponding type of the ith node at the kth moment, denotes the number of moments of the output data, denotes the zero prevention parameter, denotes the fitting sensitivity of the ith node and the jth node.
[0019] The fitting sensitivity of the present application accurately reflects the correlation between nodes fitted by the sewage treatment index prediction network.
[0020] Preferably, the method for obtaining the time corresponding weight comprises: The variance of the correlation calculated after all the moments after the wrong position is calculated as the reference variance, a Gaussian distribution function is constructed with the wrong position time length as the mean value and the reference variance as the variance, the time interval length between the corresponding moment of each data of the corresponding type of the ith node and the corresponding moment of each data of the corresponding type of the jth node is calculated, and the value at the time interval length in the Gaussian distribution function is taken as the distribution weight; The normalized value of the distribution weight is taken as the time corresponding weight.
[0021] Preferably, the method for constructing the causal correlation loss function comprises:
[0022] wherein, denotes the fitting sensitivity of the ith node and the jth node, denotes the theoretical sensitivity of the ith node and the jth node, denotes the number of successor nodes of the ith node, denotes the number of predecessor nodes, denotes the causal correlation loss function.
[0023] Preferably, the implementation of sewage treatment abnormal early warning comprises: The newly collected current time period of several types of sewage treatment operation data segments is input into the trained sewage treatment index prediction network to obtain various types of sewage treatment operation data at future time points, and if there is a data in the various types of sewage treatment operation data at the future time points that meets the abnormal early warning condition, an abnormal early warning is issued. If all the various types of sewage treatment operation data at the future time points do not meet the abnormal early warning condition, no early warning is performed.
[0024] In a second aspect, the present application provides a sewage treatment abnormal early warning system based on big data analysis, which adopts the following technical solution: The sewage treatment abnormal early warning system based on big data analysis comprises a processor and a memory, and the memory stores computer program instructions, which realize the above-mentioned sewage treatment abnormal early warning method based on big data analysis when executed by the processor.
[0025] By adopting the above-mentioned technical solution, the above-mentioned sewage treatment abnormal early warning method based on big data analysis is generated into a computer program and stored in the memory to be loaded and executed by the processor, so that a terminal device is made according to the memory and the processor, and convenient use is achieved.
[0026] The present application has the following technical effects: The present application designs a causal correlation loss function to enable the sewage treatment index prediction network to learn the causal correlation information of each link in the sewage treatment process, thereby enhancing the analysis capability of the sewage treatment index prediction network on the change of downstream link data caused by the change of upstream link data in the sewage treatment process, and improving the accuracy and robustness of the sewage treatment index prediction network prediction. Further, when designing the causal correlation loss function, the theoretical sensitivity is introduced to accurately reflect the correlation between two links in the sewage treatment process obtained from the experience information; when designing the causal correlation loss function, the fitting sensitivity is introduced to accurately reflect the correlation information between two links in the sewage treatment process fitted by the sewage treatment index prediction network. Further, by analyzing the difference between the fitting sensitivity and the theoretical sensitivity, the difference between the correlation between different links in the sewage treatment process fitted by the sewage treatment index prediction network and the correlation between two links in the sewage treatment process obtained from the experience is reflected, so as to guide the correlation between different links in the sewage treatment process fitted by the index prediction network to approach the correlation between two links in the sewage process obtained from the experience, and further enable the sewage treatment index prediction network to learn the correlation information of different links in the sewage treatment process. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 It is a flow chart of a method in a sewage treatment abnormality early warning method based on big data analysis in an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The embodiment of the present invention discloses a sewage treatment abnormality early warning method based on big data analysis, referring to Figure 1 , including steps S1 to S4: S1: Acquire a historical operation data set, where each sample in the historical operation data set includes several types of sewage treatment operation data segments in a time period.
[0029] Specifically, various types of sewage treatment operation data at various times are obtained, and the sewage treatment operation data at all times of various types are arranged in time series to obtain time series sequences of sewage treatment operation data of various types; The various types of sewage treatment operation data time series are evenly divided into data segments of preset length and recorded as sewage treatment operation data segments; all types of sewage treatment operation data segments in the next time period of any time period are used as the future observation data segments of the time period, and all types of sewage treatment operation data segments in the time period with observation data segments are taken as a sample, and the data set composed of all samples is recorded as the historical operation data set.
[0030] The types of sewage treatment operation data include but are not limited to the following: Equipment switch status data, equipment current data, equipment power data, reagent dosage frequency data, reagent dosage data, mixed liquid suspended solids concentration, redox potential, pH value, dissolved oxygen data, water temperature, ammonia nitrogen concentration data, phosphorus concentration data.
[0031] S2: Take each type of sewage treatment operation data as a node, construct directed edges between nodes and the weights of corresponding directed edges according to the correlation of different types of sewage treatment operation data, and obtain a causal relationship structure diagram; calculate the theoretical sensitivity between two nodes based on the causal relationship structure diagram, and the theoretical sensitivity is positively correlated with the weight of the directed edge of the path between the two nodes.
[0032] S20: Taking various types of sewage treatment operation data as nodes, constructing directed edges between nodes and corresponding directed edge weights according to the correlation between different types of sewage treatment operation data, and obtaining a causal relationship structure diagram.
[0033] It should be noted that there are a series of causal relationships in the process of sewage treatment in the sewage treatment system, such as the frequency of aeration fans is reduced → the aeration intensity of the biochemical pool is reduced → the dissolved oxygen (DO) concentration is reduced → the activity of aerobic microorganisms is inhibited → ammonia nitrogen ( degradation efficiency reduces → effluent ammonia nitrogen exceeds the standard. The traditional LSTM algorithm mainly realizes data prediction by fitting the change law between sewage treatment data, and cannot learn the causal correlation information of sewage treatment well, so as to cause the subsequent data change cannot be estimated in time when the equipment or process changes, and further cause the sewage treatment abnormality cannot be warned in time. In order to enable the LSTM algorithm to learn the causal correlation, the causal correlation information needs to be extracted according to the existing experience, so as to guide the LSTM algorithm to learn the causal correlation information.
[0034] It needs to be further explained that the graph structure can better reflect the causal correlation information between transactions, so the causal correlation information is described below through the graph structure.
[0035] Preferably, as an example, each type of sewage treatment operation data is taken as a node, the directed edges between the nodes and the weights of the corresponding directed edges are constructed according to the correlation of different types of sewage treatment operation data, and a causal relationship structure diagram is obtained, including: Each type of sewage treatment operation data is taken as a node, and the directed edges between the nodes corresponding to different types of sewage treatment data are constructed based on the process flow; The time sequence sequence formed by the sewage treatment operation data of all time points of each node is taken as the sewage treatment operation data time sequence of each node; and the dislocation time length of the sewage treatment operation data time sequence of two adjacent nodes is calculated.
[0036] The difference between each data and the previous data in the sewage treatment operation data time sequence of each node is taken as the change of each data; the change of any data in the sewage treatment operation data time sequence of the latter node of the two adjacent nodes is divided by the cumulative sum of the change of the data at the corresponding time point under the dislocation time length of the sewage treatment data time sequence of the former node and the anti-zero parameter as the change sensitivity of the data; and the average of the change sensitivities of all data in the sewage treatment operation data time sequence of the latter node of the two adjacent nodes is taken as the change sensitivity of the two adjacent nodes.
[0037] The change sensitivity of the two adjacent nodes is taken as the weight of the directed edge corresponding to the two adjacent nodes; and the obtained graph structure is taken as a causal relationship structure diagram.
[0038] In order to facilitate understanding, a specific example is described below: Suppose one of the process flow chains is: aeration fan frequency is reduced → aeration intensity of biochemical pool is reduced → dissolved oxygen (DO) concentration is reduced → activity of aerobic microorganisms is inhibited → ammonia nitrogen (NH3-N) degradation efficiency is reduced → effluent ammonia nitrogen exceeds the standard. degradation efficiency reduces → effluent ammonia nitrogen exceeds the standard.
[0039] The frequency data of the aeration blower, the aeration intensity data of the biochemical pool, the dissolved oxygen concentration data, the aerobic microbial activity data, and the ammonia nitrogen concentration data are respectively taken as node 1, node 2, node 3, node 4, and node 5. Based on the process chain, a directed edge of the five nodes is drawn to obtain node 1→node 2→node 3→node 4→node 5.
[0040] Taking the two nodes of node 2 and node 3 as examples, it is assumed that the time sequence of the aeration intensity data obtained by node 2 is [1.7, 1.9, 1.8, 0.8, 0.7, 0.9, 0.8, 1.0, 0.9, 1.1], and the time sequence of the dissolved oxygen concentration data obtained by node 3 is [3.4, 3.6, 3.5, 3.7, 3.6, 2.2, 2.1, 2.3, 2.2, 2.4]. It is assumed that the calculated misplacement duration is 2 time points.
[0041] The change amounts of the data in the time sequence of the aeration intensity data are respectively [0.2, -0.1, -1.0, -0.1, 0.2, -0.1, 0.2, -0.1, 0.2], and the change amounts of the data in the time sequence of the dissolved oxygen concentration data are [0.2, -0.1, 0.2, -0.1, -1.4, -0.1, 0.2, -0.1, 0.2]. The change sensitivities of the data in the time sequence of the dissolved oxygen concentration data are respectively -0.200, 1.010, 0.995, 1.010, -6.965, 1.010, 0.995. The mean value -0.306 of the change sensitivities of all the data in the time sequence of the dissolved oxygen concentration data is taken as the change sensitivity of node 2 and node 3. Herein, the zero prevention parameter is taken as 0.001 in the calculation of the change sensitivity. The zero prevention parameter can also take other values, and the embodiment is not specifically limited.
[0042] It can be understood that the directed edges between the nodes are constructed based on the propagation relationship of the process, so that the cause-effect relationship structure diagram can contain process information. Further, the time misplacement relationship of different data is reflected by analyzing the misplacement duration, thereby providing a basis for analyzing the correlation between different nodes according to the correlation of the data after time alignment, for example, the dissolved oxygen concentration decreases only after the aeration blower frequency is reduced for 2 time points, that is, the feature of the inhibition of the aerobic biological activity lags behind the feature of the reduction of the aeration blower frequency, and thus the data of the feature of the dissolved oxygen concentration and the data of the feature of the aeration blower frequency need to be processed by time alignment, so as to accurately analyze the correlation of the two feature data. Further, the sensitivity between two nodes is reflected by analyzing the data change amount of the corresponding time point of the next node caused by the unit change amount of the data of the previous node. The greater the value is, the greater the data change amount of the corresponding time point of the next node caused by the unit change amount of the data of the previous node is, and thus the greater the change sensitivity between the two nodes is.
[0043] It should be noted that the dislocation duration of the sewage treatment operation data time sequence of two adjacent nodes is calculated, including: The sewage treatment operation data time sequence of the former node in the two adjacent nodes is sequentially dislocated one time point behind the latter node, and the correlation of the sewage treatment operation data time sequence of the two adjacent nodes after dislocation is calculated once every time the time point is dislocated, and the dislocation time point number corresponding to the maximum correlation value is obtained as the dislocation duration of the sewage treatment operation data time sequence of the two adjacent nodes.
[0044] In order to facilitate understanding, a specific example is given below for illustration: Taking the two nodes of node 2 and node 3 as an example, assuming that the aeration intensity data time sequence obtained by node 2 is: [1.7, 1.9, 1.8, 0.8, 0.7, 0.9, 0.8, 1.0, 0.9, 1.1], and the dissolved oxygen concentration data time sequence obtained by node 3 is [3.4, 3.6, 3.5, 3.7, 3.6, 2.2, 2.1, 2.3, 2.2, 2.4], wherein the absolute values of the Pearson correlation coefficients of the two overlapping time sequences of node 2 and node 3 obtained by sequentially dislocating the aeration intensity data time sequence of node 2 by 1, 2, 3, 4, 5, 6, 7 time points are 0.12, 0.98, 0.05, 0.18, 0.23, 0.11, 0.08, respectively. The correlation is maximum after the aeration intensity data time sequence is dislocated by 2 time points, so 2 is the dislocation duration of the two nodes of node 2 and node 3.
[0045] It should be noted that after dislocation, there is no overlapping data for some time points, so only the correlation of the sequence composed of the overlapping time points is calculated. At the same time, due to the small amount of data, the more inaccurate the calculated correlation value is, so when the number of overlapping time points is less than the preset number, the calculated correlation value is not referred to.
[0046] S21: calculating the theoretical sensitivity between two nodes based on the causal relationship structure diagram, the theoretical sensitivity being positively correlated with the weight of the directed edge of the path between the two nodes.
[0047] Preferably, as an example, the theoretical sensitivity between two nodes is calculated based on the causal relationship structure diagram, including: Obtaining all paths between the two nodes in the causal relationship structure diagram, and taking the product of the weights of all directed edges on any path between the two nodes as the theoretical sensitivity of the path; Taking the sum of the theoretical sensitivities of all paths between the two nodes as the theoretical sensitivity between the two nodes.
[0048] It can be understood that there are multiple paths for the connection path of the two nodes, and each connection path can associate the change information of the two nodes, so it is necessary to analyze the association information on all connection paths of the two nodes to analyze the theoretical sensitivity of the two nodes.
[0049] S3: based on the LSTM algorithm to build a sewage treatment index prediction network, input all types of sewage treatment operation data segments in each sample in the historical operation data set into the sewage treatment index prediction network, obtain the output data corresponding to each node of the type, and calculate the fitting sensitivity of the two nodes based on the change association between the output data of the corresponding type of the latter node and the output data of the corresponding type of the former node in the two nodes; a causal association loss function, the causal association loss function is positively correlated with the difference between the fitting sensitivity and the theoretical sensitivity.
[0050] It should be noted that in order to predict the sewage treatment condition of the sewage treatment system at a future time, a sewage treatment index prediction network for predicting the future condition needs to be built.
[0051] Preferably, as an example, the sewage treatment index prediction network is built based on the LSTM algorithm, which includes: The network built by using the LSTM algorithm is used as the sewage treatment index prediction network.
[0052] S30: based on the LSTM algorithm to build a sewage treatment index prediction network.
[0053] It should be noted that in order to enable the sewage treatment index prediction network to learn the causal association information of each link in the sewage treatment process, a loss function can be designed to supervise the sewage treatment index prediction network to learn the association information between nodes in the causal association network.
[0054] S31: input all types of sewage treatment operation data segments in each sample in the historical operation data set into the sewage treatment index prediction network, obtain the output data corresponding to each node of the type, and calculate the fitting sensitivity of the two nodes based on the change association between the output data of the corresponding type of the latter node and the output data of the corresponding type of the former node.
[0055] It should be noted that when designing the loss function, if the causal association between the nodes fitted by the sewage treatment index prediction network is similar to the causal association information obtained based on experience, it means that the sewage treatment index prediction network has learned the association information of each link in the sewage treatment process, so the loss function can be designed based on this logic. First, analyze the causal association between the nodes fitted by the sewage treatment index prediction network.
[0056] Preferably, as an example, all kinds of sewage treatment operation data segments in each sample in the historical operation data set are input into the sewage treatment index prediction network, the output data corresponding to each node of the type is obtained, the fitting sensitivity of the two nodes is calculated based on the change correlation of the output data of the type corresponding to the latter node and the output data of the type corresponding to the former node in the two nodes, including:
[0057] Among them, The partial derivative of the output data of the type corresponding to the jth node at the hth moment, The partial derivative of the output data of the type corresponding to the ith node at the kth moment, The time corresponding weight of the output data of the type corresponding to the jth node at the hth moment and the output data of the type corresponding to the ith node at the kth moment, The number of moments of the output data, The anti-zero parameter, The fitting sensitivity of the ith node and the jth node.
[0058] In order to facilitate understanding, the following is described with a specific example: All kinds of sewage treatment operation data segments corresponding to the sample period are input into the sewage treatment index prediction network, it is assumed that the type corresponding to the ith node is aeration intensity, the output data segment of the aeration intensity type is [1.7, 1.9, 1.8, 0.8, 0.7], the type corresponding to the jth node is dissolved oxygen concentration, and the output data segment of the dissolved oxygen concentration type is [3.6, 1.8, 1.4, 1.6, 1.5]. The partial derivatives of all moment data in the output data segment [1.7, 1.9, 1.8, 0.8, 0.7] of the type corresponding to the ith node are calculated as 0.2, -0.1, -1.0, -0.1, respectively, and the partial derivatives of all moment data in the output data segment [3.6, 1.8, 1.4, 1.6, 1.5] of the type corresponding to the jth node are calculated as -1.8, -0.4, 0.2, -0.1, respectively, it is assumed that the time corresponding weight of each two moments of the ith node and the jth node is respectively: , the fitting sensitivity calculated according to the fitting sensitivity calculation formula based on the partial derivative of each time of the output data segment of the corresponding type of the two nodes and the time corresponding weight of each two times is 0.757.
[0059] It can be understood that, reflects the change correlation of the data of the jth node corresponding type at the hth time and the data of the ith node corresponding type at the kth time fitted by the sewage treatment index prediction network, the greater the value, the greater the data change of the ith node at the kth time will introduce the change of the jth node at the tth time to a greater extent, and thus the change sensitivity of the ith node and the jth node is greater; since the data of the ith node corresponding type and the data of the jth node corresponding type are time staggered, the change sensitivity of the data of the ith node corresponding type and the data of the jth node corresponding type is also related to the time corresponding relationship. When analyzing the change sensitivity between different nodes fitted by the sewage treatment index prediction network, the time corresponding relationship is considered. Therefore, the time corresponding weight is introduced to reflect the time corresponding relationship. reflects the change sensitivity between the ith node and the jth node fitted by the sewage treatment index prediction network.
[0060] It should be noted that the method for obtaining the time corresponding weight comprises: the variance of the correlation calculated after each time of the ith node corresponding type and the jth node corresponding type is recorded as a reference variance, a Gaussian distribution function is constructed with the staggered time length as the mean value and the reference variance as the variance, the time interval length of each data corresponding time of the corresponding type of the ith node and each data corresponding time of the corresponding type of the jth node is calculated, and the value of the value at the time interval length in the Gaussian distribution function is recorded as the distribution weight; the normalized value of the distribution weight is taken as the time corresponding weight.
[0061] In order to facilitate understanding, the following will be illustrated by a specific example: Suppose the staggered time length of the ith node and the jth node is 2, the variance of the correlation calculated after each time of the ith node and the jth node is 0.1073, a Gaussian function is obtained with 2 as the mean value and 0.1073 as the variance, based on the time interval length of each data corresponding time of the corresponding type of the ith node and each data corresponding time of the corresponding type of the jth node is 0, 1, 2, 3, -1, 0, 1, 2, -2, -1, 0, 1, -3, -2, -1, 0, respectively, the normalized value of the corresponding position data of each time interval length in the Gaussian function is: , , , , , , 、 、 、 、 、 、 、 、 、 .
[0062] S31: the causal correlation loss function.
[0063] It should be noted that in order to enable the wastewater treatment index prediction network to learn the causal correlation information between each link of wastewater treatment, the fitting sensitivity generated by the wastewater treatment index network needs to be similar to the theoretical sensitivity, so that the data fitted by the wastewater treatment index network conforms to this causal correlation information, thereby promoting the wastewater treatment index prediction network to learn the causal correlation information between each link of wastewater treatment.
[0064] Preferably, as an example, the causal correlation loss function includes:
[0065] wherein, represents the fitting sensitivity of the ith node and the jth node, represents the theoretical sensitivity of the ith node and the jth node, represents the number of successor nodes of the ith node, represents the number of predecessor nodes, represents the causal correlation loss function.
[0066] It can be understood that the loss function is set by analyzing the difference between the theoretical sensitivity and the fitting sensitivity, so that the loss function reflects the difference information between the theoretical sensitivity and the fitting sensitivity, and then by making the loss function value as small as possible, the data fitted by the wastewater treatment index network conforms to the causal correlation information based on experience, so that the wastewater treatment index network learns the causal correlation information based on experience.
[0067] It should be noted that the predecessor node is the node before each node, and the successor node is the node after each node.
[0068] S4: training the wastewater treatment index prediction network based on the causal correlation loss function and the loss function provided by the LSTM algorithm to realize the wastewater treatment abnormality early warning.
[0069] S40: training the wastewater treatment index prediction network based on the causal correlation loss function and the loss function provided by the LSTM algorithm.
[0070] Preferably, as an example, the training of the sewage treatment index prediction network is completed based on the causal correlation loss function and the loss function of the LSTM algorithm itself, including: The accumulation of the causal correlation loss function and the loss function of the LSTM algorithm itself is taken as a comprehensive loss function.
[0071] Each sample is input into the sewage treatment index prediction network, the learning path loss value is calculated based on the method in steps S2 to S3, the prediction loss value is calculated based on the loss function of the LSTM algorithm itself, and the comprehensive loss value is obtained by accumulating the learning path loss value and the prediction loss value.
[0072] Based on the comprehensive loss value, the parameters in the sewage treatment index prediction network are updated in reverse by using the gradient descent method. Until the comprehensive loss value converges, the training of the sewage treatment index prediction network is completed.
[0073] It should be noted that the calculation of the prediction loss value by using the loss function of the LSTM algorithm itself and the reverse update of the parameters in the sewage treatment index prediction network by using the gradient descent method based on the loss value are prior art, which will not be described here.
[0074] S41: to realize sewage treatment abnormality early warning.
[0075] Preferably, as an example, to realize sewage treatment abnormality early warning, including: The newly collected sewage treatment operation data segments of several types of the current time period are input into the trained sewage treatment index prediction network to obtain various types of sewage treatment operation data at future time points. If there is a data in the various types of sewage treatment operation data at the future time points that meets the abnormality early warning condition, an abnormality early warning is issued. If all the various types of sewage treatment operation data at the future time points do not meet the abnormality early warning condition, no early warning is performed.
[0076] It should be noted that the abnormality early warning condition can be that the sewage treatment operation data is not in a preset normal value range. It can also be other conditions, which are not specifically limited here.
[0077] The embodiment of the application also discloses a sewage treatment abnormality early warning system based on big data analysis, which comprises a processor and a memory, and the memory stores computer program instructions. When the computer program instructions are executed by the processor, the sewage treatment abnormality early warning method based on big data analysis according to the application is realized.
[0078] The above system also includes a communication bus and a communication interface and other components familiar to those skilled in the art, the settings and functions of which are known in the art, and thus will not be described here.
[0079] In the present application, the aforementioned memory can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium can be any suitable magnetic storage medium or magnetic-optical storage medium, such as a resistive random access memory, a dynamic random access memory, a static random access memory, a ferroelectric random access memory, a high bandwidth memory, a hybrid memory cube, or the like, or any other medium that can be used to store desired information and that can be accessed by an application, module, or both. Any such computer storage media can be part of the device or accessible or connectable thereto.
Claims
1. A sewage treatment abnormality early warning method based on big data analysis is characterized by: Including steps: Acquire a historical operation data set, wherein each sample in the historical operation data set includes several types of sewage treatment operation data segments in a time period; Taking various types of sewage treatment operation data as nodes, the directed edges between nodes and the weights of the corresponding directed edges are constructed according to the correlation between different types of sewage treatment operation data to obtain a causal relationship structure diagram; Calculating the theoretical sensitivity between two nodes based on the causal relationship structure graph, wherein the theoretical sensitivity is positively correlated with the weight of the directed edge of the path between the two nodes; A sewage treatment index prediction network is constructed based on the LSTM algorithm. All types of sewage treatment operation data segments in each sample in the historical operation data set are input into the sewage treatment index prediction network. Output data of the type corresponding to each node is obtained. The fitting sensitivity of the two nodes is calculated based on the change correlation between the output data of the corresponding type of the latter node and the output data of the corresponding type of the former node. A causal association loss function is constructed, and the causal association loss function is positively correlated with the difference between the fitting sensitivity and the theoretical sensitivity. The sewage treatment index prediction network is trained based on the causal association loss function and the loss function of the LSTM algorithm to achieve abnormal warning of sewage treatment.
2. The sewage treatment abnormality early warning method based on big data analysis according to claim 1 is characterized in that: The various types of sewage treatment operation data are used as nodes, and directed edges between nodes and weights of corresponding directed edges are constructed according to the correlation of different types of sewage treatment operation data to obtain a causal relationship structure diagram, including: Based on the process flow, directed edges of nodes corresponding to different types of sewage treatment data are constructed; the time series of sewage treatment operation data of each node is obtained; the staggered duration of the time series of sewage treatment operation data of two adjacent nodes is calculated, and the change sensitivity of the directed edges corresponding to the two adjacent nodes is calculated based on the temporal relationship of the time series of sewage treatment operation data of the two adjacent nodes under the staggered duration, and the change sensitivity of the two adjacent nodes is used as the weight of the directed edges corresponding to the two adjacent nodes; the obtained graph structure is recorded as a causal relationship structure graph.
3. The sewage treatment abnormality early warning method based on big data analysis according to claim 2 is characterized in that: The calculation of the misalignment duration of the sewage treatment operation data time series of two adjacent nodes includes: The sewage treatment operation data time series of the previous node of two adjacent nodes is shifted by one moment relative to the next node. The correlation of the sewage treatment operation data time series of the two adjacent nodes after the shifted moment is calculated once each time the time series is shifted. The number of shifted moments corresponding to the maximum correlation value is obtained as the shift duration of the sewage treatment operation data time series of the two adjacent nodes.
4. The sewage treatment abnormality early warning method based on big data analysis according to claim 2 is characterized in that: The calculation of the change sensitivity of the directed edges corresponding to the two adjacent nodes based on the time series relationship of the sewage treatment operation data time series of the two adjacent nodes under the staggered duration includes: The difference between each data and the previous data in the sewage treatment operation data time series of each node is taken as the variation of each data; The change sensitivity of any data in the sewage treatment operation data time series of the latter node between two adjacent nodes is calculated by dividing the change of the data at the corresponding moment under the misalignment duration in the sewage treatment data time series of the former node by the cumulative sum of the anti-zero parameter; The change sensitivity of the latter node between two adjacent nodes is taken as the change sensitivity of all data in the sewage treatment operation data time series of the latter node.
5. The sewage treatment abnormality early warning method based on big data analysis according to claim 1 is characterized in that: The calculation of the theoretical sensitivity between two nodes based on the causal relationship structure graph includes: Obtain all paths between two nodes in the causal relationship structure graph, and take the product of the weights of all directed edges on any path between the two nodes as the theoretical sensitivity of the path; The cumulative sum of the theoretical sensitivities of all paths between two nodes is taken as the theoretical sensitivity between the two nodes.
6. The sewage treatment abnormality early warning method based on big data analysis according to claim 3 is characterized in that: The calculating of the fitting sensitivity of the two nodes based on the change correlation between the output data of the corresponding type of the latter node and the output data of the corresponding type of the former node in the two nodes includes: in, Represents the partial derivative of the output data of the j-th node corresponding to the type at the h-th moment, Represents the partial derivative of the output data of the i-th node corresponding to the type at the k-th moment, It represents the time corresponding weight of the output data of the j-th node corresponding to the type at the h-th moment and the output data of the i-th node corresponding to the type at the k-th moment, Indicates the number of moments of output data, Indicates the anti-zero parameter, Represents the fitting sensitivity between the i-th node and the j-th node.
7. The sewage treatment abnormality early warning method based on big data analysis according to claim 6 is characterized in that: The method for obtaining the time corresponding weight includes: Calculate the variance of the correlation calculated after all times of misalignment and record it as the reference variance. Construct a Gaussian distribution function with the misalignment duration as the mean and the reference variance as the variance. Calculate the time interval length between the corresponding time of each data of the corresponding type of the i-th node and the corresponding time of each data of the corresponding type of the j-th node. Obtain the value of the time interval length in the Gaussian distribution function and record it as the distribution weight. The normalized value of the distribution weight is used as the time corresponding weight.
8. The sewage treatment abnormality early warning method based on big data analysis according to claim 1 is characterized in that: The constructing of the causal association loss function includes: in, represents the fitting sensitivity between the i-th node and the j-th node, represents the theoretical sensitivity of the i-th node and the j-th node, represents the number of successor nodes of the i-th node, Indicates the number of predecessor nodes, represents the causal association loss function.
9. The sewage treatment abnormality early warning method based on big data analysis according to claim 1 is characterized in that: The above-mentioned method for realizing abnormal warning of sewage treatment includes: Inputting newly collected several types of sewage treatment operation data segments of the current time period into the trained sewage treatment index prediction network to obtain various types of sewage treatment operation data at various moments in the future. If any data in the various types of sewage treatment operation data at various moments in the future meets the abnormal warning condition, an abnormal warning is issued; If all sewage treatment operation data of various types at future moments do not meet the abnormal warning conditions, no warning will be issued.
10. The sewage treatment abnormality early warning system based on big data analysis is characterized by: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the sewage treatment abnormality early warning method based on big data analysis according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Method and system for tracing non-optimal reasons in sewage treatment process and storage medium
CN116228016A
Industrial wastewater treatment monitoring method and system based on LSTM
CN119337299A
Early warning method for abnormal emission of pollution facilities based on big data analysis
CN119474672A
Simulation prediction method and system for dynamic process of sewage treatment based on digital twinning
CN120197403A
Home abnormal state signal detection method and system based on multi-mode sensing
CN120216965A