Time sequence anomaly detection method, device and equipment based on KAN network and medium

By adopting a KAN network-based method in time series anomaly detection, combining self-attention mechanism and coding noise generation, the problem of inaccurate detection results in traditional methods in multi-dimensional data is solved, and more efficient and flexible abnormality detection is achieved.

CN120067999AActive Publication Date: 2025-05-30SHIJIAZHUANG TIEDAO UNIV +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510525772.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-05-30
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

The traditional time series anomaly detection method is not accurate enough in multi-dimensional data, making it difficult to adapt to the dynamic changes of data in complex environments.

Method used

Using a KAN network-based method, the spatiotemporal characteristics of time series data are extracted through trigonometric function encoding and convolution activation coding, position encoding is generated in combination with the self-attention mechanism, and encoding noise is generated through the KAN network, and input it into a pre-constructed anomaly detection model for detection.

Benefits of technology

It improves the adaptability and flexibility of abnormal detection of time series data, enhances the nonlinear processing capability of the abnormal detection model, and thus improves the detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067999A_ABST
    Figure CN120067999A_ABST
Patent Text Reader

Abstract

The invention provides a time sequence anomaly detection method and device based on a KAN network, equipment and a medium, and relates to the technical field of data anomaly detection. Comprising the following steps: obtaining first time series data based on multi-dimensional soil parameters, and encoding the first time series data to obtain a first position code and a spatial-temporal feature code of the first time series data; performing weighted summation on the first position code and the spatial-temporal feature code based on a self-attention mechanism to obtain a second position code of the first time sequence data, and obtaining second time sequence data based on the first time sequence data and the second position code; performing noise generation processing on the second time sequence data based on the KAN network to generate coding noise of the second time sequence data; and inputting the coding noise of the second time sequence data into a pre-constructed anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameters. According to the invention, the adaptability, flexibility and detection precision of time series data anomaly detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data anomaly detection, and in particular to a method, device, equipment and medium for time series anomaly detection based on a KAN network. Background Art

[0002] In the current era of rapid digital development, time series data has been widely used in the field of soil information monitoring. Time series data plays a crucial role in soil information monitoring. Through time series data, the dynamic changes of key indicators such as soil humidity, soil salinity, soil temperature, and soil nutrient content can be obtained. Therefore, time series data can provide continuous and rich data support for soil research and management. Through time series data, the dynamic change process of the soil can be reflected, historical comparative analysis can be provided, and the construction and prediction of soil models can be supported.

[0003] Soil information can be obtained by combining remote sensing technology and ground sensors. Remote sensing technology has the advantages of a wide monitoring range, strong information continuity, and high information processing efficiency. It can quickly and widely obtain surface information and provide high-precision and multi-temporal data support for the monitoring of soil parameters. The application of remote sensing technology in soil monitoring is mainly reflected in the following aspects. The first aspect is soil humidity monitoring: Remote sensing technology can obtain soil humidity information through various sensors. The second aspect is soil quality assessment: Remote sensing technology can use high-resolution satellite images and spectral data to evaluate soil quality. The third aspect is soil erosion monitoring: Remote sensing technology can monitor the spectral information of the soil to achieve the monitoring of soil erosion. The fourth aspect is soil pollution monitoring: Remote sensing technology also has important applications in soil pollution monitoring. The fifth aspect is soil type identification: Remote sensing technology can use multi-spectral and hyperspectral images to identify soil types.

[0004] However, in practical applications, various abnormal situations may occur during the monitoring of time series data. The reasons for these anomalies are relatively complex. Equipment failures, human errors, external interferences, market emergencies, etc. can all cause time series data to be abnormal, and the occurrence of abnormal situations often has a serious impact on the construction and use of soil monitoring models, the normal operation of soil information monitoring systems, and the smooth development of soil information monitoring services. Therefore, the research on time series anomaly detection methods is very important.

[0005] However, the time dependence of time series data is not static, but will dynamically evolve with the complex environment. Traditional methods for anomaly detection of time series lack flexibility and are difficult to adapt to this change. Summary of the Invention

[0006] An embodiment of the present invention provides a method, apparatus, device, and medium for time series anomaly detection based on a KAN network, to solve the problem that the detection results are not accurate enough when traditional methods for anomaly detection of time series are used for anomaly detection of multi-dimensional time series data.

[0007] In a first aspect, an embodiment of the present invention provides a method for time series anomaly detection based on a KAN network, including: Obtaining first time series data based on multi-dimensional soil parameters, and respectively performing trigonometric function encoding and convolutional activation encoding on the first time series data to obtain the first position encoding and spatio-temporal feature encoding of the first time series data; Performing weighted summation on the first position encoding and the spatio-temporal feature encoding based on the self-attention mechanism to obtain the second position encoding of the first time series data, and obtaining second time series data based on the first time series data and the second position encoding; Performing noise generation processing on the second time series data based on the KAN network to generate the encoding noise of the second time series data; Inputting the second time series data and the encoding noise of the second time series data into a pre-constructed anomaly detection model to obtain the anomaly detection result of the multi-dimensional soil parameters.

[0008] In a second aspect, an embodiment of the present invention provides a device for time series anomaly detection based on a KAN network, including: An encoding module, configured to obtain first time series data based on multi-dimensional soil parameters, and respectively perform trigonometric function encoding and convolutional activation encoding on the first time series data to obtain the first position encoding and spatio-temporal feature encoding of the first time series data; A self-attention module, configured to perform weighted summation on the first position encoding and the spatio-temporal feature encoding based on the self-attention mechanism to obtain the second position encoding of the first time series data, and obtain second time series data based on the first time series data and the second position encoding; A generation module, configured to perform noise generation processing on the second time series data based on the KAN network to generate the encoding noise of the second time series data; A detection module, configured to input the second time series data and the encoding noise of the second time series data into a pre-constructed anomaly detection model to obtain the anomaly detection result of the multi-dimensional soil parameters.

[0009] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the method in the first aspect or any possible implementation manner of the first aspect is implemented.

[0010] Fourthly, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the method in the first aspect above or any possible implementation manner of the first aspect.

[0011] Fifthly, an embodiment of the present invention provides a computer program product including a computer program, which when executed by a processor implements the method in the first aspect above or any possible implementation manner of the first aspect.

[0012] In the embodiment of the present invention, the first time series data of multi-dimensional soil parameters is encoded and convolutionally activated to obtain the first position encoding and spatio-temporal feature encoding of the first time series data; and the first position encoding and spatio-temporal feature encoding are weighted and summed according to the self-attention mechanism to obtain the second position encoding of the first time series data, and then the second time series data is obtained according to the first time series data and the second position encoding; the encoding noise of the second time series data is generated through the second time series data and the KAN network; and the second time series data and the encoding noise of the second time series data are input into a pre-constructed anomaly detection model to obtain the anomaly detection results of multiple soil parameters. By combining the first position encoding and spatio-temporal feature encoding through the self-attention mechanism, the position encoding can be generated in a targeted manner, improving the adaptability and flexibility of the model, thereby improving the detection accuracy of time series data anomaly detection. By generating the encoding noise of the second time series data through the KAN network and inputting it into the anomaly detection model, the non-linear processing ability of the anomaly detection model can be enhanced, thereby improving the detection accuracy of time series data anomaly detection. Therefore, the anomaly detection method provided by the embodiment of the present invention can not only improve the adaptability and flexibility of time series data anomaly detection, but also improve the detection accuracy of time series data anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 is a flowchart of the implementation of the time series anomaly detection method based on the KAN network provided by the embodiment of the present invention; Figure 2 is a schematic diagram of the adaptive attention module of the time series anomaly detection method based on the KAN network provided by the embodiment of the present invention; Figure 3 is a flowchart of the noise generation process for the second time series data of the time series anomaly detection method based on the KAN network provided by the embodiment of the present invention; Figure 4 is a schematic diagram of the IMDiffusion model of the time series anomaly detection method based on the KAN network provided by the embodiment of the present invention; Figure 5It is a schematic diagram of the KAN_IMDiffusion model of the time series anomaly detection method based on the KAN network provided by an embodiment of the present invention; Figure 6 It is a schematic structural diagram of the time series anomaly detection device based on the KAN network provided by an embodiment of the present invention; Figure 7 It is a schematic diagram of an electronic device provided by an embodiment of the present invention. Specific embodiments

[0014] Next, the embodiments of the present invention will be described in detail with reference to the accompanying drawings.

[0015] See Figure 1 , which shows the implementation flowchart of the time series anomaly detection method based on the KAN network provided by an embodiment of the present invention, and is described in detail as follows: Step S110, obtain the first time series data based on multi-dimensional soil parameters, and perform trigonometric function encoding and convolutional activation encoding on the first time series data respectively to obtain the first position encoding and spatio-temporal feature encoding of the first time series data.

[0016] In some embodiments, the soil parameters can be obtained by comprehensively using a ground sensor network and remote sensing technology. The combination of the ground sensor network and remote sensing technology can build a comprehensive and accurate soil information monitoring system. Among them, ground sensors are widely deployed in the target area and can collect key parameters such as soil humidity, salinity, temperature, and nutrient content in real time, providing high-resolution local data.

[0017] Remote sensing technology can periodically obtain large-scale surface soil information, making up for the deficiency of ground sensors in spatial coverage. Through steps such as spatio-temporal alignment, missing value filling, and normalization processing, the ground sensor data and remote sensing data are fused to form a unified and high-quality soil information data set.

[0018] In some embodiments, Figure 2 is an adaptive attention module, including a trigonometric function encoding module, a convolutional activation encoding module, a self-attention module, and a residual connection module. See Figure 2 , the trigonometric function encoding refers to generating an initial position encoding for the time series data using trigonometric functions. The specific formula is as follows:

[0019]

[0020] Among them, represents the time step, is the dimension index in the position encoding vector, is the total dimension of the position encoding vector. Among them, the time series data is , where T represents the time step, and the generated first position encoding is .

[0021] In some embodiments, referring to Figure 2 , the specific implementation steps of the convolutional activation encoding are as follows: The first step is to perform a convolution operation on the first time series data X, and a convolution kernel with a size of 3 is selected to extract local features in the data. During the convolution process, to keep the data size unchanged, padding processing is performed on the convolved data. So that after the input data passes through the convolution, the time step of the output data is still T.

[0022] The second step is to pass the data after the first convolution operation through the Relu activation function to increase the non - linear expression ability of the model. The formula is:

[0023] where X is the output data after the convolution operation, and y is the result after being activated by the Relu activation function.

[0024] The third step is to perform the same convolution operation as the first time on the data after being activated by Relu. Again, a convolution kernel with a size of 3 is used and padding is performed to further extract and strengthen the important features in the time series. After these two convolution operations and Relu activation, the spatio - temporal feature encoding in the time series is finally obtained . The specific formula is as follows:

[0025] where represents the convolution operation, is the data obtained after padding the input data X, represents the activation function: = .

[0026] Passing the data after the first convolution operation through the Relu activation function can increase the non - linear expression ability of the model, and using the same - sized convolution kernel to perform a convolution operation on the data after being activated by Relu and performing padding can further extract and strengthen the important features in the time series.

[0027] In a possible implementation manner, the specific processing method of step S110 is: based on multi - dimensional soil parameters, determine the initial time series data; perform missing value filling and data normalization on the initial time series data to obtain the first time series data.

[0028] In some embodiments, during the data processing stage, the fused data is first preprocessed to fill possible missing values and normalize the data to eliminate the dimensional differences between different data sources and parameters. Then, adaptive attention position encoding is adopted and combined with convolution operations to extract spatio-temporal features from the soil time series information. This method can dynamically generate attention weights according to the data features, giving higher attention to the key spatio-temporal features, so as to more accurately capture the change patterns of soil information and provide rich and valuable feature representations for anomaly detection.

[0029] In some embodiments, the multi-dimensional soil parameters are data obtained through the soil information monitoring system. After obtaining the multi-dimensional soil parameters, the multi-dimensional soil parameters are fused to obtain the initial time series data.

[0030] In some embodiments, the missing value filling is to fill the missing values by the linear interpolation method. Let the time series data be , where represents the data value at the th time point. If is a missing value, and and are valid data, then the following formula is used for linear interpolation:

[0031] where, is the filled value.

[0032] In some embodiments, data normalization refers to scaling the data to a unified range. The minimum-maximum normalization method can be used to normalize the data to the interval [0,1]. The normalization formula is:

[0033] where, and respectively represent the minimum and maximum values in the time series . is the value after normalizing the th data.

[0034] In addition, in order to evaluate the performance of the model, the first time series data needs to be divided into a training set and a test set according to a preset ratio. The preset ratio can be 7:3, that is, the training set accounts for 70% of the total data, and the test set accounts for 30% of the total data.

[0035] Step S120 is used to perform weighted summation on the first positional encoding and the spatio-temporal feature encoding based on the self-attention mechanism to obtain the second positional encoding of the first time series data, and based on the first time series data and the second positional encoding, obtain the second time series data.

[0036] In some embodiments, referring to Figure 2 , after obtaining the second positional encoding of the first time series data, in a residual connection manner, the first time series data X1 and the second positional encoding are added together to obtain the second time series data .

[0037] The residual connection formula is: .

[0038] The specific formula of the adaptive attention positional encoding module is as follows:

[0039] Wherein, is the first positional encoding of the first time series data, is the spatio-temporal feature encoding of the first time series data.

[0040] In a possible implementation manner, the specific processing manner of step S120 is: perform a linear transformation on the first positional encoding to obtain the first attention vector, and perform a linear transformation on the spatio-temporal feature encoding to obtain the second attention vector and the third attention vector; calculate the attention score matrix based on the second attention vector and the third attention vector; perform weighted summation on the first attention vector according to the attention score matrix to obtain the second positional encoding of the first time series data.

[0041] In some embodiments, referring to Figure 2 , performing a linear transformation on the first positional encoding P1 can obtain the first attention vector V, and performing a linear transformation on the spatio-temporal feature encoding F can obtain the second attention vector K and the third attention vector Q. Among them, the full name of V is Value, representing the value vector, the full name of K is Key, representing the key vector, and the full name of Q is Query, representing the query vector. The first attention vector, the second attention vector and the third attention vector are used to determine the association degree between different positions.

[0042] Among them, the attention score matrix is represented by A, and the calculation formula is:

[0043] Wherein, is the dimension of K.

[0044] In some embodiments, by performing weighted summation on V using the attention score matrix A, a second positional encoding can be obtained. , and the calculation formula is:

[0045] By performing trigonometric function encoding, when performing anomaly detection on time series data, the changes brought about by the dynamic evolution of time dependence in a complex environment can be considered. By performing two convolutional activations, the spatio-temporal features of the input data can be extracted. Then, through the self-attention mechanism, weighted processing is performed on the spatio-temporal features encoding and the first positional encoding, and a second positional encoding containing the data features of the time series data can be obtained, improving the adaptability and flexibility of anomaly detection for time series data. Combining trigonometric function encoding with convolutional activation encoding can not only consider the changes brought about by the dynamic evolution of time dependence in a complex environment but also improve the adaptability and flexibility of anomaly detection for time series data.

[0046] Step S130 is used to perform noise generation processing on the second time series data to generate the encoding noise of the second time series data.

[0047] In some embodiments, the KAN network has strong non-linear processing ability. Therefore, using the KAN network to generate encoding noise for the second time series data and adding the KAN network to the existing anomaly detection model can strengthen the non-linear processing ability of the anomaly detection model and further improve the accuracy of anomaly detection for time series data.

[0048] In a possible implementation manner, the specific processing method of step S130 is: performing trigonometric function encoding on the second time series data to obtain a third positional encoding of the second time series data; performing data transformation on the third positional encoding based on the KAN network, and based on the data transformation result, obtaining the encoding noise of the second time series data.

[0049] In some embodiments, Figure 3 For the specific steps of performing noise generation processing on the second time series data, see Figure 3 . The noise generation processing first needs to process the second time series through trigonometric function encoding, that is, perform positional embedding on the second time series to obtain a third positional encoding, and then needs to perform data transformation on the third positional encoding to obtain the encoding noise of the second time series data.

[0050] In a possible implementation, the specific processing method of step S130 is as follows: perform data transformation on the third position encoding based on the KAN network, and input the data transformation result of the third position encoding into a preset activation function to obtain the initial encoding noise of the second time series data; perform data transformation on the initial encoding noise based on the KAN network, and input the data transformation result of the initial encoding noise into a preset activation function to obtain the encoding noise of the second time series data.

[0051] In some embodiments, the transformation formula for the KAN network to perform data transformation is:

[0052] where is the output of the data transformation by the KAN network at time step t, is the input of the data transformation by the KAN network at time step t.

[0053] The specific formula is:

[0054] where is an external function that sums the inner results, is an internal function.

[0055]

[0056] where and are weight coefficients, is a spline function, is a basis function.

[0057]

[0058]

[0059] where n is the dimension of is a weight coefficient, is a B-spline function.

[0060] In some embodiments, the preset activation function is the SiLU function, and the activation function formula is:

[0061] It should be noted that when in use, the KAN network can be used to construct as Figure 3The KAN module shown includes an encoding module that performs position encoding using trigonometric function encoding and two KAN_Layer modules. Inputting the second time series data into the KAN_Layer module can obtain the encoded noise of the second time series data.

[0062] Construct the KAN_Layer module through the KAN network, which is used to generate the encoded noise of the second time series data. It can utilize the powerful feature extraction ability of the KAN network to improve the diversity of the encoded noise and extract more robust features of multi-dimensional time series data.

[0063] Step S140 is used to input the second time series data and the encoded noise of the second time series data into a pre-constructed anomaly detection model to obtain the anomaly detection result of multi-dimensional soil parameters.

[0064] In some embodiments, the pre-constructed anomaly detection model is the IMDiffusion model, and the schematic diagram of the IMDiffusion model is as Figure 4 shown.

[0065] In a possible implementation manner, the specific processing method of step S140 is: input the second time series data into the first sub-model of the anomaly detection model to obtain the first noise and the second noise of the second time series data; input the second time series data, the encoded noise, the first noise, and the second noise into the second sub-model of the anomaly detection model to obtain the anomaly detection result of multi-dimensional soil parameters.

[0066] In some embodiments, the anomaly detection model is the IMDiffusion model. For the specific details of the first sub-model and the second sub-model, please refer to Figure 4 . Among them, reshape represents changing the shape of the feature map, 1D Conv represents one-dimensional convolution, position encoding represents the encoding generated by trigonometric functions, sigmoid and tanh represent activation functions, concat represents the concatenation operation, and the Transformer encoder represents the encoder part in the Transformer model.

[0067] In some embodiments, the model improved by the method provided in this application is the KAN_IMDiffusion model, and the schematic diagram of the KAN_IMDiffusion model is as Figure 5 shown.

[0068] The following introduces the training and testing process of the KAN_IMDiffusion model: The first step is to convert the original data into noise data by gradually adding noise. This process is controlled by a fixed forward diffusion process, and the formula is as follows:

[0069] Among them, is a predefined attenuation function, is the noise sampled from the normal distribution.

[0070] In the second step, use the trained neural network to predict the noise added at each step. During the training process, randomly select a time step , sample a sample from the dataset, and obtain through the forward diffusion process, then calculate the predicted noise and the true noise The loss between them. The loss function used is MSE, and the specific formula is as follows:

[0071] In the third step, use the optimization algorithm Adam to update the parameters of the model according to the gradient of the calculation function .

[0072] In the fourth step, select the optimal model according to the evaluation metrics. The evaluation metrics include Precision, Recall, and F1 value. The specific formulas are as follows:

[0073]

[0074]

[0075] Among them, is the number of true positive examples (predicted as positive examples and actually positive examples), is the number of false positive examples (predicted as positive examples but actually negative examples), is the number of false negative examples (predicted as negative examples but actually positive examples).

[0076] In the fifth step, set the parameters of the KAN_IMDiffusion model to the optimal parameters, and use the test set to test to obtain the anomaly detection results.

[0077] The KAN_IMDiffusion model provided by this application has strong feature extraction ability and adaptability, and has strong robustness in dealing with complex data. Therefore, it has significant advantages in the field of soil information anomaly detection. It can timely detect anomalies in soil information, such as abnormal soil humidity and abnormal changes in soil fertility, etc., providing a scientific basis for decision-making in related fields, and can be widely applied in various fields. For example, in agricultural production, it can be used to guide irrigation and fertilization, and in ecological protection, it can be used to monitor soil degradation and pollution, which can promote the development and application of soil information anomaly detection technology.

[0078] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0079] The following is an apparatus embodiment of the present invention. For the details not described in detail herein, reference may be made to the corresponding method embodiments above.

[0080] Figure 6 The structural schematic diagram of the time series anomaly detection apparatus based on the KAN network provided by the embodiments of the present invention is shown. For the sake of convenience of description, only the parts related to the embodiments of the present invention are shown and are described in detail as follows: As Figure 6 shown, the time series anomaly detection apparatus 6 based on the KAN network includes: An encoding module 61, configured to obtain first time series data based on multi-dimensional soil parameters, and perform trigonometric function encoding and convolutional activation encoding on the first time series data respectively to obtain the first position encoding and spatio-temporal feature encoding of the first time series data; A self-attention module 62, configured to perform weighted summation on the first position encoding and the spatio-temporal feature encoding based on the self-attention mechanism to obtain the second position encoding of the first time series data, and obtain the second time series data based on the first time series data and the second position encoding; A generation module 63, configured to perform noise generation processing on the second time series data based on the KAN network to generate the encoding noise of the second time series data; A detection module 64, configured to input the second time series data and the encoding noise of the second time series data into a pre-constructed anomaly detection model to obtain the anomaly detection result of the multi-dimensional soil parameters.

[0081] In a possible implementation manner, the encoding module 61 is specifically configured to: determine the initial time series data based on the multi-dimensional soil parameters; perform missing value filling and data normalization on the initial time series data to obtain the first time series data.

[0082] In a possible implementation, the self-attention module 62 is specifically configured to: perform a linear transformation on the first positional encoding to obtain a first attention vector, and perform a linear transformation on the spatio-temporal feature encoding to obtain a second attention vector and a third attention vector; calculate an attention score matrix based on the second attention vector and the third attention vector; and perform weighted summation on the first attention vector according to the attention score matrix to obtain a second positional encoding of the first time series data.

[0083] In a possible implementation, the generation module 63 is specifically configured to: perform trigonometric encoding on the second time series data to obtain a third positional encoding of the second time series data; perform data transformation on the third positional encoding based on the KAN network, and obtain an encoding noise of the second time series data based on the data transformation result.

[0084] In a possible implementation, the generation module 63 is further configured to: perform data transformation on the third positional encoding based on the KAN network, input the data transformation result of the third positional encoding into a preset activation function to obtain an initial encoding noise of the second time series data; perform data transformation on the initial encoding noise based on the KAN network, and input the data transformation result of the initial encoding noise into a preset activation function to obtain an encoding noise of the second time series data.

[0085] In a possible implementation, the detection module 64 is specifically configured to: input the second time series data into a first sub-model of the anomaly detection model to obtain a first noise and a second noise of the second time series data; input the second time series data, the encoding noise, the first noise, and the second noise into a second sub-model of the anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameters.

[0086] Figure 7 is a schematic diagram of an electronic device provided by an embodiment of the present invention. As Figure 7 shown, the electronic device 7 of this embodiment includes: a processor 70 and a memory 71. The memory 71 stores a computer program 72. When the processor 70 executes the computer program 72, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 70 executes the computer program 72, the functions of each module / unit in the above-mentioned device embodiments are implemented.

[0087] Exemplarily, the computer program 72 can be divided into one or more modules / units. The one or more modules / units are stored in the memory 71 and executed by the processor 70 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 72 in the electronic device 7.

[0088] The electronic device 7 may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art can understand that Figure 7 These are merely examples of the electronic device 7 and do not constitute a limitation on the electronic device 7. It may include more or fewer components than those shown in the figure, or combine certain components, or have different components. For example, the electronic device 7 may also include input / output devices, network access devices, a bus, etc.

[0089] The processor 70 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0090] The memory 71 may be an internal storage unit of the electronic device 7, such as the hard disk or memory of the electronic device 7. The memory 71 may also be an external storage device of the electronic device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 7. Further, the memory 71 may also include both the internal storage unit and the external storage device of the electronic device 7. The memory 71 is used to store the computer program 72 and other programs and data required by the electronic device 7. The memory 71 may also be used to temporarily store the data that has been output or will be output.

[0091] For the convenience and simplicity of description, only the above division of each functional module / unit is used as an example. In practical applications, the above functions may be assigned to different functional modules / units according to needs. The above modules / units may be implemented in the form of hardware, or in the form of software, or in the form of a combination of hardware and software.

[0092] The embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the methods in the above method embodiments are implemented.

[0093] An embodiment of the present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, the methods in the above method embodiments are implemented.

[0094] Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

[0095] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. Without special instructions and logical conflicts, the terms and / or descriptions between different embodiments are consistent and can be mutually referenced. The technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.

[0096] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A time series anomaly detection method based on KAN network, characterized in that: include: Obtaining first time series data based on multi-dimensional soil parameters, performing trigonometric function coding and convolution activation coding on the first time series data respectively, to obtain first position coding and spatiotemporal feature coding of the first time series data; Performing weighted summation on the first position code and the spatiotemporal feature code based on a self-attention mechanism to obtain a second position code of the first time series data, and obtaining second time series data based on the first time series data and the second position code; Performing noise generation processing on the second time series data based on the KAN network to generate coding noise for the second time series data; The second time series data and the encoding noise of the second time series data are input into a pre-built anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameter.

2. The time series anomaly detection method based on KAN network according to claim 1 is characterized in that: The step of performing weighted summation on the first position code and the spatiotemporal feature code based on the self-attention mechanism to obtain a second position code of the first time series data includes: Performing a linear transformation on the first position code to obtain a first attention vector, and performing a linear transformation on the spatiotemporal feature code to obtain a second attention vector and a third attention vector; Calculating an attention score matrix based on the second attention vector and the third attention vector; The first attention vector is weightedly summed according to the attention score matrix to obtain a second position encoding of the first time series data.

3. The time series anomaly detection method based on KAN network according to claim 1 is characterized in that: The step of generating coding noise of the second time series data based on the second time series data and the KAN network includes: Performing trigonometric function encoding on the second time series data to obtain a third position code of the second time series data; The third position code is subjected to data transformation based on the KAN network, and the coding noise of the second time series data is obtained based on the data transformation result.

4. The time series anomaly detection method based on KAN network according to claim 3 is characterized in that: The performing data transformation on the third position code based on the KAN network, and obtaining the coding noise of the second time series data based on the data transformation result, comprises: Performing data transformation on the third position code based on the KAN network, and inputting the data transformation result of the third position code into a preset activation function to obtain initial coding noise of the second time series data; The initial coding noise is subjected to data transformation based on the KAN network, and the data transformation result of the initial coding noise is input into the preset activation function to obtain the coding noise of the second time series data.

5. The time series anomaly detection method based on KAN network according to claim 1 is characterized in that: Inputting the second time series data and the coded noise of the second time series data into a pre-built anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameter includes: Inputting the second time series data into the first sub-model of the anomaly detection model to obtain the first noise and the second noise of the second time series data; The second time series data, the coded noise, the first noise and the second noise are input into the second sub-model of the anomaly detection model to obtain the anomaly detection result of the multi-dimensional soil parameter.

6. The time series anomaly detection method based on KAN network according to claim 1 is characterized in that: The obtaining of first time series data based on multi-dimensional soil parameters includes: Based on the multi-dimensional soil parameters, determining initial time series data; The initial time series data is filled with missing values ​​and normalized to obtain first time series data.

7. A time series anomaly detection device based on KAN network, characterized in that: include: An encoding module, used for obtaining first time series data based on multi-dimensional soil parameters, performing trigonometric function encoding and convolution activation encoding on the first time series data, respectively, to obtain first position encoding and spatiotemporal feature encoding of the first time series data; A self-attention module, configured to perform weighted summation on the first position code and the spatiotemporal feature code based on a self-attention mechanism to obtain a second position code of the first time series data, and obtain second time series data based on the first time series data and the second position code; A generating module, configured to perform noise generation processing on the second time series data based on a KAN network to generate coding noise for the second time series data; The detection module is used to input the second time series data and the coding noise of the second time series data into a pre-built anomaly detection model to obtain an anomaly detection result of the multi-dimensional soil parameter.

8. The time series anomaly detection device based on KAN network according to claim 7 is characterized in that: The self-attention module is specifically used for: Performing a linear transformation on the first position code to obtain a first attention vector, and performing a linear transformation on the spatiotemporal feature code to obtain a second attention vector and a third attention vector; Calculating an attention score matrix based on the second attention vector and the third attention vector; The first attention vector is weightedly summed according to the attention score matrix to obtain a second position encoding of the first time series data.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 6 when executing the computer program.

10. A computer-readable medium, characterized in that The computer-readable medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Text embedding vector generation method and device based on pre-training model

    CN118586399A

  • Method for accelerating high-quality MRI (Magnetic Resonance Imaging) image reconstruction based on TC-KANReccon model

    CN119152057A

  • Abnormality detection method, device, equipment and medium

    CN119577635A

  • Real-time monitoring and early warning method and system for high-speed routing

    CN119766638A