Intelligent monitoring method and system for heavy metal content based on intelligent sensor
By optimizing the layout and detection angle of the sensor probes, the problem of unstable signal capture in water-soluble fertilizer production pipelines was solved, enabling accurate monitoring of heavy metal content and supporting agricultural product safety and environmental protection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANYANG XIMANDI FERTILIZER IND CO LTD
- Filing Date
- 2026-01-22
- Publication Date
- 2026-05-01
AI Technical Summary
Existing monitoring methods are unable to reliably capture heavy metal signals in water-soluble fertilizer production pipelines, and the blind placement of sensors leads to inaccurate detection results, failing to meet the needs of continuous and automated production.
By acquiring the flow direction and velocity of the solution in the water-soluble fertilizer pipeline, and combining Monte Carlo simulation algorithm and finite element analysis method, the layout and detection angle of the sensor probe are optimized to generate the final sensor spatial layout scheme, ensuring that the sensor can stably capture signals in a dynamic environment.
Stable signal capture under dynamic water-soluble fertilizer solution flow conditions has been achieved, meeting the need for precise monitoring of heavy metal content during water-soluble fertilizer production and ensuring agricultural product safety and environmental protection.
Smart Images

Figure CN121955293A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of sensor detection technology, specifically to an intelligent monitoring method and system for heavy metal content based on intelligent sensors. Background Technology
[0002] Currently, water-soluble fertilizers are an indispensable source of nutrition in modern agriculture, and the accurate monitoring of their heavy metal content is directly related to agricultural product safety and environmental protection. In recent years, with increasing attention to food safety and ecological sustainable development, heavy metal monitoring technology based on intelligent sensors has gradually become a research hotspot. This type of technology ensures compliance with agricultural production and environmental protection standards by detecting the heavy metal concentration in water-soluble fertilizers in real time. However, existing monitoring methods mostly rely on fixed sensors or laboratory analysis equipment. Although these methods can provide a certain level of accuracy under specific conditions, they lack adaptability to dynamic production scenarios. Especially in water-soluble fertilizer production pipelines, the rapid flow and complex composition of the solution make it difficult for sensors to stably capture target signals. In addition, traditional monitoring methods often ignore the impact of the water-soluble fertilizer pipeline environment on sensor performance during production, making the detection results susceptible to interference and failing to meet the needs of continuous and automated water-soluble fertilizer production.
[0003] The information disclosed in the background section is only for enhancing the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0004] In view of this, this disclosure provides an intelligent monitoring method for heavy metal content based on smart sensors, which can improve monitoring accuracy.
[0005] In a first aspect, embodiments of this application provide an intelligent monitoring method for heavy metal content based on a smart sensor. The method includes: acquiring solution parameters of a water-soluble fertilizer solution within a water-soluble fertilizer pipeline, the solution parameters including solution flow direction and solution flow velocity; determining turbulence distribution and bubble distribution based on the solution flow direction and solution flow velocity; determining the contact degree value of a sensor probe at different locations based on the turbulence distribution and bubble distribution using a Monte Carlo simulation algorithm, and generating a contact degree distribution map; determining a first layout scheme for the sensor probe based on the contact degree distribution map; determining the detection angle of the sensor probe based on the first layout scheme and the solution flow direction; and determining the angle adaptability of the sensor probe based on the detection angle and the solution flow direction. The process involves: scoring; determining whether the angle adaptability score does not exceed a preset angle adaptability score threshold; if it does not exceed the preset angle adaptability score threshold, optimizing the detection angle based on the gradient descent algorithm; determining a second layout scheme for the sensor probe based on the optimized detection angle; constructing a finite element model of the sensor spatial layout based on the finite element analysis method, according to the optimized detection angle and the second layout scheme; determining the signal stability evaluation value of the sensor probe in a flow simulation environment based on the Monte Carlo simulation algorithm, according to the finite element model; determining whether the signal stability evaluation value does not exceed a preset stability evaluation value threshold; if it does not exceed the preset stability evaluation value threshold, optimizing the second layout scheme to generate a third layout scheme.
[0006] Secondly, embodiments of this application provide an intelligent monitoring system for heavy metal content using a smart sensor. This system includes: an acquisition module, a first determination module, a second determination module, a third determination module, a fourth determination module, a fifth determination module, a first judgment module, a sixth determination module, a construction module, a seventh determination module, and a second judgment module. The acquisition module is used to acquire solution parameters of a water-soluble fertilizer solution within a water-soluble fertilizer pipeline, including the solution flow direction and flow velocity. The first determination module is used to determine turbulence distribution and bubble distribution based on the solution flow direction and flow velocity. The second determination module is used to determine the contact degree value of the sensor probe at different positions based on the turbulence distribution and bubble distribution using a Monte Carlo simulation algorithm, and to generate a contact degree distribution map. The third determination module is used to determine a first layout scheme for the sensor probe based on the contact degree distribution map. The fourth determination module is used to determine the detection angle of the sensor probe based on the first layout scheme and the solution flow direction. The fifth determination module is used to determine the angle adaptability score of the sensor probe based on the detection angle and the solution flow direction. The first judgment module is used to determine the... The system performs several checks: First, it checks whether the angle adaptability score does not exceed a preset angle adaptability score threshold. If it does, it optimizes the detection angle based on a gradient descent algorithm. Second, it determines whether the second layout scheme of the sensor probe is not exceeded. Third, it determines whether the second layout scheme is optimized based on the optimized detection angle. Fourth, it constructs a finite element model of the sensor spatial layout based on the optimized detection angle and the second layout scheme using finite element analysis. Fifth, it determines whether the signal stability evaluation value of the sensor probe in a flow simulation environment is not exceeded based on the Monte Carlo simulation algorithm. Sixth, it determines whether the second layout scheme is optimized based on the preset stability evaluation value threshold to generate a third layout scheme.
[0007] This application provides an intelligent monitoring method and system for heavy metal content based on intelligent sensors. By acquiring the flow direction and velocity of the water-soluble fertilizer solution in the water-soluble fertilizer pipeline, a precise data foundation is provided for subsequent analysis of the complex flow patterns within the pipeline. Based on this flow direction and velocity, the turbulence and bubble distribution are determined, clearly locating key areas within the pipeline that interfere with sensor signal acquisition (such as pipe sections with concentrated turbulence or annular zones with dense bubbles), avoiding the blind sensor placement caused by the lack of clear interference source distribution in traditional monitoring methods. Secondly, based on the Monte Carlo simulation algorithm, combined with the determined turbulence and bubble distribution, the contact degree values of the sensor probe at different locations are determined, and a contact degree distribution map is generated. Utilizing the statistical characteristics of the algorithm's extensive random iterations, areas where the sensor probe does not have sufficient contact with the solution can be accurately identified. The resulting first sensor probe layout scheme can specifically cover contact blind spots, effectively solving the problem of uneven contact between the solution and sensor caused by the flow direction and velocity of the water-soluble fertilizer solution, and the inability to effectively detect some heavy metal ions. Furthermore, based on the sensor… After determining the sensor probe's detection angle based on the first probe layout scheme and the solution flow direction, an angle adaptability score is determined for the sensor probe. This score quantifies the degree of fit between the detection angle and the solution flow direction. If the angle adaptability score does not exceed a preset threshold, the detection angle is iteratively optimized using a gradient descent algorithm. This dynamically adjusts the sensor probe to the optimal detection posture that matches the solution flow direction, avoiding the problem of turbulence or bubbles forming when the solution flows through due to improper probe angles, thus preventing interference with signal acquisition. It also solves the limitation that a single-angle probe cannot comprehensively capture the distribution of heavy metals in different areas of the pipeline. Finally, a second sensor probe layout scheme is determined based on the optimized detection angle. Then, based on finite element analysis, a finite element model of the sensor's spatial layout is constructed by combining the optimized detection angle and the second layout scheme. This finite element model can highly reproduce the actual environment inside the water-soluble fertilizer pipeline, providing a simulation basis close to the actual scenario for subsequent signal stability assessment. Subsequently, based on the Monte Carlo simulation algorithm, the signal stability evaluation value of the sensor probe in the flow simulation environment is determined according to the finite element model. If the signal stability evaluation value does not exceed the preset stability evaluation value threshold, the second layout scheme is further optimized to generate the third layout scheme, forming a closed-loop logic of simulation-evaluation-optimization. This ensures that the finally determined third layout scheme can enable the sensor probe to stably capture the target signal under the dynamically changing flow state of the water-soluble fertilizer solution, meeting the needs for accurate monitoring of heavy metal content in the continuous and automated production process of water-soluble fertilizer, and thus providing reliable technical support for agricultural product safety and environmental protection. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments or conventional technologies of this disclosure, the accompanying drawings used in the description of the embodiments or conventional technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 This is a flowchart illustrating an exemplary embodiment of the intelligent monitoring method for heavy metal content based on smart sensors provided in this application.
[0010] Figure 2 This is a flowchart illustrating another exemplary embodiment of the present application of a method for intelligent monitoring of heavy metal content based on smart sensors.
[0011] Figure 3 This is a flowchart illustrating an intelligent monitoring method for heavy metal content based on a smart sensor, provided in another exemplary embodiment of this application.
[0012] Figure 4 This is a flowchart illustrating a smart monitoring method for heavy metal content based on smart sensors, provided in another exemplary embodiment of this application.
[0013] Figure 5 This is a flowchart illustrating a smart monitoring method for heavy metal content based on smart sensors, provided in another exemplary embodiment of this application.
[0014] Figure 6 This is a flowchart illustrating a smart monitoring method for heavy metal content based on smart sensors, provided in another exemplary embodiment of this application.
[0015] Figure 7 This is a flowchart illustrating a smart monitoring method for heavy metal content based on smart sensors, provided in another exemplary embodiment of this application.
[0016] Figure 8 This is a flowchart illustrating a smart monitoring method for heavy metal content based on smart sensors, provided in another exemplary embodiment of this application. Detailed Implementation
[0017] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are set forth to give a full understanding of embodiments of this disclosure.
[0018] The terms “a,” “one,” and “the” are used to indicate the existence of one or more elements / components / etc.; the terms “including” and “having” are used to indicate an open-ended inclusion and that other elements / components / etc. may exist in addition to those listed. The terms “first” and “second” are used only as markers and are not a limitation on the number of objects.
[0019] Currently, water-soluble fertilizers are an indispensable source of nutrition in modern agriculture, and the accurate monitoring of their heavy metal content is directly related to agricultural product safety and environmental protection. In recent years, with increasing attention to food safety and ecological sustainable development, heavy metal monitoring technology based on intelligent sensors has gradually become a research hotspot. This type of technology ensures compliance with agricultural production and environmental protection standards by detecting the heavy metal concentration in water-soluble fertilizers in real time. However, existing monitoring methods mostly rely on fixed sensors or laboratory analysis equipment. Although these methods can provide a certain level of accuracy under specific conditions, they lack adaptability to dynamic production scenarios. Especially in water-soluble fertilizer production pipelines, the rapid flow and complex composition of the solution make it difficult for sensors to stably capture target signals. In addition, traditional monitoring methods often ignore the impact of the water-soluble fertilizer pipeline environment on sensor performance during production, making the detection results susceptible to interference and failing to meet the needs of continuous and automated water-soluble fertilizer production.
[0020] The degree of contact between the sensor probe and the water-soluble fertilizer solution directly affects the stability and accuracy of the sensor's detection signal. For example, the flow direction and velocity of the water-soluble fertilizer solution in the pipeline can lead to uneven contact between the solution and the sensor, making it impossible to effectively detect some heavy metal ions. Some probe designs may have improper angles, causing turbulence or bubbles to form as the solution flows through, interfering with signal acquisition. This insufficient contact further exacerbates the challenge of finding the optimal detection angle, making it difficult for a single-angle probe to comprehensively capture the distribution of heavy metals in different areas of the pipeline. Furthermore, the complex flow patterns of the solution within the pipeline mean that if the sensor cannot adapt to changes in flow direction or adjust to the optimal detection angle, the accuracy of the signal will decrease significantly. This not only affects the real-time monitoring of heavy metal content but may also lead to failures in quality control during the production process.
[0021] Therefore, optimizing the spatial layout and detection angle of sensor probes in dynamically flowing water-soluble fertilizer pipelines to ensure sufficient contact with the solution and obtain stable detection signals has become a technical problem that needs to be solved for intelligent monitoring of water-soluble fertilizers.
[0022] This disclosure provides a method and system for intelligent monitoring of heavy metal content based on smart sensors, such as... Figure 1The illustrated method and system for intelligent monitoring of heavy metal content based on smart sensors. The method may include the following steps: Step S110: Obtain the solution parameters of the water-soluble fertilizer solution in the water-soluble fertilizer pipeline, including the solution flow direction and solution flow rate; Step S120: Determine the turbulence distribution and bubble distribution based on the solution flow direction and velocity; Step S130: Based on the Monte Carlo simulation algorithm, determine the contact degree value of the sensor probe at different locations according to the turbulence distribution and bubble distribution, and generate a contact degree distribution map; Step S140: Determine the first layout scheme of the sensor probe based on the contact degree distribution map; Step S150: Determine the detection angle of the sensor probe based on the first layout scheme and the solution flow direction; Step S160: Determine the angle adaptability score of the sensor probe based on the detection angle and solution flow direction; Step S170: Determine whether the angle adaptability score does not exceed the preset angle adaptability score threshold. If it is determined that it does not exceed the preset angle adaptability score threshold, then optimize the detection angle based on the gradient descent algorithm. Step S180: Determine the second layout scheme of the sensor probe based on the optimized detection angle; Step S190: Based on the finite element analysis method, construct a finite element model of the sensor spatial layout according to the optimized detection angle and the second layout scheme; Step S192: Based on the Monte Carlo simulation algorithm, determine the signal stability evaluation value of the sensor probe in the flow simulation environment according to the finite element model; Step S194: Determine whether the signal stability evaluation value does not exceed the preset stability evaluation value threshold. If it is determined that it does not exceed the preset stability evaluation value threshold, optimize the second layout scheme to generate the third layout scheme.
[0023] According to the intelligent monitoring method for heavy metal content based on intelligent sensors provided in this disclosure, the method can acquire solution parameters of the water-soluble fertilizer solution in the water-soluble fertilizer pipeline, including the solution flow direction and solution flow velocity; determine the turbulence distribution and bubble distribution based on the solution flow direction and solution flow velocity; determine the contact degree value of the sensor probe at different positions based on the turbulence distribution and bubble distribution using a Monte Carlo simulation algorithm, and generate a contact degree distribution map; determine a first layout scheme of the sensor probe based on the contact degree distribution map; determine the detection angle of the sensor probe based on the first layout scheme and the solution flow direction; determine the angle adaptability score of the sensor probe based on the detection angle and the solution flow direction; and determine the angle. If the adaptability score does not exceed the preset angle adaptability score threshold, then the detection angle is optimized based on the gradient descent algorithm. A second layout scheme for the sensor probe is determined based on the optimized detection angle. A finite element model of the sensor spatial layout is constructed based on the optimized detection angle and the second layout scheme using finite element analysis. The signal stability evaluation value of the sensor probe in a flow simulation environment is determined based on the Monte Carlo simulation algorithm and the finite element model. If the signal stability evaluation value does not exceed the preset stability evaluation value threshold, then the second layout scheme is optimized to generate a third layout scheme.
[0024] In the above method, by obtaining the flow direction and velocity of the water-soluble fertilizer solution in the pipeline, a precise data foundation is provided for subsequent analysis of the complex flow patterns within the pipeline. Based on this flow direction and velocity, the turbulence and bubble distribution are determined, clearly locating key areas within the pipeline that interfere with sensor signal acquisition (such as pipe sections with concentrated turbulence or annular zones with dense bubbles), avoiding the blind placement of sensors caused by the lack of clear interference source distribution in traditional monitoring methods. Secondly, based on the Monte Carlo simulation algorithm, combined with the determined turbulence and bubble distribution, the contact degree values of the sensor probe at different locations are determined, and a contact degree distribution map is generated. Utilizing the statistical characteristics of the algorithm's extensive random iterations, areas where the sensor probe does not have sufficient contact with the solution can be accurately identified. The resulting first sensor probe layout scheme can specifically cover contact blind spots, effectively solving the problem of uneven contact between the solution and sensor caused by the flow direction and velocity of the water-soluble fertilizer solution, and the inability to effectively detect some heavy metal ions. Furthermore, based on... After determining the sensor probe's detection angle based on the first layout scheme and solution flow direction, an angle adaptability score is determined based on this detection angle and solution flow direction. This score quantifies the degree of fit between the detection angle and the solution flow direction. If the angle adaptability score does not exceed a preset threshold, the detection angle is iteratively optimized using a gradient descent algorithm. This dynamically adjusts the sensor probe to the optimal detection posture that matches the solution flow direction, avoiding the problem of turbulence or bubbles forming when the solution flows through due to improper probe angle, thus preventing interference with signal acquisition. It also solves the limitation that a single-angle probe cannot comprehensively capture the distribution of heavy metals in different areas of the pipeline. Finally, a second layout scheme for the sensor probe is determined based on the optimized detection angle. Then, based on finite element analysis, a finite element model of the sensor's spatial layout is constructed by combining the optimized detection angle and the second layout scheme. This finite element model can highly reproduce the actual environment inside the water-soluble fertilizer pipeline, providing a simulation basis close to the actual scenario for subsequent signal stability assessment. Subsequently, based on the Monte Carlo simulation algorithm, the signal stability evaluation value of the sensor probe in the flow simulation environment is determined according to the finite element model. If the signal stability evaluation value does not exceed the preset stability evaluation value threshold, the second layout scheme is further optimized to generate the third layout scheme, forming a closed-loop logic of simulation-evaluation-optimization. This ensures that the finally determined third layout scheme can enable the sensor probe to stably capture the target signal under the dynamically changing flow state of the water-soluble fertilizer solution, meeting the needs for accurate monitoring of heavy metal content in the continuous and automated production process of water-soluble fertilizer, and thus providing reliable technical support for agricultural product safety and environmental protection.
[0025] The steps of the intelligent monitoring method for heavy metal content based on smart sensors provided in this disclosure are described in detail below: In one embodiment of this disclosure, step S110 involves acquiring the solution parameters of the water-soluble fertilizer solution within the water-soluble fertilizer pipeline. These parameters include the solution flow direction and flow velocity. Specifically, in a real-world water-soluble fertilizer production pipeline scenario, suitable sensing equipment is selected based on the pipeline structure. Taking a circular water-soluble fertilizer production pipeline with a diameter of 0.1 meters as an example, 16 ultrasonic flow sensors are evenly installed along the pipeline's cross-section to form a sensor array. (Ultrasonic sensors offer the advantage of non-contact measurement, avoiding probe contamination caused by direct contact with the water-soluble fertilizer solution, while also accurately capturing fluid flow characteristics.) This sensor array continuously collects flow data of the water-soluble fertilizer solution within the pipeline at a sampling rate of 1000 Hz per second. The sampling duration must cover typical operating conditions during normal pipeline production, such as stable flow and flow velocity fluctuations, to ensure data comprehensiveness. The collected raw data includes two core types of information: solution flow direction and solution flow velocity. The solution flow direction is presented in the form of a three-dimensional vector. For example, under steady-flow conditions, the average velocity vector of the solution flow is recorded as 1.2 m / s. This vector has an x-component of 0.8 m / s and a y-component of 0.9 m / s in the pipe cross-section, thus clearly reflecting the flow direction of the solution along the axial and radial directions of the pipe. The solution velocity includes instantaneous velocity values at different times and locations in the pipe cross-section. For example, at a certain moment, the velocity in the upper part of the pipe is 1.3 m / s, while the velocity in the lower part is 1.1 m / s, reflecting the spatial distribution difference in velocity.
[0026] Since the raw data may contain interference signals such as pipeline vibration and equipment noise, preprocessing is necessary. For example, Fourier transform algorithms can be used to filter out high-frequency noise. By setting a frequency threshold of 50Hz, noise signals with frequencies higher than 50Hz (such as electronic noise from the sensor itself and interference signals generated by pipeline mechanical vibration) can be removed. This results in standardized data with a purity of over 95%, ensuring that the final obtained solution flow direction and velocity data accurately reflect the actual flow characteristics of the water-soluble fertilizer solution within the pipeline.
[0027] In one embodiment of this disclosure, step S120, determining the turbulence distribution and bubble distribution based on the solution flow direction and solution flow velocity, further includes the following steps: Figure 2 As shown, the specific content is as follows: Step S210: Determine the fluid dataset based on the solution flow direction and solution flow rate; Step S220: Standardize the fluid dataset to generate a standardized fluid dataset; Step S230: Determine whether the velocity fluctuation in the standardized fluid dataset exceeds the preset velocity fluctuation threshold; Step S240: If it is determined that the flow rate fluctuation exceeds the preset threshold, then based on the Fourier transform, obtain the frequency features in the standardized fluid dataset to generate a fluid frequency feature set; Step S250: Based on the particle swarm optimization algorithm, perform cluster analysis on the fluid frequency feature set to determine the turbulence distribution; Step S260: Determine the bubble distribution based on the turbulence distribution using the Brownian motion algorithm.
[0028] Specifically, for example, in a water-soluble fertilizer production pipeline with a diameter of 0.1 meters, 16 ultrasonic flow sensors are evenly arranged along its cross-section, and 5 minutes of data are collected at a sampling rate of 1000Hz to obtain multiple sets of spatiotemporal sequence points. The solution flow direction vector (e.g., (x:0.78, y:0.92) m / s direction) corresponding to each time point (e.g., the 1st second, the 1.001st second), each sensor position (e.g., at the (0.05,0,0)m coordinate on the inner wall of the pipeline) is mapped one-to-one with the instantaneous flow velocity value (e.g., 1.21 m / s), ultimately generating a fluid dataset containing five types of fields: timestamp, sensor coordinates, x-component of flow direction, y-component of flow direction, and flow velocity value.
[0029] For example, the original velocity values in the fluid dataset range from 1.0 to 1.4 m / s, with a calculated mean μ = 1.2 m / s and a standard deviation σ = 0.1 m / s. A sensor collects an original velocity value of 1.3 m / s, which, after standardization, becomes (1.3 - 1.2) / 0.1 = 1.0. The original x-component of the flow direction ranges from 0.7 to 0.9 m / s, with a mean μ = 0.8 m / s and a standard deviation σ = 0.05 m / s. A certain original x-component of 0.85 m / s, after standardization, becomes (0.85 - 0.8) / 0.05 = 1.0. Ultimately, all index data fall within the range [-3, 3], generating a standardized fluid dataset.
[0030] For example, based on the water-soluble fertilizer production process, a preset flow velocity fluctuation threshold of ±0.2 (after standardization) is set. Standardized flow velocity data of a certain sensor within 10 seconds are taken: 0.1, 0.3, -0.1, 0.4, -0.2, 0.5, -0.3, 0.2, -0.4, 0.1. The maximum flow velocity within this time period is calculated to be 0.5, the minimum flow velocity is -0.4, and the fluctuation value is 0.5-(-0.4)=0.9, which exceeds the preset flow velocity fluctuation threshold of 0.2. It is determined that there is abnormal flow velocity fluctuation in the area where the sensor is located, and further analysis of turbulence characteristics is required.
[0031] It should be noted that turbulence exhibits a specific frequency distribution in the frequency domain (e.g., low-frequency bands correspond to large-scale turbulence, and high-frequency bands correspond to small-scale turbulence). These features can be extracted using Fourier transform to distinguish turbulent flow from normal flow. Therefore, a Fast Fourier Transform (FFT) is performed on standardized flow velocity data exceeding a preset velocity fluctuation threshold to convert the time-domain velocity variation curve into a power spectral density curve in the frequency domain. High-frequency noise is filtered out (e.g., frequencies above 50Hz are defined as noise frequencies), retaining the effective frequency range of 0.5-10Hz. Parameters such as frequency peak value, frequency bandwidth, and power ratio within this range are extracted to form a fluid frequency feature set. For example, significant power peaks were found at 0.8Hz, 2.5Hz, and 5.2Hz (corresponding to turbulent vortices of different scales), with peak power proportions of 35%, 28%, and 22%, respectively, and frequency bandwidths of 0.2Hz, 0.3Hz, and 0.4Hz, respectively. These parameters, such as "frequency value, peak power, power proportion, and bandwidth", were categorized and organized according to the sensor location to generate a fluid frequency feature set including "sensor coordinates, frequency peak 1, peak 1 power proportion, frequency peak 2, peak 2 power proportion, etc."
[0032] Next, leveraging the global optimization capability of the particle swarm optimization algorithm, sensor locations with similar frequency characteristics are clustered to accurately pinpoint areas of concentrated turbulence. For example, the particle swarm size is initialized to 50 particles (each particle representing the coordinates and feature threshold of a cluster center), and the algorithm is iterated 200 times with the objective function of minimizing intra-cluster variance and maximizing inter-cluster variance until convergence. The converged clustering results are then mapped to pipeline spatial coordinates, and the extent and turbulence intensity (represented by the percentage of peak power at frequency) of each cluster are labeled to determine the turbulence distribution. For example, clustering the fluid frequency feature set, after 200 iterations, converges to three clusters: Cluster 1 contains six sensors in the lower half of the pipe, with peak frequencies concentrated in the range of 0.8-1.0 Hz and peak power accounting for 30%-40% (corresponding to large-scale turbulence); Cluster 2 contains four sensors in the middle of the pipe, with peak frequencies in the range of 2.2-2.8 Hz and peak power accounting for 25%-30% (corresponding to mesoscale turbulence); Cluster 3 contains two sensors in the upper half of the pipe, with peak frequencies in the range of 5.0-5.5 Hz and peak power accounting for 20%-25% (corresponding to small-scale turbulence). The spatial extent and turbulence scale of these clusters are then plotted on the pipe cross-section diagram to form a turbulence distribution, clearly identifying the lower 60% of the pipe as the main turbulence concentration area.
[0033] It should be noted that the Brownian motion algorithm can simulate the trajectory of bubbles in turbulent flow because bubble diffusion is positively correlated with turbulence intensity (the stronger the turbulence, the wider the bubble diffusion range and the higher the density). The bubble distribution can be inferred from a known turbulence distribution. For example, by setting initial bubble release points (starting from the upstream inlet) for different regions of the pipe and substituting them into the Brownian motion equations, the movement of bubbles in turbulence can be simulated. For example, in the lower half of the pipe (large-scale turbulence zone), the bubbles are strongly dragged by turbulence, with a displacement velocity u = 0.12 m / s and a diffusion coefficient D = 1e-5 m² / s. The simulated bubble density in this region is 120 bubbles / m³. Near the upstream inlet (a region with moderate turbulence), the bubble displacement velocity u = 0.08 m / s, and the simulated bubble density is 150 bubbles / m³, concentrated in a ring-shaped zone with a radius of 0.05 m. In the upper half of the pipe (small-scale turbulence zone), the bubble displacement velocity u = 0.05 m / s, and the bubble density is 80 bubbles / m³. By mapping these density data to spatial coordinates, a bubble distribution map is generated, clearly identifying the ring-shaped zone with a radius of 0.05 m near the upstream inlet as the bubble-dense area (accounting for 70%).
[0034] In the above method, data interference is eliminated through fluid dataset standardization, turbulence frequency features are extracted through Fourier transform, precise clustering is performed using particle swarm optimization, and bubble trajectories are simulated using Brownian motion. This quantifies the turbulence and bubble distributions into concrete data. Furthermore, large-sample operations such as multiple bubble simulations reduce random errors, resulting in a reliability of over 95% for identifying turbulence distributions (e.g., the lower 60% of the pipe is a large-scale turbulence region) and bubble distributions (e.g., the 0.05m annular zone at the upstream inlet is a dense region). This allows the output turbulence and bubble distributions to directly guide the sensor to avoid high-interference areas and focus on the effective detection area, ensuring signal stability and detection accuracy of the intelligent sensor-based heavy metal content monitoring system from the source.
[0035] In one embodiment of this disclosure, step S130, which determines the contact degree value of the sensor probe at different locations based on the Monte Carlo simulation algorithm according to the turbulence distribution and bubble distribution, and generates a contact degree distribution map, further includes the following steps: Figure 3 As shown, the specific content is as follows: Step S310: Construct a contact probability model for the sensor probe based on the turbulence distribution and bubble distribution; Step S320: Based on the Monte Carlo simulation algorithm, determine the contact degree value of the sensor probe at different positions according to the contact probability model; Step S330: Determine whether the contact level value exceeds the preset contact level value threshold; Step S340: If the preset contact level threshold is exceeded, then mark it as a sufficiently contacted area; Step S350: If it is determined that the preset contact level threshold is not exceeded, then it is marked as an area of insufficient contact; Step S360: Generate a contact degree distribution map based on the areas with insufficient contact and areas with sufficient contact.
[0036] It should be noted that a Gaussian probability density function can be used as the basic framework for the contact probability model of the sensor probe. The Gaussian distribution can fit the contact probability distribution of the sensor probe under interference-free conditions (high contact probability in the central region and low contact probability at the edges). Then, turbulence correction coefficients and bubble correction coefficients are introduced to adjust the probability values. The higher the turbulence intensity, the lower the contact probability (turbulence causes turbulent flow of the solution, reducing the stable contact time between the probe and the solution); the higher the bubble density, the lower the contact probability (bubbles will block direct contact between the probe and the solution, forming a signal dead zone), thus constructing the final contact probability model.
[0037] For example, the Monte Carlo simulation's ability to handle large amounts of random sampling can be leveraged to calculate the actual contact level at different locations through multiple iterations, avoiding the biases of a single model and ensuring results more closely reflect actual working conditions. The cross-section of the water-soluble fertilizer pipeline (0.1 m in diameter) can be divided into a uniform grid of 0.01 m × 0.01 m, resulting in 121 sampling locations. Next, the Monte Carlo simulation iteration count is initialized to 10,000. Each iteration randomly generates one valid contact event based on the contact probability model (i.e., determining whether stable contact has occurred at a sampling location, with the probability following a model distribution). For each sampling location, the number of valid contact events occurring in 10,000 iterations is counted. The contact level value is then calculated as: (Number of valid contacts / Total number of iterations) (ranging from 0 to 1; a value closer to 1 indicates more sufficient contact). For example, for a sampling location at the pipeline center with coordinates (0,0), the number of valid contacts in 10,000 iterations is 9,800, and the contact level value is 9,800 / 10,000 = 0.98. For the sampling location at the edge of the pipe in the turbulent region, with coordinates (0.04, 0), the effective number of contacts is 280, and the contact degree value is 280 / 10000 = 0.028. For the sampling location in the upper middle part of the pipe, in the weakly turbulent region, with coordinates (0.02, 0.02), the effective number of contacts is 6500, and the contact degree value is 6500 / 10000 = 0.65. Through this calculation, the contact degree values for each of the 121 sampling locations are obtained.
[0038] It should be noted that the preset contact level threshold must be set in conjunction with the accuracy requirements for heavy metal detection in water-soluble fertilizers. If the contact level is too low, the sensor probe cannot stably capture heavy metal ion signals, resulting in detection errors exceeding industry standards. Therefore, the preset contact level threshold is set to 0.3. For example, in the central region of the pipe cross-section (x∈[-0.03,0.03]m, y∈[-0.03,0.03]m), the contact level values of 61 sampling locations are all between 0.5 and 0.98, exceeding the preset threshold of 0.3, and this region is marked as a sufficiently contacted region. In the edge region of the pipe (x∈[-0.05,-0.04]∪[0.04,0.05]m, y∈[-0.05,-0.04]∪[0.04,0.05]m), the contact level values of 16 sampling locations are between 0.028 and 0.28, not exceeding the preset threshold of 0.3, and this region is marked as an insufficiently contacted region. Based on the analysis of turbulence and bubble distribution, 80% of the locations in this area are simultaneously in large-scale turbulence zones and dense bubble zones, which is the core reason for insufficient contact and needs to be avoided in subsequent layout.
[0039] For example, discrete contact level data can be transformed into a visualized distribution map, intuitively presenting the contact situation within the pipeline and providing a clear spatial reference for subsequently determining sensor layout schemes. Specifically, it can be visualized in the form of a heat map, using the cross-section of the water-soluble fertilizer pipeline as the base map, with different colors representing contact level values. For example, red (contact level value 0.7-1.0), orange (contact level value 0.5-0.7), and yellow (contact level value 0.3-0.5) represent areas of sufficient contact, while blue (contact level value 0.1-0.3) and purple (contact level value 0-0.1) represent areas of insufficient contact. At the same time, the core coordinates of the insufficient contact areas and the overlapping range of the turbulence zone and the bubble-dense zone are marked on the map to form a complete contact level distribution map.
[0040] In the above method, a contact probability model is constructed by integrating turbulence distribution and bubble distribution. Monte Carlo simulation is then used to convert the degree of contact into specific numerical values, upgrading the contact effect from qualitative judgment to quantitative calculation, ensuring the objectivity and accuracy of the results. By precisely locating areas of insufficient contact and pre-setting contact degree thresholds to filter and mark areas of insufficient and sufficient contact, the generated contact degree distribution map visually presents the range of areas of sufficient contact in the form of a heatmap. This directly guides the priority deployment of sensor probes in high-contact areas, ensuring stable contact between the sensor probe and the water-soluble fertilizer solution, laying a foundation for further improving the accuracy of heavy metal content detection.
[0041] In one embodiment of this disclosure, step S140, determining the first layout scheme of the sensor probe based on the contact degree distribution map, further includes the following steps: Figure 4As shown, the specific content is as follows: Step S410: Determine the coordinates of the insufficient contact area based on the contact degree distribution map; Step S420: Determine whether the deviation between the coordinates of the insufficiently contacted area and the preset ideal coordinates exceeds a preset deviation threshold; Step S430: If the deviation exceeds the preset threshold, the initial layout scheme of the sensor probe is obtained, and the initial layout scheme is iteratively optimized based on the gradient descent algorithm to generate the first layout scheme.
[0042] Specifically, using the K-means clustering algorithm, the core coordinates of three insufficient contact regions were extracted from the contact degree distribution map, which are (-0.04, 0.03), (0.035, -0.04), and (0, -0.045). Boundary detection showed that the coordinate range of the first insufficient region is x∈[-0.05, -0.03], y∈[0.02, 0.04], the second is x∈[0.025, 0.05], y∈[-0.05, -0.03], and the third is x∈[-0.01, 0.01], y∈[-0.05, -0.04].
[0043] For example, based on the symmetry of the cross-section of the water-soluble fertilizer pipeline and the required detection coverage, ideal coordinates can be preset as points evenly distributed within the pipeline, ensuring that the spacing between adjacent ideal coordinates covers the pipeline cross-section. For example, for a pipeline with a diameter of 0.1 meters, the preset ideal coordinates would be (0,0), (-0.03,0.03), (0.03,0.03), (-0.03,-0.03), and (0.03,-0.03), a total of 5 points, covering the center and surrounding key areas of the pipeline. Next, a preset deviation threshold is set. Based on the detection accuracy requirements (contact value must be ≥0.3) and the pipeline size, a preset deviation threshold of 0.02 is set (i.e., if the distance between the core coordinates of an insufficiently contacted area and the nearest ideal coordinate exceeds 0.02, it is determined to require optimization). Finally, the Euclidean distance (deviation) between the core coordinates of each insufficiently contacted area and the nearest preset ideal coordinate is calculated. For example, for the core coordinates (-0.04, 0.03) of the insufficiently contacted area, the nearest preset ideal coordinates are (-0.03, 0.03), and the calculated deviation Δ = 0.01, which does not exceed the preset deviation threshold of 0.02; for the core coordinates (0.035, -0.04), the nearest ideal coordinates are (0.03, -0.03), and the deviation Δ = 0.011, which does not exceed the threshold; for the core coordinates (0, -0.045), the nearest ideal coordinates are (0, -0). 03), the deviation Δ=0.015, which does not exceed the threshold; if the core coordinates of a certain insufficient contact area are (0.045, 0.045) and the nearest ideal coordinates are (0.03, 0.03), the deviation Δ=0.02, which exceeds the preset deviation threshold of 0.02m, then the initial layout position of the sensor probe can be adjusted by the gradient descent algorithm so that the optimized probe can cover the insufficient area with excessive deviation, improve the overall contact adequacy and detection coverage, and finally form the first layout scheme.
[0044] For example, for the core coordinates (0.045, 0.045) of the insufficient contact area with excessive deviation, the nearest probe position in the initial layout scheme is obtained as (0.03, 0.03). The objective function of the gradient descent algorithm is constructed, which simultaneously minimizes the deviation of the insufficient contact area and the layout adjustment cost (cost includes probe movement distance and the rationality of adjacent probe spacing). Then, the gradient descent parameters are set, with a learning rate η = 0.001 (to control the adjustment amplitude in each iteration and avoid oscillation), and 50 iterations (to ensure algorithm convergence). The probe position is optimized to (0.035, 0.035). At this point, the deviation Δ = 0.014 ≤ 0.02 between the core coordinates (0.045, 0.045) of the insufficient contact area and the probe. Simultaneously, the positions of other probes were adjusted; for example, (-0.03, -0.03) was optimized to (-0.032, -0.032), resulting in the first layout scheme with the five sensor probes positioned at (0,0), (-0.03, 0.03), (0.035, 0.035), (-0.032, -0.032), and (0.03, -0.03). Verification showed that the coverage of the sufficiently contacted area (contact value ≥ 0.3) inside the pipeline increased from 82% in the initial layout to 94%, meeting the detection requirements.
[0045] In the above method, core coordinates are extracted using a contact degree distribution map and K-means clustering algorithm, avoiding the limitation of traditional methods that can only qualitatively identify blind spots without pinpointing their specific locations. This provides clear adjustment targets for sensor probe layout optimization. By presetting ideal coordinates and presetting deviation thresholds, the optimization requirements of insufficiently contacted areas are quantitatively assessed, avoiding resource waste caused by blindly adjusting the layout (optimization is only performed on areas with excessive deviations, reducing adjustment costs). Iterative optimization based on the gradient descent algorithm can minimize adjustment costs while ensuring that the sensor probe covers insufficiently contacted areas with excessive deviations, ensuring sufficient contact between the sensor probe and the water-soluble fertilizer solution. This lays the foundation for subsequent extraction of detection angle parameters and improvement of heavy metal detection accuracy, while avoiding the problem of missed detection of heavy metal ions due to unreasonable layout.
[0046] In one embodiment of this disclosure, step S150, determining the detection angle of the sensor probe based on the first layout scheme and the solution flow direction, further includes the following steps: Figure 5 As shown, the specific content is as follows: Step S510: Determine the solution flow vector based on the solution flow direction; Step S520: Determine the normal direction of the sensor probe according to the first layout scheme; Step S530: Based on the ray tracing algorithm, determine the detection angle of the sensor probe according to the normal direction of the sensor probe and the solution flow vector. The detection angle is the angle between the normal direction of the sensor probe and the solution flow vector.
[0047] Specifically, for example, in a water-soluble fertilizer production pipeline with a diameter of 0.1 meters, at z=0.5m (the axial position of the sensor probe in the first layout scheme), the solution flow direction data is collected by an ultrasonic flow sensor array: the x-direction velocity component v x =0.1 m / s (slight disturbance along the positive x-axis within the cross-section), y-direction velocity component v y =0.05 m / s (slight disturbance along the positive y-axis within the cross-section), z-direction velocity component v z =1.2m / s (the main flow along the positive z-axis of the pipe); based on this, the solution flow vector at this section is determined to be V=(0.1,0.05,1.2)m / s.
[0048] It should be noted that the normal direction of the probe is the direction from the probe installation position to the center of the pipe (ensuring it faces the core area of the solution). Next, the normal direction vector is calculated by subtracting the probe installation coordinates from the pipe center coordinates to obtain the original direction vector. This vector is then normalized (eliminating the influence of length and retaining only the direction), resulting in the normal direction vector N of the sensor probe. For example, the installation coordinates of a sensor probe extracted from the first layout scheme are P=(0.05,0,0.5). This position is located on the inner wall of the pipe along the positive x-axis (pipe radius 0.05m, x=0.05m is the inner wall boundary); the center coordinates of the pipe at this z=0.5m section are O=(0,0,0.5); the calculated original normal direction vector is O. P =(0-0.05,0-0,0.5-0.5)=(-0.05,0,0). Normalizing this vector, we get (-0.05 / 0.05,0 / 0.05,0 / 0.05)=(-1,0,0). Finally, the normal direction vector of the sensor probe is determined to be N=(-1,0,0) (i.e., along the negative x-axis, pointing towards the solution region inside the pipe, parallel to the pipe cross-section, and perpendicular to the z-axis).
[0049] Specifically, the ray tracing algorithm can simulate the detection field of view of the sensor probe, verifying whether the normal direction can effectively cover the solution flow path, avoiding angle calculation failure due to field of view offset; while the detection angle directly reflects the adaptability of the probe orientation to the solution flow direction, providing core parameters for subsequent angle adaptability scoring. For example, for the solution flow vector V=(0.1,0.05,1.2) and the normal direction vector N=(-1,0,0), a ray is emitted from the sensor probe position P=(0.05,0,0.5) along N=(-1,0,0), with the ray equations x=0.05-t, y=0, z=0.5 (t≥0). The solution flow path extends along V=(0.1,0.05,1.2), and the flow trajectory near the z=0.5m section is x=0.1s, y=0.05s, z=0.5+1.2s (s is the time parameter). The intersection point of the ray and the flow path was calculated iteratively to be (0.04, 0, 0.5) (t = 0.01, s = 0.4). This intersection point is located in the solution region within the pipe, confirming the validity of the normal direction. For example, the detection angle can be calculated using the vector dot product formula: Let the detection angle be θ, then cosθ = (N·V) / (|N|×|V|). Where N·V is the dot product of the normal direction vector and the flow vector, |N| is the magnitude of the normal direction vector (the magnitude of a unit vector is 1), and |V| is the magnitude of the flow vector (i.e., the solution velocity). The calculated detection angle θ = arccos(-0.083) ≈ 94.8°. Finally, the detection angle of the sensor probe was determined to be 94.8°, reflecting the actual angle between the probe's normal direction and the solution flow direction.
[0050] In the above method, on the one hand, by transforming the solution flow direction into a three-dimensional flow vector and the probe position into a normal direction vector, the angle calculation is upgraded from qualitative estimation to quantitative calculation, ensuring that the detection angle can truly reflect the relative positional relationship between the probe and the solution flow. On the other hand, the effectiveness of the angle calculation is guaranteed by a ray tracing algorithm. This algorithm can verify whether the probe normal direction covers the solution flow path, avoiding invalid detection angles due to field of view offset (such as the normal pointing to the pipe wall instead of the solution), while controlling the angle accuracy within 0.1°, providing high-precision parameters for subsequent angle adaptability scoring. This ensures that the sensor probe can stably capture heavy metal detection signals in dynamically flowing water-soluble fertilizer pipelines.
[0051] In one embodiment of this disclosure, step S160, determining the angle adaptability score of the sensor probe based on the detection angle and solution flow direction, further includes the following steps: Figure 6 As shown, the specific content is as follows: Step S610: Standardize the detection angles to generate a standardized detection angle dataset; Step S620: Based on the support vector machine algorithm, classify the standardized detection angle dataset to determine the detection angle classification result; Step S630: Determine the characteristics of solution direction change based on solution flow direction; Step S640: Determine the solution orientation feature set based on the solution orientation change characteristics; Step S650: Based on the kernel function method, determine the fusion feature set according to the detection angle classification results and the solution direction feature set; Step S660: Based on the logistic regression algorithm, score the fused feature set to determine the angle adaptability score of the sensor probe.
[0052] Specifically, for example, the detection angles of the 10 sensor probes in the first layout scheme are 85.2°, 94.8°, 78.5°, 102.3°, 88.6°, 91.4°, 75.9°, 105.1°, 82.7°, and 97.8°. The calculated mean of the detection angles is 90.23°, and the calculated standard deviation of the detection angles is 9.87°. The above detection angles are standardized one by one: taking the detection angle of 94.8° as an example, the standardized angle value = (94.8 - 90.23) / 9.87 ≈ 0.46; taking the detection angle of 75.9° as an example, the standardized angle value = (75.9 - 90.23) / 9.87 ≈ -1.45. Organize all standardized angle values to generate a standardized detection angle dataset: [-0.52, 0.46, -1.19, 1.22, -0.17, 0.12, -1.45, 1.51, -0.76, 0.77].
[0053] For example, a support vector machine model can be trained: The model is trained using 500 historical samples (300 "adapted" and 200 "misfit"). The model learns standardized features of the adaptation angle (e.g., standardized values between -0.23 and 0.20) and fits the decision boundary. The standardized detection angle values [-0.52, 0.46, -1.19, 1.22, -0.17, 0.12, -1.45, 1.51, -0.76, 0.77] are input into the trained model to output the detection angle classification result. The model outputs the adaptive or maladaptive category and corresponding confidence score (classification probability) for each standardized angle. For example: standardized angle 0.46 (corresponding to the original angle 94.8°): adaptive classification result, confidence score 0.89; standardized angle -1.45 (corresponding to the original angle 75.9°): adaptive classification result, confidence score 0.72; standardized angle 1.51 (corresponding to the original angle 105.1°): maladaptive classification result, confidence score 0.85. All results are processed to generate a detection angle classification result table, including four fields: sensor number, standardized angle, classification category, and confidence score.
[0054] It is important to note that in dynamically changing solution flow, key features reflecting flow stability should be extracted to avoid judging angle suitability solely based on static flow direction. The flow direction of solution in water-soluble fertilizer pipelines is disturbed by changes in pump speed, pipe bends, etc., and these directional change characteristics directly affect the suitability of the detection angle (e.g., a fixed angle may become unsuitable when the flow direction changes frequently). Therefore, solution direction change characteristics include three categories: amplitude of direction change, frequency of direction change, and duration of direction change. Amplitude of direction change refers to the maximum angular deviation of the solution flow direction within a certain time period (e.g., a 15° shift from the horizontal axis (z-axis) to an inclined angle within 1 minute); frequency of direction change refers to the number of times the solution flow direction changes per unit time (e.g., 4 changes per minute); and duration of direction change refers to the time it remains stable after each flow direction change (e.g., 8 seconds after a 10° inclination). For example, data on the solution flow direction collected for 1 minute in a 0.1-meter diameter water-soluble fertilizer pipeline can be analyzed to obtain the following results. Directional change amplitude: the maximum deviation is 18° (from the positive z-axis direction to the z-axis +18° direction); directional change frequency: a total of 5 changes within 1 minute; directional change duration: the stabilization time for each change is 12 seconds, 8 seconds, 15 seconds, 10 seconds, and 15 seconds respectively; the above three indicators are the characteristics of the solution directional change within this time period.
[0055] Furthermore, a solution orientation feature set can be constructed, for example, the orientation change amplitude is 18° (quantized value is 18, unit is degree); the orientation change frequency is 5 times / minute (quantized value is 5, unit is times / minute); the orientation change duration: average stabilization time = (12+8+15+10+15) / 5 = 12 seconds (quantized value is 12, unit is seconds); the three types of features are integrated in the order of amplitude-frequency-duration to generate a solution orientation feature set in vector form: [18,5,12], which fully reflects the dynamic change characteristics of solution flow direction.
[0056] It should be noted that the kernel function method has the ability to map to high dimensions. It can fuse the low-dimensional detection angle classification results with the low-dimensional solution direction feature set into a high-dimensional feature vector. This allows the fused features to simultaneously reflect angle adaptability and flow direction dynamics, providing a comprehensive basis for subsequent accurate scoring. For example, the detection angle classification results can be converted into a quantized vector. Taking a certain sensor as an example, the classification result "adaptation" corresponds to the category value 1 with a confidence level of 0.89, so the angle classification vector is [1, 0.89] and the solution direction feature set is [18, 5, 12]. The angle classification vector [1, 0.89] and the solution orientation feature set [18, 5, 12] are used as inputs and mapped to a 10-dimensional high-dimensional space (the dimension is set according to the feature complexity) through a radial basis kernel function. The high-dimensional feature values are calculated, and the final fused feature set [0.00, 0.0016, 0.023, 0.15, 0.32, 0.28, 0.11, 0.08, 0.03, 0.01] is generated based on multiple high-dimensional feature values. Then, the angle classification results of all 10 sensors are fused with the same solution orientation feature set [18, 5, 12] through a kernel function to generate 10 sets of fused feature sets, each of which is a 10-dimensional vector.
[0057] It should be noted that the high-dimensional fusion feature set can be transformed into a quantitative score between 0 and 1 using the logistic regression algorithm. This score directly reflects the ability to detect angle adaptation to solution flow direction (including dynamic changes). Logistic regression learns from historical score samples, outputs the adaptation probability corresponding to the fusion feature, and then combines it with weights to transform it into the final score, ensuring that the score results are interpretable and comparable. For example, the scoring formula is: Angle Adaptability Score = (Adaptation Probability × Weight of Adaptation Class) + (Misfit Probability × Weight of Misfit Class), where the weight corresponding to the adaptation class is 1.0, and the weight corresponding to the misfit class is -0.5, and the adaptation probability is output by the logistic regression algorithm. For example, using 1000 sets of historical fusion feature samples (600 sets of "high adaptation", score > 0.7; 400 sets of "low adaptation", score < 0.5) to train the logistic regression model, the logistic regression model learns the mapping relationship between fusion features and scores. For example, a value > 0.3 in the 5th dimension of the fusion feature corresponds to a high score. A fused feature set of a certain sensor [0.00, 0.0016, 0.023, 0.15, 0.32, 0.28, 0.11, 0.08, 0.03, 0.01] is input into the model, with an output fitness probability of 0.82 and a maladaptive probability of 1 - 0.82 = 0.18. Substituting into the above formula, the score is 0.82 × 1.0 + 0.18 × (-0.5) = 0.82 - 0.09 = 0.73. The fused feature sets of all 10 sensor probes are scored one by one, and finally an angle fitness score table for the 10 sensor probes is generated. For example, the scores of the 10 sensor probes are [0.68, 0.73, 0.55, 0.42, 0.78, 0.81, 0.51, 0.39, 0.62, 0.45]. The higher the score, the more suitable the detection angle is for the solution flow direction.
[0058] In the above method, by extracting the characteristics of solution direction change (amplitude, frequency, and duration) and using the kernel function method to fuse them with the detection angle classification results into high-dimensional features, the limitations of traditional methods that only consider static flow direction and ignore dynamic disturbances are overcome, ensuring that the score can reflect the adaptation effect in a real dynamic pipeline environment. A quantitative score between 0 and 1 is output through a logistic regression algorithm, providing a clear basis for detection angle optimization. At the same time, the scoring results are comparable (the degree of adaptation between different sensors can be directly compared), ensuring that the detection angle can be adjusted in a targeted manner in the future. This ensures that the sensor probe can maintain sufficient contact with the solution in the dynamic flow scenario of water-soluble fertilizer pipelines, laying the foundation for angle adaptation for stable capture of heavy metal detection signals.
[0059] In one embodiment of this disclosure, in step S170, it is determined whether the angle adaptability score does not exceed a preset angle adaptability score threshold. If it is determined that the preset angle adaptability score threshold is not exceeded, the detection angle is optimized based on the gradient descent algorithm.
[0060] Specifically, for example, the angle adaptability scores of 10 sensor probes are obtained from step S160, with results of [0.68, 0.73, 0.55, 0.42, 0.78, 0.81, 0.51, 0.39, 0.62, 0.45]. Each score is compared one by one with the preset angle adaptability score threshold of 0.7: 3 sensor probes with scores of 0.73, 0.78, and 0.81: their angle adaptability scores exceed the preset angle adaptability score threshold of 0.7, and are judged to have good adaptability, requiring no optimization; 7 sensor probes with scores of 0.68, 0.55, 0.42, 0.51, 0.39, 0.62, and 0.45: their angle adaptability scores do not exceed the preset angle adaptability score threshold of 0.7, and are judged to have insufficient adaptability, requiring optimization of the detection angle.
[0061] For example, consider a sensor probe with insufficient adaptability. Its initial state is: initial detection angle θ0 = 94.8°, initial angle adaptability score S0 = 0.62 (not exceeding the preset threshold of 0.7). The initial value of the objective function of the gradient descent algorithm is L0 = 1 - 0.62 = 0.38. After multiple iterations, the detection angle is optimized to θ0 in the 20th iteration. 20 =92.5°, corresponding to an angle adaptability score S 20 =0.71 (exceeds the preset threshold of 0.7), objective function L 20 =1-0.71=0.29, thus determining the optimized detection angle of the sensor probe to be 92.5°. Following the above steps, the remaining sensor probes with insufficient adaptability were optimized one by one, ensuring that the optimized angle adaptability score of all sensor probes exceeded the preset angle adaptability score threshold of 0.7. After the detection angle was optimized, the turbulence intensity when the solution flows through the sensor probe and the signal blocking rate of bubbles were reduced, thereby ensuring that the sensor probe can stably contact the solution.
[0062] In one embodiment of this disclosure, in step S180, a second layout scheme for the sensor probes is determined based on the optimized detection angles. Specifically, taking a water-soluble fertilizer production pipeline with a diameter of 0.1 meters, its pipeline axis set as the z-axis, and its cross-section as an xy-plane as an example, with the center coordinates (0,0,z). Basic data of 10 sensor probes in the first layout scheme can be obtained, where the initial three-dimensional coordinates of some probes are P1(0.05,0,0.5), P2(-0.05,0,0.5), and P3(0,0.05,0.5), and the pipeline coverage rate of the first layout scheme is 94%. Simultaneously, the detection angles optimized by the gradient descent algorithm are obtained, namely P1=92.5°, P2=87.3°, and P3=95.1°; subsequently, the gradient descent algorithm is used to further optimize the detection angles. The first layout scheme undergoes position fine-tuning. After 15 iterations with a learning rate of 0.001, the position of P1 is optimized to (0.048, 0, 0.5), at which point the field of view overlap with P9 reaches 18%, and the blind zone area decreases from 0.0002m² to 0.00005m². Finally, the fine-tuned positions and optimized angles of all probes are integrated, such as P2 being fine-tuned to (-0.049, 0, 0.5) and P3 being fine-tuned to (0, 0.047, 0.5), thereby generating the second layout scheme.
[0063] In one embodiment of this disclosure, in step S190, a finite element model of the sensor spatial layout is constructed based on the finite element analysis method, according to the optimized detection angle and the second layout scheme. Specifically, the sensor positions and optimized detection angles of the second layout scheme can be converted into a three-dimensional numerical model using finite element software to achieve accurate simulation of the sensor working environment inside the water-soluble fertilizer pipeline. For example, ANSYS Workbench finite element software can be used for modeling. Based on the water-soluble fertilizer production scenario, the pipeline diameter is 0.1 meters, the pipeline length is 1.0 meter (covering the sensor installation area, with the z-axis direction from 0m to 1.0m), the pipeline material is 304 stainless steel (a commonly used material for agricultural pipelines, with stable mechanical properties), and the pipeline wall thickness is 0.005 meters. The three-dimensional coordinates of 10 sensor probes were extracted from the second layout scheme, such as P1(0.048,0,0.5), P2(-0.049,0,0.5), and P3(0,0.047,0.5). The sensor probes are made of alumina ceramic (highly corrosion-resistant and suitable for water-soluble fertilizer solutions), with a diameter of 0.01 meters and a length of 0.02 meters. Simultaneously, based on the optimized detection angles, such as P1=92.5° and P2=87.3°, the normal direction vector of each probe was calculated. For example, the normal direction of P1 is the negative x-axis direction, with a vector of (-1,0,0), serving as the basis for the probe's orientation in the model. The water-soluble fertilizer solution has a density of 1100 kg / m³ (typical density including solute), a dynamic viscosity of 0.0015 Pa·s (viscosity of the water-soluble fertilizer solution at 25℃), and a flow velocity of 1.2 m / s. Based on these parameters, a finite element model of the sensor spatial layout was constructed, and a mesh was generated.
[0064] In one embodiment of this disclosure, step S192, determining the signal stability evaluation value of the sensor probe in the flow simulation environment based on the Monte Carlo simulation algorithm and the finite element model, further includes the following steps: Figure 7 As shown, the specific content is as follows: Step S710: Based on the Monte Carlo simulation algorithm, input random noise signal into the finite element model to simulate signal propagation of the sensor probe under different turbulent conditions, and output the signal-to-noise ratio of the sensor probe; Step S720: Determine whether the fluctuation of the signal-to-noise ratio exceeds the preset fluctuation threshold; Step S730: If it is determined that the fluctuation does not exceed the preset fluctuation threshold, the probability value of the signal-to-noise ratio fluctuation not exceeding the preset fluctuation threshold is calculated, and the probability value is used as the signal stability evaluation value.
[0065] Specifically, random noise matching the turbulence interference can be injected into the finite element model to simulate the actual signal propagation process under dynamic flow conditions, and then the signal-to-noise ratio (SNR), which reflects the signal quality, can be calculated. For example, taking the P1 sensor probe in the second layout scheme, with coordinates (0.048, 0, 0.5) and an optimized detection angle of 92.5°, 10,000 Monte Carlo simulations are performed in the finite element model: 1st iteration: turbulence noise is injected, and the SNR is calculated to be 27.96 dB according to the SNR calculation formula; 5000th iteration: turbulence noise is injected, and the SNR is calculated to be 21.94 dB according to the SNR calculation formula; after 10,000 iterations, the SNR dataset of the P1 probe is output, with a total of 10,000 SNR values, and the average SNR is 15.2 dB, with a standard deviation of 2.1 dB.
[0066] For example, taking the P1 probe as an example, its average SNR is 15.2 dB, and the preset fluctuation threshold is 3 dB: For the first iteration, the SNR is 27.96 dB, and the calculated fluctuation value is |27.96 - 15.2| = 12.76 dB > 3 dB, which is considered to exceed the preset fluctuation threshold. For the 5000th iteration, the SNR is 21.94 dB, and the calculated fluctuation value is |21.94 - 15.2| = 6.74 dB > 3 dB, which is also considered to exceed the preset fluctuation threshold. For the 8000th iteration, the SNR is 14.5 dB, and the calculated fluctuation value is |14.5 - 15.2| = 0.7 dB ≤ 3 dB, which is considered to be below the preset fluctuation threshold. Finally, in 10000 iterations of the P1 probe, the number of samples where the fluctuation did not exceed the preset fluctuation threshold was 9200. The total number of iterations was 10000. The signal stability assessment value is (9200 / 10000) × 100% = 92%. Similarly, the same statistics are performed on the other 9 sensor probes in the second layout scheme, such as P2(-0.049,0,0.5) and P3(0,0.047,0.5), and the signal stability assessment values of each probe are all between 90% and 93%, and the average signal stability assessment value of the overall layout is 91.5%.
[0067] In the above method, random noise matching the turbulence interference is injected through the Monte Carlo simulation algorithm to reproduce the signal propagation process under different turbulent conditions in the finite element model. This avoids the limitations of traditional methods that rely solely on static testing to evaluate signal stability, ensuring that the simulated scenario is highly consistent with the dynamic flow environment inside the water-soluble fertilizer pipeline. This allows the simulated signal-to-noise ratio data to truly reflect the degree of turbulence interference on the signal. By converting the number of stable signal samples into probability values as signal stability evaluation values, the stability is upgraded from qualitative description to quantitative calculation. For example, the 92% evaluation value of the P1 probe intuitively reflects that in 10,000 turbulence interference simulations, the signal fluctuation was within an acceptable range in 92% of the scenarios. This provides a clear quantitative basis for subsequent steps to determine whether to optimize the second layout scheme, and also provides data support for the signal reliability of the entire intelligent monitoring system, ensuring that the system can stably acquire heavy metal detection signals in the dynamically flowing water-soluble fertilizer pipeline.
[0068] In one embodiment of this disclosure, in step S194, it is determined whether the signal stability evaluation value does not exceed a preset stability evaluation value threshold. If it is determined that the signal stability evaluation value does not exceed the preset stability evaluation value threshold, the second layout scheme is optimized to generate a third layout scheme. Specifically, taking 10 sensor probes (P1-P10) in the second layout scheme as an example, their signal stability evaluation values are as follows: P1=92%, P2=93%, P3=88%, P4=87%, P5=91%, P6=89%, P7=94%, P8=86%, P9=90%, P10=92%. Comparing them one by one: the evaluation values of four probes, P3 (88%), P4 (87%), P6 (89%), and P8 (86%), are <90%, and the proportion of substandard probes is 40% (exceeding the global optimization threshold of 30%). It is determined that the overall signal stability of the second layout scheme does not exceed the preset stability evaluation value threshold of 90%, and global optimization is required. For the substandard probes P3 and P8 in the second layout, particle swarm optimization is performed. In the 100th iteration, the particle swarm converged to the optimal solution: the position of P3 was fine-tuned to (0, 0.045, 0.5), its x-coordinate remained unchanged, its y-coordinate decreased by 0.002m, and its angle was fine-tuned to 93.5°; the position of P8 was fine-tuned to (0, -0.043, 0.5), its x-coordinate remained unchanged, its y-coordinate increased by 0.003m, and its angle was fine-tuned to 90.2°. The optimized effect was verified: the signal stability evaluation value of P3 increased to 91%, and that of P8 increased to 90%; the evaluation values of the remaining probes remained ≥92%, and the overall average evaluation value reached 91.8%; the pipe coverage increased from 97% in the second layout to 98%. Finally, the optimized parameters of all probes were integrated to generate the third layout scheme.
[0069] In the above method, the particle swarm optimization algorithm is used to achieve position-angle collaborative optimization. The optimized third layout scheme not only solves the problem of insufficient signal stability of some probes in the second layout, but also maintains high coverage. It avoids coverage blind spots or signal interference caused by single optimization of stability, thus providing a final layout foundation with stable performance for the entire intelligent monitoring method. The signal stability evaluation values of all sensor probes in the third layout scheme meet the standards and can adapt to the variable flow rate environment in the pipeline. This ensures that the heavy metal detection signal based on this layout is stable and reliable, meets the quality control requirements in the continuous and automated production of water-soluble fertilizers, and provides key layout guarantees for agricultural product safety and environmental protection.
[0070] In one embodiment of this disclosure, after step S194 optimizes the second layout scheme to generate the third layout scheme if it is determined that the preset stability evaluation threshold has not been exceeded, the following steps are further included: Figure 8 As shown, the specific content is as follows: Step S810: Based on the third layout scheme, obtain the solution flow rate of the water-soluble fertilizer solution in the current water-soluble fertilizer pipeline; Step S820: Determine whether the solution flow rate exceeds the preset flow rate threshold; Step S830: If it is determined that the flow rate exceeds the preset threshold, the finite element model is updated according to the solution flow rate; Step S840: Based on the genetic algorithm, adjust the third layout scheme according to the updated finite element model; Step S850: Determine the detection frequency of the sensor probe according to the adjusted third layout scheme; Step S860: Determine whether the detection frequency does not exceed the preset detection frequency threshold; Step S870: If it is determined that the preset detection frequency threshold is not exceeded, the sampling rate of the sensor probe is adjusted.
[0071] Specifically, based on the third layout scheme, four sensor probes with integrated flow velocity detection functions, P1, P4, P7, and P10, are activated to collect 10 seconds of data at a sampling rate of 1000Hz. The instantaneous flow velocities of each probe are calculated through Doppler frequency shift: P1=2.18m / s, P4=2.22m / s, P7=2.15m / s, P10=2.25m / s. After taking the average value, the current solution flow velocity is (2.18+2.22+2.15+2.25) / 4=2.2m / s. The current solution flow rate is 2.2 m / s, the preset flow rate threshold is 2.0 m / s, and the calculated flow rate difference is 2.2 - 2.0 = 0.2 m / s > 0. This indicates that the current solution flow rate exceeds the preset flow rate threshold. Therefore, in ANSYS Workbench, open the finite element model of the sensor spatial layout that has been constructed, modify the inlet flow rate to 2.2 m / s in the Fluent module, and set the turbulence intensity coefficient α to 0.7 to update the finite element model.
[0072] For example, for the P3 probe, whose signal fluctuations increased in the updated finite element model, a genetic algorithm was used for optimization. In the 30th iteration, the population converged to the optimal solution: the P3 coordinates were fine-tuned to (0, 0.043, 0.5) (a reduction of 0.002m in the y-direction to avoid the enhanced turbulence region), and the detection angle was fine-tuned to 92.8° (a reduction of 0.7° to reduce signal interference caused by solution impact). The updated finite element model was then re-substituted for verification: the signal stability assessment value of the P3 probe increased to 92%, and the average signal stability assessment value of the overall layout increased from 91.8% to 92.5%, meeting the requirements; integrating all the fine-tuned parameters, an adjusted third layout scheme was formed.
[0073] For example, in the adjusted third layout, the field of view of the P3 probe is 0.015m, the current solution flow rate is 2.2m / s, and the signal response delay is t. delay =0.3s, t flow=0.015 / 2.2≈0.0068s; therefore, the detection frequency = 1 / (0.0068+0.3)≈3.26Hz; taking the maximum value of the detection frequencies of all probes as the overall detection frequency, the current sensor probe's detection frequency is finally determined to be 8Hz. The current sensor probe's detection frequency is 8Hz, and the preset detection frequency threshold is 10Hz. It is determined that the current detection frequency does not exceed the preset detection frequency threshold, so the current average number of samples is obtained as 125, the preset detection frequency threshold is 10Hz, and the original sampling rate is 1000Hz (corresponding to a detection frequency of 8Hz). Therefore, the new sampling rate = 10 × 125 = 1250Hz. Adjusting the sensor probe's sampling rate from 1000Hz to 1250Hz, the detection frequency is recalculated as 1250 / 125 = 10Hz, reaching the preset detection frequency threshold. Finally, the adjusted third layout scheme is compatible with the 1250Hz sampling rate and can still stably detect at a high flow rate of 2.2m / s.
[0074] In the above method, the finite element model is updated based on the solution flow rate exceeding the threshold, and the fluid dynamics parameters and boundary conditions are adjusted simultaneously. This allows the model to realistically reproduce the enhanced turbulence state under high flow rates, avoiding optimization deviations caused by using a static model to guide dynamic layout adjustments, and ensuring the targeted nature of subsequent genetic algorithm adjustments. Next, the sensor position and angle of the third layout scheme are slightly optimized using a genetic algorithm. Under strict control of the adjustment range, turbulence interference under high flow rates is counteracted, ensuring that the signal stability evaluation value of the sensor probe does not decrease with increasing flow rate, thus maintaining high stability under extreme flow rates. Finally, by calculating the detection frequency and adjusting the sampling rate, the detection frequency is increased from 8Hz to the preset detection frequency threshold of 10Hz. This solves the problem of missed detection of heavy metal concentration changes due to insufficient detection frequency under high flow rates, while ensuring that the sampling rate is controlled within the upper limit of the sensor hardware, balancing detection performance and equipment reliability. This further enhances the robustness of the intelligent monitoring method for heavy metal content based on smart sensors in complex dynamic scenarios, providing more comprehensive technical support for continuous and automated quality control of water-soluble fertilizer production.
[0075] This disclosure also provides an intelligent monitoring system for heavy metal content based on intelligent sensors. The system may include an acquisition module, a first determination module, a second determination module, a third determination module, a fourth determination module, a fifth determination module, a first judgment module, a sixth determination module, a construction module, a seventh determination module, and a second judgment module. The acquisition module acquires the solution parameters of the water-soluble fertilizer solution within the water-soluble fertilizer pipeline, including the solution flow direction and flow velocity. The first determination module determines the turbulence distribution and bubble distribution based on the solution flow direction and flow velocity. The second determination module determines the contact degree value of the sensor probe at different positions based on the turbulence distribution and bubble distribution using a Monte Carlo simulation algorithm, and generates a contact degree distribution map. The third determination module determines a first layout scheme for the sensor probe based on the contact degree distribution map. The fourth determination module determines the detection angle of the sensor probe based on the first layout scheme and the solution flow direction. The fifth determination module determines the angle adaptability score of the sensor probe based on the detection angle and the solution flow direction. The first judgment module judges the angle adaptability. The system first checks whether the score does not exceed a preset angle adaptability score threshold. If it does, the detection angle is optimized based on the gradient descent algorithm. The sixth determination module determines the second layout scheme of the sensor probe based on the optimized detection angle. The construction module constructs a finite element model of the sensor spatial layout based on the optimized detection angle and the second layout scheme using finite element analysis. The seventh determination module determines the signal stability evaluation value of the sensor probe in a flow simulation environment based on the Monte Carlo simulation algorithm and the finite element model. The second judgment module determines whether the signal stability evaluation value does not exceed a preset stability evaluation value threshold. If it does, the second layout scheme is optimized to generate a third layout scheme.
[0076] It should be noted that the embodiments of the intelligent monitoring system for heavy metal content based on intelligent sensors provided in this application can be used to execute the processing flow of the embodiments of the intelligent monitoring method for heavy metal content based on intelligent sensors in the above embodiments. Its functions will not be repeated here, but can be referred to the detailed description of the above method embodiments.
[0077] As described above, the intelligent monitoring system for heavy metal content based on intelligent sensors provided in this disclosure provides a precise data foundation for subsequent analysis of complex flow patterns within the water-soluble fertilizer pipeline by acquiring the flow direction and velocity of the solution. Based on this flow direction and velocity, the turbulence and bubble distribution are determined, clearly locating key areas within the pipeline that interfere with sensor signal acquisition (such as pipe sections with concentrated turbulence or annular zones with dense bubbles). This avoids the blind placement of sensors in traditional monitoring methods due to the lack of clear distribution of interference sources. Secondly, based on the Monte Carlo simulation algorithm, the contact degree values of the sensor probes at different locations are determined by combining the established turbulence and bubble distributions, generating a contact degree distribution map. Utilizing the statistical characteristics of the algorithm's extensive random iterations, areas with insufficient contact between the sensor probes and the solution can be accurately identified. The resulting first sensor probe layout scheme can specifically cover contact blind spots, effectively solving the problem of uneven contact between the solution and sensor caused by the flow direction and velocity of the water-soluble fertilizer solution, and preventing the separation of some heavy metals. The problem of ineffective detection of heavy metals is addressed. Furthermore, after determining the sensor probe's detection angle based on the first sensor probe layout and solution flow direction, an angle adaptability score is determined. This score quantifies the degree of fit between the detection angle and the solution flow direction. If the angle adaptability score does not exceed a preset threshold, the detection angle is iteratively optimized using a gradient descent algorithm. This dynamically adjusts the sensor probe to the optimal detection posture that matches the solution flow direction, avoiding the problem of turbulence or bubbles forming when the solution flows due to improper probe angles, thus interfering with signal acquisition. It also solves the limitation of a single-angle probe in comprehensively capturing the distribution of heavy metals in different areas of the pipeline. Finally, a second sensor probe layout is determined based on the optimized detection angle. Then, based on finite element analysis, a finite element model of the sensor's spatial layout is constructed, combining the optimized detection angle and the second layout. This finite element model can highly replicate the actual environment inside the water-soluble fertilizer pipeline, providing a simulation basis close to the actual scenario for subsequent signal stability assessment. Subsequently, based on the Monte Carlo simulation algorithm, the signal stability evaluation value of the sensor probe in the flow simulation environment is determined according to the finite element model. If the signal stability evaluation value does not exceed the preset stability evaluation value threshold, the second layout scheme is further optimized to generate the third layout scheme, forming a closed-loop logic of simulation-evaluation-optimization. This ensures that the finally determined third layout scheme can enable the sensor probe to stably capture the target signal under the dynamically changing flow state of the water-soluble fertilizer solution, meeting the needs for accurate monitoring of heavy metal content in the continuous and automated production process of water-soluble fertilizer, and thus providing reliable technical support for agricultural product safety and environmental protection.
[0078] This disclosure also provides an electronic device including one or more processors and memory resources, represented by a memory, for storing instructions executable by the processor, such as application programs. The application programs stored in the memory may include one or more modules, each corresponding to a set of instructions. Furthermore, the processor is configured to execute instructions to perform the aforementioned intelligent monitoring method for heavy metal content based on smart sensors.
[0079] The electronic device may also include a power supply component configured to perform power management of the electronic device, a wired or wireless network interface configured to connect the electronic device to a network, and an input / output (I / O) interface. The electronic device can be operated based on operating devices stored in memory, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.
[0080] In one embodiment, a computer device, which may be a server, is also provided. The computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes non-volatile storage media and internal memory. The non-volatile storage media stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device stores data. The I / O interfaces of the computer device are used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements an intelligent monitoring method for heavy metal content based on smart sensors.
[0081] In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used for exchanging information between the processor and external devices. The communication interface of the computer device is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements an intelligent monitoring method for heavy metal content based on smart sensors. The display unit of the computer device is used to form a visually visible image and may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0082] This disclosure also provides a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the aforementioned electronic device, the electronic device is able to execute an intelligent monitoring method for heavy metal content based on a smart sensor, including: acquiring solution parameters of a water-soluble fertilizer solution in a water-soluble fertilizer pipeline, the solution parameters including solution flow direction and solution flow velocity; determining turbulence distribution and bubble distribution based on the solution flow direction and solution flow velocity; determining the contact degree value of the sensor probe at different positions based on the turbulence distribution and bubble distribution using a Monte Carlo simulation algorithm, and generating a contact degree distribution map; determining a first layout scheme of the sensor probe based on the contact degree distribution map; determining the detection angle of the sensor probe based on the first layout scheme and the solution flow direction; and determining the detection angle based on the detection angle. The angle adaptability score of the sensor probe is determined by the degree and solution flow direction; it is then determined whether the angle adaptability score does not exceed a preset angle adaptability score threshold. If it does not exceed the preset angle adaptability score threshold, the detection angle is optimized based on the gradient descent algorithm; a second layout scheme of the sensor probe is determined based on the optimized detection angle; a finite element model of the sensor spatial layout is constructed based on the finite element analysis method, according to the optimized detection angle and the second layout scheme; a signal stability evaluation value of the sensor probe in a flow simulation environment is determined based on the Monte Carlo simulation algorithm and the finite element model; it is then determined whether the signal stability evaluation value does not exceed a preset stability evaluation value threshold. If it does not exceed the preset stability evaluation value threshold, the second layout scheme is optimized to generate a third layout scheme.
[0083] This disclosure can take the form of a computer program product implemented on one or more storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0084] It should be noted that although the steps of the intelligent monitoring method for heavy metal content based on smart sensors in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that these steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps, such as omitting certain steps, combining multiple steps into one step, and / or breaking down one step into multiple steps, should all be considered part of this disclosure.
[0085] It should be understood that this disclosure is not limited to the detailed structure and arrangement of the modules in the intelligent monitoring system for heavy metal content based on smart sensors proposed in this specification. This disclosure can have other embodiments and can be implemented and performed in various ways. The foregoing variations and modifications fall within the scope of this disclosure. It should be understood that this disclosure, as disclosed and defined in this specification, extends to all alternative combinations of two or more individual features mentioned or apparent in the text and / or drawings. All these different combinations constitute multiple alternative aspects of this disclosure. The embodiments described in this specification illustrate the best known mode for implementing this disclosure and will enable those skilled in the art to utilize this disclosure.
Claims
1. A method for intelligent monitoring of heavy metal content based on smart sensors, characterized in that, include: Obtain the solution parameters of the water-soluble fertilizer solution in the water-soluble fertilizer pipeline, wherein the solution parameters include the solution flow direction and the solution flow rate; The turbulence distribution and bubble distribution are determined based on the solution flow direction and the solution flow velocity. Based on the Monte Carlo simulation algorithm, the contact degree value of the sensor probe at different positions is determined according to the turbulence distribution and the bubble distribution, and a contact degree distribution map is generated; The first layout scheme of the sensor probe is determined based on the contact degree distribution map; The detection angle of the sensor probe is determined based on the first layout scheme and the solution flow direction; The angle adaptability score of the sensor probe is determined based on the detection angle and the solution flow direction. Determine whether the angle adaptability score does not exceed a preset angle adaptability score threshold. If it is determined that the angle adaptability score does not exceed the preset angle adaptability score threshold, then optimize the detection angle based on the gradient descent algorithm. The second layout scheme of the sensor probe is determined based on the optimized detection angle; Based on the finite element analysis method, a finite element model of the sensor spatial layout is constructed according to the optimized detection angle and the second layout scheme; Based on the Monte Carlo simulation algorithm, the signal stability evaluation value of the sensor probe in the flow simulation environment is determined according to the finite element model. Determine whether the signal stability evaluation value does not exceed a preset stability evaluation value threshold. If it is determined that the value does not exceed the preset stability evaluation value threshold, optimize the second layout scheme to generate a third layout scheme.
2. The intelligent monitoring method for heavy metal content based on intelligent sensors according to claim 1, characterized in that, The determination of turbulence distribution and bubble distribution based on the solution flow direction and the solution flow velocity includes: The fluid dataset is determined based on the solution flow direction and the solution flow rate; The fluid dataset is standardized to generate a standardized fluid dataset; Determine whether the flow velocity fluctuation in the standardized fluid dataset exceeds a preset flow velocity fluctuation threshold; If it is determined that the flow rate fluctuation exceeds the preset threshold, then based on the Fourier transform, the frequency features in the standardized fluid dataset are obtained to generate a fluid frequency feature set. Based on the particle swarm optimization algorithm, cluster analysis is performed on the fluid frequency feature set to determine the turbulence distribution; The bubble distribution is determined based on the Brownian motion algorithm and the turbulence distribution.
3. The intelligent monitoring method for heavy metal content based on intelligent sensors according to claim 1, characterized in that, The Monte Carlo simulation algorithm determines the contact degree values of the sensor probe at different locations based on the turbulence distribution and the bubble distribution, and generates a contact degree distribution map, including: The contact probability model of the sensor probe is constructed based on the turbulence distribution and the bubble distribution; Based on the Monte Carlo simulation algorithm, the contact degree value of the sensor probe at different positions is determined according to the contact probability model; Determine whether the contact level value exceeds a preset contact level value threshold; If the predetermined contact level threshold is exceeded, it is marked as a region of sufficient contact. If the predetermined contact level threshold is not exceeded, the area is marked as insufficient contact. A contact degree distribution map is generated based on the insufficient contact area and the sufficient contact area.
4. The intelligent monitoring method for heavy metal content based on intelligent sensors according to claim 1, characterized in that, Determining the first layout scheme of the sensor probe based on the contact degree distribution map includes: Determine the coordinates of the insufficient contact area based on the contact degree distribution map; Determine whether the deviation between the coordinates of the insufficiently contacted area and the preset ideal coordinates exceeds a preset deviation threshold. If the deviation exceeds a preset threshold, an initial layout scheme for the sensor probe is obtained, and the initial layout scheme is iteratively optimized based on the gradient descent algorithm to generate a first layout scheme.
5. The intelligent monitoring method for heavy metal content based on intelligent sensors according to claim 1, characterized in that, Determining the detection angle of the sensor probe based on the first layout scheme and the solution flow direction includes: Determine the solution flow vector based on the solution flow direction; The normal direction of the sensor probe is determined according to the first layout scheme; Based on the ray tracing algorithm, the detection angle of the sensor probe is determined according to the normal direction of the sensor probe and the solution flow vector. The detection angle is the angle between the normal direction of the sensor probe and the solution flow vector.
6. The intelligent monitoring method for heavy metal content based on intelligent sensors according to claim 1, characterized in that, The step of determining the angle adaptability score of the sensor probe based on the detection angle and the solution flow direction includes: The detection angles are standardized to generate a standardized detection angle dataset; Based on the support vector machine algorithm, the standardized detection angle dataset is classified to determine the detection angle classification result; Determine the characteristics of solution direction change based on the described solution flow direction; Determine the solution orientation feature set based on the described solution orientation change characteristics; Based on the kernel function method, a fusion feature set is determined according to the detection angle classification result and the solution direction feature set; The fused feature set is scored based on a logistic regression algorithm to determine the angle adaptability score of the sensor probe.
7. The intelligent monitoring method for heavy metal content based on intelligent sensors according to claim 1, characterized in that, The method based on Monte Carlo simulation algorithm, according to the finite element model, determines the signal stability evaluation value of the sensor probe under different turbulent conditions, including: Based on the Monte Carlo simulation algorithm, random noise signals are input into the finite element model to simulate the signal propagation of the sensor probe under different turbulent conditions, and the signal-to-noise ratio of the sensor probe is output. Determine whether the fluctuation of the signal-to-noise ratio exceeds a preset fluctuation threshold; If it is determined that the fluctuation does not exceed the preset fluctuation threshold, then the probability value of the signal-to-noise ratio fluctuation not exceeding the preset fluctuation threshold is calculated, and the probability value is used as the signal stability evaluation value.
8. The intelligent monitoring method for heavy metal content based on intelligent sensors according to claim 1, characterized in that, After determining that the preset stability evaluation threshold is not exceeded, and optimizing the second layout scheme to generate the third layout scheme, the method further includes: Based on the third layout scheme, the solution flow rate of the water-soluble fertilizer solution in the current water-soluble fertilizer pipeline is obtained; Determine whether the solution flow rate exceeds a preset flow rate threshold; If the flow rate exceeds the preset threshold, the finite element model is updated based on the solution flow rate. Based on the genetic algorithm, the third layout scheme is adjusted according to the updated finite element model; The detection frequency of the sensor probe is determined according to the adjusted third layout scheme; Determine whether the detection frequency does not exceed a preset detection frequency threshold; If it is determined that the preset detection frequency threshold is not exceeded, the sampling rate of the sensor probe is adjusted.
9. An intelligent monitoring system for heavy metal content based on intelligent sensors, characterized in that, include: The acquisition module is used to acquire the solution parameters of the water-soluble fertilizer solution in the water-soluble fertilizer pipeline, including the solution flow direction and solution flow rate; The first determining module is used to determine the turbulence distribution and bubble distribution based on the solution flow direction and the solution flow velocity; The second determining module is used to determine the contact degree value of the sensor probe at different positions based on the Monte Carlo simulation algorithm, according to the turbulence distribution and the bubble distribution, and generate a contact degree distribution map; The third determining module is used to determine the first layout scheme of the sensor probe based on the contact degree distribution map; The fourth determining module is used to determine the detection angle of the sensor probe based on the first layout scheme and the solution flow direction; The fifth determining module is used to determine the angle adaptability score of the sensor probe based on the detection angle and the solution flow direction; The first judgment module is used to determine whether the angle adaptability score does not exceed the preset angle adaptability score threshold. If it is determined that the angle adaptability score does not exceed the preset angle adaptability score threshold, the detection angle is optimized based on the gradient descent algorithm. The sixth determining module is used to determine the second layout scheme of the sensor probe based on the optimized detection angle; The module is used to construct a finite element model of the sensor spatial layout based on the finite element analysis method, according to the optimized detection angle and the second layout scheme; The seventh determination module is used to determine the signal stability evaluation value of the sensor probe in a flow simulation environment based on the Monte Carlo simulation algorithm and the finite element model. The second judgment module is used to determine whether the signal stability evaluation value does not exceed the preset stability evaluation value threshold. If it is determined that the signal stability evaluation value does not exceed the preset stability evaluation value threshold, the second layout scheme is optimized to generate the third layout scheme.