Water environment prediction method and device based on block-learnable weight matrix

By adopting blockable learning weight matrix and multi-scale structure in the STGCN model, combined with the dynamic adjustment mechanism, the problems of insufficient parameter homogeneity, scale sensitivity and time-varying in water environment prediction are solved, and the prediction accuracy is significantly improved and Explanation of the model.

CN119027276BActive Publication Date: 2024-12-20POWERCHINA HUADONG ENG CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411489225.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2024-12-20
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

The existing STGCN models have problems such as parameter homogeneity, insufficient scale sensitivity and insufficient time-variability modeling in water environment prediction, resulting in a decrease in prediction accuracy and insufficient physical explanatory nature.

Method used

Using a method based on blockable learning weight matrix, the learning weight matrix is ​​divided into different sub-blocks. Each sub-block is specifically responsible for the interactive modeling of specific types of water quality parameters, introducing a multi-scale structure and dynamic adjustment mechanism, through which Variable factors adjust the weight matrix to reflect the time-variability of hydrodynamic conditions.

Benefits of technology

It significantly improves the accuracy of water environment prediction and the expression ability of the model, can effectively capture the complex interactions and multi-scale spatial dependence between different types of water quality parameters, and accurately reflect the time-varying characteristics of hydrodynamic conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119027276B_ABST
    Figure CN119027276B_ABST
Patent Text Reader

Abstract

The present invention provides a water environment prediction method and device based on a block learnable weight matrix, which relates to the technical field of water environment prediction, including: obtaining historical water quality monitoring data of the water environment to be tested; constructing a block learnable weight matrix based on the historical water quality monitoring data; determining the scale factor and target standard deviation corresponding to each weight sub-matrix according to the initial importance of the water quality parameter, and using the scale factor and the target standard deviation to randomly initialize the weight sub-matrix to determine the target weight sub-matrix; using a preset adaptive mechanism, by adding a dynamic adjustment factor to the block learnable weight matrix composed of the target weight sub-matrix, dynamically adjusting the block learnable weight matrix to determine the target weight matrix, and using the target weight matrix to construct a target spatiotemporal convolutional network model, so as to use the target spatiotemporal convolutional network model to predict the water environment. The present invention can significantly improve the accuracy of water environment prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water environment prediction, and in particular to a water environment prediction method and device based on a block learnable weight matrix. Background Art

[0002] In recent years, deep learning technology has made significant progress in spatiotemporal data analysis. Among them, the spatio-temporal graph convolutional network (STGCN) has attracted widespread attention because of its ability to capture dependencies in both spatial and temporal dimensions. STGCN is a deep learning model for processing graph-structured data. It is suitable for capturing spatial and temporal dependencies. STGCN can learn complex interaction patterns between nodes through graph convolution operations, thereby effectively modeling time series data.

[0003] At present, relevant technologies have proposed that water environment prediction can be performed through STGCN, but the learnable weight matrix in traditional STGCN is usually designed as a single dense matrix to uniformly process all input features. This single matrix is ​​difficult to effectively capture the complex parameter relationships in the water environment. In addition, conventional STGCN models usually use fixed-scale graph convolution operations, which are difficult to fully capture the multi-scale spatial dependencies in the water environment system. The static graph structure and fixed learnable weight matrix used in the existing STGCN model are also difficult to accurately characterize the time-varying characteristics in the water environment system, resulting in a decrease in model prediction accuracy or insufficient physical explanatory power. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a water environment prediction method and device based on a block learnable weight matrix, which can significantly improve the accuracy of water environment prediction.

[0005] In a first aspect, an embodiment of the present invention provides a water environment prediction method based on a block learnable weight matrix, the method comprising: obtaining historical water quality monitoring data of the water environment to be tested, wherein the historical water quality monitoring data comprises: water quality parameters, the order of magnitude of water quality indicators contained in each water quality parameter, and characteristic dimension indicators and initial importance corresponding to each water quality parameter, and the water quality parameters comprise: physical parameters, chemical parameters and biological parameters; based on the water quality parameters, the order of magnitude of water quality indicators and characteristic dimension indicators, constructing a block learnable weight matrix, wherein the block learnable weight matrix comprises weight sub-matrices corresponding to each water quality parameter, and the block learnable weight matrix is ​​used to reflect the characteristics of each water quality parameter; according to the initial importance of the water quality parameters Importance, determine the scale factor and target standard deviation corresponding to each weight sub-matrix, and use the scale factor and target standard deviation to randomly initialize the weight sub-matrix to determine the target weight sub-matrix to capture the complex interactions between different types of water quality parameters; use the preset adaptive mechanism to dynamically adjust the block learnable weight matrix by adding dynamic adjustment factors to the block learnable weight matrix composed of the target weight sub-matrix to determine the target weight matrix, and use the target weight matrix to construct a target spatiotemporal convolutional network model to predict the water environment using the target spatiotemporal convolutional network model, where the target weight matrix is ​​a multi-scale block learnable weight matrix that can reflect the time-varying nature of hydrodynamic conditions.

[0006] In one embodiment, the scale factor and target standard deviation corresponding to each weight submatrix are determined according to the initial importance of the water quality parameters, and the weight submatrix is ​​randomly initialized using the scale factor and the target standard deviation. The step of determining the target weight submatrix includes: determining the scale factor and the spatial scale corresponding to the scale factor according to the initial importance of the water quality parameters, and setting the scale factor and the spatial scale in each weight submatrix respectively, so that the weight submatrix extracts hydrodynamic characteristics of different scales, wherein the spatial scale is associated with the corresponding weight submatrix and the scale factor, and the scale factor is negatively correlated with the spatial scale; using the scale factor to determine the target standard deviation corresponding to each weight submatrix, so that the weight submatrix is ​​randomly initialized from a normal distribution with a mean of 0 and a standard deviation of the target standard deviation, and determining the target weight submatrix.

[0007] In one embodiment, the target standard deviation is:

[0008] ;

[0009] in, is the target standard deviation, which is used to initialize the block-wise learnable weight matrix The standard deviation parameter of each weight sub-matrix in ; The number of type parameters of water quality indicators included in each water quality parameter; is the scale factor, which is an adjustment factor related to the spatial scale. The value of decreases with the increase of spatial scale k to reflect the influence of different scales.

[0010] In one embodiment, a preset adaptive mechanism is used to dynamically adjust the block learnable weight matrix by adding a dynamic adjustment factor to the block learnable weight matrix composed of the target weight submatrix, and the step of determining the target weight matrix includes: determining the time-varying learnable weight matrix by adding a dynamic adjustment factor to the block learnable weight matrix, wherein the time-varying learnable weight matrix is ​​used to reflect the time-varying nature of the hydrodynamic conditions; regularizing the time-varying learnable weight matrix, and optimizing and updating the regularized weight matrix through a forward propagation algorithm and a back propagation algorithm to determine the target weight matrix.

[0011] In one embodiment, the step of determining a time-varying learnable weight matrix by adding a dynamic adjustment factor to a block learnable weight matrix includes: determining the dynamic adjustment factor based on seasonal changes in the water environment, a hydrological condition influence coefficient, and current hydrological parameters, wherein the current hydrological parameters include: current flow, current water temperature, current pH value, and current dissolved oxygen; and determining the product of the dynamic adjustment factor and the learnable weight matrix as a time-varying learnable weight matrix.

[0012] In one embodiment, the dynamic adjustment factor is:

[0013] ;

[0014] Where t represents time, α is used to control the intensity of seasonal changes, β is the influence coefficient of hydrological conditions, and f(·) is a nonlinear function based on current hydrological parameters. is the current flow rate, Current water temperature , is the current pH value, is the current dissolved oxygen.

[0015] In one embodiment, the step of performing regularization processing on the time-varying learnable weight matrix includes: applying L2 regularization to the time-varying learnable weight matrix to merge the time-varying learnable weight matrix with the L2 regularization term, and determining a dynamic regularization expression; the dynamic regularization expression is:

[0016] ;

[0017] in, is the dynamic adjustment factor, λ is the static regularization coefficient, is the block-based learnable weight matrix, is a time-varying learnable weight matrix.

[0018] In a second aspect, an embodiment of the present invention further provides a water environment prediction device based on a block learnable weight matrix, the device comprising: a data acquisition module, for acquiring historical water quality monitoring data of the water environment to be tested, wherein the historical water quality monitoring data comprises: water quality parameters, the order of magnitude of water quality indicators contained in each water quality parameter, and characteristic dimension indicators and initial importance corresponding to each water quality parameter, and the water quality parameters comprise: physical parameters, chemical parameters and biological parameters; a matrix construction module, for constructing a block learnable weight matrix based on water quality parameters, the order of magnitude of water quality indicators and characteristic dimension indicators, wherein the block learnable weight matrix comprises weight sub-matrices corresponding to each water quality parameter, and the block learnable weight matrix is ​​used to reflect the characteristics of each water quality parameter; a matrix optimization module, for The initial importance of water quality parameters is determined, the scale factors and target standard deviations corresponding to each weight sub-matrix are determined, and the scale factors and target standard deviations are used to randomly initialize the weight sub-matrix to determine the target weight sub-matrix to capture the complex interactions between different types of water quality parameters; the model construction module uses a preset adaptive mechanism to dynamically adjust the block learnable weight matrix by adding dynamic adjustment factors to the block learnable weight matrix composed of the target weight sub-matrix, determine the target weight matrix, and use the target weight matrix to construct a target spatiotemporal convolutional network model to predict the water environment using the target spatiotemporal convolutional network model, where the target weight matrix is ​​a multi-scale block learnable weight matrix that can reflect the time-varying nature of hydrodynamic conditions.

[0019] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement any one of the methods provided in the first aspect.

[0020] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement any one of the methods provided in the first aspect.

[0021] The embodiments of the present invention bring the following beneficial effects:

[0022] The embodiment of the present invention provides a water environment prediction method and device based on a block learnable weight matrix. After acquiring historical water quality monitoring data of the water environment to be tested, the method constructs a block learnable weight matrix based on water quality parameters, the order of magnitude of water quality indicators and characteristic dimension indicators. Then, according to the initial importance of the water quality parameters, the scale factor and target standard deviation corresponding to each weight sub-matrix are determined, and the weight sub-matrix is ​​randomly initialized using the scale factor and the target standard deviation to determine the target weight sub-matrix to capture the complex interactions between different types of water quality parameters. Finally, a preset adaptive mechanism is used to dynamically adjust the block learnable weight matrix by adding a dynamic adjustment factor to the block learnable weight matrix composed of the target weight sub-matrix to determine the target weight matrix, and the target weight matrix is ​​used to construct a target spatiotemporal convolutional network model to predict the water environment using the target spatiotemporal convolutional network model. The embodiment of the present invention can significantly improve the accuracy of water environment prediction.

[0023] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0024] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 A flow chart of a water environment prediction method based on a block learnable weight matrix provided in an embodiment of the present invention;

[0027] Figure 2 A schematic diagram of a learnable weight matrix provided by an embodiment of the present invention;

[0028] Figure 3 A specific flow chart of a water environment prediction method based on a block learnable weight matrix provided by an embodiment of the present invention;

[0029] Figure 4 A schematic diagram of the structure of a water environment prediction device based on a block-learnable weight matrix provided by an embodiment of the present invention;

[0030] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] Currently, in STGCN, the construction of a learnable weight matrix is ​​a key factor in model performance. First, STGCN needs to define a graph , where V is the node set and E is the edge set. For example, in tasks such as traffic prediction, nodes usually represent sensor locations and edges represent the connection relationship between nodes. Then, the adjacency matrix is ​​constructed based on this graph structure. , where N is the number of nodes. If there is an edge between nodes i and j, then , otherwise it is 0. STGCN uses the graph convolution operation approximated by Chebyshev polynomials, and its basic form is:

[0033]

[0034] in, is the degree matrix, is the adjacency matrix, are input features, is the learnable weight matrix, is the activation function, the learnable weight matrix W is the core parameter in the STGCN model, H is the calculation result of the graph convolution, and N refers to the number of monitoring stations. refers to the dimension of the input features, refers to the dimension of the output features.

[0035] The learnable weight matrix W is responsible for mapping the input features to the new feature space, enabling the network to learn an effective representation of the data. The dimension of W depends on the input feature dimension and the output feature dimension. The input feature dimension is , the output feature dimension is , at the time of initialization, W usually uses a random method, such as uniform distribution, or normal distribution. In STGCN, all nodes in the same layer share the same learnable weight matrix W. To further prevent overfitting, L1 or L2 regularization can be applied to the learnable weight matrix. During the training process, W is continuously updated through the back-propagation algorithm and the selected optimizer. The update formula is usually:

[0036]

[0037] in, is the learning rate and L is the loss function.

[0038] At present, the existing spatiotemporal graph convolutional network (STGCN) has the following limitations in dealing with complex water environment systems: (1) Parameter homogeneity problem: The learnable weight matrix in traditional STGCN It is usually designed as a single dense matrix to uniformly process all input features. This design ignores the heterogeneity and complex interactions between different water quality parameters. For example, the behavior and influence mechanisms of parameters such as dissolved oxygen (DO), biochemical oxygen demand (BOD) and ammonia nitrogen (NH3-N) in physical, chemical and biological processes are significantly different. A single matrix is ​​difficult to effectively capture such complex parameter relationships, resulting in reduced model prediction accuracy or insufficient physical interpretation. (2) Insufficient scale sensitivity: Conventional STGCN models usually use fixed-scale graph convolution operations, which are difficult to fully capture the multi-scale spatial dependencies in water environment systems. Processes such as pollutant diffusion and biochemical reactions in water bodies show different characteristics at different spatial scales. Single-scale modeling is difficult to accurately describe this complex spatial dynamics. (3) Insufficient time-varying modeling: Existing STGCN models usually use static graph structures and fixed learnable weight matrices, which are difficult to accurately describe the time-varying characteristics in water environment systems. Factors such as hydrodynamic conditions, seasonal changes, and human activities can cause the relationship between water quality parameters to change dynamically over time. Static models are difficult to capture this complex time-varying nature.

[0039] Based on this, the water environment prediction method and device based on block learnable weight matrix provided by the present invention are designed by block matrix ( , and ) cleverly solves the problem of parameter homogeneity by dividing the learnable weight matrix into different sub-blocks, each of which is responsible for modeling the interaction between specific types of water quality parameters, effectively integrating the domain knowledge of water environment science and improving the expressiveness and interpretability of the model; through the multi-scale structure (k=1,2,3), by introducing multiple learnable weight matrices, each matrix corresponds to a different spatial scale, effectively solving the problem of insufficient scale sensitivity. This design enables the model to capture local and global hydrodynamic characteristics at the same time, improving the modeling ability of complex water environment systems; in addition, the dynamic adjustment mechanism introduced by the present invention ,The problem of insufficient time-varying modeling is effectively solved by adjusting the learnable weight matrix through time-varying factors.,This design enables the model to adaptively adjust the intensity of mutual influence between parameters, accurately reflect the time-varying characteristics of hydrodynamic conditions, and improve the model's time series modeling ability.

[0040] See also Figure 1 The flowchart of a water environment prediction method based on a block learnable weight matrix is ​​shown, and the method mainly includes the following steps S102 to S108:

[0041] Step S102, obtaining historical water quality monitoring data of the water environment to be tested, wherein the historical water quality monitoring data includes: water quality parameters, the order of magnitude of water quality indicators contained in each water quality parameter, and characteristic dimension indicators and initial importance corresponding to each water quality parameter, and the water quality parameters include: physical parameters, chemical parameters and biological parameters.

[0042] Step S104, based on the water quality parameters, the order of magnitude of the water quality index and the characteristic dimension index, a block learnable weight matrix is ​​constructed, wherein the block learnable weight matrix includes weight sub-matrices corresponding to each water quality parameter, and the block learnable weight matrix is ​​used to reflect the characteristics of each water quality parameter. In one embodiment, see Figure 2 A schematic diagram of a learnable weight matrix is ​​shown in FIG. After obtaining water quality monitoring data, a specially designed learnable weight matrix is ​​introduced based on the spatiotemporal graph convolutional network (STGCN) framework. , effectively integrating hydrodynamics mechanism and deep learning technology, the weight matrix The innovative designs include: block matrix structure, introduction of multi-scale feature capture and dynamic adjustment mechanism. The above innovative designs can significantly improve the accuracy of water environment prediction.

[0043] In one embodiment, the multi-scale design generally includes three fixed spatial scales: local, medium, and large. In addition, an adaptive multi-scale structure can be designed to dynamically adjust the number and weight of scales according to data characteristics, which all fall within the scope of the present invention.

[0044] Step S106, according to the initial importance of the water quality parameters, determine the scale factor and target standard deviation corresponding to each weight sub-matrix, and use the scale factor and target standard deviation to randomly initialize the weight sub-matrix to determine the target weight sub-matrix to capture the complex interactions between different types of water quality parameters. In one embodiment, the scale factor and the spatial scale corresponding to the scale factor can be determined according to the initial importance of the water quality parameters, and the scale factor and the spatial scale are respectively set in each weight sub-matrix so that the weight sub-matrix extracts hydrodynamic characteristics of different scales, wherein the spatial scale is associated with the corresponding weight sub-matrix and the scale factor, and the scale factor is negatively correlated with the spatial scale. The scale factor is then used to determine the target standard deviation corresponding to each weight sub-matrix, so that the weight sub-matrix is ​​randomly initialized from a normal distribution with a mean of 0 and a standard deviation of the target standard deviation to determine the target weight sub-matrix, wherein the target standard deviation is:

[0045] ;

[0046] in, is the target standard deviation, which is used to initialize the block-wise learnable weight matrix The standard deviation parameter of each weight sub-matrix in ; The number of type parameters of water quality indicators included in each water quality parameter; is the scale factor, which is an adjustment factor related to the spatial scale. The value of decreases with the increase of spatial scale k to reflect the influence of different scales.

[0047] That is, the above steps will learn the weight matrix The design is in the form of a block matrix to reflect the characteristics of different types of water quality parameters, and each sub-block is initialized with a modified He, and the standard deviation is adjusted according to the parameter type and spatial scale k. Finally, different To capture the hydrodynamic characteristics at different spatial scales.

[0048] Step S108, using a preset adaptive mechanism, by adding a dynamic adjustment factor to the block learnable weight matrix composed of the target weight submatrix, dynamically adjusting the block learnable weight matrix, determining the target weight matrix, and using the target weight matrix to construct a target spatiotemporal convolutional network model, so as to predict the water environment using the target spatiotemporal convolutional network model, wherein the target weight matrix is ​​a multi-scale block learnable weight matrix that can reflect the time-varying nature of the hydrodynamic conditions. In one embodiment, the target weight matrix can be adjusted during the training process. Apply L2 regularization and introduce dynamic factors To adjust , reflecting the time-varying nature of the hydrodynamic conditions, that is, by adding a dynamic adjustment factor to the block learnable weight matrix, the time-varying learnable weight matrix is ​​determined, and the time-varying learnable weight matrix is ​​regularized. Finally, the regularized weight matrix is ​​optimized and updated through the forward propagation algorithm and the back propagation algorithm to determine the target weight matrix, where the time-varying learnable weight matrix is ​​used to reflect the time-varying nature of the hydrodynamic conditions.

[0049] In one embodiment, in addition to being based on a simple hydrological condition function , more complex time series models (such as LSTM) can also be introduced to model , capturing long-term dependencies.

[0050] For the scheme of determining the time-varying learning weight matrix in step S108, a dynamic adjustment factor can be determined according to the seasonal changes of the water environment, the hydrological condition influence coefficient and the current hydrological parameters, and the product of the dynamic adjustment factor and the learnable weight matrix is ​​determined as the time-varying learnable weight matrix, wherein the current hydrological parameters include: current flow, current water temperature, current pH value and current dissolved oxygen, and the dynamic adjustment factor is:

[0051] ;

[0052] Where t represents time, α is used to control the intensity of seasonal changes, β is the influence coefficient of hydrological conditions, and f(·) is a nonlinear function based on current hydrological parameters. is the current flow rate, is the current water temperature, is the current pH value, is the current dissolved oxygen.

[0053] Furthermore, when performing regularization processing, L2 regularization can be applied to the time-varying learnable weight matrix to merge the time-varying learnable weight matrix with the L2 regularization term to determine a dynamic regularization expression; the dynamic regularization expression is:

[0054] ;

[0055] in, is the dynamic adjustment factor, λ is the static regularization coefficient, is the block-based learnable weight matrix, is a time-varying learnable weight matrix.

[0056] That is to say, the core of the above scheme lies in the learnable weight matrix of the block matrix structure, which can be dynamically adjusted according to the characteristics of different types of water quality parameters, and through the He initialization method and multi-scale feature capture, the model can fully characterize the complex water environment system. In addition, the present invention also introduces a time-varying factor The weight matrix is ​​dynamically adjusted according to factors such as seasonal changes, flow and temperature anomalies to further improve the prediction accuracy. At the same time, L2 regularization is used to ensure that the model behavior conforms to physical laws and adapts to the non-stationary characteristics of the water environment system, thereby improving the model performance and providing new ideas for the field of environmental system modeling.

[0057] See also Figure 3 The specific flow chart of a water environment prediction method based on a block learnable weight matrix is ​​shown in FIG. The embodiment of the present invention also provides a specific implementation method of a water environment prediction method based on a block learnable weight matrix. The core of the method is that the learnable weight matrix The innovative design includes block matrix structure, multi-scale feature capture and dynamic adjustment mechanism. For details, see (A) to (D) below:

[0058] (A) Block matrix structure, learnable weight matrix The block matrix designed to reflect the characteristics of different types of water quality parameters has the following structure:

[0059]

[0060] in, , and The weight sub-matrices representing the physical, chemical and biological parameters respectively; , and The dimension design is determined based on the characteristics of the water environment system and the input and output requirements of the model. Assume that the input feature dimension of the STGCN model of the present invention is , the output feature dimension is ,but The overall dimensions will be × .

[0061] The present invention will Breaks down into different types of parameters:

[0062]

[0063] in, , and Represent the number of physical, chemical and biological parameters respectively, so the dimensions of each sub-matrix are designed as follows:

[0064] : ×

[0065] : ×

[0066] : ×

[0067] The mathematical representation is as follows:

[0068]

[0069]

[0070] If the present invention has the following parameter settings:

[0071]

[0072] but The dimensional design will be as shown in Table 1 below:

[0073] Table 1. Submatrix dimension design example table:

[0074]

[0075] in, Keeping all sub-matrices consistent ensures that different types of parameters can interact and fuse in the same feature space. and The setting is mainly to illustrate the learnable weight matrix This hypothetical setting reflects the typical characteristics of multi-parameter monitoring of water environment and deep learning model design, rather than based on strict theoretical basis. It roughly corresponds to the order of magnitude of common water quality indicators, including three key parameters: physical, chemical and biological. This reflects the common practice of expanding feature dimensions in neural networks, which is conducive to capturing complex nonlinear relationships between parameters. However, in practical applications, these dimensions should be optimized and adjusted according to specific water body characteristics, available monitoring data, and model performance evaluation results.

[0076] In practical applications, the present invention can adjust these dimensions according to the characteristics of specific water bodies and research priorities. For example, for lakes with severe eutrophication, the present invention can increase and dimensions to better capture the relevant processes.

[0077] (B) The He initialization method specifically includes the following (1) to (3):

[0078] (1) Scaling factors based on prior knowledge :Introducing scale factor The purpose is to make Capable of extracting hydrodynamic features at different scales. In STGCN, k represents different graph convolution branches, corresponding to different spatial scales. This multi-scale architecture design allows the model to capture local, medium, and large-scale hydrodynamic features simultaneously, thereby comprehensively characterizing complex water environment systems. Each scale k is associated with a specific learnable weight matrix and scale factor Related, among which It decreases with the increase of k, reflecting the relative importance of features at different spatial scales. For example, k = 1 is used to extract local hydrodynamic features (such as local turbulence), k = 2 is used to extract medium-scale features (such as transport at the river section scale), and k = 3 is used to extract large-scale features (such as water balance of the entire basin).

[0079] The above settings reflect the prior knowledge of the present invention, that is, in water environment systems, local interactions are usually stronger than large-scale interactions. Based on the prior knowledge, the initialization strategy of the present invention not only maintains the good practices in deep learning, but also incorporates the particularity of water environment systems. This method provides an excellent starting point for the model, which helps to better capture the complex interactions between water quality parameters of different types and scales, thereby improving the overall performance and prediction accuracy of the model. This means that for different spatial scales k, the present invention can adjust To control the initial importance of the feature. For example, the present invention can be set:

[0080] .

[0081] (2) The number of corresponding type parameters : The value of is determined based on the characteristics of the water environment system and the available monitoring data. It represents the quantity of each type of parameter (physical, chemical, biological). In one embodiment, The principles for selecting include: data availability: based on the actual available monitoring data; water body characteristics: based on the main characteristics and key issues of a specific water body; prediction objectives: parameters related to the prediction task should be included; model complexity: a balance between the number of parameters and model complexity. The following is a specific The example value table is shown in Table 2:

[0082] Table 2. Value examples and description table

[0083]

[0084] The above values ​​can be adjusted according to specific circumstances. For example, for different types of water bodies, the present invention will have different Configuration, for example:

[0085] River Systems:

[0086]

[0087] Lake System:

[0088]

[0089] Marine coastal systems:

[0090]

[0091] In the model, The value of directly affects the learnable weight matrix The dimensions and initialization of The choice of will affect the learning process and performance of the model. The value will provide more information, but it will also increase the complexity of the model and the risk of overfitting. Therefore, in practical applications, it is necessary to balance the specific situation and experimental results. The value of .

[0092] (3) Standard deviation σ: Each submatrix is ​​initialized using the modified He method, and its standard deviation σ is adjusted according to the parameter type and spatial scale k:

[0093]

[0094] in, is the number of corresponding type parameters (i.e., the number of type parameters of water quality indicators contained in each water quality parameter), is the adjustment factor related to the spatial scale, i.e., the scale factor; The value of decreases as the spatial scale k increases, reflecting the influence of different scales; It is used to initialize the learnable weight matrix The standard deviation parameter of the corresponding submatrix in ; This parameter plays a key role in the weight initialization process, affecting the initial training behavior and convergence speed of the model; This initialization strategy is based on a variant of He initialization, taking into account the particularity of the water environment system, by introducing , so that the initialization can adapt to the characteristics of different spatial scales. At the same time, reasonable initialization can speed up the convergence of the model and reduce the training time.

[0095] Specifically, For example, its application in the model can be expressed as:

[0096]

[0097] That is to say, The elements in will have a mean of 0 and a standard deviation of The normal distribution of is randomly initialized, see Table 3 below for details:

[0098] Table 3. Different types of parameters Calculation example table

[0099]

[0100] In summary, The design of reflects the innovation of the present invention in model initialization. It not only considers the general principles in deep learning, but also incorporates the particularity of the water environment system. This method provides a good starting point for the model and helps to capture the complex interactions between different types of water quality parameters, thereby improving the overall performance and prediction accuracy of the model. For example, for chemical parameters, the initialization standard deviation is:

[0101]

[0102] (C) Adaptive mechanisms and dynamic factors Specifically, they include (4) to (6):

[0103] (4) Time-varying factors Definition: It is designed as a function based on current hydrological conditions, taking into account factors such as seasonal changes, flow and temperature anomalies, and can be expressed as:

[0104]

[0105] Where t represents time (days), α controls the intensity of seasonal changes, β is the hydrological condition influence coefficient, and f(·) is based on the current hydrological parameters (such as current flow , Current water temperature , Current pH value and current dissolved oxygen ), in one embodiment, see the following Table 4:

[0106] Table 4. Key parameters and their meanings of the time-varying learnable weight matrix:

[0107]

[0108] (5) Time-varying learnable weight matrix: This invention introduces a dynamic factor To adjust , to reflect the time-varying nature of the hydrodynamic conditions, namely:

[0109]

[0110] Additionally, these key parameters can be updated at each time step:

[0111]

[0112] This dynamic adjustment mechanism enables the model to adapt to seasonal changes and other environmental factors in the water environment system, further improving the accuracy of the prediction and the adaptability of the model.

[0113] (6) Dynamic regularization term: During the training process, Applying L2 regularization to ensure that the model behavior complies with physical laws, we obtain:

[0114]

[0115] Among them, λ is the regularization coefficient; In order to capture the multi-scale characteristics of the water environment system, this method designs different (k=1, 2, 3) to characterize the local, medium and large scale hydrodynamic characteristics. All follow the aforementioned block matrix structure and initialization strategy, and transform the time-varying learnable weight matrix After combining with the L2 regularization term, the present invention obtains a dynamic regularization expression:

[0116]

[0117] Among them, the above expression reveals the time-varying factor Complex effects on model regularization, Not only adjust the learnable weight matrix The time-varying behavior of also produces nonlinear modulation on the regularization strength through its square term. This mechanism enables the model to dynamically adjust its complexity according to different hydrological conditions, so as to better adapt to the non-stationary characteristics of the water environment system. In one embodiment, see Table 5 and Table 6 below:

[0118] Table 5. Dynamic regularization parameters and their meanings

[0119]

[0120] Table 6. Table of typical values ​​under different hydrological conditions

[0121]

[0122] (D) Calculation method, including the following (7) to (8):

[0123] (7) Forward propagation process: During the forward propagation of the model, the graph convolution operation needs to use the corresponding :

[0124]

[0125] in, represents the node feature matrix of the lth layer at time t, is the augmented adjacency matrix, is the corresponding degree matrix and σ(·) is the activation function.

[0126] (8) Back propagation process: During the back propagation process, gradient calculation needs to consider right Impact:

[0127]

[0128] Where L is the loss function and T is the total number of time steps. The design of the above time-varying learnable weight matrix enables the model to effectively capture short-term fluctuations and long-term trends in the water environment system, significantly improving the prediction accuracy and adaptability of the model. However, this method also increases the computational complexity, and a trade-off between performance and efficiency is required in practical applications.

[0129] In actual citation, taking the Taihu Lake cyanobacteria outbreak prediction model as an example, see (1) to (7):

[0130] (1) Data preparation: Collect water quality monitoring data of Taihu Lake from 2015 to 2020, including parameters such as temperature, dissolved oxygen, pH, total nitrogen, total phosphorus, and chlorophyll a.

[0131] (2) Network structure: A 3-layer STGCN structure is used with input feature dimensions =10, output feature dimension =64.

[0132] (3) Learnable weight matrix Design: Set according to Table 7 parameter:

[0133] Table 7: Parameter Setting Table( = 10, = 64)

[0134]

[0135] (4) Multi-scale design: set three spatial scales (k=1, 2, 3), The values ​​are shown in Table 8:

[0136] Table 8: Value table (k = 1, 2, 3):

[0137]

[0138] (5) Dynamic adjustment: design is a function based on current hydrological conditions to account for seasonal variations:

[0139]

[0140] (6) Training and evaluation: The model was trained using data from 2015 to 2019 and tested using data from 2020. The root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R²) were used as evaluation indicators.

[0141] In practical applications, taking the water quality prediction model of the middle and lower reaches of the Yangtze River as an example, see (1) to (7) below:

[0142] (1) Data collection: Collect water quality data from major monitoring stations in the middle and lower reaches of the Yangtze River from 2018 to 2023, including parameters such as water temperature, dissolved oxygen, COD, ammonia nitrogen, and total phosphorus.

[0143] (2) Network architecture: A 4-layer STGCN structure is used with input feature dimensions =12, output feature dimension =128.

[0144] (3) Learnable weight matrix Design: According to the characteristics of the Yangtze River system, adjust The parameter settings are shown in Table 9:

[0145] Table 9: Yangtze River system Parameter Setting Table( = 12, = 128)

[0146]

[0147] (4) Multi-scale design: Considering the complexity of the Yangtze River system, four spatial scales (k = 1, 2, 3, 4) are set. The values ​​are shown in Table 10:

[0148] Table 10: Yangtze River system Value table (k = 1, 2, 3, 4)

[0149]

[0150] (5) Dynamic adjustment mechanism: design A function that takes into account seasonality and flood and dry season characteristics:

[0151]

[0152] in, is the flow rate of the day, and are the historical average flow and standard deviation respectively.

[0153] (6) Model training and validation: The model is trained using data from 2018 to 2022 and tested using data from 2023. In addition to conventional evaluation indicators, the Nash-Sutcliffe efficiency coefficient (NSE) is also introduced to evaluate model performance.

[0154] This method performs well in water quality prediction in the middle and lower reaches of the Yangtze River, especially in capturing the spatiotemporal variation patterns of water quality parameters. The model can effectively reflect the impact of upstream water and tributary inflow on water quality, providing strong support for water environment management in the Yangtze River Basin.

[0155] In summary, the present invention uses a specially designed learnable weight matrix It combines hydrodynamic knowledge and deep learning technology to improve prediction accuracy and generalization ability. The block matrix structure allows the model to specialize for different types of parameters (such as physical, chemical, and biological parameters). This design enables the model to more accurately capture the interactions between various parameters, thereby improving prediction accuracy. In addition, the introduction of the multi-scale structure k enables the model to simultaneously consider local, medium, and large-scale hydrodynamic characteristics, which improves the model's performance at different spatial scales.

[0156] Since the learnable weight matrix The block structure directly reflects the mutual influence between different types of parameters, so it can enhance the interpretability: The weight distribution of each sub-matrix (physical, chemical, biological) in can explain the contribution of different parameters to water quality prediction. For example, if The submatrix that represents the effect of temperature on dissolved oxygen has a larger weight, which means that temperature plays a key role in predicting dissolved oxygen concentration. This interpretability not only helps to understand the prediction mechanism of the model, but also provides a scientific basis for water environment management. In addition, The block matrix structure also provides great flexibility. The dimensions of each sub-matrix can be adjusted according to the characteristics of the specific water body and the available monitoring data. For example, for lakes with severe eutrophication, the dimensions of the sub-matrix related to nutrients can be increased to better characterize the eutrophication process.

[0157] Furthermore, the present invention The design enables multi-scale modeling (k=1,2,3), specifically, Different sub-matrices in can correspond to different spatial scales. For example, some sub-matrices can capture local water quality changes (such as the impact of point source pollution), while other sub-matrices can characterize large-scale hydrodynamic processes. This multi-scale structure enables the model to comprehensively characterize complex water environment systems, thereby providing more accurate and comprehensive water quality predictions.

[0158] In addition, the present invention introduces a dynamic factor To adjust , to reflect the time-varying nature of hydrodynamic conditions and can adapt to dynamic changes, which means that the model can automatically adjust its parameters according to changes in time, thereby adapting to the dynamic characteristics of the water environment system, for example, in the rainy season and the dry season, There will be different values, allowing the model to adjust parameter weights accordingly to better capture the impact of seasonal changes on water quality. This dynamic adjustment mechanism greatly improves the performance of the model in long-term forecasts.

[0159] For the water environment prediction method based on block learnable weight matrix provided in the above embodiment, the embodiment of the present invention provides a water environment prediction device based on block learnable weight matrix, see Figure 4 The schematic diagram of the structure of a water environment prediction device based on a block-based learnable weight matrix is ​​shown, and the device includes the following parts:

[0160] The data acquisition module 402 acquires historical water quality monitoring data of the water environment to be tested, wherein the historical water quality monitoring data includes: water quality parameters, the order of magnitude of water quality indicators contained in each water quality parameter, and characteristic dimension indicators and initial importance corresponding to each water quality parameter, and the water quality parameters include: physical parameters, chemical parameters and biological parameters;

[0161] A matrix construction module 404 constructs a block-learnable weight matrix based on water quality parameters, magnitudes of water quality indicators, and characteristic dimension indicators, wherein the block-learnable weight matrix includes weight sub-matrices corresponding to various water quality parameters, and the block-learnable weight matrix is ​​used to reflect the characteristics of various water quality parameters;

[0162] The matrix optimization module 406 determines the scale factor and target standard deviation corresponding to each weight sub-matrix according to the initial importance of the water quality parameters, and uses the scale factor and target standard deviation to randomly initialize the weight sub-matrix to determine the target weight sub-matrix to capture the complex interactions between different types of water quality parameters;

[0163] The model building module 408 uses a preset adaptive mechanism to dynamically adjust the block learnable weight matrix by adding a dynamic adjustment factor to the block learnable weight matrix composed of the target weight submatrix, determine the target weight matrix, and use the target weight matrix to build a target spatiotemporal convolutional network model to predict the water environment using the target spatiotemporal convolutional network model, wherein the target weight matrix is ​​a multi-scale block learnable weight matrix that can reflect the time-varying nature of hydrodynamic conditions.

[0164] The water environment prediction device based on the block learnable weight matrix provided in the embodiment of the present application can significantly improve the accuracy of water environment prediction.

[0165] In one embodiment, when determining the scale factor and target standard deviation corresponding to each weight submatrix according to the initial importance of water quality parameters, and randomly initializing the weight submatrix using the scale factor and target standard deviation to determine the target weight submatrix, the above-mentioned matrix optimization module 406 is also used to: determine the scale factor and the spatial scale corresponding to the scale factor according to the initial importance of the water quality parameters, and set the scale factor and the spatial scale in each weight submatrix respectively, so that the weight submatrix extracts hydrodynamic characteristics of different scales, wherein the spatial scale is associated with the corresponding weight submatrix and scale factor, and the scale factor is negatively correlated with the spatial scale; determine the target standard deviation corresponding to each weight submatrix using the scale factor, so that the weight submatrix is ​​randomly initialized from a normal distribution with a mean of 0 and a standard deviation of the target standard deviation, and determine the target weight submatrix.

[0166] In one implementation, the matrix optimization module 406 is further configured to determine a target standard deviation as:

[0167] ;

[0168] in, is the target standard deviation, which is used to initialize the block-wise learnable weight matrix The standard deviation parameter of each weight sub-matrix in ; The number of type parameters of water quality indicators included in each water quality parameter; is the scale factor, which is an adjustment factor related to the spatial scale. The value of decreases with the increase of spatial scale k to reflect the influence of different scales.

[0169] In one embodiment, when utilizing a preset adaptive mechanism to dynamically adjust the block learnable weight matrix by adding a dynamic adjustment factor to the block learnable weight matrix formed by the target weight submatrix to determine the step of the target weight matrix, the above-mentioned model construction module 408 is also used to: determine the time-varying learnable weight matrix by adding a dynamic adjustment factor to the block learnable weight matrix, wherein the time-varying learnable weight matrix is ​​used to reflect the time-varying nature of the hydrodynamic conditions; regularize the time-varying learnable weight matrix, and optimize and update the regularized weight matrix through a forward propagation algorithm and a back propagation algorithm to determine the target weight matrix.

[0170] In one embodiment, when performing the step of determining a time-varying learnable weight matrix by adding a dynamic adjustment factor to the block learnable weight matrix, the above-mentioned model construction module 408 is also used to: determine the dynamic adjustment factor according to the seasonal changes of the water environment, the influence coefficient of the hydrological conditions and the current hydrological parameters, wherein the current hydrological parameters include: current flow, current water temperature, current pH value and current dissolved oxygen; and determine the product of the dynamic adjustment factor and the learnable weight matrix as the time-varying learnable weight matrix.

[0171] In one implementation, the model building module 408 is further used to determine the dynamic adjustment factor as:

[0172] ;

[0173] Where t represents time, α is used to control the intensity of seasonal changes, β is the influence coefficient of hydrological conditions, and f(·) is a nonlinear function based on current hydrological parameters. is the current flow rate, Current water temperature , is the current pH value, is the current dissolved oxygen.

[0174] In one implementation, when performing the step of regularizing the time-varying learnable weight matrix, the model building module 408 is further used to: apply L2 regularization to the time-varying learnable weight matrix so that the time-varying learnable weight matrix is ​​combined with the L2 regularization term to determine a dynamic regularization expression; the dynamic regularization expression is:

[0175] ;

[0176] in, is the dynamic adjustment factor, λ is the static regularization coefficient, is the block-based learnable weight matrix, is a time-varying learnable weight matrix.

[0177] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0178] An embodiment of the present invention provides an electronic device. Specifically, the electronic device includes a processor and a storage device. The storage device stores a computer program, and when the computer program is executed by the processor, it executes the method described in any one of the above-mentioned implementation methods.

[0179] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present invention, the electronic device 100 includes: a processor 50, a memory 51, a bus 52 and a communication interface 53, wherein the processor 50, the communication interface 53 and the memory 51 are connected via the bus 52; the processor 50 is used to execute an executable module stored in the memory 51, such as a computer program.

[0180] The memory 51 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 53 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.

[0181] The bus 52 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0182] Among them, the memory 51 is used to store programs, and the processor 50 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 50 or implemented by the processor 50.

[0183] The processor 50 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 50. The above processor 50 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 51, and the processor 50 reads the information in the memory 51 and completes the steps of the above method in combination with its hardware.

[0184] The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be referred to the previous method embodiments, which will not be repeated here.

[0185] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, electronic device, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., various media that can store program codes.

[0186] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A water environment prediction method based on a block-learnable weight matrix, characterized in that: The method comprises: Acquire historical water quality monitoring data of the water environment to be tested, wherein the historical water quality monitoring data includes: water quality parameters, the order of magnitude of water quality indicators contained in each of the water quality parameters, and characteristic dimension indicators and initial importance corresponding to each of the water quality parameters, and the water quality parameters include: physical parameters, chemical parameters and biological parameters; Based on the water quality parameters, the order of magnitude of the water quality index and the characteristic dimension index, constructing a block learnable weight matrix, wherein the block learnable weight matrix includes weight sub-matrices corresponding to each of the water quality parameters, and the block learnable weight matrix is ​​used to reflect the characteristics of each water quality parameter; Determine the scale factor and target standard deviation corresponding to each weight sub-matrix according to the initial importance of the water quality parameters, and use the scale factor and the target standard deviation to randomly initialize the weight sub-matrix to determine the target weight sub-matrix to capture the complex interactions between different types of water quality parameters; By utilizing a preset adaptive mechanism, a dynamic adjustment factor is added to the block learnable weight matrix composed of the target weight submatrix, the block learnable weight matrix is ​​dynamically adjusted to determine the target weight matrix, and a target spatiotemporal convolutional network model is constructed using the target weight matrix to predict the water environment using the target spatiotemporal convolutional network model, wherein the target weight matrix is ​​a multi-scale block learnable weight matrix that can reflect the time-varying nature of hydrodynamic conditions.

2. The water environment prediction method based on block learnable weight matrix according to claim 1 is characterized in that: The step of determining the scale factor and target standard deviation corresponding to each weight submatrix according to the initial importance of the water quality parameter, and randomly initializing the weight submatrix using the scale factor and the target standard deviation to determine the target weight submatrix includes: According to the initial importance of the water quality parameter, the scale factor and the spatial scale corresponding to the scale factor are determined, and the scale factor and the spatial scale are respectively set in each of the weight sub-matrices so that the weight sub-matrix extracts hydrodynamic characteristics of different scales, wherein the spatial scale is associated with the corresponding weight sub-matrix and scale factor, and the scale factor is negatively correlated with the spatial scale; The target standard deviation corresponding to each of the weight sub-matrices is determined by using the scale factor, so that the weight sub-matrix is ​​randomly initialized from a normal distribution with a mean of 0 and a standard deviation of the target standard deviation to determine the target weight sub-matrix.

3. The water environment prediction method based on block learnable weight matrix according to claim 2 is characterized in that: The target standard deviation is: ; in, is the target standard deviation, which is used to initialize the block-wise learnable weight matrix The standard deviation parameter of each weight submatrix in ; The number of type parameters of water quality indicators included in each of the water quality parameters; is the scale factor, which is an adjustment factor related to the spatial scale, The value of decreases with the increase of spatial scale k to reflect the influence of different scales.

4. The water environment prediction method based on block learnable weight matrix according to claim 1 is characterized in that: The step of using a preset adaptive mechanism to dynamically adjust the block learnable weight matrix by adding a dynamic adjustment factor to the block learnable weight matrix formed by the target weight submatrix to determine the target weight matrix includes: Determining a time-varying learnable weight matrix by adding a dynamic adjustment factor to the block learnable weight matrix, wherein the time-varying learnable weight matrix is ​​used to reflect the time-varying nature of the hydrodynamic conditions; Regularization processing is performed on the time-varying learnable weight matrix, and the regularized weight matrix is ​​optimized and updated through a forward propagation algorithm and a back propagation algorithm to determine the target weight matrix.

5. The water environment prediction method based on block learnable weight matrix according to claim 4 is characterized in that: The step of determining the time-varying learnable weight matrix by adding a dynamic adjustment factor to the block learnable weight matrix comprises: Determine the dynamic adjustment factor according to the seasonal changes of the water environment, the influence coefficient of the hydrological conditions and the current hydrological parameters, wherein the current hydrological parameters include: current flow, current water temperature, current pH value and current dissolved oxygen; The product of the dynamic adjustment factor and the learnable weight matrix is ​​determined as a time-varying learnable weight matrix.

6. The water environment prediction method based on block learnable weight matrix according to claim 5 is characterized in that: The dynamic adjustment factor is: ; Where t represents time, α is used to control the intensity of seasonal changes, β is the influence coefficient of hydrological conditions, and f(·) is a nonlinear function based on current hydrological parameters. is the current flow rate, The current water temperature , is the current pH value, is the current dissolved oxygen.

7. The water environment prediction method based on block learnable weight matrix according to claim 4 is characterized in that: The step of performing regularization processing on the time-varying learnable weight matrix comprises: Apply L2 regularization to the time-varying learnable weight matrix to combine the time-varying learnable weight matrix with the L2 regularization term to determine a dynamic regularization expression; the dynamic regularization expression is: ; in, is the dynamic adjustment factor, λ is the static regularization coefficient, is the block-based learnable weight matrix, is the time-varying learnable weight matrix.

8. A water environment prediction device based on a block-learnable weight matrix, characterized in that: The device comprises: A data acquisition module is used to acquire historical water quality monitoring data of the water environment to be tested, wherein the historical water quality monitoring data includes: water quality parameters, the order of magnitude of water quality indicators contained in each of the water quality parameters, and characteristic dimension indicators and initial importance corresponding to each of the water quality parameters, and the water quality parameters include: physical parameters, chemical parameters and biological parameters; A matrix construction module, based on the water quality parameters, the order of magnitude of the water quality index and the characteristic dimension index, constructs a block learnable weight matrix, wherein the block learnable weight matrix includes weight sub-matrices corresponding to each of the water quality parameters, and the block learnable weight matrix is ​​used to reflect the characteristics of each of the water quality parameters; A matrix optimization module, which determines the scale factor and target standard deviation corresponding to each weight sub-matrix according to the initial importance of the water quality parameters, and uses the scale factor and the target standard deviation to randomly initialize the weight sub-matrix to determine the target weight sub-matrix to capture the complex interactions between different types of water quality parameters; The model building module uses a preset adaptive mechanism to dynamically adjust the block learnable weight matrix by adding a dynamic adjustment factor to the block learnable weight matrix composed of the target weight submatrix, determine the target weight matrix, and use the target weight matrix to build a target spatiotemporal convolutional network model to predict the water environment using the target spatiotemporal convolutional network model, wherein the target weight matrix is ​​a multi-scale block learnable weight matrix that can reflect the time-varying nature of hydrodynamic conditions.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 7.