Water quality prediction method and device

By constructing relational expression structure and extracting spatial characteristic information, the problem of difficult monitoring of water quality changes in pond management is solved, and a higher-precision water quality prediction is achieved.

CN119962820APending Publication Date: 2025-05-09SHENZHEN INSIGMA INNOVATION SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510024176.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

Existing pond management is difficult to accurately monitor water quality changes in real time, resulting in low water quality prediction accuracy.

Method used

By obtaining the geographical location, basin topology and water quality dynamic data of each monitoring site, a relational expression structure is constructed, spatial characteristic information is extracted, and a water quality prediction model is input to generate water quality quality levels.

Benefits of technology

Improve the accuracy of water quality prediction, and more accurately determine the water quality changes in different locations, thereby improving management efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119962820A_ABST
    Figure CN119962820A_ABST
Patent Text Reader

Abstract

The invention provides a water quality prediction method and device. The method comprises the following steps: acquiring a geographic position, a basin topological structure and water quality dynamic data of each monitoring station of a target area; correcting the water quality dynamic data to generate corrected prediction data; according to the geographic position of each monitoring station, the basin topological structure and the correction prediction data corresponding to each monitoring station, a relation expression structural formula is constructed, each monitoring station serves as one structure in the relation expression structural formula, and different structures are connected through edges; the edges between the adjacent structures represent the geographic position relationship of the monitoring stations, and the geographic position relationship can be determined based on the geographic position and the basin topological structure; according to the constructed relationship expression structural formula, extracting spatial feature information between each monitoring station and the adjacent monitoring stations, and generating feature data; and inputting the characteristic data into a water quality prediction model to generate a water quality grade. By adopting the technical scheme, the prediction precision can be improved.
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 quality prediction, and in particular to a water quality prediction method and device. Background Art

[0002] China's aquaculture industry has achieved remarkable development in recent years, with production and market size continuing to grow. However, despite the continuous advancement of technology and equipment, the management level of aquaculture still has some shortcomings.

[0003] With the development of aquaculture, the scale and complexity of pond farming have continued to increase. However, existing pond management faces many challenges, such as the difficulty in accurately monitoring water quality changes in real time. Summary of the invention

[0004] In view of this, the present disclosure provides a water quality prediction method and device, which can improve prediction accuracy.

[0005] The present invention provides a water quality prediction method, comprising:

[0006] Obtaining the geographical location of each monitoring station in the target area, the watershed topology and the water quality dynamic data corresponding to each monitoring station, wherein the water quality dynamic data includes multiple different types of water quality data;

[0007] Correcting the water quality dynamic data to generate corrected prediction data;

[0008] According to the geographical location of each monitoring station, the watershed topology and the corrected prediction data corresponding to each monitoring station, a relational expression structure is constructed, wherein each monitoring station is used as one of the structures in the relational expression structure, different structures are connected by edges, and the edges between adjacent structures represent the geographical location relationship of the monitoring stations, and the geographical location relationship is determined based on the geographical location and the watershed topology;

[0009] According to the constructed relational expression structure, the spatial characteristic information between each monitoring station and its adjacent monitoring stations is extracted to generate characteristic data for representing the spatial variation of water quality data;

[0010] The characteristic data is input into the water quality prediction model to generate the water quality grade

[0011] Optionally, the correcting the water quality dynamic data to generate corrected prediction data includes:

[0012] The water quality dynamic data is input into a correction model, wherein the correction model has multiple levels, and the multiple levels contain all types of water quality data, wherein the water quality data at the top level has the largest characteristic gain, and the data at the last level is the correction value of the water quality data with the largest characteristic gain at the previous level;

[0013] Based on the various levels of the correction model and the stratification conditions between different levels, the water quality dynamic data is matched layer by layer to determine the correction value of the water quality data of the same water quality type as the first water quality data in the penultimate level when all stratification conditions are met;

[0014] The sum of the water quality data of the same water quality type as the first water quality data in the penultimate level and the revised value, as well as other unrevised water quality data, are taken as revised prediction data.

[0015] Optionally, the correction model is determined in the following manner:

[0016] Acquire historical water quality dynamic data with time information in the target area;

[0017] According to the time information, water quality data of the same type is divided to obtain multiple data clusters;

[0018] For any data cluster, determining the characteristic gain corresponding to the same type of water quality data includes: determining multiple intervals according to the maximum difference between the water quality data in the data cluster; determining the number of water quality data contained in each interval and the difference between adjacent water quality data; determining the difference change corresponding to each interval according to the number of water quality data contained in each interval and the difference between adjacent water quality data; determining a first variation range value based on the difference change corresponding to each interval and the water quality data contained in each interval; and determining the difference between adjacent water quality data and determining a second variation range value based on each water quality data; using the difference between the first variation range value and the second variation range value as the characteristic gain;

[0019] The water quality type with the largest characteristic gain among multiple characteristic gains is filled into the first level of the correction model, and the characteristic gains of water quality data of other water quality types in any branch in the second level are determined according to the set first stratification conditions, and are filled into the second level of the correction model in sequence according to the size of the characteristic gains, and then the filling operation is performed again according to the size of the characteristic gains according to the set second stratification conditions until the last level is generated.

[0020] Optionally, constructing a relational expression structure according to the geographical location of each monitoring station, the watershed topology and the corrected prediction data corresponding to each monitoring station includes:

[0021] defining the main structure of the relational expression structure;

[0022] Taking any monitoring site as one of the substructures in the main structure, and taking the corrected prediction data corresponding to each monitoring site as a feature matrix;

[0023] Based on the watershed topology, determine the upstream and downstream relationship or distance between any two monitoring sites, and when it is determined that the distance between the two monitoring sites is less than a preset distance, or the flow direction relationship between the two monitoring sites satisfies the upstream and downstream relationship, construct an edge between the two monitoring sites;

[0024] The relational expression structure is constructed according to the substructure, the feature matrix and the edge between two monitoring sites.

[0025] Optionally, the step of extracting spatial feature information between each monitoring station and its adjacent monitoring stations based on the constructed relational expression structure to generate feature data for representing spatial variation of water quality data includes:

[0026] Using a graph neural network, in a recursive manner, aggregate the received relational expression structure and other relational expression structures adjacent to the relational expression structure;

[0027] Adopting the attention mechanism, dynamically adjusting the information propagation weights between relational expression structures, assigning different weights to adjacent relational expression structures, and generating aggregated relational expression structures;

[0028] From the time dimension, extract the dynamic change trend in the adjacent relationship expression structure;

[0029] Based on expressing the structural formula and dynamic change trend of the aggregation relationship, a fully connected layer is used to generate the feature data.

[0030] Optionally, the graph neural network includes: an input layer, a convolutional layer, an attention layer, a modeling layer, and a fully connected layer;

[0031] Use the following formula to perform the aggregation operation:

[0032]

[0033] in, represents the feature representation of the k-th layer monitoring site x, W (k) represents the weight matrix of the k-th layer network, ε represents the activation function, and w xy represents the weight of the edge, which is determined based on the flow velocity of the target area, ρ xy represents the directional weight, which is determined based on the water flow direction indicated by the basin topology. x Represents the self-loop weight of monitoring site x.

[0034] Optionally, the water quality prediction method further includes:

[0035] Based on the historical water quality dynamic data of the target area, a style transfer network is used to perform temporal style mapping on water quality characteristics to generate a water quality characteristic distribution map;

[0036] Before inputting the characteristic data into the water quality prediction model to generate the water quality grade, the method further includes:

[0037] The water quality characteristic distribution map and the characteristic data are fused to form fused characteristic data, and the fused characteristic data is input into the water quality prediction model.

[0038] Optionally, the adopting of a style transfer network to perform temporal style mapping on water quality features to generate a water quality feature distribution map includes: adopting a content encoder to extract spatial and temporal features from the historical water quality dynamic data to generate content features; adopting a style encoder to extract style features from pollutant distribution features in the historical water quality dynamic data; using a style transfer technology to apply the style features to the content features to generate a target feature distribution map; decoding the target feature distribution map to generate the water quality feature distribution map;

[0039] The fusing of the water quality characteristic distribution map and the characteristic data to form the fused characteristic data includes: performing an alignment operation so that the water quality characteristic distribution map and the characteristic data are in the same dimension; and splicing the water quality characteristic distribution map and the characteristic data along the channel direction to form the fused characteristic data.

[0040] Optionally, the water quality prediction method satisfies at least one or more of the following:

[0041] The water quality prediction model is a long short-term memory network, and the long short-term memory network is generated by training based on at least the characteristic data and the corrected prediction data;

[0042] When it is determined that the water quality level does not meet the requirements, an alarm message is sent, and the push method of the alarm message includes: one or more of SMS, real-time pop-up window, vibration, and playing warning sound;

[0043] Based on the water quality levels generated at different times, the water quality development trend is predicted.

[0044] Accordingly, the present invention also provides a water quality prediction device, comprising:

[0045] A data acquisition unit, used to acquire the geographical location of each monitoring station in the target area, the watershed topology and the water quality dynamic data corresponding to each monitoring station, wherein the water quality dynamic data includes multiple different types of water quality data;

[0046] A correction unit, used to correct the water quality dynamic data and generate corrected prediction data;

[0047] A construction unit, according to the geographical location of each monitoring station, the watershed topology and the corrected prediction data corresponding to each monitoring station, constructs a relational expression structure, wherein each monitoring station is used as one of the structures in the relational expression structure, different structures are connected by edges, and the edges between adjacent structures represent the geographical location relationship of the monitoring stations, and the geographical location relationship is determined based on the geographical location and the watershed topology;

[0048] An extraction unit extracts spatial feature information between each monitoring station and its neighboring monitoring stations according to the constructed relational expression structure, and generates feature data for representing spatial variation of water quality data;

[0049] The prediction unit is used to generate a water quality grade based on the characteristic data.

[0050] Compared with the prior art, the technical solution of the present invention has the following advantages:

[0051] In the water quality prediction method of the semiconductor structure provided by the present invention, on the one hand, by correcting the water quality dynamic data to generate corrected prediction data, the accuracy of the prediction data is improved; on the other hand, the relational expression structure reflects the spatial position relationship between different monitoring sites, and by extracting the spatial feature information between each monitoring site and its adjacent monitoring sites, feature data for representing the spatial changes of water quality data can be generated, which fully considers the fluidity of water and can determine the water quality changes at different locations, so that when using the water quality prediction model for prediction operations, the accuracy of the water quality grade can be improved, and the water quality grade determines the water quality, thereby improving the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the implementation mode of the present application or the technical solutions in the prior art, the drawings required for use in the implementation mode or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only the implementation modes of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0053] Figure 1 A flow chart of a water quality prediction method in one embodiment of the present invention;

[0054] Figure 2 A flow chart of correcting water quality dynamic data in one embodiment of the present invention;

[0055] Figure 3A schematic diagram of a hierarchical structure of a correction model in one embodiment of the present invention;

[0056] Figure 4 A flowchart of constructing a relational expression structure in one embodiment of the present invention;

[0057] Figure 5 Schematic diagram of the structure of a water quality prediction device in one embodiment of the present invention. DETAILED DESCRIPTION

[0058] As described in the background technology, existing pond management faces many challenges, such as the difficulty in accurately monitoring water quality changes in real time.

[0059] In order to solve the above technical problems, the present invention provides a water quality prediction method. On the one hand, by correcting the water quality dynamic data to generate corrected prediction data, the accuracy of the prediction data is improved; on the other hand, the relational expression structure reflects the spatial position relationship between different monitoring sites. By extracting the spatial feature information between each monitoring site and its adjacent monitoring sites, feature data for representing the spatial changes of water quality data can be generated. This fully considers the fluidity of water and can determine the water quality changes at different locations. Therefore, when using a water quality prediction model for prediction operations, the accuracy of the water quality grade can be improved. The water quality grade determines the water quality, thereby improving the prediction accuracy.

[0060] In order to enable those skilled in the art to better understand and implement the present invention, the specific scheme, principle, advantages and effects of the present invention are described in detail below through specific implementation methods with reference to the accompanying drawings.

[0061] See also Figure 1 A flow chart of a water quality prediction method in one embodiment of the present invention is shown in FIG. Figure 1 As shown, the following steps can be performed:

[0062] A. Obtain the geographical location of each monitoring station in the target area, the basin topology structure and the water quality dynamic data corresponding to each monitoring station.

[0063] Among them, water quality dynamic data includes many different types of water quality data. The "dynamic" in water quality dynamic data means that the water quality data changes in real time.

[0064] In some embodiments, the water quality data may include various types of water quality data such as dissolved oxygen, temperature, pH value, turbidity, atmospheric pressure, flow rate or flow rate.

[0065] Among them, a variety of sensors can be used to obtain various types of water quality data.

[0066] For example, the temperature is obtained through a temperature sensor, and the flow rate or flow rate is obtained through a flow rate sensor.

[0067] In some embodiments, the geographic location of the monitoring site can be obtained based on a geographic information system (GIS) tool.

[0068] In some embodiments, there may be multiple monitoring sites in the target area, and the multiple monitoring sites are distributed at different locations in the target area to achieve comprehensive monitoring of the target area.

[0069] In some implementations, the geographical location of the monitoring site may be set based on the watershed topology to achieve better monitoring results.

[0070] In some implementations, after determining the geographical location of each monitoring point, a variety of different types of sensors or other monitoring equipment may be set up to obtain dynamic water quality data at different geographical locations in the same target area.

[0071] In some implementations, after obtaining the water quality dynamic data corresponding to each monitoring station, some preprocessing operations may be performed to remove noise, erroneous values, and missing values ​​to improve the consistency between the water quality dynamic data.

[0072] In some implementations, at consecutive time points, a value of a certain parameter shows a sharp jump that does not conform to physical laws or normal change trends, which may be a noise value.

[0073] For example, if the dissolved oxygen is 5 mg / L at the previous time point and suddenly changes to 25 mg / L at the next time point, and there is no corresponding reasonable change in other parameters to explain this jump, then the value of 25 mg / L may be noise.

[0074] In some embodiments, by comparing with other related parameters at the same time point, if the value of a certain parameter does not conform to common sense in relation to other parameters, it may also be an erroneous value.

[0075] For example, under normal circumstances, when dissolved oxygen is low, fish may experience hypoxia, which may affect their activities, and may cause certain changes in other parameters such as pH. If the dissolved oxygen is very low, but there is no corresponding change in pH and other parameters, and it does not conform to the general law of water quality changes, then this data point may have a problem.

[0076] B. Correct the water quality dynamic data to generate corrected prediction data.

[0077] In some embodiments, there are some reasons that lead to errors in at least one type of water quality data obtained, and this error is extremely small and difficult to be detected. Therefore, this type of quality data can be corrected to obtain corrected prediction data that is closer to the actual data.

[0078] It should be pointed out that the "correction" in the present invention is not the operation of "data cleaning, normalization" in the existing scheme, but a correction measure that can be performed after data cleaning and normalization.

[0079] In some embodiments, see Figure 2 A flow chart of correcting water quality dynamic data in one embodiment of the present invention is shown in FIG. Figure 2 As shown, the following steps can be performed:

[0080] B1, input the water quality dynamic data into the correction model.

[0081] In some embodiments, the revised model may be based on historical water quality dynamic data with time information in the target area.

[0082] Based on the historical water quality dynamic data with time information, the obtained correction model has multiple levels, wherein the multiple levels contain all types of water quality data, wherein the water quality data at the top level has the largest feature gain, and the data at the last level is the correction value of the water quality data of the first water quality type of the previous level.

[0083] In other words, the correction model covers all types of water quality data and reflects the degree of correction of at least one type of water quality data.

[0084] By inputting the water quality dynamic data into the correction model, the selection of water quality parameters under different stratification conditions is taken into account, and the connection between one water quality type data and other water quality type data is enhanced, so that the correction model can correct the currently acquired water quality dynamic data.

[0085] In some embodiments, the step of obtaining the modified model includes:

[0086] B11, obtaining historical water quality dynamic data with time information in the target area.

[0087] The process of obtaining historical water quality dynamic data can refer to the description of step A.

[0088] In some implementations, by clarifying the time information of historical water quality dynamic data, the change trend of the same type of water quality data within the statistical time period can be obtained, which is helpful for predetermining the water quality change situation.

[0089] B12, dividing the water quality data of the same type according to the time information to obtain multiple data clusters.

[0090] In some embodiments, a large number of historical water quality dynamic data are obtained, and one historical water quality dynamic data includes multiple different types of water quality data. These water quality data are obtained in an existing order, so the same type of water quality data can be divided to obtain a corresponding data cluster, so that the changes in one type of water quality data can be determined.

[0091] In some implementations, the division operation may be performed based on the upload time of the water quality data, so that the water quality data in a data cluster are arranged according to the upload time.

[0092] B13, for any data cluster, determine the feature gain corresponding to the same type of water quality data.

[0093] In some embodiments, through steps B11 and B12, water quality data of the same type can be classified and sorted, so that the change area between any two adjacent water quality data can be determined. At the same time, based on the water quality data itself, the characteristic gain corresponding to one type of water quality data under this division method can be determined, which reflects the change trend of this type of water quality data in the current statistical period.

[0094] In some embodiments, the larger the characteristic gain, the greater the change trend of this type of water quality data, and the higher its importance to water quality prediction, so the consistency of this type of water quality data should be ensured; the smaller the characteristic gain, the smaller the change trend of this type of water quality data, and thus this type of water quality data needs to be corrected.

[0095] In some embodiments, the characteristic gain corresponding to any type of water quality data can be determined in the following manner:

[0096] 1) Determine a plurality of intervals according to the maximum difference between the water quality data in the data cluster.

[0097] In some embodiments, the maximum difference reflects the magnitude of the change between water quality data. The larger the maximum difference, the greater the change between water quality data. In this case, more intervals can be divided to increase discreteness; the smaller the maximum difference, the smaller the change between water quality data. In this case, fewer intervals can be divided to increase coupling.

[0098] It should be noted that the total interval corresponding to the multiple intervals at least includes all water quality data.

[0099] 2) Determine the amount of water quality data contained in each interval and the difference between adjacent water quality data.

[0100] 3) According to the amount of water quality data contained in each interval and the difference between adjacent water quality data, the difference change corresponding to each interval is determined.

[0101] In some implementations, the quotient of the difference between adjacent water quality data and the number of water quality data included in the interval may be used as the corresponding difference change amount.

[0102] For example, the number of water quality data contained in each interval is m, and the differences between adjacent water quality data are n1, n2 and n3, then the difference change is: (n1+n2+n3) / m.

[0103] 4) Determine a first range of variation based on the difference variation corresponding to each interval and the water quality data contained therein.

[0104] In some implementations, the difference change amount corresponding to each interval and the mean square error between the water quality data contained therein may be used as the first variation range value.

[0105] 5) Determine the difference between adjacent water quality data, and determine the second variation range value based on each water quality data.

[0106] The determination range of the second variation range value may refer to the description of the first variation range value.

[0107] 6) The difference between the first variation range value and the second variation range value is used as the characteristic gain. In some embodiments, the first variation range value takes into account the variation range of water quality data in different intervals, while the second variation range value takes into account the variation range of water quality data in a natural state. Through these two considerations, the accuracy of the characteristic gain and the comprehensiveness of the variation factors are improved.

[0108] It should be pointed out that as time changes, the water quality data with the largest characteristic gain will change. Therefore, the correction model can be reconstructed according to the set time period, or when a certain water quality data suddenly increases and tends to be stable.

[0109] B14, fill the water quality type with the largest characteristic gain among multiple characteristic gains into the first level of the correction model, and determine the characteristic gains of water quality data of other water quality types in any branch in the second level according to the set first stratification conditions, and fill them into the second level of the correction model in sequence according to the size of the characteristic gains, and then according to the set second stratification conditions, fill them again according to the size of the characteristic gains until the last level is generated.

[0110] In some embodiments, as described above, the larger the feature gain, the higher its importance in the prediction process, and thus it can be used as an element of the first level.

[0111] After determining the first level, according to the set first stratification condition, the feature gain of the second level is minimized, and then the two branches in the second level can be determined according to the process indicated in the first level. The water quality data with a larger feature gain in the second level can be used as the first water quality type in the second level.

[0112] By performing multiple stratification operations according to the stratification conditions between each level, a correction value can be generated at the last level, wherein the last level correction value is the average of the changes when the water quality data of the first water quality type in the second to last level meets the stratification conditions.

[0113] It should be noted that when performing the second layer and subsequent layering operations, the first variation range value obtained by layering is minimized.

[0114] In order to better understand the establishment process of the correction model in this scheme, an example is given. If the historical water quality dynamic data includes dissolved oxygen, temperature and pH, for example, it contains 5 samples, of which sample 1 is 5, 20 and 6.5; sample 2 is 7, 22 and 7.5; sample 3 is 4, 18 and 6.0; sample 4 is 8, 25 and 8.5; sample 5 is 6, 23 and 7.0.

[0115] If arranged and divided according to time, we obtain a temperature cluster including temperature values ​​of 20, 22, 18, 25 and 23, a pH cluster including pH values ​​of 6.5, 7.5, 6.0, 8.5 and 7.0, and a dissolved oxygen cluster including dissolved oxygen values ​​of 5, 7, 4, 8 and 6.

[0116] Taking the calculation of characteristic gain of dissolved oxygen as an example, the maximum difference value in the dissolved oxygen cluster is 4, then the dissolved oxygen cluster can be divided into 4 intervals, among which the first interval is (-∞, 1), the second interval is [1, 4], the third interval is [4, 8], and the fourth interval is (8, +∞].

[0117] Perform the matching operation. When the interval is (-∞, 1), [1, 4] and (8, +∞), the number of samples included is 0. When the interval is [4, 8], it includes sample 1 (dissolved oxygen is 5, dissolved oxygen change is 0), sample 2 (dissolved oxygen is 7, dissolved oxygen change is 2), sample 3 (dissolved oxygen is 4, dissolved oxygen change is -3), sample 4 (dissolved oxygen is 8, dissolved oxygen change is 4), sample 5 (dissolved oxygen is 6, dissolved oxygen change is -2), then the difference change is Δ1=(0+2-3+4-2) / 5=0.2.

[0118] Then, based on Δ1 and the parameters of the dissolved oxygen cluster itself, the difference change is determined as:

[0119]

[0120] Furthermore, the first range of variation is:

[0121]

[0122] According to the above method, the second variation range value is determined:

[0123]

[0124] Thus, the characteristic gain of dissolved oxygen is 0.

[0125] Similarly, the characteristic gain of temperature is 4.06 and the characteristic gain of PH is 3.61.

[0126] After the above steps, the temperature feature gain is the largest, and the temperature is determined to be the first-level water quality type.

[0127] Then, whether the temperature is greater than 22 is used as the stratification condition (it should be pointed out that the stratification basis is: to minimize the first change range value of the water quality data of the second level), and the characteristic gains corresponding to pH and dissolved oxygen are calculated again under the stratification condition of whether the temperature is greater than 22, and the dissolved oxygen with a larger characteristic gain is used as the first water quality type in the second level, and the pH with a smaller characteristic gain is used as the second water quality type in the second level. Then, according to whether the dissolved oxygen is greater than 5 and whether the pH is greater than 7.5, the correction amount in the third level is determined, so as to obtain the following: Figure 3 A schematic diagram of the hierarchical structure of a revised model is shown.

[0128] More specifically, for samples 1 and 3 that satisfy the condition that the temperature does not exceed 22 degrees Celsius and the dissolved oxygen does not exceed 5, the corresponding dissolved oxygen changes are 0 and -3 respectively. Then, one of the correction values ​​of dissolved oxygen corresponding to the third level is (0-3) / 2=-1.5.

[0129] Similarly, other correction values ​​of dissolved oxygen corresponding to the third level under other conditions are calculated to be -2, -2, and 4, respectively. B2, based on the various levels of the correction model and the stratification conditions between different levels, the water quality dynamic data is matched layer by layer to determine the correction value of the water quality data of the same water quality type as the first water quality data in the penultimate level when all stratification conditions are met.

[0130] In some embodiments, if one of the water quality dynamic data is dissolved oxygen 6, temperature 21, and pH 7, when the data is input into the correction model, 21 is less than 22, the pH in the second level is selected, and the pH value is less than 7.5, then the correction value of dissolved oxygen is determined to be 2.

[0131] In some embodiments, if one of the water quality dynamic data is dissolved oxygen 5, temperature 24, and pH 7.2, when the data is input into the correction model, 24 is greater than 22, the dissolved oxygen in the second level is selected, and the dissolved oxygen does not exceed 5, then the correction value of dissolved oxygen is determined to be -1.5.

[0132] B3, the sum of the water quality data of the same water quality type as the first water quality type in the penultimate level and the correction value, as well as other uncorrected water quality data, is used as the corrected prediction data.

[0133] In some embodiments, after steps B1 and B2, it is determined that the corrected value of dissolved oxygen is 2, and the corrected predicted data is dissolved oxygen of 8, temperature of 21, and pH of 7.

[0134] In some embodiments, after steps B1 and B2, it is determined that the corrected value of dissolved oxygen is -1.5, and the corrected predicted data is dissolved oxygen of 3.5, temperature of 24, and pH of 7.2.

[0135] Thus, through the above process, correction of at least one type of water quality parameter is achieved.

[0136] It should be pointed out that the above examples are only for illustrative purposes and do not represent actual applications. They are only used to illustrate the process of determining the correction amount of water quality data under different conditions and should not be understood as limiting the present invention.

[0137] C. Constructing a relational expression structure according to the geographical location of each monitoring station, the watershed topology and the corrected prediction data corresponding to each monitoring station.

[0138] In some embodiments, the relationship expression structure reflects the spatial position relationship between different monitoring sites.

[0139] More specifically, each monitoring site is one of the structures in the relationship expression formula, different structures are connected by edges, and the edges between adjacent structures represent the geographical location relationship of the monitoring sites, which can be determined based on the geographical location and the basin topology.

[0140] In some embodiments, see Figure 4 You can perform the following steps to construct a relational expression structure:

[0141] C1, defines the main structure of the relational expression formula.

[0142] In some embodiments, the main structure is: G=(V, E, X), where V represents the monitoring site, E represents the connection relationship between the monitoring sites, and X represents the corrected prediction data.

[0143] C2, taking any monitoring site as one of the substructures in the main structure, and taking the corrected prediction data corresponding to each monitoring site as the feature matrix.

[0144] C3, based on the watershed topology, determines the upstream and downstream relationship or distance between any two monitoring sites, and when it is determined that the distance between the two monitoring sites is less than a preset distance, or the flow direction relationship between the two monitoring sites satisfies the upstream and downstream relationship, constructs an edge between the two monitoring sites.

[0145] Here, “edge” represents the upstream and downstream relationship or distance between any two monitoring sites.

[0146] C4, constructing the relationship expression structure according to the substructure, the feature matrix and the edge between two monitoring sites.

[0147] In some embodiments, based on steps C1 to C3, the edge between any two monitoring sites is determined, and thus the above parameters can be filled into the main structure according to the main structure to generate a relational expression structure.

[0148] D. According to the constructed relational expression structure, the spatial feature information between each monitoring station and its adjacent monitoring stations is extracted to generate feature data for representing the spatial variation of water quality data.

[0149] In some embodiments, by extracting spatial feature information between each monitoring site and its adjacent monitoring sites, feature data for representing the spatial variation of water quality data can be generated. This fully considers the fluidity of water, can determine the water quality variation at different locations, and can improve prediction accuracy.

[0150] In some embodiments, a graph neural network may be used to perform extraction operations and generate feature data for representing the spatial variation of water quality data.

[0151] Among them, the graph neural network can include: input layer, convolution layer, attention layer, modeling layer, and fully connected layer.

[0152] More specifically, step D may include:

[0153] D1, using a graph neural network, in a recursive manner, aggregates the received relational expression structure and other relational expression structures adjacent to the relational expression structure.

[0154] In some embodiments, the input layer and the convolutional layer can extract various data from the relational expression structure, obtain the initial features of each monitoring site, the connection relationship between the monitoring sites, and the weight of the edge determined based on the corrected prediction data, so as to generate a dynamic relational expression structure.

[0155] In some embodiments, the polymerization operation:

[0156]

[0157] in, represents the feature representation of the k-th layer monitoring site x, W (k) represents the weight matrix of the k-th layer network, ε represents the activation function, and w xy represents the weight of the edge, which is determined based on the flow velocity of the target area, ρ xy represents the directional weight, which is determined based on the water flow direction indicated by the basin topology. x represents the self-loop weight of monitoring site x, and y represents one of the monitoring sites in the set of neighboring monitoring sites of monitoring site x.

[0158] By adopting the above approach, the spatial and temporal characteristics in the water quality prediction scenario are fully considered, and the receptive field range of the monitoring stations is increased layer by layer, thereby capturing more upstream and downstream water quality characteristics and topological relationships.

[0159] D2 uses the attention mechanism to dynamically adjust the information propagation weights between relational expression structures, assign different weights to adjacent relational expression structures, and generate aggregated relational expression structures.

[0160] In other words, the weights are adjusted through the attention layer to further enhance the accuracy of the structural expression of the aggregation relationship.

[0161] D3, from the time dimension, extract the dynamic change trend in the adjacent relationship expression structure.

[0162] In some embodiments, the time dependency of node features is captured by processing time series data, wherein the specific method is as follows:

[0163]

[0164] Among them, GRU represents the activation function in the gated recurrent unit, o t-1 represents the input features of the previous time step, represents the feature representation of the k-th layer monitoring station x, z t Represents the time dynamic characteristics of the current time step.

[0165] D4, based on the structural expression and dynamic change trend of the aggregation relationship, a fully connected layer is used to generate the feature data.

[0166] E. Input the characteristic data into a water quality prediction model to generate a water quality grade.

[0167] In some embodiments, the water quality prediction model is a long short-term memory network, which is generated and trained based on at least the feature data and the corrected prediction data, and can effectively capture long-term dependencies, thereby improving prediction accuracy.

[0168] Among them, the water quality prediction model can be trained based on the feature data generated by historical water quality dynamic data.

[0169] Specifically, the training process of the long short-term memory network includes: obtaining historical water quality dynamic data; generating feature data in the above manner; dividing the feature data into a training set and a validation set; inputting the training set into the neural network model to be trained to obtain water quality prediction results; comparing the water quality prediction results with the validation set, and iteratively training the neural network model based on the differences to obtain a long short-term memory network.

[0170] During the training process, the back propagation algorithm is used to calculate the gradient and update the parameters in the neural network model. In order to achieve accurate prediction, the goal is to minimize the loss function and adjust the weights in the neural network model to correct the output of the long short-term memory network.

[0171] It should be pointed out that the training process of the water quality prediction model can refer to the description of the existing scheme. The focus of this scheme is: how to determine the characteristic data based on the acquired geographical location of each monitoring station, the basin topological structure and the water quality dynamic data corresponding to each monitoring station.

[0172] In some embodiments, the inventors further discovered that water quality data are usually continuous and presented in the form of time series, such as monitoring data of dissolved oxygen, ammonia nitrogen, pH value, etc., and thus these data can be converted into image data.

[0173] More specifically, the data at each time point can be used as the pixel value of the image, or the data between monitoring sites can be represented as multiple channels in the image. In this way, the monitoring data at multiple measurement moments can be used to generate a spatiotemporal continuous "dynamic image", which can then be used to predict future changes in water quality.

[0174] Based on this, the water quality prediction method in this scheme may also include: based on the historical water quality dynamic data of the target area, using a style migration network to perform time-series style mapping on water quality characteristics to generate a water quality characteristic distribution map.

[0175] Among them, the training process of the style transfer network can be based on the description of the water quality prediction model.

[0176] In some embodiments, the step of generating a water quality characteristic distribution map may include:

[0177] A content encoder is used to extract spatial and temporal features from the historical water quality dynamic data to generate content features.

[0178] Among them, spatial and temporal content features are extracted from historical water quality data, which represent the dynamic characteristics of site water quality.

[0179] In some embodiments, if the content feature is Fc, then:

[0180] Fc=φ content (R t )=W c *R t +b c

[0181] Among them, R t Represents the water quality characteristic matrix at time step t; the shape is (S, B), where S is the number of monitoring stations; B is the water quality characteristic dimension; W c represents the convolution kernel parameters of the content encoder; b c Represents the bias of the content convolution layer; * represents a two-dimensional convolution operation.

[0182] A style encoder is used to extract style features from pollutant distribution features in the historical water quality dynamic data.

[0183] The style features extracted by the style encoder include characteristics such as diffusion intensity and directionality, which can be used to capture the propagation pattern of pollutants between upstream and downstream sites.

[0184] In some embodiments, if the style feature is Fs, then:

[0185] Fs=φ style (E)=E s *E+b s

[0186] Where E represents the pollutant distribution characteristic matrix, with a shape of (Z, Z); E s represents the convolution kernel parameters of the style encoder; b s Represents the bias of the style convolution layer; * represents a two-dimensional convolution operation.

[0187] The style feature is applied to the content feature to generate a target feature distribution map using a style transfer technique.

[0188] Specifically, the content features and style features are fused to generate a target feature distribution map.

[0189] In some embodiments, if the target feature distribution map is Ft, then:

[0190]

[0191] Among them, λ1 and ξ1 represent the fusion weights of content and style features respectively; is a fusion function, which means matching content and style at the feature level.

[0192] The target characteristic distribution map is decoded to generate the water quality characteristic distribution map.

[0193] In some embodiments, a decoder is provided to convert the fused features into a pollutant distribution map of the water quality monitoring sites, indicating the pollution characteristics of each monitoring site.

[0194] In this case, before the characteristic data is input into the water quality prediction model to generate the water quality grade, it also includes:

[0195] The water quality characteristic distribution map and the characteristic data are fused to form fused characteristic data, and the fused characteristic data is input into the water quality prediction model.

[0196] In other words, the water quality prediction model predicts the fused feature data to generate a water quality grade.

[0197] In some embodiments, the step of forming fused characteristic data includes: performing an alignment operation so that the water quality characteristic distribution map and the characteristic data are in the same dimension; splicing the water quality characteristic distribution map and the characteristic data along the channel direction to form the fused characteristic data.

[0198] In some embodiments, splicing can be performed in the following manner:

[0199] F fused =λ2·H GNN +ξ2·ψ(H GNN , Ft)+η·φ(Ft)

[0200] Among them, ψ(H GNN , Ft) represents the interaction between node features and distribution features captured by the attention mechanism; φ(Ft) represents the adaptive enhancement of style features; λ2, ξ2, η represent dynamic fusion weights; H GNNRepresents feature data. Graph neural networks can extract spatial dependency features from the upstream and downstream relationships of water quality monitoring sites and capture complex interactions between sites (such as pollution diffusion paths and river topology). Style transfer networks use stylized distribution maps generated by historical data to capture the global pattern of pollutant diffusion, such as diffusion rules, diffusion directions, and intensity, and generate new feature distribution maps through the interaction of content features (temporal dynamics) and style features (diffusion patterns).

[0201] Therefore, the use of splicing and fusion can cover the different levels of characteristics involved in water quality prediction, thereby improving the comprehensiveness and accuracy of the prediction.

[0202] In some embodiments, when determining the water quality level, the following operations may also be performed:

[0203] When it is determined that the water quality level does not meet the requirements, an alarm message is sent, and the push method of the alarm message includes: one or more of text messages, real-time pop-up windows, vibrations, and playing warning sounds.

[0204] In some implementations, the APP application can be used as the core. When the artificial intelligence data processing platform detects dangerous conditions such as abnormal water quality and dissolved oxygen content exceeding the normal range, it will promptly send alarm information to the user APP through push text messages, real-time pop-up windows, vibrations, and warning sounds. Users can also use the APP to view pond water quality, historical data, and other information anytime and anywhere, thereby realizing remote monitoring and management of the pond.

[0205] In this way, by integrating artificial intelligence data processing capabilities and convenient alarm monitoring functions, the problems of untimely and inaccurate water quality monitoring and lack of effective early warning in pond aquaculture are effectively solved, the management efficiency and intelligence level of pond aquaculture are improved, and it has broad application prospects.

[0206] In some embodiments, the water quality prediction method may further include: predicting the water quality development trend based on the water quality grades generated at different times, so that when it is found that the water quality is developing in a direction of deterioration, it can be cleaned up in time.

[0207] The present invention also provides a water quality prediction device, see Figure 5 The schematic diagram of the structure of a water quality prediction device in one embodiment of the present invention is shown in FIG. Figure 5 As shown, the water quality prediction device 100 may include:

[0208] The data acquisition unit 110 is used to acquire the geographical location of each monitoring station in the target area, the watershed topology structure and the water quality dynamic data corresponding to each monitoring station, wherein the water quality dynamic data includes multiple different types of water quality data;

[0209] A correction unit 120, used to correct the water quality dynamic data to generate corrected prediction data;

[0210] The construction unit 130 constructs a relational expression structure according to the geographical location of each monitoring station, the watershed topology and the corrected prediction data corresponding to each monitoring station, wherein each monitoring station is used as one of the structures in the relational expression structure, different structures are connected by edges, and the edges between adjacent structures represent the geographical location relationship of the monitoring stations, and the geographical location relationship is determined based on the geographical location and the watershed topology;

[0211] The extraction unit 140 extracts the spatial characteristic information between each monitoring station and its neighboring monitoring stations according to the constructed relationship expression structure, and generates characteristic data for representing the spatial variation of the water quality data;

[0212] The prediction unit 150 is used to generate a water quality grade based on the characteristic data.

[0213] The specific working processes and principles of the data acquisition unit 110 , the correction unit 120 , the construction unit 130 , the extraction unit 140 and the prediction unit 150 may refer to the relevant description of the aforementioned examples.

[0214] It is understandable that the division of the above modules is only a division of logical functions, and in actual implementation, they can be fully or partially integrated into one physical entity, or physically separated. In addition, the above units can be implemented in the form of a processor calling software.

[0215] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a computer, the above-mentioned communication method is executed. The storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc. The storage medium may also include a non-volatile memory (non-volatile) or a non-transitory memory, etc.

[0216] An embodiment of the present invention also provides an electronic device, comprising at least one memory and at least one processor, wherein the memory stores one or more computer instructions, and the memory stores one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the steps of the water quality prediction method as described above.

[0217] The memory stores a computer program that can be run on the processor. When the processor runs the computer program, the steps of the water quality prediction method provided in the above embodiment are executed.

[0218] It should be understood that in the embodiment of the present invention, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0219] It should also be understood that the memory in the embodiment of the present invention can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a ROM, a programmable read-only memory (programmable ROM, PROM), an erasable programmable read-only memory (erasable PROM, EPROM), an electrically erasable programmable read-only memory (electrically EPROM, EEPROM) or a flash memory. The volatile memory can be a random access memory (random access memory, RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (doubledata rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (synchlink DRAM, SLDRAM) and direct memory bus random access memory (direct rambus RAM, DR RAM).

[0220] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above communication method when executed by a processor.

[0221] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer program can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means.

[0222] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0223] In the several embodiments provided by the present invention, it should be understood that the disclosed methods, devices and systems can be implemented in other ways. For example, the device embodiments described above are only schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0224] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0225] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units. For example, for each device or product applied to or integrated in a chip, each module / unit contained therein may be implemented in the form of hardware such as circuits, or at least part of the modules / units may be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits; for each device or product applied to or integrated in a chip module, each module / unit contained therein may be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or different components of the chip module, or at least part of the modules / units may be implemented in the form of software programs. The element can be implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the terminal, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or in different components in the terminal, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the terminal, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits.

[0226] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: a U disk, a mobile hard disk, a ROM, a random access memory RAM, a magnetic disk or an optical disk, etc., which can store program codes.

[0227] It should be noted that the terms "first" and "second" in the embodiments of the present disclosure are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. Moreover, the terms "first", "second", etc. are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.

[0228] Although the embodiments of the present disclosure are disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.

Claims

1. A water quality prediction method, characterized in that: include: Obtaining the geographical location of each monitoring station in the target area, the watershed topology and the water quality dynamic data corresponding to each monitoring station, wherein the water quality dynamic data includes multiple different types of water quality data; Correcting the water quality dynamic data to generate corrected prediction data; According to the geographical location of each monitoring station, the watershed topology and the corrected prediction data corresponding to each monitoring station, a relational expression structure is constructed, wherein each monitoring station is used as one of the structures in the relational expression structure, different structures are connected by edges, and the edges between adjacent structures represent the geographical location relationship of the monitoring stations, and the geographical location relationship is determined based on the geographical location and the watershed topology; According to the constructed relational expression structure, the spatial characteristic information between each monitoring station and its adjacent monitoring stations is extracted to generate characteristic data for representing the spatial variation of water quality data; The characteristic data is input into a water quality prediction model to generate a water quality grade.

2. The water quality prediction method according to claim 1, characterized in that: The step of correcting the water quality dynamic data to generate corrected prediction data includes: The water quality dynamic data is input into a correction model, wherein the correction model has multiple levels, and the multiple levels contain all types of water quality data, wherein the water quality data at the top level has the largest characteristic gain, and the data at the last level is the correction value of the water quality data of the first water quality type in the previous level; Based on the various levels of the correction model and the stratification conditions between different levels, the water quality dynamic data is matched layer by layer to determine the correction value of the water quality data of the same water quality type as the first water quality data in the penultimate level when all stratification conditions are met; The sum of the water quality data of the same water quality type as the first water quality data in the penultimate level and the revised value, as well as other unrevised water quality data, are taken as revised prediction data.

3. The water quality prediction method according to claim 2, characterized in that: The correction model is determined in the following manner: Acquire historical water quality dynamic data with time information in the target area; According to the time information, water quality data of the same type is divided to obtain multiple data clusters; For any data cluster, determining the characteristic gain corresponding to the same type of water quality data includes: determining multiple intervals according to the maximum difference between the water quality data in the data cluster; determining the number of water quality data contained in each interval and the difference between adjacent water quality data; determining the difference change corresponding to each interval according to the number of water quality data contained in each interval and the difference between adjacent water quality data; determining a first variation range value based on the difference change corresponding to each interval and the water quality data contained in each interval; and determining the difference between adjacent water quality data and determining a second variation range value based on each water quality data; using the difference between the first variation range value and the second variation range value as the characteristic gain; The water quality type with the largest characteristic gain among multiple characteristic gains is filled into the first level of the correction model, and the characteristic gains of water quality data of other water quality types in any branch in the second level are determined according to the set first stratification conditions, and are filled into the second level of the correction model in sequence according to the size of the characteristic gains, and then the filling operation is performed again according to the size of the characteristic gains according to the set second stratification conditions until the last level is generated.

4. The water quality prediction method according to claim 1, characterized in that: The relational expression structure is constructed according to the geographical location of each monitoring station, the watershed topology and the corrected prediction data corresponding to each monitoring station, including: defining the main structure of the relational expression structure; Taking any monitoring site as one of the substructures in the main structure, and taking the corrected prediction data corresponding to each monitoring site as a feature matrix; Based on the watershed topology, determine the upstream and downstream relationship or distance between any two monitoring sites, and when it is determined that the distance between the two monitoring sites is less than a preset distance, or the flow direction relationship between the two monitoring sites satisfies the upstream and downstream relationship, construct an edge between the two monitoring sites; The relational expression structure is constructed according to the substructure, the feature matrix and the edge between two monitoring sites.

5. The water quality prediction method according to claim 1, characterized in that: The method of extracting spatial feature information between each monitoring station and its adjacent monitoring stations based on the constructed relational expression structure, and generating feature data for representing the spatial variation of water quality data, includes: Using a graph neural network, in a recursive manner, aggregate the received relational expression structure and other relational expression structures adjacent to the relational expression structure; Adopting the attention mechanism, dynamically adjusting the information propagation weights between relational expression structures, assigning different weights to adjacent relational expression structures, and generating aggregated relational expression structures; From the time dimension, extract the dynamic change trend in the adjacent relationship expression structure; Based on expressing the structural formula and dynamic change trend of the aggregation relationship, a fully connected layer is used to generate the feature data.

6. The water quality prediction method according to claim 5, characterized in that: The graph neural network includes: an input layer, a convolutional layer, an attention layer, a modeling layer, and a fully connected layer; Use the following formula to perform the aggregation operation: in, represents the feature representation of the k-th layer monitoring site x, W (k) represents the weight matrix of the k-th layer network, ε represents the activation function, and w xy represents the weight of the edge, which is determined based on the flow velocity of the target area, ρ xy represents the directional weight, which is determined based on the water flow direction indicated by the basin topology. x Represents the self-loop weight of monitoring site x.

7. The water quality prediction method according to claim 1, characterized in that: Also includes: Based on the historical water quality dynamic data of the target area, a style transfer network is used to perform temporal style mapping on water quality characteristics to generate a water quality characteristic distribution map; Before inputting the characteristic data into the water quality prediction model to generate the water quality grade, the method further includes: The water quality characteristic distribution map and the characteristic data are fused to form fused characteristic data, and the fused characteristic data is input into the water quality prediction model.

8. The water quality prediction method according to claim 7, characterized in that: The method of using a style transfer network to perform temporal style mapping on water quality features to generate a water quality feature distribution map includes: using a content encoder to extract spatial and temporal features from the historical water quality dynamic data to generate content features; using a style encoder to extract style features from pollutant distribution features in the historical water quality dynamic data; using a style transfer technology to apply the style features to the content features to generate a target feature distribution map; decoding the target feature distribution map to generate the water quality feature distribution map; The fusing of the water quality characteristic distribution map and the characteristic data to form the fused characteristic data includes: performing an alignment operation so that the water quality characteristic distribution map and the characteristic data are in the same dimension; and splicing the water quality characteristic distribution map and the characteristic data along the channel direction to form the fused characteristic data.

9. The water quality prediction method according to claim 1, characterized in that: Satisfy at least one or more of the following: The water quality prediction model is a long short-term memory network, and the long short-term memory network is generated by training based on at least the characteristic data and the corrected prediction data; When it is determined that the water quality level does not meet the requirements, an alarm message is sent, and the push method of the alarm message includes: one or more of SMS, real-time pop-up window, vibration, and playing warning sound; Based on the water quality levels generated at different times, the water quality development trend is predicted.

10. A water quality prediction device, characterized in that: include: A data acquisition unit, used to acquire the geographical location of each monitoring station in the target area, the watershed topology and the water quality dynamic data corresponding to each monitoring station, wherein the water quality dynamic data includes multiple different types of water quality data; A correction unit, used to correct the water quality dynamic data and generate corrected prediction data; A construction unit, according to the geographical location of each monitoring station, the watershed topology and the corrected prediction data corresponding to each monitoring station, constructs a relational expression structure, wherein each monitoring station is used as one of the structures in the relational expression structure, different structures are connected by edges, and the edges between adjacent structures represent the geographical location relationship of the monitoring stations, and the geographical location relationship is determined based on the geographical location and the watershed topology; An extraction unit extracts spatial feature information between each monitoring station and its neighboring monitoring stations according to the constructed relational expression structure, and generates feature data for representing spatial variation of water quality data; The prediction unit is used to generate a water quality grade based on the characteristic data.