Ardealite building pollutant anomaly detection method, electronic equipment and program product
Through the clustering and data change curve fitting method based on the KMeans algorithm, the problems of high labor costs and subjective factors in the detection of pollutants in phosphogypsum buildings are solved, and automated analysis and more accurate detection results are achieved.
Patent Information
- Application Number
- CN202411512600.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing phosphogypsum building pollutant detection methods have problems such as high labor costs and high proportion of subjective factors, which lead to inaccurate detection results.
A method of abnormal detection of pollutants in phosphogypsum buildings based on KMeans algorithm is adopted. By obtaining the sampling data of the target detection area, clustering processing is performed, data change curve is fitted, and pollution risk warning information is issued according to preset conditions.
It realizes automated analysis and processing of pollutant content data, reduces labor costs and improves the accuracy of detection results.
Smart Images

Figure CN119541697A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of environmental detection, and in particular to a method for detecting abnormalities of phosphogypsum building pollutants, electronic equipment and program products. Background Art
[0002] Phosphogypsum is an industrial waste residue produced by the process of using sulfuric acid to decompose phosphate ore and extract phosphoric acid. The content of calcium sulfate dihydrate in it exceeds that of ordinary natural gypsum. In recent years, the amount of industrial waste residues such as phosphogypsum has increased. Under the promotion of ecological and environmental protection concepts, phosphogypsum has gradually been used. The application scope includes but is not limited to cement additives, road filling, gypsum board production, construction gypsum powder and blocks. However, due to the characteristics of phosphogypsum being difficult to handle, polluting the environment, and lacking efficient and high value-added utilization methods, coupled with the current situation of increasingly scarce mineral resources, phosphogypsum is mostly used to construct highway pavement base. Applying phosphogypsum materials to the pavement base and then adding curing agents, cement and other materials can not only save mineral resources, but also improve the comprehensive performance of phosphogypsum mixtures to a certain extent, and better meet the functional needs and performance requirements of highway pavement bases.
[0003] In actual application, since phosphogypsum contains many polluting impurities such as phosphorus, fluorine, and organic matter, these harmful impurities can easily seep into the roadbed due to rainwater leaching, deformation and cracking of roads due to heavy loads, and roads being soaked in water for a long time due to floods, causing serious pollution to the environment around the roads.
[0004] At present, the detection and prevention of pollutant seepage from building materials mixed with phosphogypsum can usually only be done by preparing road rescue measures in advance, and when pollutant seepage is detected during regular road inspections, post-disaster maintenance, or maintenance after obvious damage such as cracks, emergency treatment is carried out based on the above road rescue measures. However, pollutants in phosphogypsum often do not erupt suddenly. It is a relatively slow process for pollutants to seep from building materials, invade soil and water sources, and then be sampled and tested to find that pollutants have seeped in excess. Therefore, when it comes to large-scale detection and prevention scenarios such as road subgrades, existing pollutant detection methods often require a large number of professionals to conduct sampling analysis and data monitoring. At the same time, a large amount of data will inevitably lead to inaccurate test results due to subjective judgment errors, data recording errors, and other reasons during analysis. Summary of the invention
[0005] In view of this, the purpose of the embodiments of the present application is to provide a method, electronic equipment and program product for detecting abnormal pollutants in phosphogypsum buildings, which can improve the problems of high labor costs and too high proportion of subjective factors in traditional pollutant detection methods for phosphogypsum buildings, resulting in inaccurate detection results.
[0006] In order to achieve the above technical objectives, the technical solutions adopted in this application are as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for detecting abnormalities of phosphogypsum building pollutants, the method comprising:
[0008] Acquire sampling data corresponding to each data sampling point in the target detection area, wherein the sampling data represents the content of pollutants seeping out of the phosphogypsum building at the data sampling point;
[0009] Performing clustering processing on the sampled data based on the KMeans algorithm to obtain multiple target sub-areas;
[0010] For each of the multiple target sub-regions, fitting a data change curve corresponding to each target sub-region according to the sampled data in the target sub-region, wherein the data change curve represents a change of the sampled data with time;
[0011] The data change curve that meets the preset conditions is used as a target curve, and prompt information is issued indicating that a target sub-area corresponding to the target curve has a pollution risk.
[0012] In combination with the first aspect, in some optional implementations, the data sampling points include data points and null value points;
[0013] Before clustering the sampled data based on the KMeans algorithm to obtain a plurality of target sub-regions, the method further includes:
[0014] According to the sampled data corresponding to the data point, based on a preset interpolation strategy, interpolation processing is performed on the null value point to obtain sampled data after interpolation processing;
[0015] The sampled data is replaced by the sampled data after the interpolation processing.
[0016] In combination with the first aspect, in some optional implementations, interpolating the null value point based on a preset interpolation strategy according to the sampled data corresponding to the data point to obtain the interpolated sampled data includes:
[0017] Preprocessing the sampled data to obtain first feature maps of different scales;
[0018] Performing a first convolution operation on the first feature maps of different scales to obtain second feature maps of different scales corresponding to the first feature maps of different scales;
[0019] Obtaining an influencing factor representing an environmental factor of the geographical location of the data sampling point;
[0020] Determine a weight factor corresponding to each of the null value points according to the influencing factor, wherein the weight factor represents an environmental difference between the null value point and the data point;
[0021] Determining a plurality of pollutant prediction results according to the second characteristic graphs of different scales and the weight factors;
[0022] Performing a second convolution operation on the plurality of pollutant prediction results to obtain a target interpolation value for each of the null value points;
[0023] According to the target interpolation, the null value points in the sampled data are replaced to obtain the sampled data after the interpolation processing.
[0024] In combination with the first aspect, in some optional implementations, performing a first convolution operation on the first feature maps of different scales to obtain second feature maps of different scales corresponding to the first feature maps of different scales includes:
[0025] For each of the data sampling points in the first feature maps of different scales, the first convolution operation is performed:
[0026] h j =gat⊙m j
[0027]
[0028] In the formula, h j It represents the convolution result after the first convolution operation of each data sampling point. Gat represents gated convolution. represents the sampled data in the convolution area of the i-th convolution kernel of the k-1th layer, represents the weight corresponding to the i-th convolution kernel of the k-th layer, represents the bias term corresponding to the i-th convolution kernel of the k-th layer, represents convolution, R represents the convolution region, sig represents the sigmoid activation function, and f(·) represents any activation function;
[0029] For the first feature map at each scale, each data sampling point in the first feature map at each scale is traversed to obtain the convolution results corresponding to multiple data sampling points after the first convolution operation, and the set of the convolution results is used as the second feature map of different scales corresponding to the first feature map at each scale.
[0030] In combination with the first aspect, in some optional implementations, the influencing factors include precipitation, elevation, terrain relief, average temperature, coordinates and ground slope at the data sampling point;
[0031] Determining a weight factor corresponding to each of the null value points according to the influencing factor includes:
[0032] According to the influencing factor, the Euclidean distance between the null point and each target data point is determined:
[0033]
[0034] In the formula, dist i represents the Euclidean distance between the i-th null point and the target data point, represents the coordinate difference between the i-th null point and the target data point, S c represents the standard deviation of all coordinates, represents the elevation difference between the i-th null point and the target data point, S e represents the standard deviation of all elevations, represents the precipitation difference between the i-th null point and the target data point, S p represents the standard deviation of all precipitation amounts, represents the terrain relief difference between the i-th null point and the target data point, S u represents the standard deviation of all terrain relief, represents the evaluation temperature difference between the i-th null point and the target data point, S t represents the standard deviation of all mean temperatures, represents the ground slope difference between the i-th null point and the target data point, S s represents the standard deviation of all ground slopes, the target data point representing a data point within a preset distance range of the null value point;
[0035] The Euclidean distance is normalized to obtain the weight factor:
[0036] weight i =softmin(dist i ,{dist 0 ,dist 1 ,…,dist n})
[0037] In the formula, weight i represents the weight factor corresponding to the i-th null value point, softmin represents the activation function, {dist 0 ,dist 1 ,…,dist n} represents the set of Euclidean distances between the i-th null point and each target data point.
[0038] In combination with the first aspect, in some optional implementations, determining multiple pollutant prediction results according to the second feature maps of different scales and the weight factors includes:
[0039] The weight factor is multiplied by the convolution result corresponding to the null value point in the second feature map of different scales to obtain weighted second feature maps of different scales as the multiple pollutant prediction results.
[0040] In combination with the first aspect, in some optional implementations, clustering is performed on the sampled data based on a KMeans algorithm to obtain multiple target sub-regions, including:
[0041] Randomly select N sample data as the center point;
[0042] According to the preset geographical factor data, the distance between each sampled data and the center point is calculated, and the minimum distance between each sampled data and the center point is used as the loss function;
[0043] Dividing the sampled data into a plurality of data clusters according to the loss function;
[0044] Adjusting the position of the center point according to the loss function until the loss function meets a preset convergence condition;
[0045] When it is determined that the loss function satisfies a preset convergence condition, the multiple data clusters corresponding to the sampled data are used as the multiple target sub-regions.
[0046] In combination with the first aspect, in some optional implementations, the data change curve that meets the preset conditions is used as a target curve, and prompt information indicating that a target sub-area corresponding to the target curve has a pollution risk is issued, including:
[0047] Acquire the data variation curve obtained by sampling and fitting the target detection area within a preset time;
[0048] When the slope of at least one data change curve in the same target sub-region is continuously greater than a first preset threshold value within the preset time, a prompt message indicating that the target sub-region corresponding to the at least one data change curve has a pollution risk is issued;
[0049] Alternatively, when, in the data variation curve, the sampling data obtained by the most recent sampling of the target sub-region is greater than a second preset threshold, a prompt message indicating that there is a pollution risk in the target sub-region is issued.
[0050] In a second aspect, an embodiment of the present application further provides an electronic device, comprising a processor and a memory coupled to each other, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device executes the above method.
[0051] In a third aspect, an embodiment of the present application further provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0052] The invention adopting the above technical solution has the following advantages:
[0053] In the technical solution provided in the present application, the sampling data corresponding to each data sampling point in the target detection area is first obtained, and then the sampling data is clustered based on the KMeans algorithm to obtain multiple target sub-areas. For each of the multiple target sub-areas, the data change curve corresponding to each target sub-area is fitted according to the sampling data in each target sub-area, and finally the data change curve that meets the preset conditions is used as the target curve, and a prompt message indicating that the target sub-area corresponding to the target curve has a pollution risk is issued. In this way, the pollutant data of the phosphogypsum building is collected from each pre-set data sampling point through the front end, and after the collection, the data is aggregated to the back-end electronic device for data fitting, and the data change curve obtained by fitting is analyzed to realize the automated analysis and processing of the pollutant content data, and improve the problem that the traditional pollutant detection method of phosphogypsum buildings has high labor costs and a high proportion of subjective factors, resulting in inaccurate detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The present application may be further described by the non-limiting embodiments given in the accompanying drawings. It should be understood that the following drawings only illustrate certain embodiments of the present application and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings may be obtained based on these drawings without creative effort.
[0055] Figure 1 A structural block diagram of an electronic device provided in an embodiment of the present application.
[0056] Figure 2 A schematic flow chart of a method for detecting abnormal phosphogypsum building pollutants provided in an embodiment of the present application.
[0057] Icon: 100 - electronic device; 101 - processor; 102 - memory. DETAILED DESCRIPTION
[0058] The present application will be described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that in the drawings or descriptions, similar or identical parts use the same figure numbers, and the implementation methods not shown or described in the drawings are forms known to ordinary technicians in the relevant technical field. In the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0059] Please refer to Figure 1 , an embodiment of the present application provides an electronic device 100 that may include a processor 101 and a memory 102. The memory 102 stores a computer program, and when the computer program is executed by the processor 101, the electronic device 100 can execute the corresponding steps in the following phosphogypsum building pollutant abnormality detection method.
[0060] In this embodiment, the processor 101 may be an integrated circuit chip having signal processing capabilities. The processor 101 may be a general-purpose processor. For example, the processor 101 may be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and may implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application.
[0061] The memory 102 may be, but is not limited to, a random access memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, etc. In this embodiment, the memory 102 may be used to store data sampling points, sampled data, target sub-regions, preset interpolation strategies, data change curves, preset conditions, prompt information, etc. Of course, the memory 102 may also be used to store programs, and the processor 101 executes the program after receiving the execution instruction.
[0062] Understandably, Figure 1 The structure of the electronic device 100 shown in FIG. 1 is only a schematic diagram of a structure. The electronic device 100 may also include Figure 1 More components are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0063] In this embodiment, the electronic device 100 can be a personal computer, a laptop computer, a cloud server, etc. This embodiment takes a personal computer as an example. The electronic device 100 is used to obtain sampling data, and then cluster the sampling data to obtain multiple target sub-areas. For each sub-area, the sampling data of the area is fitted to obtain a data change curve. Finally, the data change curve that meets the preset conditions is used as the target curve, and a prompt message indicating that the target sub-area corresponding to the target curve has a pollution risk is issued.
[0064] Please refer to Figure 2 The present application also provides a method for detecting abnormalities of phosphogypsum building pollutants, which can be applied to the above-mentioned electronic device 100, and each step of the method is executed or implemented by the electronic device 100. The method for detecting abnormalities of phosphogypsum building pollutants can include the following steps:
[0065] Step 210, acquiring sampling data corresponding to each data sampling point in the target detection area, wherein the sampling data represents the pollutant content seeping out of the phosphogypsum building at the data sampling point;
[0066] Step 220, clustering the sampled data based on the KMeans algorithm to obtain multiple target sub-regions;
[0067] Step 230, for each target sub-region among the multiple target sub-regions, fitting a data change curve corresponding to each target sub-region according to the sampled data in the target sub-region, wherein the data change curve represents the change of the sampled data with time.
[0068] Step 240: taking the data variation curve that meets the preset conditions as the target curve, and issuing a prompt message indicating that the target sub-area corresponding to the target curve has a pollution risk.
[0069] The following will describe in detail the steps of the abnormal detection method of phosphogypsum building pollutants, as follows:
[0070] In step 210, the target monitoring area can be a relatively large area. For example, administrative areas such as City A, Province B, and District C, or a geographical range defined by the user. In this embodiment, the data sampling points can be flexibly set according to the actual situation. For example, the present application is used for data monitoring of pollutants (hereinafter referred to as phosphogypsum pollutants) seeping from phosphogypsum buildings (specifically, monitoring of pollutants seeping from roadbeds mixed with phosphogypsum is taken as an example), and the data sampling points must be evenly set along roads mixed with phosphogypsum. The spacing between every two data sampling points can be flexibly set according to user needs. For example, every two data sampling points can be evenly set based on highway mileage intervals of 100 meters, 500 meters, 1000 meters, etc. It is worth noting that the buildings proposed in this application are a broad general term, including but not limited to buildings, structures, roads, etc. mixed with phosphogypsum.
[0071] In this embodiment, sensors set at various data sampling points can be used to monitor the situation of phosphogypsum pollutants seeping out of the road surface and infiltrating into soil and water sources; or road cleaners can hold sampling equipment to collect samples along the road surface during road cleaning, and the back-end personnel can summarize the data into sampling data based on the marks of each sampling point and the data obtained from the sample analysis. It is understandable that due to equipment failure, false detection, missed detection, data anomaly, or reducing the distribution density of data sampling points due to cost considerations during the data collection process, the values of some data sampling points in the sampled data are null values, that is, the sampled data includes data points and null value points. Among them, it is understandable that since phosphogypsum pollutants usually seep into soil or groundwater, the sampling and detection objects of sensors or detection equipment are usually soil or water sources beside the road.
[0072] In this embodiment, the acquisition of sampled data can be obtained by front-end acquisition and analysis, and then uploaded to the processor 101 of the electronic device 100 in real time, and then subsequently processed by the electronic device 100; or, the acquisition of sampled data can also be obtained by front-end acquisition and analysis, and then stored in the memory 102 of the electronic device 100 or any database that can transmit data with the electronic device 100, and then called based on user instructions in the subsequent processing process. The acquisition method of sampled data is not specifically limited here.
[0073] Between step 210 and step 220, the method may further include:
[0074] According to the sampled data corresponding to the data point, based on a preset interpolation strategy, interpolation processing is performed on the null value point to obtain sampled data after interpolation processing;
[0075] The sampled data is replaced by the sampled data after the interpolation processing.
[0076] In this embodiment, according to the sampled data corresponding to the data point, based on a preset interpolation strategy, interpolating the null value point to obtain the sampled data after interpolation may include:
[0077] Preprocessing the sampled data to obtain first feature maps of different scales;
[0078] Performing a first convolution operation on the first feature maps of different scales to obtain second feature maps of different scales corresponding to the first feature maps of different scales;
[0079] Obtaining an influencing factor representing an environmental factor of the geographical location of the data sampling point;
[0080] Determine a weight factor corresponding to each of the null value points according to the influencing factor, wherein the weight factor represents an environmental difference between the null value point and the data point;
[0081] Determining a plurality of pollutant prediction results according to the second characteristic graphs of different scales and the weight factors;
[0082] Performing a second convolution operation on the plurality of pollutant prediction results to obtain a target interpolation value for each of the null value points;
[0083] According to the target interpolation, the null value points in the sampled data are replaced to obtain the sampled data after the interpolation processing.
[0084] In this embodiment, the preprocessing of the sampled data can be to rasterize the target detection area according to the interval of the data sampling points. For example, if the data sampling points are one point every 100 meters, the size of the grid is 100m×100m, and each grid contains one data point or a null point. Then, based on the rasterized sampled data, multiple feature maps of different scales such as n×n, 2n×2n, 4n×4n are generated, and the feature map of each scale is adaptively weighted pooled to obtain multiple first feature maps of different scales.
[0085] Among them, the pooling window size of the adaptive weighted pooling operation is 3×3 and the step size is 3 (null values can be filled at the edge of the feature map to adapt to the size of the pooling window and the step size of the pooling). During the pooling process, all the data in the pooling window are summed, and (1-number of null value points / total number of data sampling points) is used as the weight of the solution and result and multiplied by the summation result to obtain the pooling result corresponding to the pooling window. Exemplarily, if the data in a pooling window is (0,1,2,0,0,0,1,2,1), where 0 corresponds to a null value point and the rest of the data corresponds to a data point, then the pooling result corresponding to the pooling window = (0+1+2+0+0+0+1+2+1)×(1-4 / 9)=35 / 9, and then the pooling window is moved 3 steps for the next pooling until all the data in the feature map are pooled. In this way, the influence of null value points on the data point feature extraction process is avoided or weakened.
[0086] Then, each first feature map is gated convolved through the first convolution operation to obtain the second feature map of scales such as n×n, 2n×2n, and 4n×4n (it can be understood that the second feature map at this time has completed the preliminary prediction of the null point, but considering the influence of geographical environmental factors such as precipitation and average temperature in different geographical locations, the preliminary prediction results are adjusted by the weight factor). Then the influence factor is obtained, and the weight factor of each null point is calculated according to the influence factor, and then the weight factor is multiplied with the value of the original null point in the second feature map (the null point is originally a blank sampling point with no data, and the preliminary prediction result is obtained after the first convolution operation, and then the preliminary prediction result is adjusted by the influence factor here) to obtain multiple pollutant prediction results. Among them, multiple pollutant prediction results are still presented in the form of feature maps of different scales. In order to obtain the final interpolation data, the pollutant prediction results of different scales are fused through conventional convolution, and finally the target interpolation at each null point is obtained, and the data at the null point is replaced based on the target interpolation to obtain the sampling data after interpolation processing.
[0087] In this embodiment, the influencing factors may include precipitation, elevation, terrain relief, average temperature, coordinates and ground slope at the data sampling point.
[0088] In this embodiment, performing a first convolution operation on the first feature maps of different scales to obtain second feature maps of different scales corresponding to the first feature maps of different scales may include:
[0089] For each of the data sampling points in the first feature maps of different scales, the first convolution operation is performed:
[0090] h j =gat⊙m j
[0091]
[0092] In the formula, h j It represents the convolution result after the first convolution operation of each data sampling point. Gat represents gated convolution. represents the sampled data in the convolution area of the i-th convolution kernel of the k-1th layer, represents the weight corresponding to the i-th convolution kernel of the k-th layer, represents the bias term corresponding to the i-th convolution kernel of the k-th layer, represents convolution, R represents the convolution region, sig represents the sigmoid activation function, and f(·) represents any activation function;
[0093] For the first feature map at each scale, each data sampling point in the first feature map at each scale is traversed to obtain the convolution results corresponding to multiple data sampling points after the first convolution operation, and the set of the convolution results is used as the second feature map of different scales corresponding to the first feature map at each scale.
[0094] In this embodiment, m j It can be understood as a conventional convolution. The first convolution operation (i.e., gated convolution) is to eliminate the influence of null points contained in the convolved area on the convolution result through the weight gat on the basis of conventional convolution.
[0095] In this embodiment, determining the weight factor corresponding to each of the null value points according to the influencing factor may include:
[0096] According to the influencing factor, the Euclidean distance between the null point and each target data point is determined:
[0097]
[0098] In the formula, dist i represents the Euclidean distance between the i-th null point and the target data point, represents the coordinate difference between the i-th null point and the target data point, S c represents the standard deviation of all coordinates, represents the elevation difference between the i-th null point and the target data point, S e represents the standard deviation of all elevations, represents the precipitation difference between the i-th null point and the target data point, S p represents the standard deviation of all precipitation amounts, represents the terrain relief difference between the i-th null point and the target data point, S u represents the standard deviation of all terrain relief, represents the evaluation temperature difference between the i-th null point and the target data point, S t represents the standard deviation of all mean temperatures, represents the ground slope difference between the i-th null point and the target data point, S s represents the standard deviation of all ground slopes, the target data point representing a data point within a preset distance range of the null value point;
[0099] The Euclidean distance is normalized to obtain the weight factor:
[0100] weight i =softmin(dist i ,{dist 0 ,dist 1 ,…,dist n})
[0101] In the formula, weight i represents the weight factor corresponding to the i-th null value point, softmin represents the activation function, {dist 0 ,dist 1 ,…,dist n} represents the set of Euclidean distances between the i-th null point and each target data point.
[0102] In this embodiment, determining multiple pollutant prediction results according to the second feature maps of different scales and the weight factors may include:
[0103] The weight factor is multiplied by the convolution result corresponding to the null value point in the second feature map of different scales to obtain weighted second feature maps of different scales as the multiple pollutant prediction results.
[0104] In this way, by characterizing the prime weight factors of the geographical location environment factors of the null value points and the data points, the convolution results of the null value points in the second feature map (which can be understood as the preliminary prediction results of the null value points) are adjusted to enhance the accuracy of the prediction.
[0105] In step 220, clustering is performed on the sampled data based on the KMeans algorithm to obtain multiple target sub-regions, which may include:
[0106] Randomly select N sample data as the center point;
[0107] According to the preset geographical factor data, the distance between each sampled data and the center point is calculated, and the minimum distance between each sampled data and the center point is used as the loss function;
[0108] Dividing the sampled data into a plurality of data clusters according to the loss function;
[0109] Adjusting the position of the center point according to the loss function until the loss function meets a preset convergence condition;
[0110] When it is determined that the loss function satisfies a preset convergence condition, the multiple data clusters corresponding to the sampled data are used as the multiple target sub-regions.
[0111] It is understandable that in an actual road environment, the climate, slope, and geographical location of similar data sampling points are usually not very different, resulting in similar levels of phosphogypsum pollutant seepage at multiple adjacent data sampling points in harsh environments (such as long-term precipitation, soaking in water, long-term high temperature and drought, etc.). Therefore, in order to facilitate management and ensure the safety of pollutant seepage areas, this embodiment divides the sampling data into multiple target sub-areas through the KMeans clustering algorithm to achieve block monitoring.
[0112] Specifically, the preset geographical factor data may be the same as the influencing factor, or may be a part of the influencing factor. The distance calculation between the sampling data and the center point may be any distance calculation method such as Euclidean distance, Mahalanobis distance, cosine distance, etc. In this embodiment, the preset geographical factor data is used as a parameter, and the distance calculation method takes Euclidean distance as an example. The preset convergence condition can be flexibly set according to user needs. For example, if the center points adjusted multiple times all refer to the same sampling data, or the deviation between the iterative loss function and the previous loss function does not exceed 0.5%, then the loss function is determined to converge. In this way, the sampling data is divided into multiple target sub-areas through the KMeans clustering algorithm to realize the block monitoring and management of the road environment, ensuring that when phosphogypsum pollutants seep out of one or some data sampling points, the corresponding data sampling points receive timely road maintenance and advance control of the surrounding environment.
[0113] In this embodiment, the optimization algorithm for the number of center points N may be as follows:
[0114] ① Setting a preset range for the number of center points N;
[0115] ② Take the value of each center point as a particle;
[0116] ③ Initialize relevant parameters, including the initial value of the i-th particle Initial update speed of the i-th particle Inertia weight ω, optimal value of initial particles Initial global optimum Maximum number of iterations T max ;
[0117] ④ Update the update speed and value of the particle using the following formula:
[0118]
[0119] In the formula, represents the update speed of the i-th particle at time t+1, represents the value of the i-th particle at time t+1, u 1 、u 2 represents the pre-calibrated update factor, v 1 、v 2 are independent random numbers uniformly distributed in the interval [0,1]. represents the optimal value of the i-th particle at time t, represents the global optimal value of all particles at time t;
[0120] ⑤ According to the global optimal value of the particle at the current moment, determine the fitness corresponding to the global optimal value of the particle at the current moment:
[0121]
[0122] Where fit represents fitness, N represents the number of clusters that can be classified after the global optimal value of the particle at the current moment is brought into the KMeans clustering algorithm, and dis(C i ,C j ) represents cluster C i and cluster C j The average distance between two different clusters, avg(C i ) represents cluster C i The average distance between any two sample data in |C i | represents cluster C i The number of sampled data in |C j | represents cluster C j The number of sampled data in, dis(x,y) represents the cluster C i and cluster C j The distance between any two sample data in;
[0123] ⑥ Evaluate the value of the number of center points N according to the fitness to determine whether the value of the number of center points N meets the preset conditions;
[0124] ⑦ Repeat the above steps ① to ⑥ until the number of repetitions is greater than or equal to the maximum number of iterations or the fitness corresponding to the value of the number of center points N is greater than a preset value (i.e., the preset condition is met);
[0125] ⑧ Determine the value of the number of center points N obtained in the last iteration as the target value.
[0126] In this way, the optimal value of N is determined by the above optimization algorithm to improve the accuracy of the target sub-region division. After the target sub-region is divided, the data in each target sub-region is more similar, which is conducive to the subsequent abnormal warning of phosphogypsum pollutants based on the target sub-region.
[0127] In addition, in practical applications, even with the same N value, different classification results may appear in multiple independent clusterings. Therefore, in order to avoid local optimal solutions, multiple KMeams clustering can be performed using the global optimal value of the particle at the current moment to obtain multiple clustering results, and one of the clustering results with the same center point value is randomly selected as the target clustering result for subsequent fitness calculations.
[0128] In step 230, for each data sampling point in each target sub-region, the sampling data of each data sampling point within a period of time (user-defined, such as one day, one week, one month, etc.) is obtained, and then the sampling data is fitted into a data change curve (which can be a smooth curve, or any curve that can characterize the change of the sampling data within a period of time, such as a broken line). The set of data change curves of all data sampling points in the target sub-region is the data change curve corresponding to each target sub-region. The method of fitting multiple sampling data curves based on time series is a conventional technical means in the field of data processing technology, which will not be described in detail here.
[0129] It is understandable that in practical applications, the data change curve corresponding to each target sub-area can also be obtained by averaging the sampled data obtained from the target sub-area in the same data collection to obtain a comprehensive index characterizing the target sub-area in this data collection, and then obtaining multiple comprehensive indicators obtained from multiple data collections of the target sub-area over a period of time, and then performing curve fitting on the multiple comprehensive indicators to obtain a data change curve. That is, the data change curve can refer to the change in the phosphogypsum pollutant content at each data sampling point, and can also be used to refer to the comprehensive change in the phosphogypsum pollutant content in the target sub-area.
[0130] In step 240, the data change curve that meets the preset conditions is used as the target curve, and prompt information indicating that the target sub-area corresponding to the target curve has a pollution risk is issued, which may include:
[0131] Acquire the data variation curve obtained by sampling and fitting the target detection area within a preset time;
[0132] When the slope of at least one data change curve in the same target sub-region is continuously greater than a first preset threshold value within the preset time, a prompt message indicating that the target sub-region corresponding to the at least one data change curve has a pollution risk is issued;
[0133] Alternatively, when, in the data variation curve, the sampling data obtained by the most recent sampling of the target sub-region is greater than a second preset threshold, a prompt message indicating that there is a pollution risk in the target sub-region is issued.
[0134] In the present embodiment, the first preset threshold and the second preset threshold can be flexibly set according to actual conditions. Understandably, when the seepage of phosphogypsum pollutants reaches a certain amount, it will cause great harm to the human body and the environment. In order to prevent excessive seepage in advance during the seepage of pollutants, by monitoring the slope of the data change curve, when the slope is greater than the first preset threshold (it can be understood that the phosphogypsum pollutants have not reached the degree of harm to the human body and the surrounding environment, but the pollutants continue to seep out, and the pollutants contained in soil, road surface, water source, etc. are increasing), the prompt that there is a risk of pollution in the area is issued in time, so that relevant personnel can maintain and repair the road surface in time. In addition, the seepage of phosphogypsum pollutants may also be an emergency caused by road damage. Therefore, the sampled data obtained by the most recent data sampling can also be monitored. When the sampled data is greater than the second preset threshold, a prompt indicating that there is a risk of pollution in the target sub-area is issued, so that relevant personnel can take emergency measures in time.
[0135] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic device 100 described above can refer to the corresponding process of each step in the aforementioned method, and will not be elaborated herein.
[0136] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is run on a computer, the computer executes the method for detecting abnormalities of phosphogypsum building pollutants as described in the above embodiment.
[0137] Through the description of the above implementation methods, technical personnel in this field can clearly understand that the present application can be implemented by hardware, and can also be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.
[0138] In summary, the embodiments of the present application provide a method, electronic device and program product for detecting abnormal pollutants in phosphogypsum buildings. In this technical solution, the sampling data corresponding to each data sampling point in the target detection area is first obtained, and then the sampling data is clustered based on the KMeans algorithm to obtain multiple target sub-areas. For each of the multiple target sub-areas, the data change curve corresponding to each target sub-area is fitted according to the sampling data in each target sub-area. Finally, the data change curve that meets the preset conditions is used as the target curve, and a prompt message indicating that the target sub-area corresponding to the target curve has a pollution risk is issued. In this way, the pollutant data of the phosphogypsum building is collected from each pre-set data sampling point by the front end, and after the collection, the data is aggregated to the back-end electronic device for data fitting, and the data change curve obtained by fitting is analyzed to realize the automatic analysis and processing of the pollutant content data, and improve the problem that the traditional pollutant detection method of phosphogypsum buildings has high labor costs and a high proportion of subjective factors, resulting in inaccurate detection results.
[0139] In the embodiments provided by the present application, it should be understood that the disclosed method can also be implemented in other ways. The method embodiments described above are merely schematic, for example, the flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a part of a module, a program segment or a code, and a part of the module, a program segment or a code includes one or more executable instructions for implementing the specified logical function. It should also be noted that each box in the block diagram and / or the flow chart, and the combination of the boxes in the block diagram and / or the flow chart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.
[0140] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for detecting abnormalities of phosphogypsum building pollutants, characterized in that: The method comprises: Acquire sampling data corresponding to each data sampling point in the target detection area, wherein the sampling data represents the content of pollutants seeping out of the phosphogypsum building at the data sampling point; Performing clustering processing on the sampled data based on the KMeans algorithm to obtain multiple target sub-areas; For each of the multiple target sub-regions, fitting a data change curve corresponding to each target sub-region according to the sampled data in the target sub-region, wherein the data change curve represents a change of the sampled data with time; The data change curve that meets the preset conditions is used as a target curve, and prompt information is issued indicating that a target sub-area corresponding to the target curve has a pollution risk.
2. The method according to claim 1, characterized in that The data sampling points include data points and null value points; Before clustering the sampled data based on the KMeans algorithm to obtain a plurality of target sub-regions, the method further includes: According to the sampled data corresponding to the data point, based on a preset interpolation strategy, interpolation processing is performed on the null value point to obtain sampled data after interpolation processing; The sampled data is replaced by the sampled data after the interpolation processing.
3. The method according to claim 2, characterized in that According to the sampled data corresponding to the data point, based on a preset interpolation strategy, interpolation processing is performed on the null value point to obtain the sampled data after interpolation processing, including: Preprocessing the sampled data to obtain first feature maps of different scales; Performing a first convolution operation on the first feature maps of different scales to obtain second feature maps of different scales corresponding to the first feature maps of different scales; Obtaining an influencing factor representing an environmental factor of the geographical location of the data sampling point; Determine a weight factor corresponding to each of the null value points according to the influencing factor, wherein the weight factor represents an environmental difference between the null value point and the data point; Determining a plurality of pollutant prediction results according to the second characteristic graphs of different scales and the weight factors; Performing a second convolution operation on the plurality of pollutant prediction results to obtain a target interpolation value for each of the null value points; According to the target interpolation, the null value points in the sampled data are replaced to obtain the sampled data after the interpolation processing.
4. The method according to claim 3, characterized in that: Performing a first convolution operation on the first feature maps of different scales to obtain second feature maps of different scales corresponding to the first feature maps of different scales includes: For each of the data sampling points in the first feature maps of different scales, the first convolution operation is performed: h j =gat⊙m j In the formula, h j It represents the convolution result after the first convolution operation of each data sampling point. Gat represents gated convolution. represents the sampled data in the convolution area of the i-th convolution kernel of the k-1th layer, represents the weight corresponding to the i-th convolution kernel of the k-th layer, represents the bias term corresponding to the i-th convolution kernel of the k-th layer, represents convolution, R represents the convolution region, sig represents the sigmoid activation function, and f(·) represents any activation function; For the first feature map at each scale, each data sampling point in the first feature map at each scale is traversed to obtain the convolution results corresponding to multiple data sampling points after the first convolution operation, and the set of the convolution results is used as the second feature map of different scales corresponding to the first feature map at each scale.
5. The method according to claim 3, characterized in that: The influencing factors include precipitation, elevation, terrain relief, average temperature, coordinates and ground slope at the data sampling point; Determining a weight factor corresponding to each of the null value points according to the influencing factor includes: According to the influencing factor, the Euclidean distance between the null point and each target data point is determined: In the formula, dist i represents the Euclidean distance between the i-th null point and the target data point, represents the coordinate difference between the i-th null point and the target data point, S c represents the standard deviation of all coordinates, represents the elevation difference between the i-th null point and the target data point, S e represents the standard deviation of all elevations, represents the precipitation difference between the i-th null point and the target data point, S p represents the standard deviation of all precipitation amounts, represents the terrain relief difference between the i-th null point and the target data point, S u represents the standard deviation of all terrain relief, represents the evaluation temperature difference between the i-th null point and the target data point, S t represents the standard deviation of all mean temperatures, represents the ground slope difference between the i-th null point and the target data point, S s represents the standard deviation of all ground slopes, the target data point representing a data point within a preset distance range of the null value point; The Euclidean distance is normalized to obtain the weight factor: weight i =softmin(dist i ,{dist0,dist1,…,dist n }) In the formula, weiht i represents the weight factor corresponding to the i-th null value point, softmin represents the activation function, {dist0,dist1,…,dist n } represents the set of Euclidean distances between the i-th null point and each target data point.
6. The method according to claim 4, characterized in that Determining multiple pollutant prediction results according to the second characteristic graphs of different scales and the weight factors includes: The weight factor is multiplied by the convolution result corresponding to the null value point in the second feature map of different scales to obtain weighted second feature maps of different scales as the multiple pollutant prediction results.
7. The method according to claim 1, characterized in that The sampled data is clustered based on the KMeans algorithm to obtain multiple target sub-areas, including: Randomly select N sample data as the center point; According to the preset geographical factor data, the distance between each sampled data and the center point is calculated, and the minimum distance between each sampled data and the center point is used as the loss function; Dividing the sampled data into a plurality of data clusters according to the loss function; Adjusting the position of the center point according to the loss function until the loss function meets a preset convergence condition; When it is determined that the loss function satisfies a preset convergence condition, the multiple data clusters corresponding to the sampled data are used as the multiple target sub-regions.
8. The method according to claim 1, characterized in that The data change curve that meets the preset conditions is used as a target curve, and prompt information indicating that a target sub-area corresponding to the target curve has a pollution risk is issued, including: Acquire the data variation curve obtained by sampling and fitting the target detection area within a preset time; When the slope of at least one data change curve in the same target sub-region is continuously greater than a first preset threshold value within the preset time, a prompt message indicating that the target sub-region corresponding to the at least one data change curve has a pollution risk is issued; Alternatively, when, in the data variation curve, the sampling data obtained by the most recent sampling of the target sub-region is greater than a second preset threshold, a prompt message indicating that there is a contamination risk in the target sub-region is issued.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory coupled to each other, wherein the memory stores a computer program. When the computer program is executed by the processor, the electronic device executes the method according to any one of claims 1 to 8.
10. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Large-range land subsidence space-time prediction method and system based on deep learning
CN112446559A
Air quality forecasting method and system
CN112465243A
Method for discovering typical process route based on information entropy and PSO-Kmeans algorithm
CN115062920A
Animal husbandry water source pollution monitoring and early warning method and system based on big data analysis
CN117786584A
Spatial interpolation method and device, electronic equipment and storage medium
CN118096509A