Abnormal signal detection method, device, equipment and storage medium
By using window timing signal and reference point correlation screening method in timing prediction, the problem of low prediction accuracy in the prior art is solved, and higher prediction accuracy and computing resource savings are achieved.
Patent Information
- Application Number
- CN202410036943.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-10
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-01-10
AI Technical Summary
When using a whole-sequence signal for prediction, existing timing prediction methods are susceptible to signal points with low correlation, resulting in lower accuracy of prediction results.
By obtaining the window timing signal, selecting a signal point as the reference point, determining the correlation between the reference point and other signal points, selecting continuous signal points with correlation greater than the threshold as the historical timing signal, and making predictions based on this.
Improve the prediction accuracy of timing signals and save computing resources.
Smart Images

Figure CN117540136B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to an abnormal signal detection method, device, equipment, storage medium and program product. Background Art
[0002] With the rapid development of time series prediction technology, it has been widely used in the fields of stock market, sales forecasting, energy demand forecasting, traffic flow forecasting and weather forecasting. The time series prediction method often uses the current entire time series signal to predict the time series signal. Although the target time series signal can be predicted, the prediction result will be affected by the signal points with low correlation in the time series signal, resulting in low accuracy of the prediction result. Summary of the invention
[0003] The embodiments of the present application provide an abnormal signal detection method, device, electronic device, computer-readable storage medium and computer program product, which can improve the prediction accuracy of time series signals and effectively save computing resources.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present invention provides a method for detecting abnormal signals, the method comprising:
[0006] Acquire a window timing signal, wherein the window timing signal includes a position to be predicted;
[0007] Selecting a signal point in the windowed timing signal other than the position to be predicted as a first reference point;
[0008] Determine a first correlation between the first reference point and each signal point in the windowed timing signal except the position to be predicted;
[0009] From the windowed time series signal, selecting a plurality of continuous signal points whose first correlation is greater than a first correlation threshold as a historical time series signal;
[0010] Based on the historical time series signal, the time series signal of the position to be predicted is predicted to obtain a target time series signal.
[0011] The embodiment of the present application also provides an abnormal signal detection device, including:
[0012] An acquisition module, used for acquiring a window timing signal, wherein the window timing signal includes a position to be predicted;
[0013] A reference point selection module, used for selecting a signal point in the window timing signal other than the position to be predicted as a first reference point;
[0014] A correlation determination module, used to determine a first correlation between the first reference point and each signal point in the window timing signal except the position to be predicted;
[0015] A signal selection module, used for selecting a plurality of continuous signal points whose first correlation is greater than a first correlation threshold from the window time series signal as a historical time series signal;
[0016] The prediction module is used to predict the time series signal of the position to be predicted based on the historical time series signal to obtain a target time series signal.
[0017] The above abnormal signal detection device further includes:
[0018] A time window division module is used to obtain a timing signal to be predicted and determine a position to be predicted in the timing signal to be predicted; based on the position to be predicted, the timing signal to be predicted is divided according to a time window to obtain the window timing signal, wherein each window timing signal contains a position to be predicted.
[0019] In the above scheme, the reference point selection module is also used to determine the second correlation between any two different signal points in the window timing signal except the position to be predicted; based on the second correlation, determine the average correlation corresponding to each signal point in the window timing signal except the position to be predicted; select any signal point whose average correlation is greater than the second correlation threshold as the first reference point.
[0020] In the above scheme, the reference point selection module is also used to determine the second correlation between any two different signal points in the window timing signal except the position to be predicted; based on the second correlation, determine the average correlation corresponding to each signal point in the window timing signal except the position to be predicted; and select the signal point with the highest average correlation as the first reference point.
[0021] In the above scheme, the correlation determination module is also used to determine the cross attention between any two different signal points in the window timing signal except the position to be predicted, and the cross attention is used to indicate the correlation between the two different signal points; the cross attention is normalized to obtain the second correlation between the any two different signal points.
[0022] In the above scheme, the prediction module is also used to obtain the trained time series prediction model; call the encoder of the time series prediction model to extract features of the historical time series signal to obtain the encoding features of the historical time series signal; call the regressor of the time series prediction model to perform regression prediction on the encoding features to obtain the target time series signal of the position to be predicted.
[0023] Before obtaining the trained time series prediction model, the time series prediction model needs to be trained. The above abnormal signal detection device also includes:
[0024] A sample acquisition module, used to acquire a training sample constructed based on an original time series signal, wherein the training sample is an input signal selected from the original time series signal, and the sample label corresponding to the training sample is a mask signal selected from the original time series signal;
[0025] An encoding module, used to call the encoder of the time series prediction model to be trained, extract features of the input signal, and obtain encoding features of the input signal;
[0026] A regression module, used to call the regressor of the time series prediction model to be trained, perform regression prediction on the encoding feature, and obtain a prediction signal;
[0027] A parameter updating module is used to obtain a difference between the prediction signal and the mask signal, and to update a model parameter of the time series prediction model based on the difference.
[0028] In the above solution, the time window division module is also used to obtain at least one original window time series signal based on window division of the original time series signal.
[0029] The above abnormal signal detection device further includes a mask signal selection module and an input signal selection module:
[0030] The mask signal selection module is used to select a plurality of continuous signal points from the original window timing signal as the mask signal, and determine the signal points in the original window timing signal except the mask signal;
[0031] The input signal selection module is used to select a plurality of continuous signal points from the signal points excluding the mask signal as the input signal;
[0032] The sample construction module is used to construct the training sample based on the mask signal and the input signal selected from the original window timing signal.
[0033] In the above scheme, the time window division module is also used to obtain a fixed window length; when the length of the original timing signal is greater than or equal to the fixed window length, the original timing signal is window divided according to the fixed window length to obtain the original window timing signal.
[0034] In the above scheme, the mask signal selection module is also used to select a signal point in the original window timing signal as the second reference point; determine the third correlation between the second reference point and each signal point in the original window timing signal; and select multiple continuous signal points whose third correlation is greater than a third correlation threshold from the original window timing signal as the mask signal.
[0035] In the above scheme, the input signal selection module is also used to select one signal point from the signal points in the original window timing signal except the mask signal as the third reference point; determine the fourth correlation between the third reference point and each signal point except the mask signal; and select multiple continuous signal points whose fourth correlation is greater than a fourth correlation threshold as the input signal from the signal points except the mask signal.
[0036] In the above scheme, the input signal selection module obtains the first similarity between different signal points except the mask signal; based on the first similarity, determines the average similarity corresponding to each signal point except the mask signal; selects the signal point corresponding to the highest average similarity as the third reference point; based on the first similarity, determines the second similarity between the third reference point and each signal point except the mask signal; from each signal point except the mask signal, selects multiple continuous signal points whose second similarity is greater than the similarity threshold as the input signal.
[0037] An embodiment of the present application provides an electronic device, the electronic device comprising:
[0038] A memory for storing computer executable instructions;
[0039] The processor is used to implement the abnormal signal detection method provided in the embodiment of the present application when executing the computer executable instructions stored in the memory.
[0040] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the abnormal signal detection method provided in the embodiment of the present application when executed by a processor.
[0041] An embodiment of the present application provides a computer program product, including a computer program or a computer executable instruction. When the computer program or the computer executable instruction is executed by a processor, the abnormal signal detection method provided in the embodiment of the present application is implemented.
[0042] The embodiments of the present application have the following beneficial effects:
[0043] By acquiring the window timing signal and selecting a signal point as the reference point, determining the correlation between the reference point and other signal points, and taking the continuous signal points whose correlation is greater than the correlation threshold as the historical timing signal, it is ensured that the selected continuous signal points have a high correlation with the reference point, and making predictions based on the selected continuous signal points to obtain the target timing signal of the position to be predicted, thereby effectively improving the prediction accuracy of the timing signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a schematic diagram of the architecture of an abnormal signal detection system provided in an embodiment of the present application;
[0045] Figure 2 is a schematic diagram of the structure of an electronic device for abnormal signal detection provided in an embodiment of the present application;
[0046] Figure 3A It is a flowchart of an abnormal signal detection method provided in an embodiment of the present application;
[0047] Figure 3B is a flowchart of a method for selecting a first reference point provided in an embodiment of the present application;
[0048] Figure 4 It is a structural diagram of a time series prediction model provided in an embodiment of the present application;
[0049] Figure 5A It is a flowchart of a training method for a time series prediction model provided in an embodiment of the present application;
[0050] Figure 5B It is a flowchart of a method for obtaining training samples provided in an embodiment of the present application;
[0051] Figure 5C is a flowchart of a mask signal selection method provided in an embodiment of the present application;
[0052] Figure 5D It is a schematic diagram of a process of selecting an input signal according to correlation provided by an embodiment of the present application;
[0053] Figure 5E is a schematic diagram of a process for selecting input signals according to similarity provided in an embodiment of the present application;
[0054] Figure 6 is a schematic diagram of missing signal window division provided in an embodiment of the present application;
[0055] Figure 7 It is a schematic diagram of the signal completion process of the timing signal prediction model provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0057] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0058] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0059] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0060] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0061] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0062] 1) Timing signal: a time series signal, which is a signal with time as the horizontal axis. It is a signal in the time domain. It can be an analog signal or a digital signal. It is usually used to represent or transmit information. It can be expressed as a continuous waveform or a discrete pulse sequence on the time axis. For example, the clock signal of the central processing unit (CPU) is a timing signal used to control the operation timing inside the computer.
[0063] 2) Timing signal point: refers to the point corresponding to the timing signal at a certain moment. The timing signal consists of at least one timing signal point.
[0064] 3) Cross-Attention: Cross-Attention is a mechanism used in Natural Language Processing (NLP), especially in some modern architectures such as Transformer models. Moreover, cross-attention can reflect the dependency between any two signal points in the time series signal and determine the similarity between the two signal points.
[0065] 4) Softmax function: The softmax function is a normalized exponential function and a generalization of the logistic function. It can "compress" a K-dimensional vector z containing any real number into another K-dimensional real vector σ(z), so that each element ranges between (0,1) and the sum of all elements is 1.
[0066] 5) Encoder: The encoder consists of multiple identical layers, each of which consists of a self-attention layer and a feed-forward fully connected layer. It takes the input sequence as input, encodes the input sequence through the multi-head self-attention sublayer, maps it to the hidden layer representation, and then maps the hidden layer to the output sequence through the feed-forward neural network sublayer.
[0067] 6) Regressor: A regressor is an algorithm that predicts the value of a numerical variable by fitting data, including linear regression, ridge regression, lasso regression, elasticnet regression, etc.
[0068] Time series signal prediction has a wide range of applications in the industry, such as stock market prediction, sales forecast, energy demand forecast, traffic flow forecast, weather forecast, etc. However, time series prediction methods often use the current entire time series signal for time series prediction. Although the target time series signal can be predicted, the prediction result will be affected by the signal points with low correlation in the time series signal, resulting in a low accuracy of the prediction result. In response to the above problems, the embodiments of the present application provide an abnormal signal detection method, device, electronic device, computer-readable storage medium and computer program product, which can effectively improve the prediction accuracy of time series signals while saving computing resources.
[0069] See also Figure 1 , Figure 1 It is a schematic diagram of the architecture of the abnormal signal detection system 100 provided in an embodiment of the present application. To support an abnormal signal detection application, the terminal 400 is connected to the server 200 via the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.
[0070] The terminal 400 is used to display an input area for uploading a time series signal to be predicted to the user on the graphical interface 401, so as to obtain the time series signal to be predicted uploaded by the user from the input area, and input the predicted time series signal into the terminal. The terminal 400 determines the position to be predicted in the time series signal to be predicted, and divides the time series signal to be predicted according to the time window based on the position to be predicted to obtain a window time series signal, wherein each window time series signal contains a position to be predicted. After obtaining the window time series signal, the terminal 400 uploads the window time series signal to the server 200 through the network 300. After obtaining the window time series signal, the server 200 can select a signal point in the window time series signal other than the position to be predicted as the first reference point. After determining the first reference point, the server 200 determines the first correlation between the first reference point and each signal point in the window timing signal except the position to be predicted; then the server 200 selects multiple consecutive signal points whose first correlation is greater than the first correlation threshold from the window timing signal as the historical timing signal; then the server 200 predicts the timing signal of the position to be predicted based on the historical timing signal to obtain the target timing signal, and finally the server 200 transmits the target timing signal to the terminal 400 through the network 300, and displays the complete timing signal after prediction on the terminal 400.
[0071] It should be noted that the embodiments of the present application can be applied to scenarios such as timing signal prediction, missing signal completion, and abnormal signal detection.
[0072] Among them, the abnormal signal detection method provided in the embodiment of the present application can be implemented with the help of cloud technology and artificial intelligence. The embodiment of the present application can ensure the continuity of the target time series signal and the original time series signal with a high probability by selecting a plurality of continuous signal points with high correlation from the original time series signal as the historical time series signal, and use the trained time series prediction model to predict the historical time series signal, which can effectively improve the prediction accuracy of the time series signal.
[0073] Among them, cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form a resource pool and be used on demand, flexibly and conveniently. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources.
[0074] Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0075] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, pre-trained models are also called large models and basic models. After fine-tuning, they can be widely used in downstream tasks in various major directions of artificial intelligence. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0076] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.
[0077] The following describes an exemplary application of an electronic device for implementing abnormal signal detection provided by an embodiment of the present application. The electronic device in the embodiment of the present application may be a server or a terminal.
[0078] See also Figure 2 , Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Figure 2 The electronic device 500 shown may be Figure 1In the terminal 400 or server 200, the electronic device 500 includes: at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the terminal are coupled together through a bus system 440. It can be understood that the bus system 440 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, in Figure 2 Various buses are labeled as bus system 440 .
[0079] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0080] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0081] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.
[0082] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0083] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0084] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0085] A network communication module 452, used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;
[0086] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., display screen, speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripherals and displaying content and information);
[0087] The input processing module 454 is used to detect one or more user inputs or interactions from one or more input devices 432 and translate the detected inputs or interactions.
[0088] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2 The abnormal signal detection device 455 stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: an acquisition module 4551, a reference point selection module 4552, a correlation determination module 4553, a signal selection module 4554 and a prediction module 4555. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.
[0089] In other embodiments, the device provided in the embodiments of the present application can be implemented in hardware. As an example, the device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the abnormal signal detection method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (Application Specific Integrated Circuit, ASIC), digital signal processors (Digital Signal Processor, DSP), programmable logic devices (Programmable Logic Device, PLD), complex programmable logic devices (Complex Programmable Logic Device, CPLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other electronic components.
[0090] In some embodiments, the terminal or server can implement the abnormal signal detection method provided by the embodiment of the present application by running a computer program or a computer executable instruction. For example, the computer program can be a native program (for example, a training program for a dedicated classification model) or a software module in an operating system, for example, a training module for a classification model that can be embedded in any program (such as an instant messaging client, an album program, an electronic map client, a navigation client); for example, it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run. In short, the above-mentioned computer program can be an application, module or plug-in in any form.
[0091] The abnormal signal detection method provided in the embodiment of the present application will be described in conjunction with the exemplary application and implementation of the electronic device provided in the embodiment of the present application.
[0092] See also Figure 3A , Figure 3A is a flow chart of the abnormal signal detection method provided in the embodiment of the present application, which will be combined with Figure 3A The steps shown are used for illustration. The abnormal signal detection method provided in the embodiment of the present application can be implemented by a server or a terminal alone, or by a server and a terminal in collaboration. The following will be described using the server alone as an example.
[0093] In step 101, a window timing signal is obtained, wherein the window timing signal includes a position to be predicted.
[0094] In some embodiments, before obtaining the window timing signal, the server may first construct a window timing signal including multiple continuous signal points. In practical applications, the window timing signal may be constructed in the following manner: obtaining the timing signal to be predicted, and determining the position to be predicted in the timing signal to be predicted; based on the position to be predicted, dividing the timing signal to be predicted according to the time window to obtain the window timing signal, wherein each window timing signal contains a position to be predicted. It should be noted here that the multiple mentioned in this article is at least two. Among them, the timing signal to be predicted may be a financial market timing signal, a sales timing signal, an energy demand timing signal, a traffic flow timing signal, a weather timing signal, but is not limited to the above timing signals.
[0095] In practical applications, the location of the timing signal to be predicted may be different for different application scenarios. When in a signal completion scenario, to determine the missing position in the timing signal, you can use data analysis tools or write specific code to check the data integrity of the timing signal to be predicted, so as to determine the missing position; you can also visualize the timing signal through data visualization before obtaining the timing signal to be predicted, so as to intuitively determine the missing position and encapsulate the position information into the timing signal to be predicted.
[0096] When in a signal prediction scenario, the position to be predicted in the timing signal is determined. The user can specify the position to be predicted of the signal according to the needs; or a timing signal of a fixed length is selected forward and / or backward as the position to be predicted based on the timing signal, where the fixed length is a preset value.
[0097] When in an abnormal signal detection scenario, the position to be predicted in the time series signal is determined. The user can specify the detection position of the signal according to the needs; or the position of the signal point where the probability of an abnormal signal appearing in the current time series signal is greater than the threshold can be determined according to the empirical model as the position to be predicted in the time series signal. The threshold here can be a preset value or dynamically set according to different time series signals.
[0098] The method for acquiring the timing signal may be the timing signal to be predicted uploaded by the user through the terminal device, or the timing signal to be predicted collected by the collection device.
[0099] In some embodiments, a certain signal length is selected forward and / or backward based on the position to be predicted, and the timing signal to be predicted is divided into windows to obtain a window timing signal, wherein the signal is selected forward and / or backward based on the position to be predicted to ensure that the obtained window timing signal has a high correlation with the signal to be predicted, thereby improving the accuracy of the timing signal prediction.
[0100] For example, when a timing signal is obtained, the integrity of the timing signal is first checked through a data analysis tool. It is assumed that through the detection of missing signals, it is found that there are missing signals at three positions in the timing signal. Then, based on each missing position, the timing signal is divided into windows, and finally three window timing signals are obtained, where each window timing signal contains a missing position.
[0101] In step 102, a signal point other than the position to be predicted in the windowed time series signal is selected as a first reference point.
[0102] In some embodiments, based on the signal points in the window timing signal except the position to be predicted, one signal point can be selected as the first reference point.
[0103] In some embodiments, see Figure 3B , Figure 3B It is a flowchart of the first reference point selection method provided in an embodiment of the present application. Figure 3A The illustrated step 102 may be implemented by following steps 1021 to 1023, which are described in detail below.
[0104] In step 1021, a second correlation between any two different signal points in the windowed time series signal except the position to be predicted is determined.
[0105] In some embodiments, the cross attention between any two different signal points in the window timing signal except the position to be predicted can be calculated to indicate the correlation between the two different signal points, and the cross attention can be normalized to obtain a second correlation between any two different signal points.
[0106] In some embodiments, any two different signal points are selected from the window time series signal except the position to be predicted, one of the signal points is linearly transformed through a linear layer to obtain a query vector and a key vector corresponding to the signal point, and the other signal point is also linearly transformed through a linear layer to obtain a query vector and a key vector corresponding to the other signal point, and the cross attention between the two signal points is obtained by calculating the dot product of the query vector of one signal point and the key vector of the other signal point.
[0107] In practical applications, the following formula can be used to calculate the cross attention between two signal points.
[0108] S mn =Q m ·K n (1)
[0109] In formula (1), S mn is the cross attention between signal point m and signal point n, Q m is the query vector corresponding to the signal point m, K n is the key vector corresponding to signal point n, where signal points m and n are only used to distinguish two different signal points and there is no order of precedence, that is, S mn It can also be Q n With K m The dot product of .
[0110] After the cross attention is calculated, the cross attention is normalized so that the value of the correlation falls within a fixed interval. For example, the value interval of the second correlation is set to [0, 1] to facilitate comparison of the correlations between different signal points.
[0111] In step 1022, based on the second correlation, an average correlation corresponding to each signal point in the windowed time series signal except the position to be predicted is determined.
[0112] In some embodiments, the mean of the correlation between each signal point in the window timing signal except the position to be predicted and other signal points can be calculated based on the second correlation between any two different signal points to obtain the average correlation of each signal point in the window timing signal except the position to be predicted, thereby better reflecting the degree of correlation between each signal point and other signal points.
[0113] For example, the window timing signal contains 10 signal points, and the second correlations between the first signal point and the other 9 signal points are 0.2, 0.4, 0.3, 0.5, 0.6, 0.8, 0.7, 0.6, 0.8, and 0.9, respectively. By calculating the mean of the above correlations, the average correlation of the first signal point is 0.58.
[0114] In step 1023, any signal point whose average correlation is greater than a second correlation threshold is selected as a first reference point.
[0115] In some embodiments, the signal points are sorted according to the average correlation size of each signal point, and the signal points whose average correlation is greater than a second correlation threshold are determined. When there are multiple signal points whose average correlation is greater than the second correlation threshold, one signal point is selected as the first reference point, wherein the second correlation threshold can be a preset value or can be dynamically set according to the average correlation size of each signal point, thereby ensuring that the first reference point has a high correlation with other signal points. Selecting historical timing signals forward and / or backward based on the reference point can ensure the continuity of the target timing signal and the original timing signal with a high probability, and can effectively improve the prediction accuracy of the timing signal.
[0116] In some embodiments, after determining the average correlation corresponding to each signal point in the window timing signal except the position to be predicted, the signal point with the highest average correlation can also be selected as the first reference point to ensure that the first reference point has the highest correlation with other signal points, so that the reference point is the most representative in the current window timing signal. Timing signal prediction is performed based on the signal point selected based on the reference point, which can improve the prediction accuracy of the signal.
[0117] In step 103, a first correlation between the first reference point and each signal point in the windowed time series signal except the position to be predicted is determined.
[0118] In some embodiments, the second correlation between any two different signal points is determined. The specific calculation of the second correlation can refer to the aforementioned step 1021 and will not be repeated here. Based on the second correlation between different signal points, signal points representing the correlation between the first reference point and other signal points are screened out from the window timing signal to determine the first correlation, thereby facilitating subsequent screening of signal points.
[0119] In step 104, a plurality of continuous signal points whose first correlation is greater than a first correlation threshold are selected from the windowed time series signal as the historical time series signal.
[0120] In some embodiments, after determining the first correlation between the first reference point and each signal point in the window timing signal except the position to be predicted, multiple continuous signal points with a first correlation greater than a first correlation threshold can be selected forward and / or backward from the window timing signal with the first reference point as a reference, wherein the number of signal points included in the historical timing signal may be unlimited. In practical applications, the number of signal points included in the historical timing signal is not less than the target number, and the size of the target number can be set according to actual needs, for example, the target number is 10. Here, the first correlation threshold and the second correlation threshold may be the same or different in size, and there is no clear corresponding relationship. The first correlation threshold may be a preset value, or it may be dynamically set according to the correlation size of the first reference point and other signal points, thereby ensuring that the selected historical timing signal is a timing signal in the window timing signal that has a strong correlation with the signal to be predicted, and the continuity between the predicted target timing signal and the window timing signal can be ensured. In addition, the selected historical timing signal is a partial signal in the window timing signal, so that computing resources can be effectively saved when predicting the timing signal.
[0121] In step 105, based on the historical time series signal, the time series signal at the position to be predicted is predicted to obtain a target time series signal.
[0122] In some embodiments, based on the historical timing signal, a linear interpolation method can be used to predict the timing signal of the prediction position to obtain a target timing signal; a mean interpolation method can also be used to predict the timing signal of the prediction position to obtain a target timing signal; a trained timing prediction model can also be used to predict the timing signal of the prediction position to obtain a target timing signal. The specific abnormal signal detection method used can be selected according to the actual situation and is not specifically limited here.
[0123] When the linear interpolation method is used to predict the time series signal, the linear relationship between different signal points can be determined based on the historical time series signal, and the time series signal at the position to be predicted can be predicted based on the linear relationship to obtain the target time series signal. For example, according to the historical time series signal, the time point x of the time series signal and the signal value y are about the univariate linear function relationship y=2x, and the linear interpolation method is used to determine the target time series signal of the time series signal at the position to be predicted.
[0124] When the mean interpolation method is used for time series signal prediction, the average values of different signal points can be determined based on the historical time series signal, and the mean value of the historical time series signal can be used to determine the target time series signal at the position to be predicted. For example, the mean value K of the signal value in the historical time series signal is obtained by calculation, and the mean interpolation method is used, so the target time series signal value of the time series signal at the position to be predicted is K.
[0125] When using a time series prediction model to predict time series signals, see Figure 4 , Figure 4 : is a schematic diagram of the structure of the time series prediction model provided in the embodiment of the present application. Here, the time series prediction model is composed of an encoder and a regressor. Figure 4 The time series prediction model structure shown illustrates the abnormal signal detection process of the time series prediction model. First, the selected historical time series signal is input into the trained time series prediction model. The server calls the encoder in the time series prediction model to extract features of the historical time series signal to obtain the encoding features corresponding to the historical time series signal. Then, the server calls the regressor in the time series prediction model and uses the regression method to regress the encoding features to obtain the target time series signal of the position to be predicted. Among them, the encoder adopts a transformer structure, which can support the input of variable-length signals. The regression method used in the regressor can be one or more common regression methods, which are not specifically limited here.
[0126] Before using the time series prediction model for abnormal signal detection, the time series prediction model needs to be trained in advance.
[0127] See also Figure 5A , Figure 5A is a flow chart of a training method for a time series prediction model provided in an embodiment of the present application, which will be combined with Figure 5A The steps shown are used to illustrate that the training method of the time series prediction model provided in the embodiment of the present application can be implemented by a server or a terminal alone, or by a server and a terminal in collaboration. The following will be described using the server alone as an example.
[0128] In step 201, a training sample constructed based on an original time series signal is obtained.
[0129] Here, the training sample is an input signal selected from the original time series signal, and the sample label corresponding to the training sample is a mask signal selected from the original time series signal.
[0130] Here, the training samples can be constructed based on the original time series signals, or directly obtained from the server database, or obtained from other distributed systems. The specific method of obtaining the training samples can be selected according to the actual situation and is not specifically limited here.
[0131] The following is a description of the specific process of constructing training samples based on the original time series signal. Figure 5B , Figure 5B is a flow chart of constructing a training sample based on an original time series signal provided by an embodiment of the present application. In some embodiments, when the training sample is constructed based on the original time series signal, before the server obtains the training sample, the training sample can be constructed based on the original time series signal by: Figure 5B The steps 301-304 shown are implemented as follows:
[0132] In step 301, at least one original windowed time series signal is obtained based on window division of the original time series signal.
[0133] In some embodiments, a fixed window length T can be determined based on the original timing signal, where the fixed window length can be a preset value or dynamically set based on the length of the original timing signal; when the original timing signal is greater than or equal to the fixed window length T, the original timing signal is windowed according to the fixed window length T to obtain different original window timing signals.
[0134] In some embodiments, when the original timing signal is less than the fixed window length T, if the current original timing signal is greater than or equal to the signal length threshold, the current original timing signal is divided into a window to obtain the original window timing signal; if the current original timing signal is less than the signal length threshold, it means that the current original timing signal does not meet the conditions for constituting the original window timing signal and is discarded; wherein, the signal length threshold can be a preset value or can be dynamically set according to the length of the timing signal in the training sample.
[0135] For example, the length of the original timing signal is 12, the preset value of the fixed window length T is 5, and the signal length threshold is 3. The original timing signal is divided into two original window timing signals with a window length of 5 according to the fixed window length. The length of the last timing signal is 2, which is less than the signal length threshold of 3. Therefore, it does not meet the conditions for constituting an original window timing signal and cannot be divided into a separate original window timing signal.
[0136] The process of selecting the mask signal and the input signal based on the original window timing signal is described below. The process of selecting the mask signal and the input signal is specifically implemented by the following steps 303 and 304.
[0137] In step 302, a plurality of continuous signal points are selected from the original window timing signal as mask signals, and signal points other than the mask signals in the original window timing signal are determined.
[0138] In some embodiments, see Figure 5C , Figure 5CIt is a flow chart of the mask signal selection method provided by the embodiment of the present application. In step 3021, a signal point in the original window timing signal can be selected as the second reference point. In practical applications, the second reference point can be selected by selecting a signal point from the original window timing signal as the second reference point, or by selecting a signal point from the signal points whose average correlation is greater than the correlation threshold as the second reference point, or by selecting a signal point with the highest average correlation as the second reference point. Here, the correlation threshold can be a preset value or dynamically set according to the average correlation. In step 3022, the third correlation between the second reference point and each signal point in the original window signal is determined. In practical applications, the specific calculation of the third correlation can refer to the aforementioned step 1021, which will not be repeated here, and the third correlation has no clear corresponding relationship with the aforementioned first correlation and second correlation, and can be the same or different. In step 3023, multiple continuous signal points whose third correlation is greater than the third correlation threshold are selected from the original window timing signal as mask signals, wherein the third correlation threshold can be a preset value or dynamically set according to the size of the third correlation.
[0139] In some embodiments, a signal point in the original window timing signal can be selected as the second reference point, and the cross attention between the second reference point and each signal point in the original window signal is calculated using formula (1), thereby obtaining a third similarity between the second reference point and each signal point in the original window signal, and selecting multiple continuous signal points whose third similarity is greater than the second similarity threshold from the original window timing signal as mask signals. The similarity threshold can be a preset value or can be dynamically set according to the third similarity, and the third similarity is normalized to obtain a third correlation.
[0140] In step 303, a plurality of continuous signal points are selected from signal points excluding the mask signal as input signals.
[0141] In some embodiments, the input signal may be selected according to correlation, see Figure 5D , Figure 5DIt is a flowchart of selecting an input signal according to correlation provided by an embodiment of the present application. In step 3031A, one of the signal points in the original window timing signal other than the mask signal can be selected as the third reference point. In practical applications, the third reference point can be selected arbitrarily, or it can be selected according to the correlation with reference to the aforementioned steps 1021 to 1023, which will not be described in detail here. In step 3032A, the fourth correlation between the third reference point and each signal point other than the mask signal is determined. In practical applications, the calculation of the fourth correlation can be specifically calculated with reference to the aforementioned step 1021, which will not be described in detail here. In step 3033A, from the signal points other than the mask signal, multiple continuous signal points whose fourth correlation is greater than the fourth correlation threshold are selected as input signals, wherein the fourth correlation threshold can be a preset value, or it can be dynamically set according to the size of the fourth correlation.
[0142] In some embodiments, the input signal may be selected based on the similarity between signal points, see Figure 5E , Figure 5E It is a flow chart of selecting input signals according to similarity provided by an embodiment of the present application. In step 3031B, the first similarity between different signal points except the mask signal can be obtained. In practical applications, formula (1) can be used to calculate the cross attention between different signal points except the mask signal, and then the first similarity between different signal points except the mask signal can be obtained. In step 3032B, based on the first similarity, the average similarity corresponding to each signal point except the mask signal is determined. In practical applications, the average of the similarities between each signal point except the mask signal and other signal points can be calculated according to the first similarity between different signal points except the mask signal, and the average similarity of each signal point except the mask signal can be obtained. In step 3033B, the signal point corresponding to the highest average similarity is selected as the third reference point. In practical applications, the signal points can be sorted according to the average similarity of each signal point, and the signal point with the largest average similarity is used as the third reference point. In step 3034B, based on the first similarity, the second similarity between the third reference point and each signal point except the mask signal is determined. In practical applications, formula (1) can be used to calculate the cross attention between the third reference point and each signal point except the mask signal, thereby obtaining the second similarity between the third reference point and each signal point except the mask signal. In step 3035B, from each signal point except the mask signal, multiple continuous signal points whose second similarity is greater than the first similarity threshold are selected as input signals, wherein the first similarity threshold can be a preset value or can be dynamically set according to the size of the second similarity.
[0143] In some embodiments, the process of selecting the mask signal and the input signal based on the original window timing signal can also be implemented by the following steps:
[0144] From the original window timing signal, multiple continuous signal points are selected as input signals, and signal points in the original window timing signal other than the input signal are determined; in actual applications, a fourth reference point can be selected from the original window timing signal, wherein the fourth reference point can be selected arbitrarily, or can be selected based on correlation with reference to the aforementioned steps 1021 to 1023, which is not described in detail here; then, the fifth correlation between the fourth reference point and other signal points in the original window timing signal is determined, wherein the calculation of the fifth correlation can be specifically calculated with reference to the aforementioned step 1021, which is not described in detail here; finally, from the signal points in the window timing signal, multiple continuous signal points whose fifth correlation is greater than a fifth correlation threshold are selected as input signals, wherein the fifth correlation threshold can be a preset value, or can be dynamically set according to the size of the fifth correlation.
[0145] From signal points other than the input signal, multiple continuous signal points are selected as mask signals; in actual applications, one of the signal points other than the input signal can be selected as the fifth reference point, wherein the selection method of the fifth reference point can be arbitrary, or a specified signal point can be selected according to a preset rule; then the sixth correlation between the fifth reference point and other signal points other than the input signal is determined, wherein the calculation of the sixth correlation is specifically calculated with reference to the aforementioned step 1021 and is not repeated here; finally, from signal points other than the input signal, multiple continuous signal points whose sixth correlation is greater than a sixth correlation threshold are selected as mask signals, wherein the sixth correlation threshold can be a preset value, or can be dynamically set according to the size of the sixth correlation.
[0146] After the mask signal and the input signal are acquired, step 304 is performed to obtain corresponding training samples.
[0147] In step 304, a training sample is constructed based on the mask signal and the input signal selected from the original window timing signal.
[0148] In some embodiments, based on the mapping relationship between the input signal and the mask signal selected based on the original window timing signal, the input signal is used as a training sample in the timing prediction model, and the corresponding mask signal is used as the sample label of the training sample, so that a training sample carrying the sample label is obtained.
[0149] In step 202, the encoder of the time series prediction model to be trained is called to extract features of the input signal to obtain encoding features of the input signal.
[0150] In some embodiments, the input signal is input into the encoder in the time series prediction model to be trained, and the encoder extracts the corresponding coding features of the input signal. Here, the coding features of the time series signal can reflect the shape of the signal (such as square wave, sine wave, cosine wave, triangle wave, sawtooth wave, etc.), trend (such as rising, falling, stable, etc.), frequency component (such as fundamental frequency, harmonic, overtone, etc.), etc., and the information in the time series signal can be better identified by extracting the coding features.
[0151] In step 203, the regressor of the time series prediction model to be trained is called to perform regression prediction on the encoding features to obtain a prediction signal.
[0152] In some embodiments, the coding features are input into a regressor in a time series prediction model to be trained. The regressor uses a regression method to regress and predict the time series signal at the position of the signal to be predicted based on the coding features of the input signal and the position information of the signal to be predicted, and obtains a corresponding prediction signal. The regression method used may be one or more common regression methods, which are not specifically limited here. The length of the prediction signal is greater than or equal to the length of the mask signal.
[0153] In step 204, the difference between the prediction signal and the mask signal is obtained, and the model parameters of the time series prediction model are updated based on the difference.
[0154] In some embodiments, a loss function may be constructed based on the root mean square between the prediction signal and the mask signal, and specifically, the following formula may be referred to:
[0155]
[0156] In formula (3), L is the loss value, p is the number of signal points of the input signal in the training sample, and predict i is the predicted signal value corresponding to the i-th signal point in the predicted signal, mask i is the true signal value corresponding to the i-th signal point in the mask signal.
[0157] In practical applications, the value of the loss function of the time series prediction model is determined based on the difference between the prediction signal and the mask signal; when the value of the loss function of the time series prediction model reaches a parameter threshold, the corresponding target time series signal is determined based on the loss function of the time series prediction model; the target time series signal is back-propagated in the time series prediction model, and the model parameters of the time series prediction model are updated during the propagation process.
[0158] Here we explain back propagation. The training sample data is input into the input layer of the neural network model, passes through the hidden layer, and finally reaches the output layer and outputs the result. This is the forward propagation process of the neural network model. Since there is an error between the output result of the neural network model and the actual result, the error between the result and the actual value is calculated, and the error is back propagated from the output layer to the hidden layer until it propagates to the input layer. During the back propagation process, the value of the model parameter is adjusted according to the error; the above process is continuously iterated until convergence.
[0159] Taking the loss function (2) of the time series prediction model in the embodiment of the present application as an example, the server determines the error value based on the loss function, back-propagates the error value from the output layer of the regressor in the time series prediction model, and back-propagates the error value layer by layer in the regressor. When the error value reaches each layer, the gradient (that is, the partial derivative of the loss function with respect to the parameters of each layer in the regressor) is solved in combination with the transmitted error value, and the parameters of each layer in the regressor are updated with the corresponding gradient values.
[0160] Next, taking the implementation scenario of missing signal completion as an example, the abnormal signal detection method provided in the embodiment of the present application is explained.
[0161] See also Figure 6 , Figure 6 It is a schematic diagram of the missing signal window division provided in an embodiment of the present application. In some embodiments, a segment of a timing signal 501 is obtained, and a position to be completed 5021 and a position to be completed 5022 in the timing signal are determined, and then the timing signal 501 is window-divided according to the position to be completed 5021 and the position to be completed 5022 to obtain a window timing signal 5031 and a window timing signal 5032, wherein each window timing signal contains a position to be completed.
[0162] After the window timing signals are acquired, it is necessary to complete the signal to be completed in each window timing signal.
[0163] See also Figure 7 , Figure 7is a schematic diagram of the signal completion process of the timing signal prediction model provided in an embodiment of the present application. In some embodiments, a window timing signal 601 is obtained, the cross attention between different signal points in the window timing signal 601 except the position to be completed is calculated, and then the cross attention is normalized to obtain a second correlation between different signal points; based on the second correlation, the average correlation of each signal point in the window timing signal 601 except the position to be completed is determined; the average correlation is sorted according to size, and the signal point with the highest average correlation is selected as the first reference point; the first reference point is determined The first correlation of each signal point in the window timing signal, selects multiple continuous signal points whose average correlation is greater than the first correlation threshold as the historical timing signal 602; inputs the historical timing signal 602 into the trained timing prediction model 610; calls the encoder 603 in the timing prediction model 610 to extract features of the historical timing signal 602 to obtain the encoding features 604 of the historical timing signal; calls the regressor 605 in the timing prediction model 610 to perform regression prediction on the encoding features 604 of the historical timing signal to obtain the target timing signal 606 of the position to be completed.
[0164] Next, taking the prediction of time series signals as an example, the abnormal signal detection method provided in the embodiment of the present application is described.
[0165] In some embodiments, a time series signal to be predicted is obtained, and a position to be predicted is determined, and a window is divided according to the position to be predicted to obtain a corresponding window time series signal; the cross-attention between different signal points except the position to be predicted is calculated based on the window time series signal, and then the cross-attention is normalized to obtain a second correlation between different signal points; based on the second correlation, the average correlation of each signal point in the window time series signal except the position to be predicted is determined; the average correlation is sorted according to size, and the signal point with the highest average correlation is selected as the first reference point; the first correlation between the first reference point and each signal point in the window time series signal except the position to be predicted is determined, and multiple continuous signal points with an average correlation greater than the first correlation threshold are selected as historical time series signals; the historical time series signal is input into a trained time series prediction model; the encoder in the time series prediction model is called to extract features of the historical time series signal to obtain the encoding features of the historical time series signal; the regressor in the time series prediction model is called to perform regression prediction on the encoding features of the historical time series signal to obtain a target time series signal for the position to be predicted.
[0166] Next, taking the implementation scenario of abnormal signal detection as an example, the abnormal signal detection method provided in the embodiment of the present application is described.
[0167] In some embodiments, a timing signal to be detected is obtained, and a position to be detected is determined, and a window is divided according to the position to be detected to obtain a corresponding window timing signal; based on the window timing signal, the cross attention between different signal points except the position to be detected is calculated, and then the cross attention is normalized to obtain a second correlation between different signal points; based on the second correlation, the average correlation of each signal point in the window timing signal except the position to be detected is determined; the average correlation is sorted according to size, and the signal point with the highest average correlation is selected as the first reference point; the correlation between the first reference point and each signal point in the window timing signal except the position to be detected is determined. The first correlation of the signal points, select multiple continuous signal points whose average correlation is greater than the first correlation threshold as the historical time series signal; input the historical time series signal into the trained time series prediction model; call the encoder in the time series prediction model to extract features of the historical time series signal to obtain the encoding features of the historical time series signal; call the regressor in the time series prediction model to perform regression prediction on the encoding features of the historical time series signal to obtain the target time series signal of the position to be detected, calculate the difference between the target time series signal and the actual signal of the position to be detected, and when the difference value is greater than the corresponding threshold, determine the actual signal of the position to be detected as an abnormal signal.
[0168] It can be seen from this that the embodiment of the present application only selects signal points with higher correlation from the window timing signal for timing signal prediction, which greatly saves computing resources and improves the prediction accuracy of the timing signal. In addition, the abnormal signal detection method can be effectively applied to the fields of timing signal completion, future timing signal prediction, and abnormal signal detection.
[0169] The following further describes an exemplary structure of the abnormal signal detection device 455 provided in the embodiment of the present application implemented as a software module. In some embodiments, the software module in the abnormal signal detection device 455 may include:
[0170] An acquisition module 4551 is used to acquire a window timing signal, wherein the window timing signal includes a position to be predicted;
[0171] A reference point selection module 4552, configured to select a signal point in the windowed timing signal other than the position to be predicted as a first reference point;
[0172] A correlation determination module 4553, configured to determine a first correlation between the first reference point and each signal point in the windowed timing signal except the position to be predicted;
[0173] A signal selection module 4554, configured to select, from the window time series signal, a plurality of continuous signal points whose first correlation is greater than a first correlation threshold as a historical time series signal;
[0174] The prediction module 4555 is used to predict the time series signal of the position to be predicted based on the historical time series signal to obtain a target time series signal.
[0175] The above-mentioned abnormal signal detection device also includes a time window division module, which is used to obtain the time series signal to be predicted and determine the position to be predicted of the time series signal to be predicted; based on the position to be predicted, the time series signal to be predicted is divided according to the time window to obtain the window time series signal.
[0176] In some embodiments, each of the window timing signals includes a position to be predicted.
[0177] In some embodiments, the reference point selection module 4552 is also used to determine a second correlation between any two different signal points in the window timing signal except the position to be predicted; based on the second correlation, determine the average correlation corresponding to each signal point in the window timing signal except the position to be predicted; and select any signal point whose average correlation is greater than a second correlation threshold as the first reference point.
[0178] In some embodiments, the reference point selection module 4552 is also used to determine a second correlation between any two different signal points in the window timing signal except the position to be predicted; based on the second correlation, determine the average correlation corresponding to each signal point in the window timing signal except the position to be predicted; and select the signal point with the highest average correlation as the first reference point.
[0179] In some embodiments, the correlation acquisition module is also used to determine the cross attention between any two different signal points in the window timing signal except the position to be predicted, and the cross attention is used to indicate the correlation between the two different signal points; the cross attention is normalized to obtain a second correlation between the any two different signal points.
[0180] In some embodiments, the prediction module 4555 is also used to obtain a trained timing prediction model; call the encoder of the timing prediction model to perform feature extraction on the historical timing signal to obtain the encoding features of the historical timing signal; call the regressor of the timing prediction model to perform regression prediction on the encoding features to obtain the target timing signal of the position to be predicted.
[0181] In some embodiments, before obtaining the trained time series prediction model, the time series prediction model needs to be trained. The abnormal signal detection device further includes:
[0182] The sample acquisition module is used to acquire training samples constructed based on the original time series signal, wherein the training samples are input signals selected from the original time series signal, and the sample labels corresponding to the training samples are mask signals selected from the original time series signal.
[0183] An encoding module, used to call the encoder of the time series prediction model to be trained, extract features of the input signal, and obtain encoding features of the input signal;
[0184] A regression module, used to call the regressor of the time series prediction model to be trained, perform regression prediction on the encoding feature, and obtain a prediction signal;
[0185] A parameter updating module is used to obtain a difference between the prediction signal and the mask signal, and to update a model parameter of the time series prediction model based on the difference.
[0186] In some embodiments, the time window division module is further used to obtain at least one original window time series signal based on window division of the original time series signal;
[0187] The above abnormal signal detection device further includes a mask signal selection module and an input signal selection module:
[0188] The mask signal selection module is used to select a plurality of continuous signal points from the original window timing signal as the mask signal, and determine the signal points in the original window timing signal except the mask signal;
[0189] The input signal selection module is used to select a plurality of continuous signal points from the signal points excluding the mask signal as the input signal;
[0190] The sample construction module is used to construct the training sample based on the mask signal and the input signal selected from the original window timing signal.
[0191] In some embodiments, the time window division module is also used to obtain a fixed window length; when the length of the original timing signal is greater than or equal to the fixed window length, the original timing signal is windowed according to the fixed window length to obtain the original window timing signal.
[0192] In some embodiments, the mask signal selection module is also used to select a signal point in the original window timing signal as a second reference point; determine the third correlation between the second reference point and each signal point in the original window timing signal; and select multiple continuous signal points from the original window timing signal whose third correlation is greater than a third correlation threshold as the mask signal.
[0193] In some embodiments, the input signal selection module is also used to select one signal point in the original window timing signal except the mask signal as a third reference point; determine the fourth correlation between the third reference point and each signal point except the mask signal; and select multiple continuous signal points whose fourth correlation is greater than a fourth correlation threshold as the input signal from the signal points except the mask signal.
[0194] In some embodiments, the input signal selection module is also used to obtain a first similarity between different signal points except the mask signal; based on the first similarity, determine the average similarity corresponding to each signal point except the mask signal; select the signal point corresponding to the highest average similarity as the third reference point; based on the first similarity, determine the second similarity between the third reference point and each signal point except the mask signal; from each signal point except the mask signal, select multiple continuous signal points whose second similarity is greater than a similarity threshold as the input signal.
[0195] An embodiment of the present application provides a computer program product, which includes a computer program or computer executable instructions, which are stored in a computer-readable storage medium. A processor of an electronic device reads the computer executable instructions from the computer-readable storage medium, and the processor executes the computer executable instructions, so that the electronic device executes the abnormal signal detection method described above in the embodiment of the present application.
[0196] The embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will be caused to execute the abnormal signal detection method provided in the embodiment of the present application, for example, Figure 3A The abnormal signal detection method is shown.
[0197] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0198] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0199] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0200] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.
[0201] To summarize, by obtaining the window time series signal and selecting a signal point as the reference point, determining the correlation between the reference point and other signal points, and taking the continuous signal points whose correlation is greater than the correlation threshold as the historical time series signal, it is ensured that the selected continuous signal points have a high correlation with the reference point, and based on the selected continuous signal points, prediction is performed to obtain the target time series signal of the position to be predicted, which effectively improves the prediction accuracy of the time series signal and saves computing resources at the same time.
[0202] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A method for detecting abnormal signals, characterized in that: The method comprises: Acquire a traffic flow time series signal to be predicted, and determine a position to be predicted in the traffic flow time series signal to be predicted; Based on the position to be predicted, the traffic flow time series signal to be predicted is divided according to time windows to obtain window time series signals, wherein each window time series signal contains one position to be predicted; Selecting a signal point in the windowed timing signal other than the position to be predicted as a first reference point; Determine a first correlation between the first reference point and each signal point in the windowed timing signal except the position to be predicted; From the windowed time series signal, selecting a plurality of continuous signal points whose first correlation is greater than a first correlation threshold as a historical time series signal; Based on the historical time series signal, predict the time series signal of the position to be predicted to obtain a target time series signal; Determine a difference value between the target timing signal and an actual signal at the position to be predicted; When the difference value is greater than the corresponding threshold, the actual signal of the to-be-predicted position is determined as an abnormal signal.
2. The abnormal signal detection method according to claim 1, characterized in that: The selecting a signal point in the window timing signal other than the position to be predicted as the first reference point includes: Determine a second correlation between any two different signal points in the windowed timing signal except the position to be predicted; Based on the second correlation, determining an average correlation corresponding to each signal point in the windowed time series signal except the position to be predicted; Any signal point whose average correlation is greater than a second correlation threshold is selected as the first reference point.
3. The abnormal signal detection method according to claim 2, characterized in that: The determining a second correlation between any two different signal points in the window timing signal except the position to be predicted includes: Determine a cross attention between any two different signal points in the windowed timing signal except the position to be predicted, wherein the cross attention is used to indicate a correlation between the two different signal points; The cross attention is normalized to obtain a second correlation between any two different signal points.
4. The abnormal signal detection method according to claim 1, characterized in that: The step of predicting the time series signal of the position to be predicted based on the historical time series signal to obtain a target time series signal includes: Obtain the trained time series prediction model; Calling the encoder of the time series prediction model to extract features of the historical time series signal to obtain encoding features of the historical time series signal; The regressor of the time series prediction model is called to perform regression prediction on the coding feature to obtain the target time series signal of the position to be predicted.
5. The abnormal signal detection method according to claim 4, characterized in that: Before acquiring the trained time series prediction model, the method further includes: Acquire a training sample constructed based on the original time series signal, wherein the training sample is an input signal selected from the original time series signal, and the sample label corresponding to the training sample is a mask signal selected from the original time series signal; Calling the encoder of the time series prediction model to be trained, performing feature extraction on the input signal, and obtaining encoding features of the input signal; Calling the regressor of the time series prediction model to be trained, performing regression prediction on the encoding feature, and obtaining a prediction signal; A difference between the prediction signal and the mask signal is obtained, and a model parameter of the time series prediction model is updated based on the difference.
6. The abnormal signal detection method according to claim 5, characterized in that: Before acquiring the training sample constructed based on the original time series signal, the method further includes: Based on window division of the original time series signal, at least one original window time series signal is obtained; The following processing is performed on each of the original window timing signals: Selecting a plurality of continuous signal points from the original window timing signal as the mask signal, and determining signal points in the original window timing signal other than the mask signal; Selecting a plurality of continuous signal points from the signal points other than the mask signal as the input signal; The training sample is constructed based on the mask signal and the input signal selected based on the original window timing signal.
7. The abnormal signal detection method according to claim 6, characterized in that: The step of obtaining at least one original windowed timing signal based on window division of the original timing signal comprises: Get the fixed window length; When the length of the original timing signal is greater than or equal to the fixed window length, the original timing signal is windowed according to the fixed window length to obtain the original window timing signal.
8. The abnormal signal detection method according to claim 6, characterized in that: The step of selecting a plurality of continuous signal points from the original window timing signal as the mask signal comprises: Selecting a signal point in the original window timing signal as a second reference point; Determine a third correlation between the second reference point and each signal point in the original windowed timing signal; A plurality of continuous signal points whose third correlation is greater than a third correlation threshold are selected from the original window timing signal as the mask signal.
9. The abnormal signal detection method according to claim 6, characterized in that: The step of selecting a plurality of continuous signal points from the signal points other than the mask signal as the input signal comprises: Selecting a signal point among the signal points of the original window timing signal except the mask signal as a third reference point; determining a fourth correlation between the third reference point and each signal point other than the mask signal; A plurality of continuous signal points whose fourth correlation is greater than a fourth correlation threshold are selected from the signal points other than the mask signal as the input signal.
10. The abnormal signal detection method according to claim 6, characterized in that: The step of selecting a plurality of continuous signal points from the signal points other than the mask signal as the input signal comprises: Acquire a first similarity between different signal points except the mask signal; Based on the first similarity, determining an average similarity corresponding to each signal point except the mask signal; Selecting a signal point corresponding to the highest average similarity as a third reference point; Based on the first similarity, determining a second similarity between the third reference point and each signal point except the mask signal; From each signal point except the mask signal, a plurality of continuous signal points whose second similarity is greater than a similarity threshold are selected as the input signal.
11. An abnormal signal detection device, characterized in that: The device comprises: A time window division module is used to obtain a traffic flow time series signal to be predicted and determine a position to be predicted in the traffic flow time series signal to be predicted; based on the position to be predicted, the traffic flow time series signal to be predicted is divided according to a time window to obtain a window time series signal, wherein each window time series signal contains a position to be predicted; A reference point selection module, used for selecting a signal point in the window timing signal other than the position to be predicted as a first reference point; A correlation determination module, used to determine a first correlation between the first reference point and each signal point in the window timing signal except the position to be predicted; A signal selection module, used for selecting a plurality of continuous signal points whose first correlation is greater than a first correlation threshold from the window time series signal as a historical time series signal; A prediction module is used to predict the timing signal of the position to be predicted based on the historical timing signal to obtain a target timing signal; determine the difference value between the target timing signal and the actual signal of the position to be predicted; when the difference value is greater than a corresponding threshold, determine the actual signal of the position to be predicted as an abnormal signal.
12. An electronic device, characterized in that: The electronic device comprises: A memory for storing computer executable instructions; The processor is used to implement the abnormal signal detection method according to any one of claims 1 to 10 when executing the computer executable instructions stored in the memory.
13. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer programs are executed by a processor, the abnormal signal detection method according to any one of claims 1 to 10 is implemented.
14. A computer program product comprising a computer program or computer executable instructions, characterized in that: When the computer program or computer executable instruction is executed by a processor, the abnormal signal detection method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Time sequence signal anomaly detection method and system
CN115158399A
Multi-target prediction method and device, equipment and storage medium
CN115705583A