Data anomaly detection method for safe production of agricultural fertilizer

By real-time encoding-decoding processing and deep learning analysis of agricultural fertilizer production environment data, the problem that prior art is difficult to capture nonlinear relationships and deep correlations in complex data environments is solved, and the accuracy and sensitivity of data anomaly detection are improved.

CN119830027AInactive Publication Date: 2025-04-15GUIZHOU JUNHE HUANYU ENVIRONMENTAL PROTECTION TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411857032.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is difficult to adapt to data variability when facing highly complex data environments, especially when data patterns change frequently or complex timing dependencies, it cannot accurately reflect nonlinear relationships and deep correlations, resulting in a decrease in the sensitivity and accuracy of abnormal detection.

Method used

By obtaining environmental data at multiple moments in the fertilizer production process in real time, the environmental data at the current moment and historical data are encoded and decoded, and using deep learning-based data analysis and processing algorithms to perform implicit correlation analysis and decoding inference of eigenvalue timing to automatically determine data exceptions.

Benefits of technology

It improves the accuracy and sensitivity of abnormal detection of agricultural fertilizer safety production data, can capture nonlinear relationships and complex patterns in the data, and improves the ability to capture subtle timing-dependent relationships between characteristic values.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830027A_ABST
    Figure CN119830027A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data analysis, and provides a data anomaly detection method for agricultural fertilizer safety production, which comprises the following steps: acquiring environmental data at multiple moments in a fertilizer production process in real time; multiple pieces of environmental data before the current moment are used as historical environmental data, and the environmental data at the current moment are used as environmental data at the current moment; carrying out characteristic value time sequence implicit association, query matching analysis based on a first characteristic value and decoding reasoning on the historical environment data by adopting a data analysis and processing algorithm based on deep learning; therefore, whether data exception exists or not is automatically determined according to comparison between a difference value between the decoding reasoning value of the first feature value representation vector and the first feature value in the environment data at the current moment and a preset threshold value. In this way, the accuracy and sensitivity of agricultural fertilizer safety production data anomaly detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data analysis, and more specifically, to a data anomaly detection method for safe production of agricultural fertilizers. Background Art

[0002] Agricultural fertilizers are key agricultural inputs that provide nutrients for plant growth and improve soil quality and fertility. During the fertilizer production process, workers often operate in a closed environment and may be exposed to a variety of harmful gases, which may pose a threat to their health. Therefore, in order to ensure the safety of workers, continuous monitoring of the agricultural fertilizer production environment must be implemented to detect potential hazards in real time and take corresponding measures.

[0003] Chinese patent CN116975768B proposes a data anomaly detection method for fertilizer production safety, which obtains environmental data at multiple times in the fertilizer production process in real time, compares and analyzes the current data with historical data, obtains the continuity and correlation of characteristic values ​​to evaluate the reliability of the data. It evaluates equipment safety in combination with the equipment maintenance time interval, and comprehensively evaluates the abnormality of the current data, ultimately achieving real-time detection of data anomalies to ensure production safety.

[0004] In the above patent, anomaly detection of current data is performed through statistical methods such as calculating the absolute value of the difference, selecting reference data and calculating the mean. This method performs well when the data environment is relatively stable and the pattern is relatively simple. However, when faced with a highly complex data environment, this statistical method may be difficult to adapt to the variability of the data, especially when the data pattern changes frequently or there are complex time series dependencies. Specifically, this statistical method may not be able to capture the subtle changes and deep associations between these features. For example, when there is a nonlinear relationship between the eigenvalues ​​or the data presents non-stationary characteristics (seasonal changes, the impact of emergencies), this statistical method is difficult to accurately reflect the associations and dynamic changes between these complex patterns, resulting in a decrease in the sensitivity and accuracy of anomaly detection.

[0005] Therefore, an optimized data anomaly detection method for safe production of agricultural fertilizers is desired. Summary of the invention

[0006] In view of the shortcomings of the prior art, the present application provides a data anomaly detection method for the safe production of agricultural fertilizers.

[0007] According to one aspect of the present application, a data anomaly detection method for safe production of agricultural fertilizers is provided, which comprises:

[0008] Real-time acquisition of environmental data at multiple times during the fertilizer production process, wherein the environmental data at each time point includes multiple characteristic values;

[0009] Taking the plurality of environmental data before the current moment as historical environmental data and taking the environmental data at the current moment as the environmental data at the current moment;

[0010] Performing encoding-decoding processing on the historical environmental data to obtain current moment environmental derivation data;

[0011] The encoding-decoding process of the historical environment data to obtain the current environment derivation data includes:

[0012] Performing feature neighborhood query matching encoding based on feature value sample dimension on the historical environmental data to obtain a first feature value global query matching implicit association feature representation;

[0013] Performing decoder-based inference encoding on the first feature value global query matching implicit association feature representation to obtain the current moment environment derivation data;

[0014] Based on the comparison between the current moment environment derivation data and the current moment environment data, it is determined whether there is a data anomaly.

[0015] This application has significant technical effects due to the adoption of the above technical solutions:

[0016] The data anomaly detection method for agricultural fertilizer production safety provided by the present application obtains environmental data at multiple moments in the fertilizer production process in real time, and uses multiple environmental data before the current moment as historical environmental data and the environmental data at the current moment as the environmental data at the current moment, and adopts a data analysis and processing algorithm based on deep learning to perform characteristic value time series implicit association, query matching analysis based on the first characteristic value, and decoding reasoning on the historical environmental data, so as to automatically determine whether there is data anomaly based on the comparison between the difference between the decoding reasoning value of the first characteristic value representation vector and the first characteristic value in the environmental data at the current moment and a preset threshold. In this way, the accuracy and sensitivity of data anomaly detection for agricultural fertilizer production safety can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0018] Figure 1This is a flow chart of a data anomaly detection method for safe production of agricultural fertilizers according to an embodiment of the present application.

[0019] Figure 2 The present invention is a flowchart of encoding and decoding the historical environmental data to obtain the environmental derivation data at the current moment in the data anomaly detection method for safe production of agricultural fertilizers according to an embodiment of the present application.

[0020] Figure 3 In the data anomaly detection method for agricultural fertilizer safety production according to an embodiment of the present application, the historical environmental data is encoded with a feature neighborhood query matching based on the feature value sample dimension to obtain a flowchart of the implicit association feature representation of the first feature value global query matching.

[0021] Figure 4 In the data anomaly detection method for safe production of agricultural fertilizers according to an embodiment of the present application, data regularization is performed on the historical environmental data to obtain multiple historical feature value time series input vectors, and then time series pattern feature extraction is performed to obtain multiple historical feature value time series implicit correlation feature vectors.

[0022] Figure 5 In the data anomaly detection method for safe production of agricultural fertilizers according to an embodiment of the present application, a historical feature value time series implicit association feature vector corresponding to a first feature value among the multiple historical feature value time series implicit association feature vectors is used as a query feature vector and the multiple historical feature value time series implicit association feature vectors are used as a sequence of analog key feature vectors, and a local time series global optimization analysis is performed on the sequence of the query feature vector and the analog key feature vector to obtain a flowchart of the global query matching implicit association feature representation of the first feature value.

[0023] Figure 6 A flowchart for determining whether there is a data anomaly based on a comparison between the current moment environmental derivation data and the current moment environmental data in a data anomaly detection method for safe production of agricultural fertilizers according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.

[0025] Agricultural fertilizers are essential to ensure crop growth and soil fertility. In the production process of agricultural fertilizers, workers often operate in a closed environment, where they may be exposed to a variety of harmful gases, which threatens the health of workers. Therefore, the agricultural fertilizer production environment must be continuously monitored to ensure the safety of workers. Chinese patent CN116975768B proposes a data anomaly detection method for fertilizer production safety, which obtains environmental data at multiple times during fertilizer production, compares the current time with historical data, and analyzes the continuity and correlation of characteristic values ​​to evaluate data reliability. The equipment safety is evaluated by combining the equipment maintenance time interval, and the data anomaly is comprehensively evaluated to detect abnormal data in real time to ensure production safety. The data anomaly detection method in the above patent adopts statistical methods such as calculating the absolute value of the difference, selecting reference data, and calculating the mean. This method works well when the data environment is stable and the pattern is simple, but in a highly complex data environment, it is difficult to adapt to the data because of the variability of the data, especially when the data pattern is constantly changing or has time series dependence. For example, when the eigenvalues ​​have a nonlinear relationship or the data is non-stationary (affected by seasons and emergencies), it is difficult to capture subtle changes and deep associations between features, which will lead to reduced sensitivity and accuracy of anomaly detection.

[0026] In response to the above technical problems, the technical concept of the present application is to obtain environmental data at multiple moments in the fertilizer production process in real time, and use multiple environmental data before the current moment as historical environmental data and the environmental data at the current moment as the environmental data at the current moment, and use a data analysis and processing algorithm based on deep learning to perform implicit association of characteristic value time series, query matching analysis based on the first characteristic value, and decoding reasoning on the historical environmental data, so as to automatically determine whether there is a data anomaly based on the comparison between the difference between the decoding reasoning value of the first characteristic value representation vector and the first characteristic value in the environmental data at the current moment and the preset threshold. In this way, it is possible to capture nonlinear relationships and complex patterns in the data to improve the sensitivity to changes in time series data. At the same time, it is possible to improve the ability to capture subtle time-dependent associations between characteristic values, thereby improving the accuracy of anomaly detection to achieve automation of production data anomaly detection.

[0027] Figure 1 Flow chart of a data anomaly detection method for safe production of agricultural fertilizers according to an embodiment of the present application. Figure 1 As shown, according to the data anomaly detection method for safe production of agricultural fertilizers according to the embodiment of the present application, the method includes: S110, real-time acquisition of environmental data at multiple moments in the fertilizer production process, wherein the environmental data at each moment includes multiple characteristic values; S120, taking multiple environmental data before the current moment as historical environmental data and taking the environmental data at the current moment as the environmental data at the current moment; S130, encoding and decoding the historical environmental data to obtain environmental derivation data at the current moment.

[0028] In step S110, environmental data at multiple moments in the fertilizer production process are acquired in real time, wherein the environmental data at each moment includes multiple characteristic values. During the fertilizer production process, it is necessary to detect various harmful gases and flammable and explosive gases or raw materials in the production process to ensure the safety of workers and equipment during the production process. Specifically, after the workers enter the processing environment, it is necessary to detect various harmful gases in the processing environment. When performing safety anomaly detection, it is necessary to detect the concentration changes of various hazardous chemicals in each production process in real time. The multiple characteristic values ​​contained in the environmental data at each moment in this application specifically refer to the concentrations of multiple hazardous chemicals.

[0029] In step S120, multiple environmental data before the current moment are used as historical environmental data and the environmental data at the current moment are used as the environmental data at the current moment. It should be understood that the historical environmental data provides time series information, which can reflect the changing trend and pattern of the fertilizer production environmental conditions. These data are helpful in deriving the environmental state at the current moment, because many abnormal situations are often caused by the gradual change of environmental conditions. In short, with the support of historical environmental data, it is possible to more accurately judge whether the environmental data at the current time is truly abnormal, thereby improving the accuracy of detection.

[0030] In step S130, the historical environment data is encoded and decoded to obtain the current environment derivation data. Specifically, Figure 2 This is a flowchart of encoding and decoding the historical environmental data to obtain the current environmental derivation data in the data anomaly detection method for agricultural fertilizer safety production according to an embodiment of the present application. Figure 2 As shown, the historical environment data is encoded and decoded to obtain the current environment derivation data, including: S131, the historical environment data is encoded based on the feature value sample dimension of the feature neighborhood query matching to obtain the first feature value global query matching implicit association feature representation; S132, the first feature value global query matching implicit association feature representation is encoded based on the decoder inference to obtain the current environment derivation data; S133, based on the comparison between the current environment derivation data and the current environment data, it is determined whether there is a data anomaly.

[0031] More specifically, Figure 3 The present invention is a flowchart of a method for detecting anomalies in data for safe production of agricultural fertilizers according to an embodiment of the present application, in which the historical environmental data is encoded based on the feature neighborhood query matching of the feature value sample dimension to obtain the first feature value global query matching implicit association feature representation. Figure 3As shown, the historical environment data is subjected to feature neighborhood query matching encoding based on the feature value sample dimension to obtain a first feature value global query matching implicit association feature representation, including: S1311, data regularization is performed on the historical environment data to obtain multiple historical feature value time series input vectors and then time series pattern feature extraction is performed to obtain multiple historical feature value time series implicit association feature vectors; S1312, using the historical feature value time series implicit association feature vector corresponding to the first eigenvalue in the multiple historical feature value time series implicit association feature vectors as the query feature vector and using the multiple historical feature value time series implicit association feature vectors as a sequence of analog key feature vectors, performing local time series global optimization analysis on the query feature vector and the sequence of the analog key feature vectors to obtain the first eigenvalue global query matching implicit association feature representation.

[0032] In step S1311, the historical environment data is regularized to obtain a plurality of historical feature value time series input vectors, and then time series pattern feature extraction is performed to obtain a plurality of historical feature value time series implicit correlation feature vectors. Specifically, Figure 4 This is a flow chart of a method for detecting anomalies in data used for safe production of agricultural fertilizers according to an embodiment of the present application, in which data regularization is performed on the historical environmental data to obtain multiple historical feature value time series input vectors, and then time series pattern feature extraction is performed to obtain multiple historical feature value time series implicit correlation feature vectors. Figure 4 As shown, the historical environmental data is data-warped to obtain a plurality of historical eigenvalue time series input vectors, and then time series pattern feature extraction is performed to obtain a plurality of historical eigenvalue time series implicitly associated feature vectors, including: S13111, data-warping the historical environmental data according to the eigenvalue sample dimension to obtain the plurality of historical eigenvalue time series input vectors; S13112, inputting the plurality of historical eigenvalue time series input vectors into a time series pattern feature extractor based on a Bi-LSTM model to obtain the plurality of historical eigenvalue time series implicitly associated feature vectors.

[0033] It should be understandable that different time points may record different amounts or types of data, and there is continuity and correlation between these data in time. Based on this, in order to better analyze the time series correlation characteristics between each data point in each time point, in the technical solution of the present application, the historical environmental data is regularized according to the characteristic value sample dimension to obtain multiple historical characteristic value time series input vectors, so that the dynamic characteristics in the time series, such as trends, periodicity and sudden changes, can be better captured in the subsequent processing process.

[0034] Accordingly, considering that there are implicit associations and mutual dependencies between each eigenvalue at each time point, the Bi-LSTM model can effectively capture the long-term and short-term dependencies in the input sequence data by processing the input sequence data from both the forward and backward directions. Based on this, in the technical solution of the present application, the multiple historical eigenvalue time series input vectors are input into a time series pattern feature extractor based on the Bi-LSTM model to capture and mine the time series implicit associations between the various eigenvalues, and obtain multiple historical eigenvalue time series implicit association feature vectors.

[0035] In step S1312, the historical feature value time series implicit association feature vector corresponding to the first feature value in the multiple historical feature value time series implicit association feature vectors is used as the query feature vector and the multiple historical feature value time series implicit association feature vectors are used as the sequence of analog key feature vectors, and the query feature vector and the sequence of analog key feature vectors are subjected to local time series global optimization analysis to obtain the first feature value global query matching implicit association feature representation. It should be understood that, considering that the multiple historical feature value time series implicit association feature vectors express the implicit association information of each feature value in the historical environmental data at different time points in the time dimension. In the safe production of agricultural fertilizers, the first feature value may be the most critical or representative feature, which can reflect the main changes in the overall environmental state or production process. Therefore, in order to capture and characterize the influence of features in key indicators more concentratedly, in the technical solution of the present application, the historical feature value time series implicit association feature vector corresponding to the first eigenvalue among the multiple historical feature value time series implicit association feature vectors is used as the query feature vector and the multiple historical feature value time series implicit association feature vectors are used as a sequence of pseudo-key feature vectors, and a historical feature value time series global query matching analysis is performed on the query feature vector and the sequence of pseudo-key feature vectors to obtain the first eigenvalue global query matching implicit association representation vector as the first eigenvalue global query matching implicit association feature representation.

[0036] In detail, first, the multiple historical feature value temporal implicit association feature vectors are subjected to one-dimensional convolution encoding to capture local features in the time dimension to obtain a sequence of historical feature value temporal local neighborhood semantic association feature vectors. That is, through the convolution operation, the local patterns of the feature values ​​in the time series can be extracted, and these local patterns are very important for understanding the short-term relationship between the feature values. The size of the convolution kernel is set to an integer multiple of the length of the historical feature value temporal local neighborhood semantic association feature vector, which can ensure that the convolution kernel can capture meaningful patterns with a certain time length, so as to better capture the semantic correlation between these local neighborhoods. Then, the historical feature value temporal implicit association feature vector (query feature) corresponding to the first feature value is processed using the value embedding coding matrix to obtain the historical feature value temporal value feature vector. That is, the original query feature is mapped to a higher dimensional space to better represent the complex relationship and interdependence between the features, so that in the subsequent attention mechanism, the ability to represent the query feature is improved and the interaction with other features is strengthened. Subsequently, the processed query vector, value vector, and key vector are input into a multi-head attention query module based on a converter structure to obtain a sequence of feature value temporal key granularity query matching implicit vectors and a sequence of feature value temporal key neighborhood granularity query matching implicit vectors, respectively. In other words, the multi-head attention query module can focus on different aspects of the features. This can capture the multifaceted and complex relationships between features, thereby improving the ability of feature representation. It should be understood that the first multi-head attention query module generates a sequence of feature value temporal key granularity query matching implicit vectors, focusing on the characteristics of the key vector itself; while the second multi-head attention query module generates a sequence of feature value temporal key neighborhood granularity query matching implicit vectors, focusing on the characteristics of the key vector and its neighborhood, thereby comprehensively considering local and global information and improving the accuracy of query matching. Then, the mean vector of the sequence of implicit vectors of eigenvalue time-series key granularity query matching and the sequence of implicit vectors of eigenvalue time-series key neighborhood granularity query matching is calculated to comprehensively and comprehensively characterize the global features of different granularities to obtain the eigenvalue time-series key granularity query matching feature vector and the eigenvalue time-series key neighborhood granularity query matching feature vector. Finally, the features of the two different granularities are fused to obtain the first eigenvalue global query matching implicit association representation vector, so as to comprehensively reflect the multi-faceted interactive relationship between the vector corresponding to the first eigenvalue and the key vector.

[0037] Specifically, Figure 5In the data anomaly detection method for agricultural fertilizer safety production according to the embodiment of the present application, the historical feature value time series implicit association feature vector corresponding to the first feature value in the multiple historical feature value time series implicit association feature vectors is used as the query feature vector and the multiple historical feature value time series implicit association feature vectors are used as the sequence of the key feature vectors, and the query feature vector and the sequence of the key feature vectors are subjected to local time series global optimization analysis to obtain the flowchart of the first feature value global query matching implicit association feature representation. Figure 5 As shown, the historical feature value time series implicit association feature vector corresponding to the first feature value in the multiple historical feature value time series implicit association feature vectors is used as the query feature vector and the multiple historical feature value time series implicit association feature vectors are used as a sequence of analog key feature vectors, and the query feature vector and the sequence of analog key feature vectors are subjected to local time series global optimization analysis to obtain the first feature value global query matching implicit association feature representation, including: S13121, one-dimensional convolution encoding is performed on the multiple historical feature value time series implicit association feature vectors to obtain a sequence of historical feature value time series local neighborhood semantic association feature vectors, wherein the scale of the one-dimensional convolution encoding is equal to the historical feature value time series local neighborhood semantic association feature vectors. An integer multiple of the length of the historical feature value time series implicit association feature vector; S13122, embedding the historical feature value time series implicit association feature vector corresponding to the first feature value to obtain the historical feature value time series value feature vector; S13123, respectively using the sequence of the multiple historical feature value time series implicit association feature vectors and the sequence of the historical feature value time series local neighborhood semantic association feature vectors as the sequence of key vectors, and using the historical feature value time series value feature vector as the value vector, performing local neighborhood implicit optimization and attention-based gating processing on the sequence of the query vector, the value vector and the key vector to obtain the first feature value global query matching implicit association feature representation.

[0038] More specifically, in an embodiment of the present application, the historical eigenvalue time series implicitly associated feature vector corresponding to the first eigenvalue is embedded and encoded to obtain a historical eigenvalue time series value feature vector, including: using a value embedding coding matrix to process the historical eigenvalue time series implicitly associated feature vector corresponding to the first eigenvalue to obtain the historical eigenvalue time series value feature vector.

[0039] In an embodiment of the present application, specifically, a value embedding coding matrix is ​​used to process the historical eigenvalue time series implicitly associated eigenvalue vector corresponding to the first eigenvalue to obtain the historical eigenvalue time series value eigenvalue, including: matrix multiplying the historical eigenvalue time series implicitly associated eigenvalue vector corresponding to the first eigenvalue with the value embedding coding matrix, and then adding the obtained historical eigenvalue time series embedding vector and the value bias vector by position to obtain the historical eigenvalue time series value eigenvalue.

[0040] More specifically, in an embodiment of the present application, the sequence of the multiple historical feature value temporal implicit association feature vectors and the sequence of the historical feature value temporal local neighborhood semantic association feature vectors are respectively used as a sequence of key vectors, and the historical feature value temporal value feature vector is used as a value vector, and the sequence of the query vector, the value vector and the key vector are subjected to local neighborhood implicit optimization and attention-based gating processing to obtain the first feature value global query matching implicit association feature representation, including: using the historical feature value temporal implicit association feature vector corresponding to the first feature value as the query vector, the historical feature value temporal value feature vector as the value vector and the multiple historical feature value temporal implicit association feature vectors as the sequence of key vectors, inputting the sequence of the query vector, the value vector and the key vector into a first multi-head attention query module based on a converter structure to obtain a sequence of feature value temporal key granularity query matching implicit vectors; using the historical feature value temporal value feature vector corresponding to the first feature value as the query vector, the historical feature value temporal value feature vector as the value vector and the multiple historical feature value temporal implicit association feature vectors as the sequence of key vectors; The historical eigenvalue temporal implicit association feature vector is used as the query vector, the historical eigenvalue temporal value feature vector is used as the value vector and the sequence of the historical eigenvalue temporal local neighborhood semantic association feature vector is used as the sequence of key vectors, and the query vector, the value vector and the sequence of the key vector are input into the second multi-head attention query module based on the converter structure to obtain the sequence of eigenvalue temporal key neighborhood granularity query matching implicit vectors; the positional mean vector of the sequence of the eigenvalue temporal key granularity query matching implicit vectors and the sequence of the eigenvalue temporal key neighborhood granularity query matching implicit vectors are calculated to obtain the eigenvalue temporal key granularity query matching feature vector and the eigenvalue temporal key neighborhood granularity query matching feature vector; the eigenvalue temporal key granularity query matching feature vector and the eigenvalue temporal key neighborhood granularity query matching feature vector are fused to obtain the first eigenvalue global query matching implicit association representation vector as the first eigenvalue global query matching implicit association feature representation.

[0041] More specifically, in an embodiment of the present application, the historical feature value time series implicit association feature vector corresponding to the first feature value is used as a query vector, the historical feature value time series value feature vector is used as a value vector, and the plurality of historical feature value time series implicit association feature vectors are used as a sequence of key vectors, and the sequence of the query vector, the value vector, and the key vector is input into a first multi-head attention query module based on a converter structure to obtain a sequence of feature value time series key granularity query matching implicit vectors, including: calculating the transposed vector of the historical feature value time series implicit association feature vector corresponding to the first feature value and the historical feature value time series implicit association feature vector After obtaining the historical query-eigenvalue time series implicit association matrix by multiplying the product between them, the historical query-eigenvalue time series implicit association matrix and the square root of the length of the historical eigenvalue time series implicit association feature vector are divided by position to obtain the historical query-eigenvalue time series implicit association modulation matrix; the historical query-eigenvalue time series implicit association modulation matrix is ​​input into the softmax function to obtain the historical query-eigenvalue time series implicit association activation matrix; the historical query-eigenvalue time series implicit association activation matrix is ​​multiplied by the historical eigenvalue time series value eigenvector to obtain the eigenvalue time series key granularity query matching implicit vector.

[0042] More specifically, in an embodiment of the present application, the eigenvalue temporal key granularity query matching feature vector and the eigenvalue temporal key neighborhood granularity query matching feature vector are fused to obtain a first eigenvalue global query matching implicit association representation vector, including: respectively calculating the positional subtraction, positional dot multiplication and positional addition between the eigenvalue temporal key granularity query matching feature vector and the eigenvalue temporal key neighborhood granularity query matching feature vector to obtain the eigenvalue temporal key granularity-key neighborhood granularity difference vector, the eigenvalue temporal key granularity-key neighborhood granularity dot product vector and the eigenvalue temporal key granularity-key neighborhood granularity Neighborhood granularity sum vector; cascade the eigenvalue time key granularity-key neighborhood granularity difference vector, the eigenvalue time key granularity-key neighborhood granularity dot product vector and the eigenvalue time key granularity-key neighborhood granularity sum vector to obtain a eigenvalue time key granularity-key neighborhood granularity cascade vector; after performing one-dimensional convolution encoding on the eigenvalue time key granularity-key neighborhood granularity cascade vector, perform local window-based maximum pooling processing on the obtained eigenvalue time key granularity-key neighborhood granularity convolution encoding vector to obtain the first eigenvalue global query matching implicit association representation vector.

[0043] In an embodiment of the present application, specifically, using the historical feature value time series implicit association feature vector corresponding to the first feature value among the multiple historical feature value time series implicit association feature vectors as the query feature vector and using the multiple historical feature value time series implicit association feature vectors as a sequence of quasi-key feature vectors, performing local time series global optimization analysis on the query feature vector and the sequence of the quasi-key feature vectors to obtain the first feature value global query matching implicit association feature representation, including: performing historical feature value time series global query matching analysis on the query feature vector and the sequence of the quasi-key feature vector using the following formula, wherein the formula is expressed as:

[0044] K={k1,k2,...,k i ,...,k n}

[0045] K′=Conv 1×l ({k1,k2,...,k i ,...,k n})

[0046] K′={k1′,k2′,...,k i ′,...,k m ′}

[0047] v v =v q W q +b q

[0048]

[0049]

[0050] Wherein, K represents the implicit correlation feature vector of the multiple historical feature value time series, k1, k2, ..., k i ,...,k n is the first, second, ..., i-th, ..., n-th historical eigenvalue time series implicit association feature vector among the plurality of historical eigenvalue time series implicit association feature vectors, n is the number of feature vectors in the plurality of historical eigenvalue time series implicit association feature vectors, Conv 1×l (·) is a one-dimensional convolutional code, l is an integer multiple of the length of the implicit association feature vector of the historical feature value time series, K′ is a sequence of the local neighborhood semantic association feature vectors of the historical feature value time series, k1′, k2′, ..., k i ′,...,k m′ The first, second, ..., i-th, ..., m-th historical feature value temporal local neighborhood semantic association feature vectors in the sequence of the historical feature value temporal local neighborhood semantic association feature vectors, where m is the number of feature vectors in the sequence of the historical feature value temporal local neighborhood semantic association feature vectors, v q is the implicitly associated eigenvector of the historical eigenvalue time series corresponding to the first eigenvalue, W q is the value embedding encoding matrix, b q is the value bias vector, v v is the time series value feature vector of the historical feature value, k i T and k i ' T k i and k i ′, d1 and d2 are the lengths of the implicit association feature vector of the historical feature value time series and the semantic association feature vector of the local neighborhood of the historical feature value time series, softmax(·) is the softmax function, v ki is the i-th eigenvalue time-series key granularity query matching implicit vector in the sequence of the eigenvalue time-series key granularity query matching implicit vector, v ni is the ith eigenvalue temporal key neighborhood granularity query matching implicit vector in the sequence of the eigenvalue temporal key neighborhood granularity query matching implicit vector, v k is the feature value time series key granularity query matching feature vector, v n is the feature value time series key neighborhood granularity query matching feature vector, ⊙ and are position-wise subtraction, position-wise multiplication, and position-wise addition, respectively. [·,·,·] is a cascade process. conv1D(·) is a one-dimensional convolutional encoding operation. MaxPool(·) is a maximum pooling operation. p It is the first feature value global query matching implicit association representation vector.

[0051] In step S132, the first feature value global query matching implicit association feature representation is subjected to decoder-based inference encoding to obtain the current moment environment derivation data. Specifically, in an embodiment of the present application, the first feature value global query matching implicit association feature representation is subjected to decoder-based inference encoding to obtain the current moment environment derivation data, including: inputting the first feature value global query matching implicit association representation vector into a decoder-based inference module to obtain the decoded inference value of the first feature value as the current moment environment derivation data. It should be understood that the first feature value global query matching implicit association representation vector contains the environment time series change pattern and implicit association information. In order to derive the current moment environment data based on the implicit information in the vector, it needs to be input into the decoder. The decoder uses a deconvolution layer to perform deconvolution decoding on the first feature value global query matching implicit association representation vector, and then decodes to obtain a decoding result for representing the current moment environment derivation data.

[0052] In step S133, based on the comparison between the current moment environment derivation data and the current moment environment data, it is determined whether there is a data anomaly. Specifically, Figure 6 A flowchart of determining whether there is a data anomaly based on the comparison between the current moment environmental derivation data and the current moment environmental data in the data anomaly detection method for agricultural fertilizer safety production according to an embodiment of the present application. Figure 6 As shown, based on the comparison between the current moment environmental derivation data and the current moment environmental data, determining whether there is a data anomaly includes: S1331, subtracting the decoded inference value of the first eigenvalue from the first eigenvalue in the current moment environmental data to obtain the first eigenvalue outlier degree value; S1332, determining whether there is a data anomaly based on the comparison between the first eigenvalue outlier degree value and the preset threshold. That is, the first eigenvalue global query matching implicit association feature representation obtained by performing local neighborhood query matching using the multiple historical eigenvalue temporal implicit association feature vectors is decoded and processed, so as to automatically determine whether there is a data anomaly based on the comparison between the difference between the decoded inference of the first eigenvalue and the first eigenvalue in the current moment environmental data and the preset threshold. In this way, nonlinear relationships and complex patterns in the data can be captured to improve the sensitivity to changes in time series data. At the same time, the ability to capture subtle time series dependent association relationships between eigenvalues ​​can be improved, thereby improving the accuracy of anomaly detection to achieve automation of production data anomaly detection.

[0053] In particular, considering that each of the multiple historical feature value temporal implicit association feature vectors represents the long-range-short-range bidirectional temporal association features of each feature value in the environmental data, respectively. When the historical feature value temporal implicit association feature vector corresponding to the first feature value in the multiple historical feature value temporal implicit association feature vectors is used as the query feature vector and the multiple historical feature value temporal implicit association feature vectors are used as the sequence of the imitation key feature vectors, and the query feature vector and the sequence of the imitation key feature vectors are input into the attention gated query network based on 1D convolution local neighborhood implicit optimization, considering that there are differences in the association weights between each imitation key feature vector in the sequence of the imitation key feature vector, there are also differences in the association weights between the query feature vector and each imitation key feature vector in the sequence of the imitation key feature vector, so that the first feature value global query matching implicit association representation vector will also have a feature distribution space structure difference based on the difference in local interaction weights, affecting the convergence consistency of the decoder, thereby affecting the accuracy of the decoded inference value of the first feature value obtained by the inference module based on the decoder.

[0054] Preferably, inputting the first feature value global query matching implicit association representation vector into the decoder-based reasoning module to obtain a decoded reasoning value of the first feature value comprises:

[0055] The absolute value sum and the square root of the square sum of all eigenvalues ​​of the first eigenvalue global query matching implicit association representation vector are calculated to obtain the first eigenvalue global query matching implicit association spatial structure value and the second eigenvalue global query matching implicit association spatial structure value, that is:

[0056] w1=∑ i |v i |

[0057]

[0058] Among them, v i represents the i-th eigenvalue of the implicit association representation vector matched by the global query of the first eigenvalue, w1 represents the implicit association spatial structure value matched by the global query of the first eigenvalue, and w2 represents the implicit association spatial structure value matched by the global query of the second eigenvalue;

[0059] Determine the number of eigenvalues ​​L of all eigenvalues ​​of the first eigenvalue global domain query matching implicit association representation vector, that is, the length of the first eigenvalue global domain query matching implicit association representation vector;

[0060] For each eigenvalue of the first eigenvalue global query matching implicit association representation vector, the first eigenvalue global query matching implicit association spatial structure value minus the product of the eigenvalue and the number of eigenvalues ​​is calculated to obtain the first eigenvalue global query matching implicit association long-range dependency value x i =w1-v i ×L, where w1 represents the first eigenvalue global query matching implicit association space structure value, v i represents the i-th eigenvalue of the implicit association representation vector matched by the first eigenvalue global query, L represents the number of eigenvalues ​​of all eigenvalues ​​of the implicit association representation vector matched by the first eigenvalue global query, x i Indicates that the first eigenvalue global query matches the implicitly associated long-range dependency value;

[0061] Calculate the product of the square root of the number of eigenvalues ​​multiplied by the eigenvalue minus the second eigenvalue global query matching implicit association spatial structure value to obtain the second eigenvalue global query matching implicit association long-range dependency value Among them, w2 represents the second eigenvalue global query matching implicit association space structure value, v i represents the i-th eigenvalue of the implicit association representation vector matched by the first eigenvalue global query, L represents the number of eigenvalues ​​of all eigenvalues ​​of the implicit association representation vector matched by the first eigenvalue global query, y i Indicates that the second eigenvalue global query matches the implicitly associated long-range dependency value;

[0062] The first eigenvalue global query matching implicit association long-range dependency value is used as the exponent of the natural constant to calculate the exponent value and the reciprocal of the second eigenvalue global query matching implicit association long-range dependency value to perform weighted summation to obtain the optimized eigenvalue corresponding to each eigenvalue Among them, x i Indicates the first eigenvalue global query matching implicit association long-range dependency value, y i represents the second eigenvalue, the global query matches the implicit association long-range dependency value, e represents a natural constant, α and β represent weighted hyperparameters, and f′ i Indicates the optimized eigenvalue corresponding to each eigenvalue;

[0063] The optimized eigenvalues ​​are combined into an optimized first eigenvalue global query matching implicit association representation vector, and the optimized first eigenvalue global query matching implicit association representation vector is input into the decoder-based reasoning module to obtain a decoded reasoning value of the first eigenvalue.

[0064] That is, in view of the possible spatial structure loss in the high-dimensional space of the feature set of the first feature value global query matching implicit association representation vector, which causes the weight of the decoder to implicitly infer spatial structure information based on the feature, resulting in inconsistent convergence, a long-distance feature dependency relationship is established based on the overall feature scale of the first feature value global query matching implicit association representation vector relative to the spatial structure representation of the first feature value global query matching implicit association representation vector, so as to establish the feature local connectivity of the first feature value global query matching implicit association representation vector, and to capture the spatial ambiguity information of the object feature value through the unstructured feature value point prediction of the first feature value global query matching implicit association representation vector, thereby improving the spatial inductive bias perception ability of the feature set of the first feature value global query matching implicit association representation vector, improving the convergence consistency of the decoder, and improving the accuracy of the decoded inference value of the first feature value obtained by the first feature value global query matching implicit association representation vector through the decoder-based inference module. In this way, nonlinear relationships and complex patterns in the data can be captured to improve the sensitivity to changes in time series data. At the same time, it can improve the ability to capture subtle temporal dependencies between feature values, thereby improving the accuracy of anomaly detection and realizing the automation of production data anomaly detection.

[0065] In summary, the data anomaly detection method for agricultural fertilizer production safety based on the embodiment of the present application is explained, which obtains environmental data at multiple moments in the fertilizer production process in real time, and uses multiple environmental data before the current moment as historical environmental data and the environmental data at the current moment as the environmental data at the current moment, and uses a data analysis and processing algorithm based on deep learning to perform characteristic value time series implicit association, query matching analysis based on the first characteristic value, and decoding reasoning on the historical environmental data, so as to automatically determine whether there is a data anomaly based on the comparison between the difference between the decoding reasoning value of the first characteristic value representation vector and the first characteristic value in the environmental data at the current moment and the preset threshold. In this way, the accuracy and sensitivity of data anomaly detection for agricultural fertilizer production safety can be improved.

[0066] The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present application. In addition, the specific details of the above application are only for the purpose of illustration and ease of understanding, rather than limitation, and the above details do not limit the present application to the use of the above specific details to be implemented.

Claims

1. A data anomaly detection method for agricultural fertilizer safety production, characterized in that: include: Real-time acquisition of environmental data at multiple times during the fertilizer production process, wherein the environmental data at each time point includes multiple characteristic values; Taking the plurality of environmental data before the current moment as historical environmental data and taking the environmental data at the current moment as the environmental data at the current moment; Performing encoding-decoding processing on the historical environmental data to obtain current moment environmental derivation data; The encoding-decoding process of the historical environment data to obtain the environment derivation data at the current moment includes: Performing feature neighborhood query matching encoding based on feature value sample dimension on the historical environmental data to obtain a first feature value global query matching implicit association feature representation; Performing decoder-based inference encoding on the first feature value global query matching implicit association feature representation to obtain the current moment environment derivation data; Based on the comparison between the current moment environment derivation data and the current moment environment data, it is determined whether there is a data anomaly.

2. The data anomaly detection method for agricultural fertilizer safety production according to claim 1, characterized in that: Performing feature neighborhood query matching encoding based on feature value sample dimension on the historical environmental data to obtain a first feature value global query matching implicit association feature representation, including: Performing data regularization on the historical environmental data to obtain a plurality of historical characteristic value time series input vectors, and then extracting time series pattern features to obtain a plurality of historical characteristic value time series implicit correlation feature vectors; Taking the historical feature value time series implicit association feature vector corresponding to the first feature value among the multiple historical feature value time series implicit association feature vectors as the query feature vector and taking the multiple historical feature value time series implicit association feature vectors as the sequence of quasi-key feature vectors, local time series global optimization analysis is performed on the query feature vector and the sequence of quasi-key feature vectors to obtain the first feature value global query matching implicit association feature representation.

3. The data anomaly detection method for agricultural fertilizer safety production according to claim 2 is characterized in that: The historical environmental data is subjected to data regularization to obtain a plurality of historical characteristic value time series input vectors, and then time series pattern feature extraction is performed to obtain a plurality of historical characteristic value time series implicit correlation feature vectors, including: Regularizing the historical environmental data according to the characteristic value sample dimension to obtain the multiple historical characteristic value time series input vectors; The multiple historical feature value time series input vectors are input into a time series pattern feature extractor based on a Bi-LSTM model to obtain the multiple historical feature value time series implicit correlation feature vectors.

4. The data anomaly detection method for agricultural fertilizer safety production according to claim 3 is characterized in that: Taking the historical feature value time series implicit association feature vector corresponding to the first feature value among the multiple historical feature value time series implicit association feature vectors as the query feature vector and taking the multiple historical feature value time series implicit association feature vectors as a sequence of quasi-key feature vectors, performing local time series global optimization analysis on the query feature vector and the sequence of quasi-key feature vectors to obtain the first feature value global query matching implicit association feature representation, including: Performing one-dimensional convolution coding on the multiple historical feature value temporal implicit association feature vectors to obtain a sequence of historical feature value temporal local neighborhood semantic association feature vectors, wherein the scale of the one-dimensional convolution coding is equal to an integer multiple of the length of the historical feature value temporal implicit association feature vector; Embedding the historical eigenvalue time series implicitly associated eigenvalue vector corresponding to the first eigenvalue to obtain the historical eigenvalue time series value eigenvalue; The sequence of the multiple historical feature value time series implicit association feature vectors and the sequence of the historical feature value time series local neighborhood semantic association feature vectors are respectively used as the sequence of key vectors, and the historical feature value time series value feature vector is used as the value vector, and the sequence of the query vector, the value vector and the key vector are subjected to local neighborhood implicit optimization and attention-based gating processing to obtain the first feature value global query matching implicit association feature representation.

5. The data anomaly detection method for agricultural fertilizer safety production according to claim 4, characterized in that: The historical eigenvalue time series implicitly associated eigenvalue vector corresponding to the first eigenvalue is embedded and encoded to obtain the historical eigenvalue time series value eigenvalue, including: using a value embedding coding matrix to process the historical eigenvalue time series implicitly associated eigenvalue vector corresponding to the first eigenvalue to obtain the historical eigenvalue time series value eigenvalue.

6. The data anomaly detection method for agricultural fertilizer safety production according to claim 5, characterized in that: Using the multiple historical feature value time series implicit association feature vectors and the sequence of the historical feature value time series local neighborhood semantic association feature vectors as the sequence of key vectors, and using the historical feature value time series value feature vector as the value vector, performing local neighborhood implicit optimization and attention-based gating processing on the sequence of the query vector, the value vector and the key vector to obtain the first feature value global query matching implicit association feature representation, including: Taking the historical feature value time series implicitly associated feature vector corresponding to the first feature value as a query vector, the historical feature value time series value feature vector as a value vector and the plurality of historical feature value time series implicitly associated feature vectors as a sequence of key vectors, inputting the sequence of the query vector, the value vector and the key vector into a first multi-head attention query module based on a converter structure to obtain a sequence of feature value time series key granularity query matching implicit vectors; Taking the historical feature value time series implicit association feature vector corresponding to the first feature value as the query vector, the historical feature value time series value feature vector as the value vector and the sequence of the historical feature value time series local neighborhood semantic association feature vector as the sequence of key vectors, the query vector, the value vector and the sequence of the key vector are input into a second multi-head attention query module based on a converter structure to obtain a sequence of feature value time series key neighborhood granularity query matching implicit vectors; Calculating the positional mean vector of the sequence of the eigenvalue time series key granularity query matching implicit vectors and the sequence of the eigenvalue time series key neighborhood granularity query matching implicit vectors to obtain the eigenvalue time series key granularity query matching feature vector and the eigenvalue time series key neighborhood granularity query matching feature vector; The eigenvalue temporal key granularity query matching feature vector and the eigenvalue temporal key neighborhood granularity query matching feature vector are fused to obtain a first eigenvalue global query matching implicit association representation vector as the first eigenvalue global query matching implicit association feature representation.

7. The data anomaly detection method for agricultural fertilizer safety production according to claim 6, characterized in that: Taking the historical feature value time series implicit association feature vector corresponding to the first feature value as a query vector, the historical feature value time series value feature vector as a value vector and the plurality of historical feature value time series implicit association feature vectors as a sequence of key vectors, inputting the sequence of the query vector, the value vector and the key vector into a first multi-head attention query module based on a converter structure to obtain a sequence of feature value time series key granularity query matching implicit vectors, including: After calculating the product between the historical eigenvalue time series implicit association feature vector corresponding to the first eigenvalue and the transposed vector of the historical eigenvalue time series implicit association feature vector to obtain a historical query-eigenvalue time series implicit association matrix, the historical query-eigenvalue time series implicit association matrix is ​​divided by the square root of the length of the historical eigenvalue time series implicit association feature vector by position to obtain a historical query-eigenvalue time series implicit association modulation matrix; Inputting the historical query-eigenvalue temporal implicit association modulation matrix into a softmax function to obtain a historical query-eigenvalue temporal implicit association activation matrix; The historical query-eigenvalue temporal implicit association activation matrix is ​​multiplied by the historical eigenvalue temporal value eigenvector to obtain the eigenvalue temporal key granularity query matching implicit vector.

8. The data anomaly detection method for agricultural fertilizer safety production according to claim 7, characterized in that: The eigenvalue temporal key granularity query matching eigenvalue vector and the eigenvalue temporal key neighborhood granularity query matching eigenvalue vector are merged to obtain a first eigenvalue global query matching implicit association representation vector, including: Respectively calculating the positional subtraction, positional dot multiplication and positional addition between the eigenvalue time series key granularity query matching eigenvalue vector and the eigenvalue time series key neighborhood granularity query matching eigenvalue vector to obtain an eigenvalue time series key granularity-key neighborhood granularity difference vector, an eigenvalue time series key granularity-key neighborhood granularity dot product vector and an eigenvalue time series key granularity-key neighborhood granularity sum vector; Cascade processing is performed on the eigenvalue time series key granularity-key neighborhood granularity difference vector, the eigenvalue time series key granularity-key neighborhood granularity dot product vector and the eigenvalue time series key granularity-key neighborhood granularity sum vector to obtain an eigenvalue time series key granularity-key neighborhood granularity cascade vector; After performing one-dimensional convolution encoding on the eigenvalue time series key granularity-key neighborhood granularity cascade vector, the obtained eigenvalue time series key granularity-key neighborhood granularity convolution encoding vector is subjected to local window-based maximum pooling processing to obtain the first eigenvalue global query matching implicit association representation vector.

9. The data anomaly detection method for agricultural fertilizer safety production according to claim 8, characterized in that: The first feature value global query matching implicit association feature representation is subjected to decoder-based inference encoding to obtain the current moment environment derivation data, including: inputting the first feature value global query matching implicit association representation vector into a decoder-based inference module to obtain a decoded inference value of the first feature value as the current moment environment derivation data.

10. The data anomaly detection method for agricultural fertilizer safety production according to claim 9, characterized in that: Determining whether there is a data anomaly based on a comparison between the current moment environment derivation data and the current moment environment data includes: Subtracting the decoded inference value of the first eigenvalue from the first eigenvalue in the current moment environmental data to obtain an outlier degree value of the first eigenvalue; Based on the comparison between the outlier degree value of the first characteristic value and a preset threshold, it is determined whether there is data anomaly.

Citation Information

Patent Citations

  • A method for detecting data anomalies in fertilizer safety production

    CN116975768B

  • Direct current brushless motor driving method

    CN119324645A

  • Production defect identification method and system for metal rubber composite plate

    CN119355118A

  • Regional scale-based soil heavy metal ecological damage identification and evaluation method and system

    CN119378558A

  • Production command case-oriented interactive deduction method and system

    CN120163059A