Farmland wireless sensor anomaly detection method and system based on auto-encoder

By constructing a trust feature matrix and using an autoencoder for trust evaluation, the identification accuracy problem of farmland wireless sensor network under dynamic environment changes is solved, accurate detection of abnormal sensors is achieved, and network reliability is improved.

CN120602902APending Publication Date: 2025-09-05XINJIANG UNIVERSITY

Patent Information

Application Number
CN202510817166.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

The prior art is difficult to quickly adapt to the dynamic environment and node state changes in farmland wireless sensor networks, resulting in reduced identification accuracy, and the deployment of edge servers and allocation of computing resources, making it difficult to meet the low-cost and resource-constrained needs in the terrestrial environment.

Method used

By constructing a trust feature matrix and using an autoencoder for trust evaluation, combining the reconstruction error of the autoencoder output, the trust evaluation results of the acquisition module are quantified and the abnormal sensor is accurately detected.

Benefits of technology

It improves the reliability and identification accuracy of farmland wireless sensor networks to meet the actual needs of agricultural data monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602902A_ABST
    Figure CN120602902A_ABST
Patent Text Reader

Abstract

The invention provides a farmland wireless sensor anomaly detection method and system based on an auto-encoder, and relates to the field of sensor anomaly detection, and the method comprises the steps: S1, each intermediate module carries out the transmission pre-processing of the received monitoring data of a plurality of collection modules; s2, regarding the acquisition module, aiming at each monitoring time point, the detection module calculates crop trust data, weather trust data and task trust data corresponding to the monitoring time point; and S3, the detection module generates a trust feature matrix of the acquisition module, inputs the trust feature matrix subjected to normalization processing into the auto-encoder, and quantifies a trust evaluation result of the acquisition module according to a reconstruction error output by the auto-encoder. According to the invention, the abnormal farmland wireless sensor can be accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of sensor anomaly detection, and in particular to a method and system for detecting anomaly of farmland wireless sensors based on an autoencoder. Background Art

[0002] By deploying large-scale, low-power, high-precision wireless sensor nodes in farmland environments, it is possible to monitor key parameters such as crop growth status and temperature and humidity in the agricultural environment in real time and accurately. Therefore, it is particularly important to effectively identify abnormal sensor nodes and ensure the reliability and overall performance of farmland wireless sensor networks.

[0003] The Chinese patent application with publication number CN112165694A discloses a method for establishing a trust model for wireless sensor networks. By abstracting interactive factors and private factors, an interactive trust model and a private trust model are constructed to evaluate node credibility. The interactive factors mainly include the communication effectiveness, data similarity and clock consistency between nodes, while the private factors focus on the stability of the node's own perception data and the remaining energy status. These factors are used to identify faulty nodes, event nodes and normal nodes in the network. However, this patent application does not deeply analyze the impact of dynamic environmental changes on node trust evaluation, resulting in reduced recognition accuracy of the model in application scenarios with complex environmental changes. It assigns static weights to interactive trust factors and does not provide a mechanism for dynamically adjusting weights as the network environment or node status changes. It is difficult to quickly adapt to the actual needs of different network environments and changes in node behavior.

[0004] A Chinese patent application, publication number CN113891275A, proposes a trust model for underwater wireless sensor networks based on transfer learning. First, a node clustering model is established based on the mobility and energy consumption characteristics of underwater nodes. The cluster head node collects trust evidence and transmits it to the edge server for preprocessing. Subsequently, a transfer learning algorithm is used to train the data on the edge server, resulting in a detection model that adapts to dynamic environmental changes and malicious attacks, enabling node trust assessment and malicious node identification. However, this patent application is primarily based on the unique node mobility and ocean current drift in underwater environments, and does not consider application scenarios with fixed node locations. The edge server deployment and computing resource allocation methods used are relatively complex, and the energy consumption management strategy for underwater scenarios is difficult to meet the low-cost and resource-constrained deployment requirements of terrestrial environments. Summary of the Invention

[0005] This application constructs a trust feature matrix for the acquisition module by calculating crop trust data, weather trust data, and task trust data at several consecutive monitoring time points. This trust feature matrix is ​​then input into an autoencoder. Based on the reconstruction error output by the autoencoder, the trust evaluation result of the acquisition module is obtained. This application aims to intelligently evaluate the trust status of farmland wireless sensors and accurately detect abnormal farmland wireless sensors.

[0006] This application provides a method for detecting anomalies in farmland wireless sensors based on an autoencoder, comprising the following steps: S1. Set up a communication connection between several acquisition modules with the same data type and an intermediate module, and each intermediate module performs pre-sending processing on the monitoring data received from the several acquisition modules, and transmits the pre-sending processing result data to the detection module; S2. Regarding the acquisition module, the detection module determines a number of consecutive monitoring time points, and for each monitoring time point, the detection module calculates the crop trust data, weather trust data, and task trust data corresponding to the monitoring time point; S3. The detection module generates a trust feature matrix for the acquisition module based on the crop trust data, weather trust data, and task trust data corresponding to several monitoring time points. The normalized trust feature matrix is ​​input into the autoencoder. The trust evaluation result of the acquisition module is quantified based on the reconstruction error output by the autoencoder.

[0007] As a preferred technical solution of the present application, each intermediate module performs pre-sending processing on the monitoring data received from several acquisition modules, including the following steps: S11. Each intermediate module determines the maximum and minimum monitoring data from the monitoring data received from the multiple acquisition modules, calculates the difference between the maximum and minimum monitoring data, and determines whether the difference is greater than a preset standard deviation. If so, the intermediate module directly uses the monitoring data received from the multiple acquisition modules as the pre-sending processing result data; if not, the intermediate module proceeds to the next step. S12. Each intermediate module calculates a reduced data size based on the difference, and represents the monitoring data received from each acquisition module by subtracting the minimum monitoring data from the monitoring data according to the reduced data size; S13. Each intermediate module generates pre-sending processing result data including the number of monitoring data, minimum monitoring data, data size before reduction, data size after reduction, and several calculation results.

[0008] As a preferred technical solution of the present application, after the intermediate module transmits the pre-sending processing result data to the detection module, when the detection module determines that the pre-sending processing result data includes the reduced monitoring data, a recovery calculation is performed on the pre-sending processing result data.

[0009] As a preferred technical solution of the present application, the detection module calculates the crop trust data corresponding to the monitoring time point, including the following steps: S211, the detection module obtains monitoring data of various data types of the collection module at the monitoring time point, and calculates basic crop trust data based on the monitoring data of various data types; S212: The detection module determines the time window in which the monitoring time point is located, calculates the variance of all monitoring data of each data type of the acquisition module within the time window, maps each variance to a value between 0 and 1, and calculates the mean of all variances as the constant rate; S213: The detection module determines adjacent time points of the monitoring time point, calculates the change rate of the monitoring data of the monitoring time point and the monitoring data of the adjacent time points for each data type of the acquisition module, and calculates the mean of the change rates of all the change rates; S214: The detection module determines several other acquisition modules in the same area as the acquisition module, and for each data type, calculates a consistency rate based on all monitoring data of the acquisition module and the several other acquisition modules at the monitoring time point, and calculates the mean consistency rate of all consistency rates; S215. The detection module uses the constant rate, the mean of the change rate, and the mean of the consistency rate to perform reduction processing on the basic crop trust data.

[0010] As a preferred technical solution of the present application, the detection module calculates the weather trust data corresponding to the monitoring time point, including the following steps: S221, the detection module determines the fuzzy sets of temperature, precipitation, and wind speed at the monitoring time point, and the fuzzy set of weather trust data, and defines the membership functions of the fuzzy sets of temperature, precipitation, and wind speed, and the fuzzy set of weather trust data; S222, the detection module performs fuzzy reasoning based on Mamdani fuzzy rules and uses the centroid method to perform defuzzification to obtain weather trust data.

[0011] As a preferred technical solution of this application, the detection module calculates the task trust data corresponding to the monitoring time point, including the following steps: S231. Based on the collection task corresponding to the monitoring time point, determine whether all key collection modules have successfully sent monitoring data. If so, determine that the collection task is successful; otherwise, determine that the collection task has failed. S232. When the acquisition module is not a key acquisition module, if the acquisition task is successful, the sum of the historical success count of the acquisition module and the reward weight is calculated as the current success count; if the acquisition task fails, the sum of the historical failure count of the acquisition module and the penalty weight is calculated as the current failure count, where the reward weight is the same as the penalty weight; S233. When the acquisition module is a key acquisition module, if the acquisition task is successful, the sum of the historical success count corresponding to the acquisition module and the reward weight is calculated as the current success count; if the acquisition task fails, the sum of the historical failure count corresponding to the acquisition module and the penalty weight is calculated as the current failure count, where the penalty weight is greater than the reward weight; S234. Divide the current number of successes by the sum of the current number of successes and the current number of failures to obtain task trust data.

[0012] This application also provides a farmland wireless sensor anomaly detection system based on an autoencoder, which includes the following modules: The acquisition module is used to collect monitoring data and send the monitoring data to the intermediate module; The intermediate module is used to establish communication connections with several acquisition modules of the same data type, and to perform pre-sending processing on the monitoring data received from the several acquisition modules, and transmit the pre-sending processing result data to the detection module; The detection module is used to determine several consecutive monitoring time points for the acquisition module and, for each monitoring time point, calculate the crop trust data, weather trust data, and task trust data corresponding to the monitoring time point. The detection module is also used to generate a trust feature matrix for the acquisition module based on the crop trust data, weather trust data, and task trust data corresponding to the several monitoring time points. The normalized trust feature matrix is ​​input into the autoencoder, and the trust evaluation result of the acquisition module is quantified based on the reconstruction error output by the autoencoder.

[0013] Compared with the prior art, the present invention can achieve at least the following beneficial effects: In the technical solution of the present application, first, several acquisition modules with the same data type are set to communicate with an intermediate module, and each intermediate module performs pre-sending processing on the monitoring data received from several acquisition modules, and transmits the pre-sending processing result data to the detection module. Secondly, with respect to the acquisition module, the detection module determines several consecutive monitoring time points, and for each monitoring time point, the detection module calculates the crop trust data, weather trust data, and task trust data corresponding to the monitoring time point. Finally, the detection module generates a trust feature matrix of the acquisition module based on the crop trust data, weather trust data, and task trust data corresponding to the several monitoring time points, inputs the normalized trust feature matrix into the autoencoder, and quantifies the trust evaluation result of the acquisition module based on the reconstruction error output by the autoencoder. Through this application, the trust status of farmland wireless sensors can be intelligently evaluated, so that abnormal farmland wireless sensors can be accurately detected, which helps to improve the reliability of farmland wireless sensor networks and meet the actual needs of agricultural data monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0015] Figure 1 Schematic diagram of the autoencoder-based farmland wireless sensor anomaly detection method in this application.

[0016] Figure 2 Schematic diagram of the autoencoder-based farmland wireless sensor anomaly detection system in this application. DETAILED DESCRIPTION

[0017] The embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0018] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of this application.

[0019] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this application, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number and aspect described herein can be used to implement an apparatus and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this apparatus and / or practice this method.

[0020] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. The illustrations only show components related to the present application and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.

[0021] Additionally, in the following description, specific details are provided to provide a thorough understanding of the examples, however, one skilled in the art will appreciate that the examples can be practiced without these specific details.

[0022] See also Figure 1 The farmland wireless sensor anomaly detection method based on an autoencoder in the embodiment of the present application includes the following main steps: S1. Set up a communication connection between several acquisition modules with the same data type and an intermediate module, and each intermediate module performs pre-sending processing on the monitoring data received from the several acquisition modules, and transmits the pre-sending processing result data to the detection module; S2. Regarding the acquisition module, the detection module determines a number of consecutive monitoring time points, and for each monitoring time point, the detection module calculates the crop trust data, weather trust data, and task trust data corresponding to the monitoring time point; S3. The detection module generates a trust feature matrix for the acquisition module based on the crop trust data, weather trust data, and task trust data corresponding to several monitoring time points. The normalized trust feature matrix is ​​input into the autoencoder. The trust evaluation result of the acquisition module is quantified based on the reconstruction error output by the autoencoder.

[0023] Specifically, farmland wireless sensor networks are typically deployed in open, volatile farmland environments. Sensor nodes are often subject to multiple factors, including complex natural conditions (storms, heavy rain, and high temperatures) and malicious interference (wireless communication interference and malicious human attacks). These factors can easily lead to decreased operational stability or even failure, significantly reducing the overall reliability of the network. To effectively identify abnormal sensors and improve the reliability of farmland wireless sensor networks, the following method is proposed: In S1, several acquisition modules with the same data type are connected to a central module for communication. The acquisition modules are sensor modules fixed to the farmland and can simultaneously collect monitoring data of multiple types, such as humidity and temperature. For ease of understanding, let's consider an example where acquisition modules 1 and 2 send their collected temperature data to central module 1 and their collected humidity data to central module 2. Central modules 1 and 2 are computer devices located near the farmland wireless sensor network. Each central module pre-processes the monitoring data received from the multiple acquisition modules and transmits the pre-processed data to the detection module. The purpose of pre-processing is to reduce the amount of data required to be sent and minimize data congestion on the communication route from the central module to the detection module, thereby enabling the rapid detection of abnormal acquisition modules. In S2, for the acquisition modules, the detection module determines several consecutive monitoring time points. For each monitoring time point, the detection module calculates the corresponding crop trust data, weather trust data, and task trust data. In S3, the detection module generates a trust feature matrix for the acquisition module based on the crop trust data, weather trust data, and task trust data corresponding to several monitoring time points. The crop trust data, weather trust data, and task trust data corresponding to each monitoring time point are used as a row in the trust feature matrix. The trust feature matrix is ​​normalized. Specifically, the Min-Max normalization formula can be used to normalize each column in the trust feature matrix. The normalized trust feature matrix is ​​input into the autoencoder. The encoder projects the high-dimensional trust feature matrix into the low-dimensional latent feature space. The decoder then reconstructs the latent features to restore the input trust feature matrix. It should be noted that the autoencoder is trained using the trust feature matrix of the normal acquisition module. The trust evaluation result of the acquisition module is quantified based on the reconstruction error output by the autoencoder. The specific method is to use the formula Calculate the reconstruction error of the acquisition module, and is the number of rows and columns of the trust feature matrix, is the first in the input trust feature matrix Rank The value of the column, is the first in the output trust feature matrix Rank After obtaining the reconstruction errors of all acquisition modules, the values ​​of the columns are calculated using the formula Standardize the reconstruction error of the acquisition module. For the The reconstruction error of each acquisition module, is the minimum value among all reconstruction errors, is the maximum value among all reconstruction errors. When the reconstruction error of the acquisition module is small, it indicates that the trust characteristics of the acquisition module conform to the normal mode, so its trust value is high. Conversely, when the reconstruction error of the acquisition module is large, it indicates that the acquisition module may have an abnormality, so its trust value is low.

[0024] Furthermore, each intermediate module performs pre-sending processing on the monitoring data received from several acquisition modules, including the following steps: S11. Each intermediate module determines the maximum and minimum monitoring data from the monitoring data received from the multiple acquisition modules, calculates the difference between the maximum and minimum monitoring data, and determines whether the difference is greater than a preset standard deviation. If so, the intermediate module directly uses the monitoring data received from the multiple acquisition modules as the pre-sending processing result data; if not, the intermediate module proceeds to the next step. S12. Each intermediate module calculates a reduced data size based on the difference, and represents the monitoring data received from each acquisition module by subtracting the minimum monitoring data from the monitoring data according to the reduced data size; S13. Each intermediate module generates pre-sending processing result data including the number of monitoring data, minimum monitoring data, data size before reduction, data size after reduction, and several calculation results.

[0025] Specifically, it introduces how each intermediate module performs pre-sending processing on the monitoring data received from several acquisition modules. In S11, each intermediate module determines the maximum monitoring data and the minimum monitoring data among the monitoring data received from several acquisition modules, and calculates the difference between the two. If the difference is greater than the preset standard deviation, the monitoring data received from the several acquisition modules is directly used as the pre-sending processing result data. If the difference is not greater than the preset standard deviation, the next step is continued. In S12, each intermediate module calculates the reduced data size based on the difference, and calculates the reduced data size based on the formula Calculate the reduced data size, that is, the number of bits, where It is the difference. For example, the maximum monitoring data is 81 and the minimum monitoring data is 65, then the difference is 16. According to the formula, the reduced data size is 5 bits. For the monitoring data received from each acquisition module, the calculation result of the monitoring data minus the minimum monitoring data is expressed according to the reduced data size. In S13, each intermediate module generates pre-sending processing result data including the number of monitoring data, the minimum monitoring data, the data size before reduction, the data size after reduction, and several calculation results. Among them, the data size before reduction is, for example, 8 bits, that is, 8 bits are used to represent 65 above.

[0026] Furthermore, after the intermediate module transmits the pre-sending processing result data to the detection module, when the detection module determines that the pre-sending processing result data includes the reduced monitoring data, a recovery calculation is performed on the pre-sending processing result data.

[0027] Specifically, by adding a flag to the pre-processing result data, the detection module can determine that the result data includes the reduced monitoring data. The recovery calculation for the result data includes: extracting a number of calculation results based on the number of monitoring data and the reduced data size, and restoring the original monitoring data based on the minimum monitoring data and the data size before reduction. It should be noted that when the intermediate module sends the pre-processing result data to the detection module, it also sends explanatory information. The explanatory information includes the monitoring time point corresponding to the calculation result and the unique code of the acquisition module.

[0028] Furthermore, the detection module calculates the crop trust data corresponding to the monitoring time point, including the following steps: S211, the detection module obtains monitoring data of various data types of the collection module at the monitoring time point, and calculates basic crop trust data based on the monitoring data of various data types; S212: The detection module determines the time window in which the monitoring time point is located, calculates the variance of all monitoring data of each data type of the acquisition module within the time window, maps each variance to a value between 0 and 1, and calculates the mean of all variances as the constant rate; S213: The detection module determines adjacent time points of the monitoring time point, calculates the change rate of the monitoring data of the monitoring time point and the monitoring data of the adjacent time points for each data type of the acquisition module, and calculates the mean of the change rates of all the change rates; S214: The detection module determines several other acquisition modules in the same area as the acquisition module, and for each data type, calculates a consistency rate based on all monitoring data of the acquisition module and the several other acquisition modules at the monitoring time point, and calculates the mean consistency rate of all consistency rates; S215. The detection module uses the constant rate, the mean of the change rate, and the mean of the consistency rate to perform reduction processing on the basic crop trust data.

[0029] Specifically, the process of calculating the crop trust data corresponding to the monitoring time point by the detection module is introduced. In S211, the detection module obtains the monitoring data of various data types from the acquisition module at the monitoring time point, and calculates the basic crop trust data based on the monitoring data of various data types. Specifically, the formula Calculate, where is the number of data types, For the The weight of the monitoring data of each data type, For the Monitoring data of various data types, For the The ideal maximum value corresponding to the monitoring data of each data type, For the The ideal minimum value corresponding to the monitoring data of each data type, For the The ideal average value corresponding to the monitoring data of each data type, For the The preset small constant value corresponding to the monitoring data of each data type. In S212, the detection module determines the time window where the monitoring time point is located, obtains the monitoring data of various data types at each monitoring time point in the time window from the acquisition module, and for each data type, calculates the variance of all monitoring data of the data type of the acquisition module in the time window, maps each variance to between 0 and 1, and calculates the mean of all variances as a constant rate. The specific formula is: Mapping, For the The variance corresponding to each data type, For the The lower bound of the normal fluctuation corresponding to the variance corresponding to each data type. In S213, the detection module determines the adjacent time points before the monitoring time point, and for each data type, calculates the rate of change of the monitoring data of the monitoring time point of the acquisition module and the monitoring data of the adjacent time points. The specific method is to use the absolute value of the difference between the two divided by the monitoring data of the adjacent time points, and calculate the mean of all change rates as the mean of the change rate. In S214, the detection module determines several other acquisition modules in the same area as the acquisition module. In order to determine several other acquisition modules, the farmland can be divided into several small areas in advance. For each data type, the consistency rate is calculated based on all the monitoring data of the acquisition module and several other acquisition modules at the monitoring time point. The specific method is to use the formula Perform calculations, For the Monitoring data of various data types, For the Monitoring data of the same data type from other acquisition modules, is the total number of other acquisition modules, The default normalization constant is used to calculate the mean of all consistency rates as the consistency rate mean. In S215, the detection module uses the constant rate, the change rate mean, and the consistency rate mean to reduce the basic crop trust data. The specific formula used is To carry out reduction processing, To use a constant rate, To determine the attenuation coefficient of the reduction strength corresponding to the constant rate, is the mean rate of change, is the attenuation coefficient that determines the reduction strength corresponding to the mean value of the rate of change, is the mean consistency rate, is the attenuation coefficient that determines the reduction strength corresponding to the mean consistency rate.

[0030] Furthermore, the detection module calculates the weather trust data corresponding to the monitoring time point, including the following steps: S221, the detection module determines the fuzzy sets of temperature, precipitation, and wind speed at the monitoring time point, and the fuzzy set of weather trust data, and defines the membership functions of the fuzzy sets of temperature, precipitation, and wind speed, and the fuzzy set of weather trust data; S222, the detection module performs fuzzy reasoning based on Mamdani fuzzy rules and uses the centroid method to perform defuzzification to obtain weather trust data.

[0031] Specifically, the process of calculating the weather trust data corresponding to the monitoring time point by the detection module is introduced. In S221, the detection module determines the fuzzy sets of temperature, precipitation, and wind speed at the monitoring time point, as well as the fuzzy set of weather trust data. Each fuzzy set is Low, Mod, and High. At the same time, the membership functions of the fuzzy sets of temperature, precipitation, and wind speed, as well as the membership function of the fuzzy set of weather trust data, are defined respectively. The temperature, precipitation, and wind speed are denoted as T, P, and W, respectively. The membership function of the fuzzy set of temperature is as follows:

[0032]

[0033]

[0034] The membership function of the fuzzy set of precipitation is as follows:

[0035]

[0036]

[0037] The membership function of the fuzzy set of wind speed is as follows:

[0038]

[0039]

[0040] The membership function of the fuzzy set of weather trust data is as follows:

[0041]

[0042]

[0043] In S222, the detection module performs fuzzy reasoning based on Mamdani fuzzy rules and uses the centroid method for defuzzification to obtain weather trust data. The fuzzy rules are shown in the following table.

[0044]

[0045] For ease of understanding, let's set the input to 5°C temperature, 10mm precipitation, and 6m / s wind speed. The results of calculating the membership degree item by item are shown in the following table:

[0046] The only trigger rule 2 is (low, low, medium), take the minimum trigger degree, that is, calculate =0.5, in Mamdani type fuzzy reasoning, after each IF-THEN rule is triggered by the input, its triggering degree needs to be mapped to the corresponding output membership function, and the output , defuzzification is performed by the centroid method, and the membership function after clipping is as follows:

[0047] Cutting height , the original triangle is [0.3, 0.5, 0.7], calculate the denominator , A , calculate the molecule , since the graph is about =0.5 symmetry, the horizontal coordinate of the center of mass is the triangle symmetry axis 0.50, so , substituting into the formula we get , that is, moderately credible.

[0048] Furthermore, the detection module calculates the task trust data corresponding to the monitoring time point, including the following steps: S231. Based on the collection task corresponding to the monitoring time point, determine whether all key collection modules have successfully sent monitoring data. If so, determine that the collection task is successful; otherwise, determine that the collection task has failed. S232. When the acquisition module is not a key acquisition module, if the acquisition task is successful, the sum of the historical success count of the acquisition module and the reward weight is calculated as the current success count; if the acquisition task fails, the sum of the historical failure count of the acquisition module and the penalty weight is calculated as the current failure count, where the reward weight is the same as the penalty weight; S233. When the acquisition module is a key acquisition module, if the acquisition task is successful, the sum of the historical success count corresponding to the acquisition module and the reward weight is calculated as the current success count; if the acquisition task fails, the sum of the historical failure count corresponding to the acquisition module and the penalty weight is calculated as the current failure count, where the penalty weight is greater than the reward weight; S234. Divide the current number of successes by the sum of the current number of successes and the current number of failures to obtain task trust data.

[0049] Specifically, the process of calculating the task trust data corresponding to the monitoring time point by the detection module is introduced. In S231, regarding the collection task corresponding to the monitoring time point, it is determined whether all key collection modules have successfully sent the monitoring data. It should be noted that all collection modules send the collected monitoring data every time they reach a monitoring time point. The time intervals between different monitoring time points are the same. The sending process of all collection modules is regarded as a collection task. Successfully sending the monitoring data means that the detection module successfully receives the sent monitoring data. If so, the collection task is determined to be successful. If not, the collection task is determined to be failed. In S232, when the collection module is not a key collection module, if the collection task is successful, the sum of the historical success count corresponding to the collection module and the reward weight is calculated as the current success count. The historical success count refers to the number of successful collection tasks in history. If the collection task fails, the sum of the historical failure count corresponding to the collection module and the penalty weight is calculated as the current failure count. The historical failure count refers to the number of failed collection tasks in history. Among them, the reward weight and the penalty weight are the same and can be 1. In S233, when the acquisition module is the key acquisition module, if the acquisition task is successful, the sum of the historical success count corresponding to the acquisition module and the reward weight is calculated as the current success count. If the acquisition task fails, the sum of the historical failure count corresponding to the acquisition module and the penalty weight is calculated as the current failure count, where the penalty weight is greater than the reward weight, for example, the penalty weight is 3 and the reward weight is 1. In S234, the current success count is divided by the sum of the current success count and the current failure count to obtain task trust data.

[0050] According to another aspect of the embodiment of the present application, Figure 2 As shown, the present application also provides a farmland wireless sensor anomaly detection system based on an autoencoder, including an acquisition module, an intermediate module, and a detection module to implement the farmland wireless sensor anomaly detection method based on an autoencoder described above. The functions of each module are as follows: The acquisition module is used to collect monitoring data and send the monitoring data to the intermediate module; The intermediate module is used to establish communication connections with several acquisition modules of the same data type, and to perform pre-sending processing on the monitoring data received from the several acquisition modules, and transmit the pre-sending processing result data to the detection module; The detection module is used to determine several consecutive monitoring time points for the acquisition module and, for each monitoring time point, calculate the crop trust data, weather trust data, and task trust data corresponding to the monitoring time point. The detection module is also used to generate a trust feature matrix for the acquisition module based on the crop trust data, weather trust data, and task trust data corresponding to the several monitoring time points. The normalized trust feature matrix is ​​input into the autoencoder, and the trust evaluation result of the acquisition module is quantified based on the reconstruction error output by the autoencoder.

[0051] In this specification, the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments described later, the description is relatively simple, and the relevant parts can be referred to the partial description of the previous embodiments.

[0052] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any changes or replacements that can be easily thought of by any technician familiar with this technical field within the technical scope disclosed in this application should be covered by the scope of protection of the present application.

Claims

1. The farmland wireless sensor anomaly detection method based on autoencoder is characterized by: The method comprises the following steps: S1. Set up a communication connection between several acquisition modules with the same data type and an intermediate module, and each intermediate module performs pre-sending processing on the monitoring data received from the several acquisition modules, and transmits the pre-sending processing result data to the detection module; S2. Regarding the acquisition module, the detection module determines a number of consecutive monitoring time points, and for each monitoring time point, the detection module calculates the crop trust data, weather trust data, and task trust data corresponding to the monitoring time point; S3. The detection module generates a trust feature matrix for the acquisition module based on the crop trust data, weather trust data, and task trust data corresponding to several monitoring time points. The normalized trust feature matrix is ​​input into the autoencoder. The trust evaluation result of the acquisition module is quantified based on the reconstruction error output by the autoencoder.

2. The method according to claim 1, characterized in that Each intermediate module processes the monitoring data received from several acquisition modules before sending it, including the following steps: S11. Each intermediate module determines the maximum and minimum monitoring data from the monitoring data received from the multiple acquisition modules, calculates the difference between the maximum and minimum monitoring data, and determines whether the difference is greater than a preset standard deviation. If so, the intermediate module directly uses the monitoring data received from the multiple acquisition modules as the pre-sending processing result data; if not, the intermediate module proceeds to the next step. S12. Each intermediate module calculates a reduced data size based on the difference, and represents the monitoring data received from each acquisition module by subtracting the minimum monitoring data from the monitoring data according to the reduced data size; S13. Each intermediate module generates pre-sending processing result data including the number of monitoring data, minimum monitoring data, data size before reduction, data size after reduction, and several calculation results.

3. The method according to claim 2, characterized in that After the intermediate module transmits the pre-sending processing result data to the detection module, when the detection module determines that the pre-sending processing result data includes the reduced monitoring data, a recovery calculation is performed on the pre-sending processing result data.

4. The method according to claim 1, wherein The detection module calculates the crop trust data corresponding to the monitoring time point, including the following steps: S211, the detection module obtains monitoring data of various data types of the collection module at the monitoring time point, and calculates basic crop trust data based on the monitoring data of various data types; S212: The detection module determines the time window in which the monitoring time point is located, calculates the variance of all monitoring data of each data type of the acquisition module within the time window, maps each variance to a value between 0 and 1, and calculates the mean of all variances as the constant rate; S213: The detection module determines adjacent time points of the monitoring time point, calculates the change rate of the monitoring data of the monitoring time point and the monitoring data of the adjacent time points for each data type of the acquisition module, and calculates the mean of the change rates of all the change rates; S214: The detection module determines several other acquisition modules in the same area as the acquisition module, and for each data type, calculates a consistency rate based on all monitoring data of the acquisition module and the several other acquisition modules at the monitoring time point, and calculates the mean consistency rate of all consistency rates; S215. The detection module uses the constant rate, the mean of the change rate, and the mean of the consistency rate to perform reduction processing on the basic crop trust data.

5. The method according to claim 1, wherein The detection module calculates the weather trust data corresponding to the monitoring time point, including the following steps: S221, the detection module determines the fuzzy sets of temperature, precipitation, and wind speed at the monitoring time point, and the fuzzy set of weather trust data, and defines the membership functions of the fuzzy sets of temperature, precipitation, and wind speed, and the fuzzy set of weather trust data; S222, the detection module performs fuzzy reasoning based on Mamdani fuzzy rules and uses the centroid method to perform defuzzification to obtain weather trust data.

6. The method according to claim 1, wherein The detection module calculates the task trust data corresponding to the monitoring time point, including the following steps: S231. Based on the collection task corresponding to the monitoring time point, determine whether all key collection modules have successfully sent monitoring data. If so, determine that the collection task is successful; otherwise, determine that the collection task has failed. S232. When the acquisition module is not a key acquisition module, if the acquisition task is successful, the sum of the historical success count of the acquisition module and the reward weight is calculated as the current success count; if the acquisition task fails, the sum of the historical failure count of the acquisition module and the penalty weight is calculated as the current failure count, where the reward weight is the same as the penalty weight; S233. When the acquisition module is a key acquisition module, if the acquisition task is successful, the sum of the historical success count corresponding to the acquisition module and the reward weight is calculated as the current success count; if the acquisition task fails, the sum of the historical failure count corresponding to the acquisition module and the penalty weight is calculated as the current failure count, where the penalty weight is greater than the reward weight; S234. Divide the current number of successes by the sum of the current number of successes and the current number of failures to obtain task trust data.

7. A farmland wireless sensor anomaly detection system based on an autoencoder, used to implement the method according to any one of claims 1 to 6, characterized in that: Includes the following modules: The acquisition module is used to collect monitoring data and send the monitoring data to the intermediate module; The intermediate module is used to establish communication connections with several acquisition modules of the same data type, and to perform pre-sending processing on the monitoring data received from the several acquisition modules, and transmit the pre-sending processing result data to the detection module; The detection module is used to determine several consecutive monitoring time points for the acquisition module and, for each monitoring time point, calculate the crop trust data, weather trust data, and task trust data corresponding to the monitoring time point. The detection module is also used to generate a trust feature matrix for the acquisition module based on the crop trust data, weather trust data, and task trust data corresponding to the several monitoring time points. The normalized trust feature matrix is ​​input into the autoencoder, and the trust evaluation result of the acquisition module is quantified based on the reconstruction error output by the autoencoder.

Citation Information

Patent Citations

  • Method for establishing trust model of wireless sensor network

    CN112165694A

  • Underwater wireless sensor network trust model based on transfer learning

    CN113891275A

Cited By

  • Drainage pipe network sensor anomaly detection method based on self-adaptive soft measurement strategy

    CN121808648A

  • Anomaly Detection Method for Drainage Pipeline Sensors Based on Adaptive Soft Sensing Strategy

    CN121808648B