Intelligent monitoring method for silkworm breeding environment data
By setting up multiple monitoring points in the silkworm breeding environment, collecting various types of data, and using the true anomaly degree to correct the moving average filter value, the problem of reduced accuracy of the moving average filter algorithm in the silkworm breeding environment monitoring was solved, achieving higher monitoring accuracy and timely alarm.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-04-03
AI Technical Summary
Existing moving average filtering algorithms tend to treat real environmental anomalies as noise in silkworm farming environment monitoring, leading to reduced monitoring accuracy.
Multiple monitoring points are set up in a dispersed manner in the silkworm breeding scenario to collect various types of environmental data simultaneously. By calculating the degree of data fluctuation and the trend of change, suspected abnormal data points are identified, and the moving average filter value is corrected by using the true anomaly degree to improve the monitoring accuracy.
The moving average filtering algorithm significantly improves the accuracy of silkworm breeding environment monitoring, ensuring that real abnormal data is not filtered out and enhancing the ability to promptly warn of environmental anomalies.
Smart Images

Figure CN121783247A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data acquisition and processing technology, and in particular to an intelligent monitoring method for silkworm breeding environment data. Background Technology
[0002] Silkworms are extremely sensitive to environmental parameters such as temperature, humidity, light, and air quality. Deviations from suitable ranges can lead to stunted growth, disease, and even death. Furthermore, the quality of the cocoons is directly related to environmental stability; excessive humidity can cause cocoons to become loose, while excessively low temperatures can slow cocoon formation. Therefore, it is necessary to monitor silkworm rearing environmental data to promptly detect abnormalities, prevent large-scale outbreaks of silkworm diseases, and support precise environmental control to improve yield stability and cocoon and silk quality.
[0003] In actual monitoring, the silkworm rearing environment often contains dust, silkworm excrement, and silk dander, which can easily interfere with sensors and cause monitoring noise. Therefore, noise reduction processing of the rearing environment data is necessary. However, due to the limited equipment resources (small sensor nodes, low-power microcontrollers) in silkworm rearing scenarios, complex algorithms are difficult to deploy. The moving average filtering algorithm, due to its low computational load, is suitable for real-time processing on low-power devices and is therefore often used to process noise in silkworm rearing environment monitoring data. However, existing traditional moving average filtering algorithms, due to their underlying principles, tend to treat real environmental anomalies as noise during noise processing, leading to reduced accuracy in silkworm rearing environment monitoring and significant delays in anomaly alarms.
[0004] In other words, the current moving average filtering algorithm is prone to losing real abnormal data in the silkworm breeding environment when denoising the data, which leads to a decrease in the accuracy of monitoring the silkworm breeding environment. Summary of the Invention
[0005] In view of this, the present invention provides an intelligent monitoring method for silkworm breeding environment data to solve the technical problem that the accuracy of monitoring environmental anomalies will be reduced when using the moving average filtering algorithm to denoise silkworm environmental monitoring data.
[0006] The present invention provides an intelligent monitoring method for silkworm rearing environment data, comprising: In the silkworm breeding scenario, multiple monitoring points are set up in a dispersed manner, and multiple types of environmental data are sampled simultaneously at each monitoring point. The data of any type of environmental data at any monitoring point within the most recent preset time period constitutes the current data segment. The degree of data fluctuation of any data point in the current data segment determines suspected abnormal data points. The difference between the data change of any suspected abnormal data point in the current data segment and the data change at the same sampling time in the same type of environmental data sampled from monitoring points other than the corresponding monitoring point in the current data segment is calculated, and the absolute value is taken as the first truth value. The difference between the absolute value of the data change of any suspected abnormal data point in the current data segment and the absolute value of the data change at the same sampling time in other types of environmental data sampled from the corresponding monitoring point in the current data segment is calculated, and the absolute value is taken and the reciprocal is taken as the second truth value. The true anomaly value of any suspected abnormal data point in the current data segment is constructed, which is proportional to both the first truth value and the second truth value. The data change refers to the difference between the sampled value at the current sampling time and the sampled value at the previous sampling time. Based on the true anomaly degree of any suspected abnormal data point, the filtered value of the suspected abnormal data point after moving average filtering is corrected to obtain a corrected value, thus completing the monitoring of silkworm breeding environment data.
[0007] Furthermore, the step of determining suspected abnormal data points based on the degree of data fluctuation of any data point in the current data segment includes: The absolute value of the change in data for any data point in the current data segment is used as the first likelihood of any data point in the current data segment, and the reciprocal of the number of times the first likelihood of any data point in the current data segment appears in the current data segment is used as the second likelihood of any data point in the current data segment. Construct a suspected anomaly score for any data point in the current data segment that is proportional to both the first and second suspected scores, and designate data points with a suspected anomaly score greater than a preset suspected anomaly score threshold as suspected anomaly data points.
[0008] Furthermore, the sum of the normalized value of the first suspicion level and the normalized value of the second suspicion level is used as the suspicion anomaly level of any data point in the current data segment; Cluster the suspected anomalies of all data points in the current data segment, and select the two clusters with the most suspected anomalies as the first target cluster and the second target cluster. Calculate the mean of the suspected anomalies in the first target cluster as the first mean, calculate the mean of the suspected anomalies in the second target cluster as the second mean, and use the average of the first mean and the second mean as the preset suspected anomaly threshold.
[0009] Furthermore, the difference between the normalized value of the absolute value of the data change of any suspected abnormal data point in the current data segment and the normalized value of the absolute value of the data change of other types of environmental data sampled at the same sampling time obtained from the corresponding monitoring point in the current data segment is calculated, and the absolute value is taken and the reciprocal is taken as the second degree of truth.
[0010] Furthermore, the true anomaly degree of any suspected anomalous data point in the current data segment is: , in, This represents the true anomaly degree of the p-th suspected anomaly data point in the current data segment. This indicates the number of other monitoring points in the neighborhood of the monitoring point corresponding to the current data segment. This represents the amount of data change for the p-th suspected outlier data point in the current data segment. This represents the change in data among the i-th monitoring point in the neighborhood of the current data segment, which is sampled at the same time as the p-th suspected abnormal data point. This indicates the number of types of environmental data sampled at the monitoring point corresponding to the current data segment, excluding the environmental data corresponding to the current data segment. This represents the normalized value of the absolute value of the data change of the p-th suspected outlier data point in the current data segment. This represents the normalized value of the absolute value of the data change of the data point in the j-th type of environmental data sampled from the monitoring point corresponding to the current data segment, which is sampled at the same time as the p-th suspected abnormal data point. This indicates normalization.
[0011] Furthermore, the step of correcting the filtered value of any suspected anomalous data point after moving average filtering based on the true anomalousness of any suspected anomalous data point includes: A first weight and a second weight are set for any suspected abnormal data point in the current data segment. The first weight is directly proportional to the actual abnormality of the suspected abnormal data point, and the second weight is inversely proportional to the actual abnormality of the suspected abnormal data point. The original value of the suspected abnormal data point is weighted by the first weight to obtain a first weighted value. The filtered value of the suspected abnormal data point after moving average filtering is weighted by the second weight to obtain a second weighted value. The correction value of the suspected abnormal data point is determined by the first weighted value and the second weighted value.
[0012] The advantages of this invention compared to the prior art are: This invention synchronously monitors various environmental data in different regions of a silkworm farming scenario. It identifies suspected anomaly data points by analyzing the fluctuation levels of recent data points for any environmental data at any monitoring point. Then, it compares the degree to which similar environmental data from different monitoring points show opposite trends at the same time, and compares the similarity of changes in different types of environmental data at the same monitoring point at the same time. This determines the degree to which the data changes of suspected anomaly data points conform to the changing patterns of the silkworm farming environment, thus obtaining their true anomaly score. The true anomaly score is then used to correct the filtered value of the suspected anomaly data points after applying a moving average filter, completing the silkworm farming environment data monitoring. This invention distinguishes between noise and true anomalies in suspected anomaly data points based on the consistency between the data change characteristics of suspected anomaly data points and the actual environmental data changes in silkworm farming, and corrects the moving average filter results, significantly improving the accuracy of silkworm farming environment monitoring based on moving average filtering. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a flowchart illustrating an intelligent monitoring method for silkworm breeding environment data provided in Embodiment 1 of the present invention. Detailed Implementation
[0015] The overall concept of this invention is as follows: This invention deploys multiple sensors in a silkworm farming scenario, with each sensor collecting various types of environmental data. First, it analyzes the mutation rate of each data point in the single-type data sequence from individual sensors to identify suspected anomalous data points. Then, it considers the characteristic that silkworm metabolism affects environmental data during movement, causing the environmental change trends at the starting and ending points to be opposite, while different types of environmental data at the same location should exhibit the same trend. This distinguishes it from randomly generated noise data, which lacks this characteristic. Suspected anomalous data points are further screened to determine their true anomalousness. Based on the true anomalousness of these suspected anomalous data points, the smoothing degree in the moving average filtering is adjusted accordingly to improve the retention of truly defective data. Ultimately, this improves the monitoring accuracy of silkworm environmental monitoring data when using the moving average filtering algorithm for noise reduction.
[0016] To further illustrate the technical solution of the present invention, specific embodiments are described below.
[0017] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a particular feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. Furthermore, a particular feature, structure, or characteristic in one or more embodiments may be combined in any suitable form, and the terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically emphasized.
[0018] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0019] Method Implementation Examples: See Figure 1 This is a flowchart illustrating an intelligent monitoring method for silkworm rearing environment data provided in Embodiment 1 of the present invention. Figure 1 As shown, the monitoring method may include the following steps: S101. Multiple monitoring points are set up in a silkworm breeding scenario, and multiple types of environmental data are sampled simultaneously at each monitoring point. The current data segment is formed by the data of any type of environmental data at any monitoring point within the most recent preset time period. Suspected abnormal data points are determined by the degree of data fluctuation of any data point in the current data segment.
[0020] Multidimensional sensors are used to monitor the silkworm rearing environment, primarily monitoring data such as temperature, humidity, and oxygen concentration. The preferred sampling frequency is once per second. Since silkworm rearing monitoring is typically used in large-scale silkworm farming, with a wide distribution of rearing areas, different locations within the silkworm rearing room or on the silkworm rack may exhibit varying environmental conditions. A single sensor cannot characterize a large-scale environment, and this embodiment also requires comparing environmental data from different locations. Therefore, multiple monitoring points are distributed throughout the silkworm rearing area, preferably in a two-dimensional matrix format. Each location serves as a monitoring point and is equipped with a multidimensional sensor capable of collecting the aforementioned environmental data. This collects multidimensional silkworm rearing environmental data, transmits it to a data processing terminal, and stores data for each dimension separately in a sequence, with newly stored data added to the end of the sequence.
[0021] For any sequence, the monitoring data before the current time for a preset duration is extracted as the latest environmental monitoring data segment and recorded as the current data segment. The value of the preset duration can be set according to the monitoring sensitivity requirements and sampling frequency. In this embodiment, the preferred value is 10 minutes.
[0022] Data points exhibiting a certain degree of fluctuation are likely to be outliers. However, under normal circumstances, monitoring data itself also exhibits normal fluctuations, such as changes in temperature and humidity, fluctuations in oxygen concentration due to indoor and outdoor ventilation, and noise-related data points also show significant fluctuations, just like outlier data points. Therefore, it is necessary to identify potentially outlier data points from among the fluctuating data points as suspected anomalies.
[0023] Considering that, on the one hand, normal data fluctuations have relatively small amplitudes, while fluctuations in abnormal environmental data change much faster and are more significant; on the other hand, because normal environmental data fluctuations are a regular phenomenon, their changes will reappear in recent historical data, i.e., in the current data segment, while potentially abnormal data fluctuation values appear less frequently. The reason for using the degree of data fluctuation rather than the data value itself to identify suspected abnormal data points is that the overall data may exhibit a continuous upward or downward trend, leading to significant differences in normal sampled data values at different sampling times. Therefore, to avoid misjudgment, the change value is used instead of the data value itself.
[0024] Therefore, the degree of data fluctuation of any data point in the current data segment can be used to identify suspected abnormal data points, including: The absolute value of the change in data for any data point in the current data segment is used as the first likelihood of any data point in the current data segment, and the reciprocal of the number of times the first likelihood of any data point in the current data segment appears in the current data segment is used as the second likelihood of any data point in the current data segment. Among them, the data change refers to the difference between the sampled value at the current sampling time and the sampled value at the previous sampling time; Construct a suspected anomaly score for any data point in the current data segment that is proportional to both the first and second suspected scores, and designate data points with a suspected anomaly score greater than a preset suspected anomaly score threshold as suspected anomaly data points.
[0025] Furthermore, in order to eliminate the difference in magnitude between the first and second suspicion levels and to ensure that the first and second suspicion levels contribute equally in the process of constructing the suspicion anomaly level of a data point, in a preferred embodiment, the sum of the normalized value of the first suspicion level and the normalized value of the second suspicion level is used as the suspicion anomaly level of any data point in the current data segment.
[0026] Meanwhile, since the suspected anomaly score is obtained by summing the normalized first and second suspected scores, and the range of suspected anomaly scores for different data points is the same, the setting of the preset suspected anomaly score threshold can preferably be as follows: cluster the suspected anomaly scores of all data points in the current data segment, and take the two clusters containing the most suspected anomaly scores as the first target cluster and the second target cluster, calculate the mean of the suspected anomaly scores in the first target cluster as the first mean, calculate the mean of the suspected anomaly scores in the second target cluster as the second mean, and use the average of the first mean and the second mean as the preset suspected anomaly score threshold.
[0027] The reason for selecting the two clusters with the most suspected outliers is that these two clusters correspond to normal data points and suspected outliers. Therefore, by taking the mean of these two clusters and then taking the average of the two clusters, we can accurately distinguish between normal data points and suspected outliers, making the process of determining suspected outliers based on their suspected outliers more accurate.
[0028] Furthermore, in a preferred embodiment, the formula for the suspected anomaly degree is expressed as follows: , in, The degree of suspected anomaly is the q-th data point in the current data segment. Let represent the sampled value of the q-th data point in the current data segment, and let represent the sampled value of the (q-1)-th data point in the current data segment. The first suspicion level represents the absolute value of the data change at the q-th data point in the current data segment. It characterizes the data fluctuation amplitude at that data point; the greater the fluctuation amplitude, the higher the likelihood of an anomaly. After obtaining the first suspicion level for each data point in the current data segment, the number of times the first suspicion level of the q-th data point appears in the current data segment can be determined. The more frequently the first suspicion level of the q-th data point appears in the current data segment, the more often the change in the q-th data point is repeated in the current data segment, and the more likely it is to be normal data fluctuation. Conversely, the fewer frequently the first suspicion level of the q-th data point appears in the current data segment, the more likely the change in the q-th data point is to be abnormal data fluctuation, and the stronger the suspicion of anomaly. Therefore, an inverse proportionality is used. In form, Normalization refers to methods such as linear normalization and norm normalization, which unify the magnitudes of the two parts of a formula.
[0029] After obtaining the suspected anomaly scores of each data point in the current data segment, the preferred embodiment described above clusters the suspected anomaly scores to determine a preset suspected anomaly score threshold. Of course, a simpler approach can also be adopted, specifically: Considering that the absolute value of the data change (i.e., the first degree of suspicion) is significantly different from that of normal data, regardless of whether it is real abnormal environmental data or noisy data, and that the repetition degree of the first degree of suspicion in the current data segment is significantly different from that of the first degree of suspicion of normal data points in the same data segment, the resulting suspected anomaly degrees for real abnormal data points and noisy data points will be clearly distinguished from those for normal data points, falling at opposite ends of the suspected anomaly degree value range. Therefore, based on the specific calculation formula for suspected anomaly degree mentioned above, the value range of suspected anomaly degree can be determined as [0,2], and the median value of this range, 1, can be used as the preset suspected anomaly degree threshold. If the data point is considered to have suspected abnormal characteristics, it is designated as a suspected abnormal data point.
[0030] S102, calculate the difference between the data change of any suspected abnormal data point in the current data segment and the data change at the same sampling time in the same type of environmental data sampled from monitoring points other than the corresponding monitoring point in the current data segment, and take the absolute value as the first truth value. Calculate the difference between the data change of any suspected abnormal data point in the current data segment and the data change at the same sampling time in other types of environmental data sampled from the corresponding monitoring point in the current data segment, take the absolute value, and then take the reciprocal as the second truth value. Construct the true anomaly value of any suspected abnormal data point in the current data segment that is proportional to both the first truth value and the second truth value. The data change refers to the difference between the sampled value at the current sampling time and the sampled value at the previous sampling time.
[0031] After obtaining suspected abnormal data points, since the data points with large amplitude and irregularity not only include real abnormal data points but also monitoring noise points, we further combined the data characteristics of the silkworm breeding environment to distinguish between real abnormal data and noise data.
[0032] The environmental data of silkworm rearing is mainly affected by the silkworms' activity behavior. For example, during the molting and cocooning stages, silkworms are more active and their metabolism is enhanced, which will have a more significant impact on the environmental data. At the same time, with different levels of mulberry leaf consumption, as some areas consume more mulberry leaves and the remaining leaves become insufficient, silkworms will gradually gather in other areas with more mulberry leaves, resulting in concentrated metabolism. Therefore, in the data changes of multiple monitoring points, if there is a sudden increase in the environmental data value in one area, it should usually be accompanied by a sudden decrease in the environmental data value in the neighboring areas. This is consistent with the characteristics of real abnormal environmental changes. However, the changes in noisy data are highly random and do not have the regular variation characteristics of the distribution in that area.
[0033] Furthermore, since real environmental anomalies are caused by the collective activities of silkworms, the impact of these activities on the environment is reflected in multiple dimensions. Although environmental data such as temperature, humidity, and oxygen concentration change in different directions, they will change simultaneously. Therefore, multidimensional data within the same area should exhibit correlated change characteristics. When environmental data of a certain dimension or type shows significant fluctuations, other dimensions should also show significant fluctuations. Thus, the stronger the degree of co-fluctuation between the current dimension and other dimensions, the more it reflects the characteristics of a real abnormal environmental change. In contrast, interference from dust, silkworm excrement, and silk dander in the breeding environment usually only affects the sensing and monitoring of individual dimensions, and the degree of co-fluctuation of noise is relatively weak.
[0034] Therefore, we can consider the degree of inverse relationship between the changes in the data of suspected abnormal data points in the current data segment and the data changes of similar environmental data at other monitoring points at the same sampling time, as well as the degree of similarity between the data changes of different environmental data at the same monitoring point at the same sampling time, to measure the true anomaly of suspected abnormal data points: Calculate the difference between the data change of any suspected abnormal data point in the current data segment and the data change at the same sampling time in the same type of environmental data sampled from monitoring points other than the corresponding monitoring point in the current data segment, and take the absolute value as the first truth score. Calculate the difference between the absolute value of the data change of any suspected abnormal data point in the current data segment and the absolute value of the data change at the same sampling time in other types of environmental data sampled from the corresponding monitoring point in the current data segment, take the absolute value, and then take the reciprocal as the second truth score. Construct the true anomaly score of any suspected abnormal data point in the current data segment that is proportional to both the first and second truth scores.
[0035] The reason why the absolute value of the changes in the two subtracted data parts was not taken when calculating the first degree of truth is that the first degree of truth measures the degree of inverse relationship between the two changes in the trend of change. However, the absolute value of the changes in the two subtracted data parts is taken when calculating the second degree of truth because the changes in multiple types of environmental data at a certain monitoring point that are synchronously affected by the silkworm colony's activities may be the same or opposite. For example, after the silkworm colony leaves, the temperature at the original location decreases while the oxygen content increases, or the temperature decreases while the humidity decreases. Therefore, the difference in the second degree of truth measures whether the changes in various types of environmental data at the same monitoring point are synchronous. Therefore, the absolute value of the changes in the two subtracted data parts is taken when calculating the second degree of truth.
[0036] Furthermore, considering that the magnitude of change may differ when multidimensional environmental data at the same monitoring point changes synchronously, in a preferred embodiment, the calculation process for the second degree of accuracy is improved as follows: Calculate the difference between the normalized value of the absolute value of the data change of any suspected abnormal data point in the current data segment and the normalized value of the absolute value of the data change of other types of environmental data sampled at the same sampling time from the corresponding monitoring point in the current data segment. Take the absolute value and then take the reciprocal as the second degree of truth.
[0037] In another preferred embodiment, the formula for the true anomaly degree of suspected anomalous data points is expressed as follows: , in, This represents the true anomaly degree of the p-th suspected anomaly data point in the current data segment. This indicates the number of other monitoring points in the neighborhood of the monitoring point corresponding to the current data segment. This represents the amount of data change for the p-th suspected outlier data point in the current data segment. This represents the data change of a data point within the neighborhood of the current data segment corresponding to the monitoring point i, which is sampled at the same time as the sampled data of the p-th suspected anomaly data point. The larger the value obtained by subtracting the data change of the p-th suspected anomaly data point from the data change of other similar data points in the neighborhood monitoring points at the same time, the greater the likelihood that the trend of the p-th suspected anomaly data point in the current data segment is opposite to the trend of similar environmental data in the surrounding neighborhood monitoring points. In this case, the environmental change characteristics of the p-th suspected anomaly data point in the current data segment are more consistent with the actual characteristics of environmental anomalies. This indicates the number of types of environmental data sampled at the monitoring point corresponding to the current data segment, excluding the environmental data corresponding to the current data segment. This represents the normalized value of the absolute value of the data change of the p-th suspected outlier data point in the current data segment. This represents the normalized value of the absolute value of the data change of the data point in the j-th type of environmental data sampled from the monitoring point corresponding to the current data segment, which is sampled at the same time as the p-th suspected abnormal data point. The smaller the value, the more similar the degree of change of the data points recorded in both dimensions. Therefore, an inverse proportional form is used. , The sum of the similarities between the current suspected anomaly data point and all other data points across the same monitoring point is calculated. The larger this sum, the more the suspected anomaly data point exhibits the multidimensional data distribution characteristics of a true anomaly, and the stronger the degree of anomaly. Normalization is used to unify the magnitudes of the two parts of a formula.
[0038] In this embodiment, based on the two-dimensional matrix planar arrangement of the monitoring points, the preferred neighborhood monitoring points of the aforementioned monitoring points are eight-neighborhoods, that is, selecting the eight other monitoring points adjacent to the current monitoring point as the neighborhood monitoring points of the current monitoring point. In other embodiments, the neighborhood values can be specifically set according to the arrangement of the monitoring points and the monitoring accuracy requirements.
[0039] S103, based on the true anomaly degree of any suspected abnormal data point, correct the filtered value of any suspected abnormal data point after moving average filtering to obtain a corrected value, thus completing the monitoring of silkworm breeding environment data.
[0040] In the process of moving average filtering, the average value of all data points in the window containing the target data point is calculated by moving average sliding window, and the average value is used to replace the target data point at a fixed position in the window (such as the center of the window) to complete the filtering of the target data point. It can be seen that although this filtering method can effectively remove noise, it will also lead to the loss of real abnormal environmental monitoring values.
[0041] Therefore, in this embodiment, this step is based on the true anomaly degree of the target data point. A first weight is constructed for the original value of the target data point, and a second weight is constructed for the filtered value obtained after the target data point has undergone the aforementioned moving average filtering. The original value and the filtered value of the target data point are then weighted using the first and second weights respectively to obtain a corrected value for the target data point. Specifically: A first weight and a second weight are set for any suspected abnormal data point in the current data segment. The first weight is directly proportional to the actual abnormality of the suspected abnormal data point, and the second weight is inversely proportional to the actual abnormality of the suspected abnormal data point. The original value of the suspected abnormal data point is weighted by the first weight to obtain a first weighted value. The filtered value of the suspected abnormal data point after moving average filtering is weighted by the second weight to obtain a second weighted value. The correction value of the suspected abnormal data point is determined by the first weighted value and the second weighted value.
[0042] The reason for setting the first and second weights as described above and obtaining the correction value is that the true anomaly degree of the suspected abnormal data points obtained in the previous step reflects the probability that the original value of the data point, i.e., the original environmental monitoring value, belongs to a true environmental anomaly. Therefore, for all suspected abnormal data points, the weight ratio of the data points within the moving average sliding window during moving average filtering is adjusted according to their anomaly degree. When the true anomaly degree is larger, it means that the suspected abnormal data point is more likely to be a true anomaly, and the corresponding data point should not be smoothed out; the weight ratio of the data point's own value, i.e., the original value, should be larger. When the true anomaly degree is smaller, it means that the suspected abnormal data point is more likely to be noise, and the corresponding data point should be smoothed out; the weight ratio of the data point's own value, i.e., the original value, should be smaller.
[0043] The formula for correcting the filtered value of suspected outlier data points after applying a moving average filter based on the true outlier degree is as follows:
[0044] in, This is the correction value for the p-th suspected outlier data point. This represents the original value of the p-th suspected outlier data point. This represents the filtered value of the p-th suspected outlier data point after applying a moving average filter. As the first weight with a value range of [0,1], the higher the true anomaly degree, The larger the value, the more likely the suspected outlier is a genuine outlier, and the greater the proportion of the original value of the suspected outlier in the weighted summation. The second weight is also [0,1]. The smaller the second weight, the smaller the proportion of the filtered value of the p-th suspected outlier data point after the moving average filter in the weighted summation. Conversely, the larger the second weight, the larger the proportion of the filtered value of the p-th suspected outlier data point after the moving average filter in the weighted summation, and the closer the weighted summation result is to the moving average filter result.
[0045] In practice, the real-time environmental monitoring data can first undergo preliminary filtering and denoising, which is accomplished directly using the existing moving average filtering algorithm. Then, because the preliminary direct filtering may filter out some genuine anomalies, a second filtering and denoising process is performed every preset time interval (10 minutes) on the historical data from the previous 10 minutes, obtaining corrected values as described above. This second-stage filtered and denoised data is used to further analyze whether there are any real signs of abnormal changes. The resulting filtered data more accurately reflects the actual silkworm rearing environmental monitoring data points after noise removal, improving the accuracy of environmental anomaly monitoring when using the moving average filtering algorithm to denoise silkworm environmental monitoring data.
[0046] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for intelligent monitoring of silkworm rearing environment data, characterized in that, The method includes: In the silkworm breeding scenario, multiple monitoring points are set up in a dispersed manner, and multiple types of environmental data are sampled simultaneously at each monitoring point. The data of any type of environmental data at any monitoring point within the most recent preset time period constitutes the current data segment. The degree of data fluctuation of any data point in the current data segment determines suspected abnormal data points. The difference between the data change of any suspected abnormal data point in the current data segment and the data change at the same sampling time in the same type of environmental data sampled from monitoring points other than the corresponding monitoring point in the current data segment is calculated, and the absolute value is taken as the first truth value. The difference between the absolute value of the data change of any suspected abnormal data point in the current data segment and the absolute value of the data change at the same sampling time in other types of environmental data sampled from the corresponding monitoring point in the current data segment is calculated, and the absolute value is taken and the reciprocal is taken as the second truth value. The true anomaly value of any suspected abnormal data point in the current data segment is constructed, which is proportional to both the first truth value and the second truth value. The data change refers to the difference between the sampled value at the current sampling time and the sampled value at the previous sampling time. Based on the true anomaly degree of any suspected abnormal data point, the filtered value of the suspected abnormal data point after moving average filtering is corrected to obtain a corrected value, thus completing the monitoring of silkworm breeding environment data.
2. The intelligent monitoring method for silkworm rearing environment data according to claim 1, characterized in that, The step of determining suspected abnormal data points based on the degree of data fluctuation of any data point in the current data segment includes: The absolute value of the change in data for any data point in the current data segment is used as the first likelihood of any data point in the current data segment, and the reciprocal of the number of times the first likelihood of any data point in the current data segment appears in the current data segment is used as the second likelihood of any data point in the current data segment. Construct a suspected anomaly score for any data point in the current data segment that is proportional to both the first and second suspected scores, and designate data points with a suspected anomaly score greater than a preset suspected anomaly score threshold as suspected anomaly data points.
3. The intelligent monitoring method for silkworm rearing environment data according to claim 2, characterized in that, The sum of the normalized value of the first suspicion level and the normalized value of the second suspicion level is used as the suspicion anomaly level of any data point in the current data segment; Cluster the suspected anomalies of all data points in the current data segment, and select the two clusters with the most suspected anomalies as the first target cluster and the second target cluster. Calculate the mean of the suspected anomalies in the first target cluster as the first mean, calculate the mean of the suspected anomalies in the second target cluster as the second mean, and use the average of the first mean and the second mean as the preset suspected anomaly threshold.
4. The intelligent monitoring method for silkworm rearing environment data according to claim 1, characterized in that, Calculate the difference between the normalized value of the absolute value of the data change of any suspected abnormal data point in the current data segment and the normalized value of the absolute value of the data change of other types of environmental data sampled at the same sampling time from the corresponding monitoring point in the current data segment. Take the absolute value and then take the reciprocal as the second degree of truth.
5. The intelligent monitoring method for silkworm rearing environment data according to claim 4, characterized in that, The true anomaly degree of any suspected anomalous data point in the current data segment is: , in, This represents the true anomaly degree of the p-th suspected anomaly data point in the current data segment. This indicates the number of other monitoring points in the neighborhood of the monitoring point corresponding to the current data segment. This represents the amount of data change for the p-th suspected outlier data point in the current data segment. This represents the change in data among the i-th monitoring point in the neighborhood of the current data segment, which is sampled at the same time as the p-th suspected abnormal data point. This indicates the number of types of environmental data sampled at the monitoring point corresponding to the current data segment, excluding the environmental data corresponding to the current data segment. This represents the normalized value of the absolute value of the data change of the p-th suspected outlier data point in the current data segment. This represents the normalized value of the absolute value of the data change of the data point in the j-th type of environmental data sampled from the monitoring point corresponding to the current data segment, which is sampled at the same time as the p-th suspected abnormal data point. This indicates normalization.
6. The intelligent monitoring method for silkworm rearing environment data according to claim 1, characterized in that, The step of correcting the filtered value of any suspected anomalous data point after moving average filtering based on the true anomalousness of any suspected anomalous data point includes: A first weight and a second weight are set for any suspected abnormal data point in the current data segment. The first weight is directly proportional to the actual abnormality of the suspected abnormal data point, and the second weight is inversely proportional to the actual abnormality of the suspected abnormal data point. The original value of the suspected abnormal data point is weighted by the first weight to obtain a first weighted value. The filtered value of the suspected abnormal data point after moving average filtering is weighted by the second weight to obtain a second weighted value. The correction value of the suspected abnormal data point is determined by the first weighted value and the second weighted value.