Water quality monitoring and alerting method and apparatus

By acquiring water quality detection data and water surface images at different target times, and using image recognition models and water quality detection similarity calculations, the water quality detection frequency is dynamically adjusted and alarms are sent. This solves the problem that existing technologies cannot adjust water quality monitoring according to changes in the water surface, and improves the flexibility and accuracy of water quality monitoring.

CN115267102BActive Publication Date: 2026-05-15AEROSPACE INFORMATION RES INST CAS
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AEROSPACE INFORMATION RES INST CAS
Filing Date
2022-06-17
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Current water quality monitoring technologies cannot adjust water quality detection and issue alarms based on changes in water surface conditions.

Method used

By acquiring water quality detection data and water surface images at different target times, and using image recognition models and water quality detection similarity calculations, the water quality detection frequency is adjusted and alarms are sent.

Benefits of technology

It enables dynamic adjustment of water quality detection frequency based on changes in water surface conditions, improving the flexibility and accuracy of water quality monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115267102B_ABST
    Figure CN115267102B_ABST
Patent Text Reader

Abstract

The application provides a water quality monitoring and alarming method and device, the method comprises the following steps: obtaining first water quality detection data and a first water surface image at a first target time, and obtaining second water quality detection data and a second water surface image at a second target time; obtaining water quality detection similarity according to the first water quality detection data and the second water quality detection data; inputting the first water surface image and the second water surface image into an image recognition model to obtain a change label image output by the image recognition model; obtaining a water quality monitoring result according to the water quality detection similarity and the change label image; if the water quality monitoring result exceeds a target threshold, adjusting a water quality detection frequency and sending an alarm. The water quality monitoring and adjusting method and device provided by the application obtain water surface images and water quality detection data at different target times, obtain a water quality monitoring result, and adjust a water quality detection frequency and send an alarm according to the water quality monitoring result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of environmental protection technology, and in particular to a water quality monitoring and alarm method and device. Background Technology

[0002] Water exhibits a comprehensive range of characteristics under environmental influences, including its physical properties and chemical composition. Water in nature is an extremely complex system composed of various substances (dissolved and undissolved). The dissolved substances in water directly affect many properties of natural water, resulting in variations in water quality. Different uses require different water quality standards. Drinking water has higher quality requirements, with strict regulations on its physical properties, total mineralization, total hardness, and the content of bacteria and harmful substances. Domestic water, industrial water, and agricultural irrigation water all have different standards. Therefore, monitoring water quality for different applications is of practical significance.

[0003] Most existing water quality monitoring systems only detect water quality at a set frequency and cannot adjust the detection and issue alarms based on changes in the water surface. Summary of the Invention

[0004] This invention provides a water quality monitoring and alarm method and device to solve the shortcomings of existing water quality monitoring technologies, which mostly only detect water quality at a set frequency and cannot adjust the water quality detection according to changes in the water surface and issue alarms.

[0005] This invention provides a water quality monitoring and alarm method, comprising:

[0006] Acquire first water quality detection data and first water surface image at the first target time, and acquire second water quality detection data and second water surface image at the second target time;

[0007] The water quality detection similarity is obtained based on the first water quality detection data and the second water quality detection data;

[0008] The first water surface image and the second water surface image are input into an image recognition model to obtain a change label map output by the image recognition model; wherein, the image recognition model is obtained by training a neural network model based on water surface image samples and water surface image features;

[0009] Based on the water quality detection similarity and the change label map, the water quality monitoring results are obtained;

[0010] If the water quality monitoring results exceed the target threshold, the water quality detection frequency will be adjusted and an alarm will be sent.

[0011] According to a water quality monitoring and alarm method provided by the present invention, the image recognition model includes:

[0012] The first layer is used to obtain a first feature image and a second feature image based on the first water surface image and the second water surface image;

[0013] The second layer is used to obtain the Euclidean distance between the first feature image and the second feature image based on the first feature image and the second feature image;

[0014] The third layer is used to obtain a change label map based on the loss function and the Euclidean distance.

[0015] According to a water quality monitoring and alarm method provided by the present invention, the step of obtaining a first feature image and a second feature image based on a first water surface image and a second water surface image includes:

[0016] The first water surface image is input into a neural network, and the second water surface image is input into a twin network of the neural network to obtain a first feature image and a second feature image.

[0017] According to a water quality monitoring and alarm method provided by the present invention, the step of obtaining water quality detection similarity based on the first water quality detection data and the second water quality detection data includes:

[0018] Based on the first water quality detection data and the second water quality detection data, the first spectral vector at the first target time and the second spectral vector at the second target time are obtained;

[0019] The water quality detection similarity is obtained based on the angle between the first spectral vector and the second spectral vector.

[0020] According to a water quality monitoring and alarm method provided by the present invention, obtaining water quality monitoring results based on the water quality detection similarity and the change label map includes:

[0021] Based on the water quality detection similarity and the change label map, the spatial-spectral joint value is obtained;

[0022] The water quality monitoring results are determined based on the combined spatial and spectral values.

[0023] According to a water quality monitoring and alarm method provided by the present invention, the step of obtaining a spatial-spectral joint value based on the water quality detection similarity and the change label map includes:

[0024] Based on the values ​​corresponding to the water quality detection similarity, the values ​​corresponding to the change label map, and the weighting coefficients, the spatial-spectral joint value is obtained.

[0025] The present invention also provides a water quality monitoring and alarm device, comprising:

[0026] The acquisition module is used to acquire the first water quality detection data and the first water surface image at the first target time, and to acquire the second water quality detection data and the second water surface image at the second target time.

[0027] The calculation module is used to obtain the water quality detection similarity based on the first water quality detection data and the second water quality detection data;

[0028] The recognition module is used to input the first water surface image and the second water surface image into an image recognition model to obtain a change label map output by the image recognition model; wherein, the image recognition model is obtained by training a neural network model based on water surface image samples and water surface image features;

[0029] The determination module is used to obtain water quality monitoring results based on the water quality detection similarity and the change label map;

[0030] The adjustment module is used to adjust the water quality detection frequency and send an alarm when the water quality monitoring result exceeds the target threshold.

[0031] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the water quality monitoring and alarm method as described above.

[0032] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the water quality monitoring and alarm method as described above.

[0033] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the water quality monitoring and alarm method as described above.

[0034] The water quality monitoring and alarm method and apparatus provided by the present invention obtain water quality monitoring results by acquiring water surface images and water quality detection data at different target times, and adjust the water quality detection frequency and send alarms based on the water quality monitoring results. Attached Figure Description

[0035] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0036] Figure 1 This is a flowchart illustrating the water quality monitoring and alarm method provided by the present invention;

[0037] Figure 2 This is a schematic diagram of the water quality detection unit;

[0038] Figure 3 This is a schematic diagram of the image recognition model;

[0039] Figure 4 This is a schematic diagram of the water quality monitoring and alarm device provided by the present invention;

[0040] Figure 5 This is a schematic diagram of the water quality monitoring and alarm device provided by the present invention;

[0041] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0043] In the description of the embodiments of the present invention, it should be noted that the terms "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of the present invention. In addition, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0044] In the description of the embodiments of the present invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of the present invention based on the specific circumstances.

[0045] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0046] Figure 1 This is a flowchart illustrating the water quality monitoring and alarm method provided by the present invention. (Refer to...) Figure 1 This invention proposes a water quality monitoring and alarm method, comprising:

[0047] S110, acquire the first water quality detection data and the first water surface image at the first target time, and acquire the second water quality detection data and the second water surface image at the second target time.

[0048] S120, Based on the first water quality detection data and the second water quality detection data, the water quality detection similarity is obtained.

[0049] S130, the first water surface image and the second water surface image are input into the image recognition model to obtain the change label map output by the image recognition model; wherein, the image recognition model is obtained by training a neural network model based on water surface image samples and water surface image features.

[0050] S140, Based on the water quality detection similarity and the change label map, the water quality monitoring results are obtained.

[0051] S150, if the water quality monitoring result exceeds the target threshold, adjust the water quality detection frequency and send an alarm.

[0052] In step S110, the camera unit acquires a first water surface image at the first target time and a second water surface image at the second target time; the water quality detection unit acquires first water quality detection data at the first target time and second water quality detection data at the second target time.

[0053] Among them, such as Figure 2 As shown, the water quality detection unit includes:

[0054] According to a water quality monitoring and adjustment method provided by the present invention, the image recognition model includes:

[0055] Reflector 210 is used to reflect the light from the light source back to the spectral unit after it passes through the water body;

[0056] Measuring chamber 220 is used to hold water.

[0057] The light source 230 is used to emit broadband light to illuminate the water sample. The light source 230 and the measurement cavity 220 can be connected by optical fiber. The measurement cavity and the dispersive element 240 can be connected by optical fiber.

[0058] The dispersive element 240 is used to disperse the transmitted light in the water body. It can be a graded filter, a grating, a prism, or other devices.

[0059] Detector 250 is used to convert dispersed light into electrical signals. It can be a linear array detector, a planar array detector, or a photodiode array, etc.; water quality detection can also be performed by electrochemical or biological methods.

[0060] Motor 260 is used to adjust the length of measuring cavity 220 according to the intensity of the spectrometer signal.

[0061] In step S150, an alarm is sent to the management personnel. The management personnel can view real-time images and water quality parameters through the background display control unit. In addition, the management personnel can also send control commands through the background display control unit. The background display control unit can be a laptop, desktop computer, tablet computer, or smartphone, etc.

[0062] Understandably, the camera unit is used to monitor the safety of the monitoring equipment and monitor changes in the water surface. When the water surface changes, the detection frequency of the underwater water quality detection unit is changed from routine screening to monitoring. Based on the images and water quality parameters, the changes in water quality can be tracked and decisions can be made. This invention can simultaneously monitor the images of the water surface and changes in water quality parameters, and effectively extend the lifespan of the water quality detection unit.

[0063] Based on the above embodiments, as an optional embodiment, such as Figure 3 As shown, the image recognition model includes:

[0064] The first layer is used to obtain a first feature image and a second feature image based on the first water surface image and the second water surface image;

[0065] The second layer is used to obtain the Euclidean distance between the first feature image and the second feature image based on the first feature image and the second feature image;

[0066] The third layer is used to obtain a change label map based on the loss function and the Euclidean distance.

[0067] Optionally, obtaining the first feature image and the second feature image based on the first water surface image and the second water surface image includes:

[0068] The first water surface image is input into a neural network, and the second water surface image is input into a Siamese network of the neural network to obtain a first feature image and a second feature image. Specifically, the neural network can be Deeplabv3, and the Siamese network can also be Deeplabv3, with parameters shared between the two.

[0069] Assuming the image acquired by the camera unit at the first target time (t0) is 'a', and the image acquired by the camera unit at the second target time (t1) is 'b', the images are input into the trained Deeplabv3+ Siamese network to obtain feature images, and then the Euclidean distance and loss function are calculated to obtain the change label map.

[0070] Understandably, this application uses a trained neural network model to calculate the change label map of water surface images at different times, providing data support for subsequent water quality detection. This solves the problem that in existing technologies, water quality monitoring is mostly carried out according to a set frequency and cannot be adjusted according to changes in water surface conditions.

[0071] Based on the above embodiments, as an optional embodiment, obtaining the water quality detection similarity based on the first water quality detection data and the second water quality detection data includes:

[0072] Based on the first water quality detection data and the second water quality detection data, the first spectral vector at the first target time and the second spectral vector at the second target time are obtained;

[0073] The water quality detection similarity is obtained based on the angle between the first spectral vector and the second spectral vector.

[0074] Assume that the first spectral vector corresponding to the first target time, i.e., time t0, is A(λ1, λ2, ..., λn), and the second spectral vector corresponding to the second target time, i.e., time t1, is B(λ1, λ2, ..., λn).

[0075] The angle between two vectors is used to characterize the degree of similarity between them. In high-dimensional space, the angle between two vectors is represented by the inverse cosine:

[0076]

[0077] The smaller the value, the greater the similarity between the two vectors.

[0078] Understandably, this application provides data support for subsequent water quality detection by calculating water quality detection similarity, thus solving the defect in existing technologies where water quality monitoring is mostly carried out according to a set frequency and cannot be adjusted according to changes in water surface conditions.

[0079] Based on the above embodiments, as an optional embodiment, obtaining the water quality monitoring results according to the water quality detection similarity and the change label map includes:

[0080] Based on the water quality detection similarity and the change label map, the spatial-spectral joint value is obtained;

[0081] The water quality monitoring results are determined based on the combined spatial and spectral values.

[0082] Optionally, obtaining the spatial-spectral joint value based on the water quality detection similarity and the change label map includes:

[0083] Based on the values ​​corresponding to the water quality detection similarity, the values ​​corresponding to the change label map, and the weighting coefficients, the spatial-spectral joint value is obtained.

[0084] A threshold is set for θ. If the value exceeds the threshold, the value is E; otherwise, the value is 0. The sum of the pixel values ​​of the changed label image is calculated, and a threshold is set for it. If the sum exceeds the threshold, the value is D; otherwise, the value is 0.

[0085] The formula for calculating the combined spatial and spectral value is W = αD + βE, where α and β are weighting coefficients that are set empirically. When the final combined spatial and spectral value exceeds the final threshold, it is determined that the water quality has changed, and the detection frequency of the water quality detection unit is adjusted.

[0086] Optionally, web and mobile versions can be configured to display or calculate water quality parameters at various points and send real-time messages to the administrator regarding any abnormal situations.

[0087] Understandably, this application can track and make decisions based on images and water quality parameters, and can simultaneously monitor water surface images and changes in water quality parameters. This solves the problem that most existing water quality monitoring technologies only perform water quality detection at a set frequency and cannot adjust water quality detection according to changes in water surface conditions.

[0088] The water quality monitoring and alarm device provided by the present invention is described below. The water quality monitoring and alarm device described below can be referred to in correspondence with the water quality monitoring and alarm method described above.

[0089] Figure 4 This is a schematic diagram of the water quality monitoring and alarm device provided by the present invention, with reference to... Figure 4 The present invention also provides a water quality monitoring and alarm device, comprising:

[0090] The acquisition module 410 is used to acquire the first water quality detection data and the first water surface image at the first target time, and to acquire the second water quality detection data and the second water surface image at the second target time.

[0091] The calculation module 420 is used to obtain the water quality detection similarity based on the first water quality detection data and the second water quality detection data;

[0092] The recognition module 430 is used to input the first water surface image and the second water surface image into an image recognition model to obtain a change label map output by the image recognition model; wherein, the image recognition model is obtained by training a neural network model based on water surface image samples and water surface image features;

[0093] The determination module 440 is used to obtain water quality monitoring results based on the water quality detection similarity and the change label map;

[0094] The adjustment module 450 is used to adjust the water quality detection frequency and send an alarm when the water quality monitoring result exceeds the target threshold.

[0095] As one embodiment, the image recognition model includes:

[0096] The first layer is used to obtain a first feature image and a second feature image based on the first water surface image and the second water surface image;

[0097] The second layer is used to obtain the Euclidean distance between the first feature image and the second feature image based on the first feature image and the second feature image;

[0098] The third layer is used to obtain a change label map based on the loss function and the Euclidean distance.

[0099] As an example, the first layer of the image recognition model is used for:

[0100] The first water surface image is input into a neural network, and the second water surface image is input into a twin network of the neural network to obtain a first feature image and a second feature image.

[0101] As one embodiment, the computing module 420 is used for:

[0102] Based on the first water quality detection data and the second water quality detection data, the first spectral vector at the first target time and the second spectral vector at the second target time are obtained;

[0103] The water quality detection similarity is obtained based on the angle between the first spectral vector and the second spectral vector.

[0104] As one embodiment, the determining module 440 is used for:

[0105] Based on the water quality detection similarity and the change label map, the spatial-spectral joint value is obtained;

[0106] The water quality monitoring results are determined based on the combined spatial and spectral values.

[0107] As one embodiment, the determining module 440 is further configured to:

[0108] Based on the values ​​corresponding to the water quality detection similarity, the values ​​corresponding to the change label map, and the weighting coefficients, the spatial-spectral joint value is obtained.

[0109] Figure 5 This example illustrates the hardware structure of a water quality monitoring and alarm system. The system includes a camera unit 510, a power supply unit 520, a control unit 530, a transmission unit 540, a water quality detection unit 550, and a background display control unit 560. The power supply unit 520 supplies power to the camera unit 510. The control unit 530 is connected to both the camera unit 510 and the water quality detection unit 550, acquiring images and water quality detection information, which are then transmitted to the background display control unit 560 via the transmission unit 540. The camera unit 510 is located on the shore or in the water, while the water quality detection unit 550 is located in the water.

[0110] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a water quality monitoring and alarm method, which includes:

[0111] Acquire first water quality detection data and first water surface image at the first target time, and acquire second water quality detection data and second water surface image at the second target time;

[0112] The water quality detection similarity is obtained based on the first water quality detection data and the second water quality detection data;

[0113] The first water surface image and the second water surface image are input into an image recognition model to obtain a change label map output by the image recognition model; wherein, the image recognition model is obtained by training a neural network model based on water surface image samples and water surface image features;

[0114] Based on the water quality detection similarity and the change label map, the water quality monitoring results are obtained;

[0115] If the water quality monitoring results exceed the target threshold, the water quality detection frequency will be adjusted and an alarm will be sent.

[0116] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0117] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is capable of executing a water quality monitoring and alarm method, the method comprising:

[0118] Acquire first water quality detection data and first water surface image at the first target time, and acquire second water quality detection data and second water surface image at the second target time;

[0119] The water quality detection similarity is obtained based on the first water quality detection data and the second water quality detection data;

[0120] The first water surface image and the second water surface image are input into an image recognition model to obtain a change label map output by the image recognition model; wherein, the image recognition model is obtained by training a neural network model based on water surface image samples and water surface image features;

[0121] Based on the water quality detection similarity and the change label map, the water quality monitoring results are obtained;

[0122] If the water quality monitoring results exceed the target threshold, the water quality detection frequency will be adjusted and an alarm will be sent.

[0123] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform a water quality monitoring and alarm method, the method comprising:

[0124] Acquire first water quality detection data and first water surface image at the first target time, and acquire second water quality detection data and second water surface image at the second target time;

[0125] The water quality detection similarity is obtained based on the first water quality detection data and the second water quality detection data;

[0126] The first water surface image and the second water surface image are input into an image recognition model to obtain a change label map output by the image recognition model; wherein, the image recognition model is obtained by training a neural network model based on water surface image samples and water surface image features;

[0127] Based on the water quality detection similarity and the change label map, the water quality monitoring results are obtained;

[0128] If the water quality monitoring results exceed the target threshold, the water quality detection frequency will be adjusted and an alarm will be sent.

[0129] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0130] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A water quality monitoring and alarm method, characterized in that, include: Acquire first water quality detection data and first water surface image at the first target time, and acquire second water quality detection data and second water surface image at the second target time; The water quality detection similarity is obtained based on the first water quality detection data and the second water quality detection data; The first water surface image and the second water surface image are input into an image recognition model to obtain a change label map output by the image recognition model; wherein, the image recognition model is obtained by training a neural network model based on water surface image samples and water surface image features; Based on the water quality detection similarity and the change label map, the water quality monitoring results are obtained; If the water quality monitoring results exceed the target threshold, the water quality detection frequency will be adjusted and an alarm will be sent. The step of obtaining water quality detection similarity based on the first water quality detection data and the second water quality detection data includes: Based on the first water quality detection data and the second water quality detection data, the first spectral vector at the first target time and the second spectral vector at the second target time are obtained; The water quality detection similarity is obtained based on the angle between the first spectral vector and the second spectral vector; The process of obtaining water quality monitoring results based on the water quality detection similarity and the change label map includes: Based on the water quality detection similarity and the change label map, the spatial-spectral joint value is obtained; The water quality monitoring results are determined based on the combined spatial and spectral values.

2. The water quality monitoring and alarm method according to claim 1, characterized in that, The image recognition model includes: The first layer is used to obtain a first feature image and a second feature image based on the first water surface image and the second water surface image; The second layer is used to obtain the Euclidean distance between the first feature image and the second feature image based on the first feature image and the second feature image; The third layer is used to obtain a change label map based on the loss function and the Euclidean distance.

3. The water quality monitoring and alarm method according to claim 2, characterized in that, The step of obtaining a first feature image and a second feature image based on the first water surface image and the second water surface image includes: The first water surface image is input into a neural network, and the second water surface image is input into a twin network of the neural network to obtain a first feature image and a second feature image.

4. The water quality monitoring and alarm method according to claim 1, characterized in that, The step of obtaining the spatial-spectral joint value based on the water quality detection similarity and the change label map includes: Based on the values ​​corresponding to the water quality detection similarity, the values ​​corresponding to the change label map, and the weighting coefficients, the spatial-spectral joint value is obtained.

5. A water quality monitoring and alarm device, characterized in that, include: The acquisition module is used to acquire the first water quality detection data and the first water surface image at the first target time, and to acquire the second water quality detection data and the second water surface image at the second target time. The calculation module is used to obtain the water quality detection similarity based on the first water quality detection data and the second water quality detection data; The recognition module is used to input the first water surface image and the second water surface image into an image recognition model to obtain a change label map output by the image recognition model; wherein, the image recognition model is obtained by training a neural network model based on water surface image samples and water surface image features; The determination module is used to obtain water quality monitoring results based on the water quality detection similarity and the change label map; The adjustment module is used to adjust the water quality detection frequency and send an alarm when the water quality monitoring result exceeds the target threshold; The step of obtaining water quality detection similarity based on the first water quality detection data and the second water quality detection data includes: Based on the first water quality detection data and the second water quality detection data, the first spectral vector at the first target time and the second spectral vector at the second target time are obtained; The water quality detection similarity is obtained based on the angle between the first spectral vector and the second spectral vector; The process of obtaining water quality monitoring results based on the water quality detection similarity and the change label map includes: Based on the water quality detection similarity and the change label map, the spatial-spectral joint value is obtained; The water quality monitoring results are determined based on the combined spatial and spectral values.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the water quality monitoring and alarm method as described in any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the water quality monitoring and alarm method as described in any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the water quality monitoring and alarm method as described in any one of claims 1 to 4.