CN114418189A - Water quality grade prediction method, system, terminal device and storage medium - Google Patents

Water quality grade prediction method, system, terminal device and storage medium Download PDF

Info

Publication number
CN114418189A
CN114418189A CN202111605824.8A CN202111605824A CN114418189A CN 114418189 A CN114418189 A CN 114418189A CN 202111605824 A CN202111605824 A CN 202111605824A CN 114418189 A CN114418189 A CN 114418189A
Authority
CN
China
Prior art keywords
water area
target
node
water quality
target water
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111605824.8A
Other languages
Chinese (zh)
Inventor
全绍军
林格
陈小燕
梁少玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Longse Technology Co ltd
Original Assignee
Longse Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Longse Technology Co ltd filed Critical Longse Technology Co ltd
Priority to CN202111605824.8A priority Critical patent/CN114418189A/en
Publication of CN114418189A publication Critical patent/CN114418189A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0639Performance analysis of employees; Performance analysis of enterprise or organisation operations
    • G06Q10/06395Quality analysis or management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/06Energy or water supply
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A20/00Water conservation; Efficient water supply; Efficient water use
    • Y02A20/152Water filtration

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Business, Economics & Management (AREA)
  • Tourism & Hospitality (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Water Supply & Treatment (AREA)
  • General Health & Medical Sciences (AREA)
  • Primary Health Care (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application is applicable to the technical field of computer application, and provides a water quality grade prediction method, a water quality grade prediction system, terminal equipment and a computer-readable storage medium, wherein the water quality grade prediction method comprises the following steps: establishing a site detection diagram of the target water area according to the site position of the target water area and the index type data associated with each site; performing node aggregation on the site detection graph of the target water area based on the attention network of the heteromorphic graph to obtain a feature update result of each node in the site detection graph of the target water area; generating a water area feature vector of the target water area according to the feature update result of each node in the station detection graph of the target water area; the water quality grade of the target water area is predicted according to the historical detection data and the water area feature vector, the influence of various types of indexes on the water quality condition can be comprehensively considered, the influence of the historical water quality feature on the future water quality condition is introduced, the accuracy of water quality grade prediction is effectively improved, and the problem that the current prediction accuracy of the water quality condition has deviation is solved.

Description

Water quality grade prediction method, system, terminal device and storage medium
Technical Field
The application belongs to the technical field of computer application, and particularly relates to a water quality grade prediction method, a water quality grade prediction system, terminal equipment and a computer-readable storage medium.
Background
Water is used as a source of life and is closely related to the productive life of human beings. The evaluation and detection of the water quality are beneficial to people to know the water resource condition, provide guarantee for safe water use and simultaneously are beneficial to the maintenance of the water environment health, so that pollution sources can be found in time and the water quality can be treated in time.
The traditional water quality evaluation methods comprise a comprehensive index evaluation method, a fuzzy comprehensive evaluation method and the like, and the methods all need complex calculation processes. In recent years, with the development of deep learning technology, some deep learning classical models, such as a sequence model LSTM network, a graph neural network based on a graph structure, a generation countermeasure network and the like, are applied to the automatic prediction and evaluation problem of the water quality condition of a water area, and through the automatic prediction process of deep learning, the method is favorable for predicting the sustainable development condition of the water quality condition of the water area, taking measures in advance for the possible pollution condition, providing help for the optimization of a water quality treatment scheme, and further promoting the development of water quality treatment.
However, because various factors such as biology, hydrology, and landform in the water area also affect the water quality, how to comprehensively consider the importance of the influence factors on the water quality due to the increase of the consideration factors, how to establish the relationship between different influence factors, and thus, the problem of water quality detection is still further difficult. At present, weights of different influence factors are manually defined by an analytic hierarchy process, the weight definition method has high requirements on professional knowledge and fixed weights, and cannot be adaptive to different water area conditions, and some deep learning methods simply splice characteristics of various influence factors, so that complex relationships among the factors are difficult to learn, and the prediction accuracy of the water quality condition has deviation.
Disclosure of Invention
The embodiment of the application provides a water quality grade prediction method, a water quality grade prediction system, terminal equipment and a computer readable storage medium, and solves the problems that the prediction of the river hydrological information for a long time is easy to have errors and the prediction accuracy is low at present.
In a first aspect, an embodiment of the present application provides a water quality grade prediction method, including:
establishing a site detection map of a target water area according to the site position of the target water area and the index type data associated with each site;
performing node aggregation on the site detection graph of the target water area based on the attention network of the heteromorphic graph to obtain a feature updating result of each node in the site detection graph of the target water area;
generating a water area feature vector of the target water area according to the feature updating result of each node in the station detection graph of the target water area;
and predicting the water quality grade of the target water area according to the historical detection data and the water area feature vector.
In an implementation manner of the first aspect, the node aggregation of the site detection graph of the target water area based on the attention network of the heteromorphic graph to obtain a feature update result of each node in the site detection graph of the target water area includes:
carrying out node level aggregation on the site detection graph of the target water area to obtain the aggregation characteristics of the target nodes;
and performing semantic level aggregation on the detection graph of the site of the target water area according to the aggregation characteristics of the target nodes to obtain a characteristic updating result of each node in the site detection graph of the target water area.
In an implementation manner of the first aspect, the aggregating the site detection graph of the target water area at a node level to obtain an aggregation characteristic of the target node includes:
embedding different types of nodes into a meta-path type space corresponding to the meta-path type through linear transformation of the meta-path type to obtain a feature vector of the node which is integrated with the meta-path feature;
according to an attention mechanism, determining the attention weight of each neighbor node to a target node under a meta-path;
and performing feature aggregation according to the attention weight of each neighbor node to the target node and the feature vector of the neighbor node to obtain the aggregation feature of the target node.
In an implementation manner of the first aspect, the performing semantic-level aggregation on the detection graph of the site of the target water area according to the aggregated feature of the target node to obtain a feature update result of each node in the site detection graph of the target water area includes:
determining an aggregate attention score for each meta-path;
and determining a feature updating result of each node in the site detection graph of the target water area according to the aggregation feature of the target node and the aggregation attention score of the meta-path.
In an implementation manner of the first aspect, the predicting the water quality level of the target water area according to the historical detection data and the water area feature vector includes:
carrying out time coding to obtain a characteristic vector of a time difference;
and inputting the historical water area characteristic sequence into a GRU network, coding and splicing the output characteristic of each time step and the time difference of the next time step by the GRU network, and outputting the prediction probability of the water quality grade of the next time step by a multilayer perceptron.
In an implementation manner of the first aspect, after the establishing a site detection map of the target water area according to the site location of the target water area and the index type data associated with each site, the method further includes:
acquiring historical detection data of each index in a target water area;
and carrying out data coding on the historical detection data of each index to obtain a historical detection feature coding vector. In an implementation manner of the first aspect, after obtaining the historical detection data of each indicator in the target water area, the method further includes:
and distinguishing the historical detection data according to the position and the acquisition time of the monitoring station for acquiring the historical detection data.
In a second aspect, an embodiment of the present application provides a water quality level prediction system, including:
the system comprises an establishing unit, a detecting unit and a judging unit, wherein the establishing unit is used for establishing a site detection map of a target water area according to site positions of the target water area and index type data associated with each site;
the aggregation unit is used for carrying out node aggregation on the site detection graph of the target water area based on the heteromorphic graph attention network to obtain a feature update result of each node in the site detection graph of the target water area;
the generating unit is used for generating a water area feature vector of the target water area according to the feature updating result of each node in the station detection graph of the target water area;
and the prediction unit is used for predicting the water quality grade of the target water area according to the historical detection data and the water area characteristic vector.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the water quality level prediction method according to any one of the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the water quality level prediction method according to any one of the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program product, which when run on a terminal device, enables the terminal device to execute the water quality level prediction method according to any one of the above first aspects.
Compared with the prior art, the embodiment of the application has the advantages that:
according to the water quality grade prediction method provided by the embodiment of the application, the influences of different types of indexes on the sites and the space influences among the sites are analyzed, the influences of different historical moments on the future water quality condition are considered, the past site water quality characteristics are fused, the water quality characteristics of the target water area are further obtained, and the water quality grade of the water area at the future time is predicted.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a water quality grade prediction method according to an embodiment of the present application;
fig. 2 is a schematic flow chart of an implementation of a water quality grade prediction method according to an embodiment of the present application;
fig. 3 is a schematic flow chart illustrating another implementation of a water quality grade prediction method according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a water quality level prediction system according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Since the comprehensive evaluation and prediction of water quality relates to various index systems, how to comprehensively consider the influence of different index systems on the prediction result of the water quality grade becomes a problem to be solved in the water quality evaluation problem. The traditional methods such as an analytic hierarchy process and the like need to artificially define weights among different factors, and some deep learning methods simply splice or add the index features, so that the difference of the influence degrees of different indexes on a final result is difficult to be fully considered. In addition, the historical water quality characteristics contain a certain water quality evolution rule, and in order to realize the prediction of the future situation, the past water quality situation also needs to be considered, so that the future water quality situation (namely the water quality grade) can be effectively predicted by effectively integrating various indexes.
In order to effectively integrate the influence of various indexes on the prediction of the water quality condition and improve the accuracy of the water quality grade prediction, the embodiment of the application provides a water quality grade prediction method, the influence of different indexes on stations and the space influence among the stations are analyzed, the influence of different historical moments on the future water quality condition is considered, the past station water quality characteristics are fused, the water quality characteristics of a target water area are obtained, and the water quality grade of the water area at the future time is predicted, so that the influence of the various indexes on the water quality condition can be comprehensively considered, the influence of the historical water quality characteristics on the future water quality condition is introduced, the accuracy of the water quality grade prediction is effectively improved, and the problem that the current prediction accuracy of the water quality condition has deviation is solved.
The water quality grade prediction method provided by the embodiment of the application is exemplarily described below with reference to the accompanying drawings:
referring to fig. 1, fig. 1 is a schematic view of an implementation scenario of a water quality level prediction method according to an embodiment of the present application. As shown in fig. 1, the main body of the water quality level prediction method may be the terminal device 10 shown in fig. 1, and the terminal device 10 may be connected to the water area monitoring site 20 in a communication manner.
In one embodiment of the present application, a plurality of water monitoring sites 20 may be located in a water area to monitor the water quality of the water area.
In a specific application, the water area monitoring station 20 may collect detection data of different index types. The different index types include but are not limited to physical and chemical characteristic indexes, hydrological characteristic indexes, landform morphological characteristic indexes, riparian zone characteristic indexes and the like. The physical and chemical characteristic indexes may include, but are not limited to, dissolved oxygen, PH, turbidity, heavy metals, conductivity, total nitrogen, total phosphorus, total suspended matter, chemical oxygen demand, chlorophyll, nitrate nitrite, etc., the hydrological characteristic indexes include, but are not limited to, flow rate conditions, water volume conditions, etc., the topographic characteristic indexes include, but are not limited to, bank protection form, river course width-depth ratio, etc., and the riparian zone characteristic indexes include, but are not limited to, riparian width, riparian zone structural integrity, etc.
In specific application, the terminal device can record the acquired positions of the water area monitoring stations and the detection time of the uploaded detection data so as to manage the detection data of the water area monitoring stations and realize the water quality grade prediction of the water area by using the historical detection data of the water area monitoring stations.
In a specific application, the classification standard of the water quality grade of the water area can be determined according to the current water area evaluation grade, and the water quality grade of the water area can be classified into five grades, namely healthy, good, medium, sub-healthy, ill and the like. Each grade corresponds to each index, namely the corresponding grade can be obtained through the numerical values of the indexes.
In this embodiment, the terminal device may be an electronic device such as a computer, a mobile phone, a tablet computer, a desktop computer, and a smart wearable device, which is not limited herein.
It should be noted that the above application scenarios are only examples for facilitating understanding, and it is to be understood that the embodiment of the present application is not limited to the above application scenarios, for example, the terminal device may be replaced by a server, and the water quality level prediction method provided in the embodiment of the present application may be executed by the server, where the server may be a conventional server or a cloud server, and is not limited specifically herein.
The water quality grade prediction method provided by the embodiment of the present application, in which the main body of execution of the water quality grade prediction method can be the terminal device, will be described in detail below.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating an implementation flow of a water quality level prediction method according to an embodiment of the present application. As shown in fig. 2, the water quality grade prediction method provided in an embodiment of the present application may include S11 to S14, which are detailed as follows:
s11: and establishing a site detection map of the target water area according to the site position of the target water area and the index type data associated with each site.
In this embodiment, the site detection graph of the target water area is composed of a plurality of sites and a plurality of nodes in the sites, each node corresponds to one index type, and different index types represent nodes of different types, that is, a site may have a plurality of nodes, for example, a node corresponding to a physicochemical characteristic index, a node corresponding to a hydrological characteristic index, and a node corresponding to a topographic characteristic index.
In the establishment of the connection relationship, the connection mode among the plurality of stations is to calculate the spatial distance among different stations, and establish connection for two stations with the spatial distance smaller than a preset distance threshold, so that the influence among the stations with the spatial influence can be effectively reflected.
For each site, establishing connection edges between the site and various corresponding index nodes, so as to establish the influence of different index types on water quality grade evaluation.
In a specific application, data of different historical moments within a period of time can be combined into a water area site detection map at multiple moments.
S12: and carrying out node aggregation on the site detection graph of the target water area based on the attention network of the heteromorphic graph to obtain a feature updating result of each node in the site detection graph of the target water area.
In the embodiment of the present application, in order to determine the spatial influences of different sites and the influence degrees of different index data, based on the site detection map of the target water area established in S11, node aggregation is performed on the site detection map of the target water area through the attention network of the heteromorphic graph, so that the characteristics of the connected sites and nodes are integrated into each node of the site detection map of the target water area, the influence of detection data of different index types on the water quality grade is comprehensively considered when the water quality grade is predicted, the spatial influences among different sites can be integrated, and the accuracy of prediction is effectively improved.
In a specific implementation, the node aggregation includes node-level aggregation and semantic-level aggregation.
The node level aggregation refers to the feature representation of the neighbor nodes under the unitary path for the target node.
The semantic level aggregation refers to aggregating the updated node characteristics obtained by each meta-path after the characteristic representation that neighbor nodes are aggregated by each node under each meta-path is obtained, so as to obtain the characteristic update result of each node in the site detection graph of the target water area.
In an embodiment of the present application, the step S12 may include the following steps:
carrying out node level aggregation on the site detection graph of the target water area to obtain the aggregation characteristics of the target nodes;
and performing semantic level aggregation on the detection graph of the site of the target water area according to the aggregation characteristics of the target nodes to obtain a characteristic updating result of each node in the site detection graph of the target water area.
In an embodiment of the present application, the node-level aggregating the site detection graph of the target water area to obtain the aggregation characteristic of the target node may include the following steps:
embedding different types of nodes into a meta-path type space corresponding to the meta-path type through linear transformation of the meta-path type to obtain a feature vector of the node which is integrated with the meta-path feature;
according to an attention mechanism, determining the attention weight of each neighbor node to a target node under a meta-path;
and performing feature aggregation according to the attention weight of each neighbor node to the target node and the feature vector of the neighbor node to obtain the aggregation feature of the target node.
In a particular application, it will notEmbedding the nodes of the same type into corresponding meta-path type spaces through meta-path type related linear transformation modes of the nodes of the same type, and performing linear transformation on the characteristics of the nodes i to obtain characteristic vectors h of the nodes i, which are integrated with meta-path characteristicsi', and a feature vector h of a node i into which meta-path features are to be mergedi' as an initial input to the heteromorphic graph network, namely:
Figure BDA0003433753970000091
wherein h isiFeature encoding vectors are detected for the history of node i,
Figure BDA0003433753970000092
is a meta path phiiA corresponding weight matrix.
And determining the attention weight of each neighbor node j to the target node i by considering the influence of different nodes on the target node update under the meta-path through an attention mechanism. Under the meta-path phi, the attention weight calculation mode of the neighbor node j to the target node i is as follows:
Figure BDA0003433753970000093
wherein, the sigma is a sigmoid function, and the | represents the merging operation,
Figure BDA0003433753970000094
for a linear transformation based on meta-path phi at the node level,
Figure BDA0003433753970000095
all the neighbor nodes of the node i under the meta-path phi.
And after the attention weight of each neighbor node under the meta-path phi is obtained, carrying out feature aggregation by weighting and summing the attention weight and the corresponding neighbor node features. Meanwhile, a multi-head attention method is adopted, and K attention heads are used for information transmission. Thus, the target nodei aggregated characteristics at meta-path Φ
Figure BDA0003433753970000101
Expressed as:
Figure BDA0003433753970000102
wherein the content of the first and second substances,
Figure BDA0003433753970000103
indicating the transfer of K-headed attention information.
In an embodiment of the present application, the performing semantic-level aggregation on the detection graph of the site of the target water area according to the aggregated features of the target nodes to obtain a feature update result of each node in the site detection graph of the target water area includes the following steps:
determining an aggregate attention score for each meta-path;
and determining a feature updating result of each node in the site detection graph of the target water area according to the aggregation feature of the target node and the aggregation attention score of the meta-path.
In specific application, the node i aggregates the aggregation characteristics of the neighbor nodes under the condition that each meta-path is obtained
Figure BDA0003433753970000106
And then, aggregating the updated node characteristics obtained by each meta-path.
In the aggregation process of meta-path features, the influence difference of different meta-paths on node updating needs to be concerned, so that the attention score of each meta-path on the aggregation of the target node features needs to be calculated first, and then the meta-path phi is subjected topThe formula for calculating the attention score of (1) is expressed as:
Figure BDA0003433753970000104
Figure BDA0003433753970000105
wherein V represents all node sets in the abnormal graph, W is a weight matrix, b is an offset item, and q isTFor the semantic attention vector, P is the total number of meta-paths, and tanh (. cndot.) is the tanh activation function.
The final node aggregation considers the influence difference between different neighbor nodes and the meta-path, and the final feature update result of a single node is expressed as:
Figure BDA0003433753970000111
referring to fig. 3, fig. 3 is a schematic diagram illustrating an implementation flow of another water quality level prediction method according to an embodiment of the present application. As shown in fig. 3, in an embodiment of the present application, before S12, the method further includes the following steps:
s31: acquiring historical detection data of each index in a target water area;
s32: and carrying out data coding on the historical detection data of each index to obtain a historical detection feature coding vector.
In the embodiment of the application, historical detection data of each index in the target water area is acquired by the monitoring station in the water area, and the acquired historical detection data can be distinguished through the acquired position and acquisition time of the monitoring station.
After the historical detection data is obtained, data coding is performed on the data, and then a historical detection feature coding vector corresponding to the historical detection data is obtained.
In a specific application, the historical detection data includes historical detection data of different index types, and the data with continuity and discontinuity of the data with different index types, for example, the classification of the stability of the riverbed (stable, unstable) in the topographic characteristic index is discontinuous data, and the content of each index in the physicochemical characteristic index of the water quality is continuous data. Coding the discontinuous data by adopting one-hot to obtain a feature coding vector of the discontinuous data; and for the coding of continuous data, a classification network consisting of a multi-layer perceptron (MLP) is adopted to extract characteristic codes of which intermediate layer vectors represent the numerical values.
In a specific application, the encoding of the data of different index types may also output corresponding feature codes by adopting a normal distribution mode, a pre-training network extraction feature mode, and the like, which are only examples and are not limited.
S13: and generating a water area feature vector of the target water area according to the feature updating result of each node in the station detection image of the target water area.
In specific application, the feature update results of each node in the site detection graph of the target water area are added to obtain the water area feature vector H of the target water areat
S14: and predicting the water quality grade of the target water area according to the historical detection data and the water area feature vector.
In the specific application, the water area feature vectors at t moments obtained by the heterogeneous graph network are sequentially formed into a sequence according to time sequence, the sequence is input into the cyclic neural network for processing, the water area feature vectors at all historical moments are aggregated by the cyclic neural network, and then the corresponding water quality grade prediction result is output.
In an embodiment of the present application, the recurrent neural network employs a GRU network, and the embedded feature x at each time step is implemented by the GRU networktCan output the water quality rating prediction of the next time. In which the feature x is embeddedtThe sequence formed by the water area feature vectors at the t moments is transmitted according to the time sequence, so that the water quality features of all historical moments are included, the predicted water quality grade can aggregate the water area features of the historical moments, and the water area feature vectors of the historical moments aggregate the influences of different types of index data and different space stations, so that the accuracy of the prediction result can be effectively improved.
In a specific application, the GRU network includes an update gate and a forgetting gate, and the GRU network can control a forgetting degree of the history information through the update gate and the forgetting gate.
Specifically, the main formula of the GRU network is as follows:
ut=σ(Wu·[xt-1,Ht])
rt=σ(Wr·[xt-1,Ht])
Figure BDA0003433753970000121
Figure BDA0003433753970000122
wherein u istPresentation update door, rtIndicating forgetting gate, HtIs the water area feature vector at time t, WuTo update the weight matrix of the gate, WrWeight matrix for forgetting gate, WxTo embed feature weights, σ is a sigmoid function.
In an embodiment of the present application, the step S14 may include the following steps:
carrying out time coding to obtain a characteristic vector of a time difference;
and inputting the historical water area characteristic sequence into a GRU network, coding and splicing the output characteristic of each time step and the time difference of the next time step by the GRU network, and outputting the prediction probability of the water quality grade of the next time step by a multilayer perceptron.
In a specific application, assuming that the time recorded at a time step in the historical water area sequence data is T, the time difference Δ T of the next time T + Δ T to be predicted is encoded by a sine-cosine encoding method to obtain a feature vector representation T of the time differenceΔt
The output characteristics of each time step of the GRU network are spliced with the time difference code of the next time step, and the probability prediction vector of the water quality grade of the next time step is output through a multilayer perceptron, namely:
s=Softmax(MLP(x t||TΔt));
the method comprises the steps of obtaining a water quality grade of a target water area, obtaining a water quality grade of the target water area, and obtaining a water quality grade of the target water area, wherein | | represents vector splicing, MLP (·) represents a multilayer perceptron, D-dimensional vectors are output, D is equal to the water quality grade in number, Softmax (·) represents a Softmax function, and the sum of all dimensions of the vectors is 1, so that the water quality grade corresponding to the largest one-dimensional is a prediction result, namely the water quality grade corresponding to the highest prediction probability is the prediction result of the water quality grade of the target water area.
In a specific application, the GRU network may be optimized through a cross entropy function to obtain a model with better prediction performance, and the optimization of the GRU network through the cross entropy function may refer to an existing optimization method, which is not limited herein.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
It can be seen from the above that, according to the water quality grade prediction method provided by the embodiment of the application, by analyzing the influences of different types of indexes on the sites and the space influences among the sites, considering the influences of different historical moments on the future water quality condition, fusing the past site water quality characteristics, further obtaining the water quality characteristics of the target water area and predicting the water quality grade of the water area at the future time, the influences of multiple types of indexes on the water quality condition can be comprehensively considered, the influences of the historical water quality characteristics on the future water quality condition are introduced, the accuracy of water quality grade prediction is effectively improved, and the problem that the prediction accuracy of the water quality condition at present has deviation is solved.
Fig. 4 is a block diagram of a water quality grade prediction system according to an embodiment of the present invention, which corresponds to the water quality grade prediction method according to the above embodiment, and only the relevant portions of the water quality grade prediction system according to the embodiment of the present invention are shown for convenience of explanation. Referring to fig. 4, the water quality level prediction system 40 includes: a building unit 41, an aggregation unit 42, a generation unit 43, and a prediction unit 44. Wherein:
the establishing unit 41 is configured to establish a site detection map of the target water area according to the site location of the target water area and the index type data associated with each site.
The aggregation unit 42 is configured to perform node aggregation on the site detection map of the target water area based on the heteromorphic graph attention network, and obtain a feature update result of each node in the site detection map of the target water area.
The generating unit 43 is configured to generate a water area feature vector of the target water area according to the feature update result of each node in the station detection map of the target water area.
The prediction unit 44 is configured to predict the water quality level of the target water area according to the historical detection data and the water area feature vector.
In one embodiment of the present application, the polymerization unit 42 may include a first polymerization unit and a second polymerization unit.
The first aggregation unit is used for carrying out node level aggregation on the site detection graph of the target water area to obtain the aggregation characteristics of the target nodes.
The second aggregation unit is used for performing semantic level aggregation on the detection graph of the site of the target water area according to the aggregation characteristics of the target nodes to obtain a characteristic update result of each node in the site detection graph of the target water area.
In an embodiment of the present application, the first aggregation unit is specifically configured to embed different types of nodes into a meta-path type space corresponding to a meta-path type through linear transformation of the meta-path type, so as to obtain a feature vector of a node into which meta-path features are merged; according to an attention mechanism, determining the attention weight of each neighbor node to a target node under a meta-path; and performing feature aggregation according to the attention weight of each neighbor node to the target node and the feature vector of the neighbor node to obtain the aggregation feature of the target node.
In an embodiment of the present application, the second aggregation unit is specifically configured to determine an aggregation attention score of each meta-path; and determining a feature updating result of each node in the site detection graph of the target water area according to the aggregation feature of the target node and the aggregation attention score of the meta-path.
In an embodiment of the present application, the prediction unit 44 may include a temporal coding unit and a probability output unit.
The time coding unit is used for carrying out time coding to obtain a characteristic vector of the time difference.
The probability output unit is used for inputting the historical water area characteristic sequence into the GRU network, the GRU network encodes and splices the output characteristic of each time step and the time difference of the next time step, and the prediction probability of the water quality grade of the next time step is output through the multilayer perceptron.
In an embodiment of the present application, the water quality level prediction system 40 further includes an obtaining unit and a data encoding unit. Wherein:
the acquisition unit is used for acquiring historical detection data of each index in the target water area.
The data coding unit is used for carrying out data coding on the historical detection data of each index to obtain a historical detection feature coding vector.
In an embodiment of the present application, the water quality level prediction system 40 further includes a differentiation unit.
The distinguishing unit is used for distinguishing the historical detection data according to the position and the collection time of the monitoring station for collecting the historical detection data.
It can be seen from the above that, the water quality grade prediction system provided in the embodiment of the present application can also obtain the water quality characteristics of the target water area and predict the water quality grade of the water area at the future time by analyzing the influences of different types of indexes on the stations and the space influences among the stations and considering the influences of different historical moments on the future water quality conditions, and fusing the past station water quality characteristics, so that the influences of multiple types of indexes on the water quality conditions can be comprehensively considered, the influences of the historical water quality characteristics on the future water quality conditions are introduced, the accuracy of water quality grade prediction is effectively improved, and the problem that the prediction accuracy of the water quality conditions at present has deviation is solved.
Fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 5, the terminal device 5 of this embodiment includes: at least one processor 50 (only one is shown in fig. 5), a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, wherein the processor 50 executes the computer program 52 to implement the steps of any one of the above-mentioned water quality level prediction method embodiments.
Those skilled in the art will appreciate that fig. 5 is only an example of the terminal device 5, and does not constitute a limitation to the terminal device 5, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
The Processor 50 may be a Central Processing Unit (CPU), and the Processor 50 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may in some embodiments be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 51 may also be used to temporarily store data that has been output or is to be output.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in any one of the above-mentioned water quality class prediction method embodiments can be implemented.
The embodiment of the present application provides a computer program product, which when running on a terminal device, enables the terminal device to implement the steps in any one of the above-mentioned water quality class prediction method embodiments when executed.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in any one of the above-mentioned water quality class prediction method embodiments can be implemented.
The embodiment of the application provides a computer program product, and when the computer program product runs on a terminal device, the terminal device can implement the steps in any one of the water quality grade prediction method embodiments when executed.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one first processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed water quality level prediction system and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A water quality grade prediction method is characterized by comprising the following steps:
establishing a site detection map of a target water area according to the site position of the target water area and the index type data associated with each site;
performing node aggregation on the site detection graph of the target water area based on the attention network of the heteromorphic graph to obtain a feature updating result of each node in the site detection graph of the target water area;
generating a water area feature vector of the target water area according to the feature updating result of each node in the station detection graph of the target water area;
and predicting the water quality grade of the target water area according to the historical detection data and the water area feature vector.
2. The method for predicting the water quality level according to claim 1, wherein the node aggregation of the site detection map of the target water area based on the attention network of the heteromorphic image to obtain the feature update result of each node in the site detection map of the target water area comprises:
carrying out node level aggregation on the site detection graph of the target water area to obtain the aggregation characteristics of the target nodes;
and performing semantic level aggregation on the detection graph of the site of the target water area according to the aggregation characteristics of the target nodes to obtain a characteristic updating result of each node in the site detection graph of the target water area.
3. The method for predicting the water quality level according to claim 2, wherein the aggregating the site detection maps of the target waters at the node level to obtain the aggregate characteristics of the target nodes comprises:
embedding different types of nodes into a meta-path type space corresponding to the meta-path type through linear transformation of the meta-path type to obtain a feature vector of the node which is integrated with the meta-path feature;
according to an attention mechanism, determining the attention weight of each neighbor node to a target node under a meta-path;
and performing feature aggregation according to the attention weight of each neighbor node to the target node and the feature vector of the neighbor node to obtain the aggregation feature of the target node.
4. The method for predicting the water quality level according to claim 2, wherein the semantic-level aggregation of the detection maps of the sites of the target water areas according to the aggregated features of the target nodes to obtain the feature update result of each node in the site detection maps of the target water areas comprises:
determining an aggregate attention score for each meta-path;
and determining a feature updating result of each node in the site detection graph of the target water area according to the aggregation feature of the target node and the aggregation attention score of the meta-path.
5. The method of predicting a water quality level of a target water area according to the historical test data and the water area feature vector of the target water area of the water quality level of the target water area of the water quality control system of the present invention comprises:
carrying out time coding to obtain a characteristic vector of a time difference;
inputting the historical water area characteristic sequence into a GRU network, coding and splicing the output characteristic of each time step and the time difference of the next time step by the GRU network, and outputting the prediction probability of the water quality grade of the next time step by a multilayer perceptron.
6. The method according to any one of claims 1 to 5, wherein after the step of establishing the site detection map of the target water area according to the site location of the target water area and the index type data associated with each site, the method further comprises:
acquiring historical detection data of each index in a target water area;
and carrying out data coding on the historical detection data of each index to obtain a historical detection feature coding vector.
7. The method of predicting water quality level according to claim 6, further comprising, after obtaining historical detection data for each index in the target water area:
and distinguishing the historical detection data according to the position and the acquisition time of the monitoring station for acquiring the historical detection data.
8. A water quality level prediction system, comprising:
the system comprises an establishing unit, a detecting unit and a judging unit, wherein the establishing unit is used for establishing a site detection map of a target water area according to site positions of the target water area and index type data associated with each site;
the aggregation unit is used for carrying out node aggregation on the site detection graph of the target water area based on the heteromorphic graph attention network to obtain a feature update result of each node in the site detection graph of the target water area;
the generating unit is used for generating a water area feature vector of the target water area according to the feature updating result of each node in the station detection graph of the target water area;
and the prediction unit is used for predicting the water quality grade of the target water area according to the historical detection data and the water area characteristic vector.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the water quality level prediction method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the water quality level prediction method according to any one of claims 1 to 7.
CN202111605824.8A 2021-12-25 2021-12-25 Water quality grade prediction method, system, terminal device and storage medium Pending CN114418189A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111605824.8A CN114418189A (en) 2021-12-25 2021-12-25 Water quality grade prediction method, system, terminal device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111605824.8A CN114418189A (en) 2021-12-25 2021-12-25 Water quality grade prediction method, system, terminal device and storage medium

Publications (1)

Publication Number Publication Date
CN114418189A true CN114418189A (en) 2022-04-29

Family

ID=81269045

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111605824.8A Pending CN114418189A (en) 2021-12-25 2021-12-25 Water quality grade prediction method, system, terminal device and storage medium

Country Status (1)

Country Link
CN (1) CN114418189A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115471115A (en) * 2022-10-01 2022-12-13 浙江嘉园智能科技有限公司 Electronic river length control system for unified united treatment of global water body
CN117933572A (en) * 2024-03-20 2024-04-26 四川飞洁科技发展有限公司 Water quality prediction method and related device
CN118101657A (en) * 2024-04-23 2024-05-28 长视科技股份有限公司 Method and device for optimizing cooperative computing power among multiple devices applied to water resource
CN118101657B (en) * 2024-04-23 2024-07-02 长视科技股份有限公司 Method and device for optimizing cooperative computing power among multiple devices applied to water resource

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115471115A (en) * 2022-10-01 2022-12-13 浙江嘉园智能科技有限公司 Electronic river length control system for unified united treatment of global water body
CN115471115B (en) * 2022-10-01 2023-10-31 浙江嘉园智能科技有限公司 Electronic river length control system for unified combined treatment of global water body
CN117933572A (en) * 2024-03-20 2024-04-26 四川飞洁科技发展有限公司 Water quality prediction method and related device
CN117933572B (en) * 2024-03-20 2024-06-11 四川飞洁科技发展有限公司 Water quality prediction method and related device
CN118101657A (en) * 2024-04-23 2024-05-28 长视科技股份有限公司 Method and device for optimizing cooperative computing power among multiple devices applied to water resource
CN118101657B (en) * 2024-04-23 2024-07-02 长视科技股份有限公司 Method and device for optimizing cooperative computing power among multiple devices applied to water resource

Similar Documents

Publication Publication Date Title
Wang et al. Privacy-aware traffic flow prediction based on multi-party sensor data with zero trust in smart city
CN114418189A (en) Water quality grade prediction method, system, terminal device and storage medium
Rao et al. Interval data‐based k‐means clustering method for traffic state identification at urban intersections
CN114742183B (en) Deep learning-based water pollution early warning method, system, equipment and storage medium
CN113643532B (en) Regional traffic prediction method and device
CN111291715B (en) Vehicle type identification method based on multi-scale convolutional neural network, electronic device and storage medium
Cheng et al. A lightweight ensemble spatiotemporal interpolation model for geospatial data
CN115983497A (en) Time sequence data prediction method and device, computer equipment and storage medium
CN115114484A (en) Abnormal event detection method and device, computer equipment and storage medium
CN113822144A (en) Target detection method and device, computer equipment and storage medium
CN116975622A (en) Training method and device of target detection model, and target detection method and device
CN116467759A (en) Method, device, equipment and storage medium for determining data storage strategy
CN112529315B (en) Landslide prediction method, landslide prediction device, landslide prediction equipment and storage medium
CN113298265B (en) Heterogeneous sensor potential correlation learning method based on deep learning
CN115278757A (en) Method and device for detecting abnormal data and electronic equipment
CN116861226A (en) Data processing method and related device
Lijun et al. An intuitionistic calculus to complex abnormal event recognition on data streams
Zhang et al. Dynamic pricing strategy for high occupancy toll lanes based on random forest and nested model
CN113487316B (en) Distributed payment system security processing method and device
CN116050508B (en) Neural network training method and device
CN109255432B (en) Neural network model construction method and device, storage medium and electronic equipment
CN113657623B (en) Power equipment state diagnosis effect determining method, device, terminal and storage medium
KR102672518B1 (en) Artificial intelligence-based real-time stratum distribution and condition identification ground investigation system
Zeng et al. Addressing robust travel mode identification with individual trip‐chain trajectory noise reduction
CN111435463B (en) Data processing method, related equipment and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination