Underwater glider anomaly detection method based on data sequence

By pre-processing and optimizing the abnormal detection model of the underwater glider data, using correlation differences and reconstruction sequences combined with prediction output data, the problems of limited characterization capabilities and poor robustness in the prior art are solved, and the state of the underwater glider is improved Accuracy and adaptability of detection.

CN119128376AActive Publication Date: 2024-12-13TIANJIN UNIV

Patent Information

Application Number
CN202411159713.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-13
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

Existing machine learning and deep learning models have limited characterization capabilities and poor robustness in underwater glider state detection, making it difficult to meet the requirements of accurate anomaly detection in complex marine environments, especially in terms of data loss and multi-faceted data feature determination.

Method used

By preprocessing the data sequences collected by the underwater glider, including data completion and normalization, the training sequence and label sequence are determined, the abnormal detection is performed using correlation differences and reconstruction sequences, and combining the predicted output data and reference output data, it is determined Anomaly detection results, adapt to correlation differences, reconstruction loss and predict loss learning tasks.

Benefits of technology

It improves the accuracy and data availability of abnormal detection, can better characterize the abnormal state of the underwater glider and adapt to the detection needs in complex marine environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128376A_ABST
    Figure CN119128376A_ABST
Patent Text Reader

Abstract

The invention provides an underwater glider anomaly detection method based on a data sequence, which can be applied to the technical field of artificial intelligence. The method comprises the steps that a data sequence collected by an underwater glider is preprocessed to obtain a to-be-detected data sequence, the to-be-detected data sequence comprises a training sequence and a label sequence, the training sequence comprises a data sequence with the length being W in the to-be-detected data sequence, and the length of the label sequence is P; comprising the following P-1 data sequences in the training data as prediction input data and one data after the training data in the to-be-detected data sequence as reference output data; determining association differences of data corresponding to the time points in the training sequence; obtaining a reconstruction sequence based on the training sequence and the association difference; obtaining prediction output data based on the prediction input data in the tag sequence; and determining an anomaly detection result of the underwater glider based on the association difference, the reconstruction sequence, the prediction output data and the reference output data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to an underwater glider anomaly detection method based on data sequences. Background Art

[0002] Underwater Glider is a new type of autonomous underwater vehicle driven by buoyancy, which can be used for long-term observation of the marine environment of the target sea area. In order to respond to various abnormal conditions that may occur in the glider in a timely manner, professionals usually monitor the data sent by the underwater glider to the shore-based control center every time it leaves the water. Due to the limited detection accuracy of manual monitoring methods and high operating costs, as the size of the underwater glider fleet increases and the flight time increases, manual monitoring will not be able to cover the entire voyage. With the development of machine learning and deep learning, methods for detecting the status of underwater gliders using machine learning and deep learning have emerged.

[0003] When using machine learning to detect the status of underwater gliders, traditional machine learning models such as isolation forest, single-class support vector machine, and local anomaly factor are usually used to automatically detect anomalies in the multivariate time series data corresponding to underwater gliders. The anomaly detection method based on traditional machine learning has reduced the labor cost to a certain extent, but the representation ability of the above models is limited and the robustness to noise signals is poor, which makes it difficult to meet the needs of accurate anomaly detection in complex marine environments.

[0004] Compared with the method of detecting the state of underwater gliders using machine learning, the method of detecting the state of underwater gliders using deep learning has better characterization ability for nonlinear complex time series features. The multivariate time series data anomaly detection methods based on deep learning can be roughly divided into reconstruction-based methods, prediction-based methods and correlation difference-based methods.

[0005] In the process of implementing the present disclosure, the inventors found that the prior art has at least the following problems: although the use of machine learning models for state monitoring reduces labor costs, the machine learning model has limited representation capabilities and poor robustness, and therefore it is difficult to meet the accuracy requirements of anomaly detection. The use of deep learning models for state monitoring requires the use of a large amount of observation data for calculation, but the data sent by the underwater glider may be lost due to sensor instability and other reasons. In addition, it is difficult for the deep learning model to simultaneously use multiple data features determined based on the observation data to determine the state of the underwater glider, and therefore it is also difficult to meet the accuracy requirements of anomaly detection. Summary of the invention

[0006] In view of the above problems, the present disclosure provides an underwater glider anomaly detection method based on data sequence.

[0007] According to a first aspect of the present disclosure, a method for detecting anomalies of an underwater glider based on a data sequence is provided, comprising: preprocessing a data sequence collected by an underwater glider to obtain a data sequence to be detected, wherein the data sequence to be detected comprises a training sequence and a label sequence, the training sequence comprises a data sequence with a length of W in the data sequence to be detected, the length of the label sequence is P, and the last P-1 data sequences in the training data are used as predicted input data, and a data after the training data in the data sequence to be detected is used as reference output data; determining an association difference of data corresponding to a time point in the training sequence, wherein the association difference characterizes the degree of association between the data and data corresponding to other time points in the training sequence; obtaining a reconstructed sequence based on the training sequence and the association difference; predicting the sequence based on the predicted input data in the label sequence to obtain predicted output data; and determining an anomaly detection result of the underwater glider based on the association difference, the reconstructed sequence, the predicted output data and the reference output data.

[0008] According to an embodiment of the present disclosure, a data sequence collected by an underwater glider is preprocessed to obtain a data sequence to be detected, including: completing the data sequence to obtain a data completion result; normalizing the data completion result to obtain a normalized data sequence; and determining a training sequence and a label sequence based on the normalized data sequence.

[0009] According to an embodiment of the present disclosure, a data sequence includes a multivariate data sequence collected by one or more sensors of an underwater glider; data completion is performed on the data sequence to obtain a data completion result, including: determining a start time and an end time of each data sequence in the data sequence; in the case where the data sequence is a multivariate data sequence, determining a start acquisition time and an end acquisition time of the data sequence based on multiple start times and multiple end times; determining multiple resampling timestamps within an acquisition time interval, wherein the acquisition time interval is determined based on the start acquisition time and the end acquisition time; using a first sliding window, dividing the acquisition time interval into multiple interpolation windows, wherein a preset window length and a sliding step of the first sliding window are both first preset lengths; and using a linear interpolation method, interpolating at the resampling timestamp in each interpolation window to obtain a data completion result.

[0010] According to an embodiment of the present disclosure, the underwater glider anomaly detection method based on data sequence also includes: dividing the time series data to be detected multiple times to obtain training sequences corresponding to multiple time points; based on each training sequence, determining a label sequence corresponding to the time point of the training sequence in the time series data to be detected; based on the training sequence and label sequence at each time point, determining the anomaly detection result of the underwater glider at the time point; and determining the abnormal situation of the underwater glider based on multiple anomaly detection results.

[0011] According to an embodiment of the present disclosure, determining the association difference of data corresponding to a time point in a training sequence includes: inputting the training sequence into a first embedding layer of an anomaly detection model to obtain first embedded data; fusing the first embedded data with a first position code of the data sequence to obtain first fused data; and inputting the first fused data into an encoder to obtain the association difference of data corresponding to the time point in the training sequence, wherein the association difference includes a priori association and a sequence association, the priori association characterizing the degree of association between the data corresponding to the time point calculated using a first weight and the training sequence, and the sequence association characterizing the degree of association between the data corresponding to the time point calculated using a second weight and the training sequence, wherein the weight value assigned by the first weight to data corresponding to other time points that are farther away from the time point is lower than the weight value assigned by the second weight to data corresponding to other time points that are farther away from the time point.

[0012] According to an embodiment of the present disclosure, an abnormality detection result of an underwater glider is determined based on association differences, a reconstructed sequence, predicted output data and reference output data, including: determining a reconstruction loss based on a reconstructed sequence and a training sequence; determining a prediction loss based on the predicted output data and the reference output data; determining an association difference based on a priori association and a sequence association; and determining an anomaly score of the time series data to be detected based on the association difference, the reconstruction loss and the prediction loss; and determining an abnormality detection result of the underwater glider based on the anomaly score.

[0013] According to an embodiment of the present disclosure, an abnormality detection result of an underwater glider is determined based on an abnormality score, including: comparing the abnormality score with a preset abnormality threshold to determine a comparison result; and when the comparison result indicates that the abnormality score is greater than the abnormality threshold, determining that the abnormality detection result of the underwater glider is a state abnormality.

[0014] According to an embodiment of the present disclosure, a reconstructed sequence is obtained based on a training sequence and an associated difference, including: determining an associated difference corresponding to the data based on data in the training sequence; and reconstructing the training sequence based on the data and the associated difference to obtain a reconstructed sequence.

[0015] According to an embodiment of the present disclosure, a training method for an anomaly detection model includes: preprocessing a sample data sequence to obtain a sample data sequence to be detected, wherein the sample data sequence is obtained from a sample data sequence set, the sample data sequence set includes historical readings of one or more sensors of an underwater glider over time, and the sample data sequence to be detected includes a sample training sequence and a sample label sequence; inputting the sample data sequence to be detected into an initial anomaly detection model to obtain sample association differences of the sample training sequence, a sample reconstruction sequence, and sample prediction output data determined based on the sample label sequence; determining a loss function of the initial anomaly detection model based on the sample association differences, the sample reconstruction sequence, and the sample prediction output data; and adjusting model parameters of the initial anomaly detection model based on the loss function until the loss value determined based on the loss function is minimized.

[0016] According to an embodiment of the present disclosure, based on the loss function, adjusting the model parameters of the initial anomaly detection model includes: determining the size relationship between the prior association and the sequence association; when the sample sequence association in the loss function is fixed, adjusting the prior association based on the minimum strategy and the size relationship to obtain the adjusted prior association; when the sample prior association in the loss function is fixed, maximizing the sequence association based on the maximum strategy to obtain the adjusted sequence association; and adjusting the model parameters of the initial anomaly detection model based on the adjusted prior association and the adjusted sequence association.

[0017] A second aspect of the present disclosure provides an underwater glider abnormality detection device based on a data sequence, comprising:

[0018] A data preprocessing module is used to preprocess the data sequence collected by the underwater glider to obtain a data sequence to be detected, wherein the data sequence to be detected includes a training sequence and a label sequence, the training sequence includes a data sequence with a length of W in the data sequence to be detected, the length of the label sequence is P, and includes the last P-1 data sequences in the training data as prediction input data, and a data after the training data in the data sequence to be detected as reference output data;

[0019] An association difference determination module is used to determine an association difference of data corresponding to a time point in a training sequence, wherein the association difference represents a degree of association between the data and data corresponding to other time points in the training sequence;

[0020] A sequence reconstruction module, used for obtaining a reconstructed sequence based on a training sequence and an associated difference;

[0021] A sequence prediction module, used to predict the sequence based on the prediction input data in the label sequence to obtain the prediction output data; and

[0022] The result determination module is used to determine the abnormal detection result of the underwater glider based on the associated difference, the reconstructed sequence, the predicted output data and the reference output data.

[0023] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0024] The fourth aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the above computer program or instructions are executed by a processor.

[0025] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implement the steps of the above method when the above computer program or instructions are executed by a processor.

[0026] According to the embodiments of the present disclosure, the data sequence collected by the underwater glider is preprocessed to obtain the data sequence to be detected, which reduces the impact of data missing and data corresponding to abnormal time points on the detection results and improves the availability of data. Based on the training sequence in the data sequence to be detected, the association difference and reconstruction result are determined, and the association difference and reconstruction loss are further determined. Based on the label sequence in the data sequence to be detected, the predicted output data is determined, and the prediction loss is further determined. Based on the association difference, reconstruction loss and prediction loss, the abnormal detection result of the underwater glider is determined, so that the abnormal detection process can simultaneously adapt to the association difference learning task, the reconstruction loss learning task and the prediction loss learning task. Therefore, the features learned by different learning tasks can better characterize the data, thereby improving the accuracy of the abnormal detection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0028] Figure 1 A diagram schematically shows an application scenario of a method, device, equipment, medium, and program product for underwater glider anomaly detection based on a data sequence according to an embodiment of the present disclosure;

[0029] Figure 2 The flowchart of the underwater glider abnormality detection method based on data sequence according to an embodiment of the present disclosure is schematically shown;

[0030] Figure 3 A structural diagram of an anomaly detection model for underwater glider anomaly detection based on data sequence according to an embodiment of the present disclosure is schematically shown;

[0031] Figure 4 A histogram schematically shows an indicator of an underwater glider anomaly detection method based on a data sequence according to an embodiment of the present disclosure and a comparison algorithm for detection on a real-world data set;

[0032] Figure 5 A waveform diagram schematically shows an anomaly detection method for underwater glider based on data sequence according to an embodiment of the present disclosure, which performs anomaly detection on an actual underwater glider data set;

[0033] Figure 6 A structural block diagram of an underwater glider abnormality detection device based on a data sequence according to an embodiment of the present disclosure is schematically shown; and

[0034] Figure 7 A block diagram of an electronic device suitable for implementing a method for detecting underwater glider anomalies based on a data sequence according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0035] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0036] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0037] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0038] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0039] In the technical solution of the present disclosure, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0040] In the scenario of using personal information for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure provide users with corresponding operation portals for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating a person's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs, and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge and skills, and have reached a certain level of professionalism.

[0041] An embodiment of the present disclosure provides an underwater glider anomaly detection method based on data sequences, comprising: preprocessing a data sequence collected by an underwater glider to obtain a data sequence to be detected, wherein the data sequence to be detected includes a training sequence and a label sequence, the training sequence includes a data sequence with a length of W in the data sequence to be detected, the length of the label sequence is P, including the last P-1 data sequences in the training data as predicted input data, and a data after the training data in the data sequence to be detected as reference output data; determining the correlation difference of data corresponding to a time point in the training sequence, wherein the correlation difference characterizes the degree of correlation between the data and data corresponding to other time points in the training sequence; obtaining a reconstructed sequence based on the training sequence and the correlation difference; predicting the sequence based on the predicted input data in the label sequence to obtain predicted output data; and determining the anomaly detection result of the underwater glider based on the correlation difference, the reconstructed sequence, the predicted output data and the reference output data.

[0042] Figure 1 The application scenario diagram of the underwater glider anomaly detection method, device, equipment, medium and program product based on data sequence according to an embodiment of the present disclosure is schematically shown.

[0043] like Figure 1As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0044] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0045] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0046] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0047] It should be noted that the underwater glider anomaly detection method based on data sequence provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the underwater glider anomaly detection device based on data sequence provided in the embodiment of the present disclosure can generally be set in the server 105. The underwater glider anomaly detection method based on data sequence provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the underwater glider anomaly detection device based on data sequence provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0048] It should be understood that Figure 1The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0049] The following will be based on Figure 1 The scene described by Figure 2~Figure 5 The underwater glider anomaly detection method based on data sequence according to an embodiment of the present disclosure is described in detail.

[0050] Figure 2 The flowchart of the underwater glider anomaly detection method based on data sequence according to an embodiment of the present disclosure is schematically shown.

[0051] like Figure 2 As shown, the underwater glider anomaly detection method based on data sequence of this embodiment includes operations S210 to S250.

[0052] In operation S210, the data sequence collected by the underwater glider is preprocessed to obtain a data sequence to be detected, wherein the data sequence to be detected includes a training sequence and a label sequence.

[0053] According to an embodiment of the present disclosure, the training sequence includes a data sequence with a length of W in the data sequence to be detected, the length of the label sequence is P, the label sequence includes the last P-1 data sequences in the training data, and one data after the training data in the data sequence to be detected, wherein the last P-1 data sequences in the training data are predicted input data in the label sequence, and the one data after the training data in the data sequence to be detected is the reference output data in the label sequence.

[0054] In operation S220, correlation differences of data corresponding to time points in the training sequence are determined.

[0055] According to an embodiment of the present disclosure, when abnormal data appears at one or more time points in a training sequence, the data at the one or more time points are not highly correlated with other data in the training sequence, and the time point is an abnormal time point. Due to the scarcity of the above-mentioned abnormal time point, the abnormal time point itself is only good at establishing association with the data corresponding to the local time point nearby, but it is difficult to establish association with the data corresponding to the more distant time point.

[0056] In operation S230, a reconstructed sequence is obtained based on the training sequence and the associated difference.

[0057] According to an embodiment of the present disclosure, the correlation difference can be used to characterize the distribution characteristics of multiple data in the training sequence. The training sequence is reconstructed according to the correlation difference and the data at the time point corresponding to the correlation difference in the training sequence to obtain a reconstructed sequence.

[0058] In operation S240 , the sequence is predicted based on the predicted input data in the tag sequence to obtain predicted output data.

[0059] According to an embodiment of the present disclosure, since the predicted input data in the tag sequence is the preceding data of the reference output data, the reference output data can be predicted according to the predicted input data to obtain the predicted output data.

[0060] In operation S250, an abnormality detection result of the underwater glider is determined based on the correlation difference, the reconstructed sequence, the predicted output data, and the reference output data.

[0061] According to an embodiment of the present disclosure, based on the association difference, the reconstructed sequence, the predicted output data and the reference output data, an indicator for characterizing the severity of the abnormality of the underwater glider can be determined, wherein the indicator value comprehensively considers the loss when reconstructing the training sequence, the loss when predicting the label sequence and the loss determined according to the association difference.

[0062] According to an embodiment of the present disclosure, when the index value is not greater than a preset threshold, the abnormality detection result indicates that the underwater glider has no abnormality, and when the index value is greater than the preset threshold, the abnormality detection result indicates that the underwater glider has an abnormality.

[0063] According to the embodiments of the present disclosure, the data sequence collected by the underwater glider is preprocessed to obtain the data sequence to be detected, which reduces the impact of data missing and data corresponding to abnormal time points on the detection results and improves the availability of data. Based on the training sequence in the data sequence to be detected, the association difference and reconstruction result are determined, and the association difference and reconstruction loss are further determined. Based on the label sequence in the data sequence to be detected, the predicted output data is determined, and the prediction loss is further determined. Based on the association difference, reconstruction loss and prediction loss, the abnormal detection result of the underwater glider is determined, so that the abnormal detection process can simultaneously adapt to the association difference learning task, the reconstruction loss learning task and the prediction loss learning task. Therefore, the features learned by different learning tasks can better characterize the data, thereby improving the accuracy of the abnormal detection results.

[0064] According to an embodiment of the present disclosure, a data sequence collected by an underwater glider is preprocessed to obtain a data sequence to be detected, including: completing the data sequence to obtain a data completion result; normalizing the data completion result to obtain a normalized data sequence; and determining a training sequence and a label sequence based on the normalized data sequence.

[0065] According to an embodiment of the present disclosure, since the data sequence is collected by sensors of an underwater glider, data at some time points in the data sequence may be lost due to sensor instability and other reasons. Therefore, the data sequence can be supplemented by interpolation to obtain a data supplement result.

[0066] According to an embodiment of the present disclosure, the data completion result is normalized to obtain a normalized data sequence, wherein the data normalization method includes but is not limited to minimum-maximum normalization, Z-score normalization, decimal calibration normalization, etc. The normalized data sequence is divided using a sliding window method or the like to determine a training sequence and a label sequence.

[0067] According to the embodiments of the present disclosure, data completion and normalization of data sequences can improve the availability of data, thereby improving the anomaly detection effect. Dividing the data to determine the training sequence and label sequence can make the data meet the input format requirements of the model and improve the anomaly detection efficiency.

[0068] According to an embodiment of the present disclosure, a data sequence includes a multivariate data sequence collected by one or more sensors of an underwater glider; data completion is performed on the data sequence to obtain a data completion result, including: determining a start time and an end time of each data sequence in the data sequence; in the case where the data sequence is a multivariate data sequence, determining a start acquisition time and an end acquisition time of the data sequence based on multiple start times and multiple end times; determining multiple resampling timestamps within an acquisition time interval, wherein the acquisition time interval is determined based on the start acquisition time and the end acquisition time; using a first sliding window, dividing the acquisition time interval into multiple interpolation windows, wherein a preset window length and a sliding step of the first sliding window are both first preset lengths; and using a linear interpolation method, interpolating at the resampling timestamp in each interpolation window to obtain a data completion result.

[0069] According to an embodiment of the present disclosure, the data sequence includes a multi-dimensional data sequence collected by one or more sensors of the underwater glider, wherein the data sequences collected by the multiple sensors respectively include a depth data sequence, a roll angle data sequence, a pitch angle data sequence, a heading angle data sequence, a data sequence characterizing the change of the position of the battery pack over time, etc.

[0070] According to an embodiment of the present disclosure, when the data sequence is a multivariate data sequence, the data sequence is a multivariate data sequence collected by multiple sensors of an underwater glider, and the operating time, sampling interval and other parameters of each of the multiple sensors may be different. Therefore, the working time of multiple sensors can be aligned by data completion.

[0071] According to an embodiment of the present disclosure, the start time and end time of each data sequence collected by each sensor in the multivariate data sequence are determined, wherein the start time indicates the moment when the sensor starts working, and the end time indicates the moment when the sensor stops working.

[0072] According to an embodiment of the present disclosure, the start time of the data sequence is determined based on the start time and end time of each data sequence collected by multiple sensors. and end collection time , as shown in formulas (1) to (2):

[0073] (1)

[0074] (2)

[0075] in, represents the starting time of the data sequence collected by the jth sensor,

[0076] It indicates the end time of the data sequence collected by the jth sensor, the start collection time indicates the start time of the sensor that starts collecting data earliest, and the end collection time indicates the end time of the sensor that ends collecting data latest.

[0077] According to an embodiment of the present disclosure, based on the start acquisition time and the end acquisition time, an acquisition time interval is determined, and multiple resampling timestamps are determined within the acquisition time interval. , as shown in formula (3):

[0078] (3)

[0079] Here, q is the resampling interval.

[0080] According to an embodiment of the present disclosure, a first sliding window is used to divide the acquisition time interval into multiple interpolation windows, wherein the preset window length and sliding step of the first sliding window are both first preset lengths, wherein for the interpolation window including the resampling timestamp, a linear interpolation method is used to determine the completion value at the resampling timestamp in each interpolation window, and the completion value is inserted into the position of the resampling timestamp to complete data completion and obtain a data completion result, wherein the completion value is calculated separately based on the data of each dimension in the multivariate data sequence.

[0081] According to the embodiments of the present disclosure, by completing the data sequence, the time of the data collected by multiple sensors can be aligned, so that the input data features are more comprehensive, thereby avoiding the problem of prediction errors caused by missing sensor data.

[0082] According to the embodiment of the present disclosure, after the data completion result is obtained, the average value is calculated for the data completion result corresponding to the data collected by the jth sensor. and standard deviation , as shown in formulas (4) to (5):

[0083] (4)

[0084] (5)

[0085] Among them, T represents the number of data, Z ij Represents the value of the jth sensor at the i-th time point.

[0086] According to an embodiment of the present disclosure, for the data completion result corresponding to the data collected by the jth sensor, based on the average value and standard deviation The data completion result is normalized as shown in formula (6):

[0087] (6)

[0088] Among them, X ij It represents the normalized value of the j-th sensor at the i-th time point.

[0089] According to an embodiment of the present disclosure, the underwater glider anomaly detection method based on data sequence also includes: dividing the time series data to be detected multiple times to obtain training sequences corresponding to multiple time points; based on each training sequence, determining a label sequence corresponding to the time point of the training sequence in the time series data to be detected; based on the training sequence and label sequence at each time point, determining the anomaly detection result of the underwater glider at the time point; and determining the abnormal situation of the underwater glider based on multiple anomaly detection results.

[0090] According to an embodiment of the present disclosure, the time series data to be detected is divided multiple times to obtain training sequences corresponding to multiple time points, wherein the division can be performed using a sliding window. For example, the time series data to be detected is divided into training sequences corresponding to multiple time points using a second sliding window, wherein the time point of the training sequence can be determined based on the starting time point of multiple data in each training sequence, the length of the second sliding window is W, and the sliding stride is less than W, thereby ensuring that after multiple divisions, the data at each time point in the time series data to be detected belongs to at least one training sequence, and preferably, the sliding stride can be 1.

[0091] According to an embodiment of the present disclosure, based on each training sequence, a label sequence corresponding to the time point of the training sequence is determined in the time series data to be detected, wherein the length of the label sequence is P, and P is less than W. For example, when the time point corresponding to the last data of the training sequence is k, the data corresponding to the k-P+2th time point to the k+1th time point in the time series data to be detected is intercepted using a third sliding window of length P as the label sequence, wherein the length of the data corresponding to the k-P+2th time point to the kth time point is P-1, which is the predicted input data in the label sequence, and the length of the data corresponding to the k+1th time point is 1, which is the reference output data in the label sequence.

[0092] According to an embodiment of the present disclosure, based on the training sequence and the label sequence at each time point, the associated difference, the reconstructed sequence, the predicted output data and the reference output data are determined, and the abnormal detection result of the underwater glider at the time point is determined, wherein the label sequence corresponding to the training sequence at a certain time point is the label sequence at the time point. Based on multiple abnormal detection results, the abnormal situation of the underwater glider is determined. When multiple abnormal detection results all indicate that the underwater glider has no abnormality, the abnormal situation of the underwater glider indicates that the underwater glider operates normally without abnormality. When there is an abnormal detection result indicating that the underwater glider has an abnormality among multiple abnormal detection results, the abnormal situation of the underwater glider indicates that the underwater glider has an abnormality.

[0093] According to an embodiment of the present disclosure, the time series data to be detected is divided multiple times so that the divided multiple windows cover all the data in the time series data to be detected, thereby ensuring that the state of the underwater glider at each time point in the time series data to be detected is detected, thereby ensuring the accuracy and comprehensiveness of the detection.

[0094] According to an embodiment of the present disclosure, determining the association difference of data corresponding to a time point in a training sequence includes: inputting the training sequence into a first embedding layer of an anomaly detection model to obtain first embedded data; fusing the first embedded data with a first position code of the data sequence to obtain first fused data; and inputting the first fused data into an encoder to obtain the association difference of data corresponding to the time point in the training sequence, wherein the association difference includes a priori association and a sequence association, the priori association characterizing the degree of association between the data corresponding to the time point calculated using a first weight and the training sequence, and the sequence association characterizing the degree of association between the data corresponding to the time point calculated using a second weight and the training sequence, wherein the weight value assigned by the first weight to data corresponding to other time points that are farther away from the time point is lower than the weight value assigned by the second weight to data corresponding to other time points that are farther away from the time point.

[0095] According to an embodiment of the present disclosure, the training sequence is input into the first embedding layer of the anomaly detection model to obtain the first embedded data, wherein the first embedding layer can be used to convert the input data into a data format that can be processed by the anomaly detection model, that is, the first embedded data is a data format that can be processed by the anomaly detection model, the input channel of the first embedding layer can be N, and the output channel can be , the first embedding layer may include a convolution layer with a convolution kernel size of 3.

[0096] According to an embodiment of the present disclosure, based on the position information of each of the multiple data in the data sequence, the first position code of each of the multiple data is determined, and the first embedded data is fused with the first position code to obtain the first fused data. It can be determined according to formula (7):

[0097] (7)

[0098] in, Represents the data corresponding to a time point in the training sequence.

[0099] According to an embodiment of the present disclosure, the first fusion data is input into the encoder to obtain the correlation difference of the data corresponding to the time point in the training sequence, wherein the correlation difference includes a priori correlation and sequence correlation, the priori correlation represents the correlation degree between the data corresponding to the time point calculated by the first weight and the training sequence, the sequence correlation represents the correlation degree between the data corresponding to the time point calculated by the second weight and the training sequence, wherein the weight value assigned by the first weight to the data corresponding to other time points far away from the time point is lower than the weight value assigned by the second weight to the data corresponding to other time points far away from the time point, the first weight can be calculated by a learnable Gaussian kernel function, the sequence correlation represents the correlation degree between the data corresponding to the time point and the training sequence, including the correlation weight distribution between the data at each time point and the entire training sequence, and the second weight can be calculated by self-attention in the transformer model.

[0100] Figure 3 The structure diagram of the anomaly detection model for underwater glider anomaly detection based on data sequence according to an embodiment of the present disclosure is schematically shown.

[0101] like Figure 3 As shown, the model structure includes two parts, wherein the first embedding layer, the encoder and the first decoder are used to process the training sequence, and the second embedding layer and the second decoder are used to process the label sequence.

[0102] Preferably, the encoder includes L layers, each of which includes abnormal multi-head attention, a first layer of standardization, a feedforward layer, and a second layer of standardization in sequence, wherein a residual connection is set before the first layer of standardization and the second layer of standardization, and the feedforward layer includes two convolutional layers with a convolution kernel size of 1 connected in series, and the input channel of the first convolutional layer is , the output channel is , the input channel of the second convolutional layer is , the output channel is .

[0103] According to an embodiment of the present disclosure, after the training sequence is combined with the first position code to obtain the first fused data, the first fused data is input into the encoder, and the multivariate time series data output by the encoder layer l-1 is recorded as .

[0104] According to an embodiment of the present disclosure, an unusual multi-head attention mechanism in the encoder is used to calculate the prior correlation and sequence correlation of the first fusion data.

[0105] According to an embodiment of the present disclosure, the abnormal multi-head attention mechanism of the encoder layer l is used to process the multivariate time series data output by the encoder layer l-1 to determine the prior association It can be calculated according to formula (8):

[0106] (8)

[0107] in, Represents the kernel parameter matrix in the Gaussian distribution kernel function, which is each time series data in the multivariate time series data output by the encoder layer l-1 Using learnable Gaussian kernel parameter weight matrix Mapped, represents the Gaussian kernel parameter corresponding to the i-th time point in the first fusion data. i and j represent different time points. By modifying the values ​​of i and j, the prior association between the time series data at different time points can be determined. It means to normalize the Gaussian distribution to the range of [0,1].

[0108] According to an embodiment of the present disclosure, the abnormal multi-head attention mechanism of the encoder layer l is used to process the multivariate time series data output by the encoder layer l-1 to determine the sequence association It can be calculated according to formula (9):

[0109] (9)

[0110] Among them, Q and K are parameter matrices, which convert each time series data in the multivariate time series data output by the encoder layer l-1 into Using learnable weight matrices Mapped.

[0111] According to an embodiment of the present disclosure, each time series data in the multivariate time series data output by the encoder layer l-1 Input to the encoder layer l, the abnormal multi-head attention mechanism uses a learnable weight matrix The parameter matrix V is obtained by mapping, and V is used to calculate the reconstruction result of the sequence association after the abnormal multi-head attention mechanism , as shown in formula (16):

[0112] (10)

[0113] According to an embodiment of the present disclosure, each of the multiple time series data output by the l-1th layer of the encoder Instead of rebuilding the results After the residual connection, the first layer is normalized to obtain the hidden representation of the lth layer. , as shown in formula (11):

[0114] (11)

[0115] Among them, LayerNorm (·) represents layer normalization and + represents residual connection.

[0116] According to an embodiment of the present disclosure, the hidden representation of the lth layer Input to the feedforward layer for processing, and the processing results are compared with After the residual connection, the second layer is used for layer normalization to obtain the time series data output by the encoder layer l. , as shown in formula (12):

[0117] (12)

[0118] Among them, FeedForward (·) represents the feedforward layer.

[0119] According to an embodiment of the present disclosure, the output of the Lth layer of the encoder Input to the decoder to obtain the reconstruction result of the training sequence, that is, the reconstructed sequence .

[0120] According to an embodiment of the present disclosure, association differences are determined based on training sequences. Since the prior association reflects the inductive deviation in the adjacent concentration of each time point, that is, it is more difficult for abnormal time points to establish a strong association with the entire sequence, but they are more inclined to establish associations with adjacent time points. Sequence association can provide a rich description of the temporal context and reflect the dynamic patterns of time series data, such as periodicity or trends. Therefore, the changing pattern of association differences can improve the accuracy of distinguishing normal and abnormal time points.

[0121] According to an embodiment of the present disclosure, based on the predicted input data in the label sequence, the sequence is predicted to obtain predicted output data, including: inputting the predicted input data into the second embedding layer of the anomaly detection model to obtain second embedded data, fusing the second embedded data with the second position encoding of the label sequence to obtain second fused data, and inputting the second fused data into the second decoder to obtain predicted output data.

[0122] Preferably, the second embedding layer includes a convolution layer with a convolution kernel size of 3, an input channel of N, and an output channel of d model .

[0123] The second decoder includes L layers, each of which includes a masked multi-head self-attention mechanism, a third-layer standardization, a multi-head self-attention mechanism, a fourth-layer standardization, a feedforward layer, and a fifth-layer standardization. Residual connections are set before the third-layer standardization, the fourth-layer standardization, and the fifth-layer standardization. The feedforward layer includes two convolutional layers with a convolution kernel size of 1 connected in series. The input channel of the first convolutional layer is , the output channel is , the input channel of the second convolutional layer is , the output channel is .

[0124] According to an embodiment of the present disclosure, the second decoder first uses a masked multi-head self-attention mechanism to extract temporal features from the input label sequence. The masked multi-head self-attention mechanism uses a masking mechanism to process the learnable weight matrix to ensure that only past information but not future information can be used when predicting the next element. Secondly, the multi-head self-attention mechanism is used to combine the semantic information of the training sequence and the label sequence to extract temporal features again.

[0125] According to an embodiment of the present disclosure, the label sequence is fused with the second position code to obtain the second fused data, and the second fused data is input to the second decoder. The first layer of the second decoder determines the time series feature extraction result through the masked multi-head attention mechanism. , as shown in formula (13):

[0126] (13)

[0127] According to an embodiment of the present disclosure, each time series data in the multivariate time series data output by the second decoder layer l-1 And the results of temporal feature extraction after the masked multi-head self-attention mechanism Perform residual connection and use the third layer standardization to perform layer standardization to obtain the first hidden representation of the lth layer .

[0128] According to an embodiment of the present disclosure, the hidden representation of the second decoder layer l is The learnable weight matrix W after the multi-head self-attention mechanism q The mapping obtains the tensor q, the time series data output by the encoder layer L The learnable weight matrix W after the multi-head self-attention mechanism k , W v Get the tensors k and v, and use formula (14) to calculate the time series feature extraction result after the multi-head self-attention mechanism :

[0129] (14)

[0130] According to an embodiment of the present disclosure, the temporal feature extraction result of the second decoder layer l after the multi-head self-attention mechanism and the first hidden representation of layer l After the residual connection, the fourth layer is used for layer normalization to obtain the second hidden representation of the lth layer. The second hidden representation of the lth layer is passed through the feedforward layer and is residually connected with the second hidden representation of the lth layer. The fifth layer is used for layer normalization to obtain the time series data output by the lth layer of the second decoder. .

[0131] According to an embodiment of the present disclosure, the second decoder may include an input channel , the linear layer with N output channels, the time series data output by the Lth layer of the second decoder After linear layer mapping, the predicted output data corresponding to the label sequence is obtained , as shown in formula (15):

[0132] (15)

[0133] According to an embodiment of the present disclosure, an abnormality detection result of an underwater glider is determined based on association differences, a reconstructed sequence, predicted output data and reference output data, including: determining a reconstruction loss based on a reconstructed sequence and a training sequence; determining a prediction loss based on the predicted output data and the reference output data; determining an association difference based on a priori association and a sequence association; and determining an anomaly score of the time series data to be detected based on the association difference, the reconstruction loss and the prediction loss; and determining an abnormality detection result of the underwater glider based on the anomaly score.

[0134] According to an embodiment of the present disclosure, based on the prior association and the sequence association in the association difference, the association difference is determined. , as shown in formula (16):

[0135] (16)

[0136] where AssDis(·) represents the association difference function, represents the first fused data of a time window, L represents the number of layers of the encoder, KL (·||·) represents the KL divergence, W represents the window length of the second sliding window, Represents the prior association between the data corresponding to the i-th time point in the input data of the encoder layer l and the input data of the encoder layer l, Represents the sequence association between the data corresponding to the i-th time point in the input data of the encoder layer l and the input data of the encoder layer l.

[0137] According to an embodiment of the present disclosure, based on the reconstruction sequence and the training sequence, the reconstruction loss is determined. , as shown in formula (17):

[0138] (17)

[0139] Among them, L recon (·) represents the reconstruction loss function, Represents the data of a time window in the reconstruction result, represents the data of a time window in the training sequence, express The data vector corresponding to the i-th time point, express The data vector corresponding to the i-th time point.

[0140] According to an embodiment of the present disclosure, based on the predicted output data and the reference output data, the predicted loss is determined. , as shown in formula (18):

[0141] (18)

[0142] Among them, L pre (·) represents the prediction loss function, Represents the predicted output data of a time window, Representation and The label sequence of the same time window, express The data vector corresponding to the last time point, express Reference output data.

[0143] According to an embodiment of the present disclosure, based on the association difference, reconstruction loss and prediction loss, the anomaly score of the time series data to be detected is determined, and based on the anomaly score, the anomaly detection result of the underwater glider is determined, as shown in formula (19):

[0144] (19)

[0145] Among them, β is a weight hyperparameter, which can be selected based on experience.

[0146] According to the embodiments of the present disclosure, since the changing rules of correlation differences can improve the accuracy of distinguishing normal and abnormal time points, determining the anomaly score based on correlation differences, reconstruction loss and prediction loss can comprehensively determine whether there are anomalies in the time series data, thereby further improving the detection accuracy of the underwater glider anomaly detection method based on data sequences.

[0147] According to an embodiment of the present disclosure, an abnormality detection result of an underwater glider is determined based on an abnormality score, including: comparing the abnormality score with a preset abnormality threshold to determine a comparison result; and when the comparison result indicates that the abnormality score is greater than the abnormality threshold, determining that the abnormality detection result of the underwater glider is a state abnormality.

[0148] According to an embodiment of the present disclosure, based on the data in the training sequence, the associated difference corresponding to the data is determined, and the time series data output by the encoder is determined using formula (12): , the time series data output by the encoder is input into the decoder to obtain the reconstruction result of the training sequence, that is, the reconstructed sequence , as shown in formula (20):

[0149] (20)

[0150] Among them, Linear (·) represents a linear layer.

[0151] According to an embodiment of the present disclosure, a training method for an anomaly detection model includes: preprocessing a sample data sequence to obtain a sample data sequence to be detected, wherein the sample data sequence is obtained from a sample data sequence set, the sample data sequence set includes historical readings of one or more sensors of an underwater glider over time, and the sample data sequence to be detected includes a sample training sequence and a sample label sequence; inputting the sample data sequence to be detected into an initial anomaly detection model to obtain sample association differences of the sample training sequence, a sample reconstruction sequence, and sample prediction output data determined based on the sample label sequence; determining a loss function of the initial anomaly detection model based on the sample association differences, the sample reconstruction sequence, and the sample prediction output data; and adjusting model parameters of the initial anomaly detection model based on the loss function until the loss value determined based on the loss function is minimized.

[0152] According to an embodiment of the present disclosure, a sample data sequence is processed using a method similar to that used for a data sequence, and after obtaining the sample association difference, sample reconstruction loss, and sample prediction loss corresponding to the sample data sequence, a loss function of an initial anomaly detection model is determined based on the sample association difference, sample reconstruction loss, and sample prediction loss. , as shown in formula (21):

[0153] (twenty one)

[0154] Among them, k is a weight hyperparameter, which can be selected based on experience, ||·|| 1 represents L1 regularization loss.

[0155] According to an embodiment of the present disclosure, based on the loss function, the model parameters of the initial anomaly detection model are adjusted until the loss value determined based on the loss function is minimized, the current network parameters are fixed, and the anomaly detection model is obtained.

[0156] According to an embodiment of the present disclosure, the initial anomaly detection model is trained using sample time series data, and the model parameters of the initial anomaly detection model are adjusted, thereby improving the accuracy and robustness of the adjusted anomaly detection model in processing time series data.

[0157] According to an embodiment of the present disclosure, based on the loss function, adjusting the model parameters of the initial anomaly detection model includes: determining the size relationship between the prior association and the sequence association; when the sample sequence association in the loss function is fixed, adjusting the prior association based on the minimum strategy and the size relationship to obtain the adjusted prior association; when the sample prior association in the loss function is fixed, maximizing the sequence association based on the maximum strategy to obtain the adjusted sequence association; and adjusting the model parameters of the initial anomaly detection model based on the adjusted prior association and the adjusted sequence association.

[0158] According to an embodiment of the present disclosure, the magnitude relationship between the prior association and the sequence association is determined. In the case where the data at a certain time point in the sample data sequence is abnormal data, the abnormal data may have a high degree of association with the data at adjacent time points, but a low degree of association with other data in the entire data sequence, so the difference between its prior association and the sequence association is not large, and thus the association difference of the abnormal data is small. For the time point when the data is normal data, since the degree of association between the normal data and all the data in the entire data sequence is high, the difference between the prior association of the normal data and the sequence association is large, and thus the association difference of the normal data is large.

[0159] According to the embodiments of the present disclosure, in the model training stage, the learning goal is to learn the data distribution patterns and data features at the time points corresponding to normal data, so it is necessary to maximize the correlation difference. Directly maximizing the correlation difference may cause the model to be overly sensitive to noise and outliers in the sample data sequence, and may make the Gaussian kernel parameters in the prior association too small, resulting in subsequent optimization difficulties. Therefore, the model parameters can be adjusted by combining the maximum and minimum strategies through alternating minimization and maximization processes.

[0160] According to an embodiment of the present disclosure, when the sample sequence association in the loss function is fixed, the prior association is adjusted by back propagation based on the minimum strategy and the size relationship, wherein the adjusted prior association is shown in formula (22):

[0161] (twenty two)

[0162] in, Represents a sequence association Without back-propagation calculation, the optimization goal of formula (22) is to reduce the difference between the adjusted prior correlation and the sequence correlation. When the prior correlation is smaller than the sequence correlation, the prior correlation is amplified; when the prior correlation is larger than the sequence correlation, the prior correlation is reduced.

[0163] According to an embodiment of the present disclosure, when the sample prior association in the loss function is fixed, based on the maximum strategy, the sequence association is maximized by back propagation to obtain the adjusted sequence association. The optimization target of the second solution is shown in formula (23):

[0164] (twenty three)

[0165] in, Represents the prior association No back-propagation calculation is performed.

[0166] According to an embodiment of the present disclosure, the model parameters of the initial anomaly detection model are adjusted using the loss function calculation result obtained by the maximum and minimum strategy, and the maximum and minimum strategy is repeatedly used to perform the above back propagation and parameter adjustment process until the value of the loss function is minimized, thereby completing the adjustment of the model parameters.

[0167] According to the embodiments of the present disclosure, the minimax strategy can be used to add stronger constraints to the learning process of the prior association, thereby improving the robustness of the training process and the accuracy of anomaly detection.

[0168] According to an embodiment of the present disclosure, an underwater glider anomaly detection method based on data sequence is used to conduct experiments on 5 authoritative real-world datasets representing the diversity of multivariate time series data distribution and 1 underwater glider actual dataset. The datasets used are Mars Science Laboratory (MSL), Pooled Server Metrics (PSM), Soil Moisture Active Passive (SMAP), Server Machine Dataset (SMD) and Secure Water Treatment (SWaT). The parameters of the real-world datasets are shown in Table 1.

[0169] Table 1

[0170]

[0171] Among them, Entities represents the number of entities, Dimensions represents the attribute dimension, Train and Test represent the number of training sets and test sets respectively, and Anomaly Rate represents the proportion of abnormal data in the total data of the data set.

[0172] According to the embodiments of the present disclosure, the effect of the underwater glider anomaly detection method based on data sequence can be demonstrated through comparative experiments with 7 more advanced models on the above 5 actual data sets, as shown in Table 2.

[0173] Table 2

[0174]

[0175] Among them, P is the precision, R is the recall, and F1 is the F1 score. According to Table 2, it can be determined that the underwater glider anomaly detection method based on data sequence has achieved the best or second best results among the eight models in most indicators of most data sets.

[0176] In the underwater glider anomaly detection method based on data sequence, the length of the second sliding window of the training sequence is set to 100, and the length of the label sequence is set to 10. and The number of layers of the encoder and the second decoder is set to 3, the number of heads of the multi-head anomaly attention mechanism, the masked multi-head self-attention mechanism, and the multi-head self-attention mechanism are all set to 8, the weight hyperparameter k of the underwater glider anomaly detection loss function is set to 0.7, β is set to 0.6, and the data batch size is 1024. The five data sets are divided into training sets and validation sets in a ratio of 8:2, the maximum training rounds are set to 10, and the model is trained using the Adam optimizer with a learning rate and weight decay of 1e-4. When the reconstruction loss on the validation set does not decrease for 5 consecutive rounds, the training is stopped, and the model with the lowest reconstruction loss on the validation set is retained.

[0177] Figure 4 A histogram of indicators of the underwater glider anomaly detection method based on data sequence and the comparison algorithm detected on a real-world data set according to an embodiment of the present disclosure is schematically shown.

[0178] like Figure 4 As shown in the figure, the heights of the bar graphs are the average indicators of the eight models on five different data sets. It can be determined that the three indicators of the underwater glider anomaly detection method based on data sequences, namely, the average accuracy, average recall and average F1 score are all higher than those of other comparison algorithms.

[0179] According to an embodiment of the present disclosure, specific characteristics of the actual data set of the underwater glider are shown in Table 3:

[0180] Table 3

[0181]

[0182] Among them, the underwater glider data with serial number 1 maintained a healthy operating state from deployment to the ocean to salvage on shore. The underwater glider with serial number 2 lost its right wing some time after being deployed to the ocean, and then maintained this abnormal state until it was salvaged on shore. Among them, the underwater glider data with serial number 1 is used to train the anomaly detection model, and the underwater glider data with serial number 2 is used to test the detection effect of the anomaly detection model.

[0183] Figure 5 The waveform diagram schematically shows anomaly detection performed on an actual underwater glider data set by the underwater glider anomaly detection method based on data sequence according to an embodiment of the present disclosure.

[0184] like Figure 5As shown in the figure, the waveforms are used to characterize the depth data, roll angle data, pitch angle data, position data of the battery pack, heading angle data and anomaly score of the underwater glider from top to bottom. According to the waveforms, it can be determined that when the timestamp is between 150000 and 175000, the anomaly score suddenly changes beyond the preset anomaly threshold, so the underwater glider is in an abnormal operating state after this time point. By analyzing multiple waveforms, it can be determined that the roll angle of the underwater glider suddenly changes, and then it is determined that the right wing of the underwater glider is lost after this time point.

[0185] Based on the above-mentioned underwater glider anomaly detection method based on data sequence, the present disclosure also provides an underwater glider anomaly detection device based on data sequence. Figure 6 The device is described in detail.

[0186] Figure 6 The structural block diagram of the underwater glider anomaly detection device based on data sequence according to an embodiment of the present disclosure is schematically shown.

[0187] like Figure 6 As shown, the underwater glider anomaly detection device 600 based on data sequence of this embodiment includes a data preprocessing module 610, an association difference determination module 620, a sequence reconstruction module 630, a sequence prediction module 640 and a result determination module 650.

[0188] The data preprocessing module 610 is used to preprocess the data sequence collected by the underwater glider to obtain the data sequence to be detected, wherein the data sequence to be detected includes a training sequence and a label sequence, the training sequence includes a data sequence with a length of W in the data sequence to be detected, the length of the label sequence is P, including the last P-1 data sequences in the training data as the prediction input data, and a data after the training data in the data sequence to be detected as the reference output data. In one embodiment, the data preprocessing module 610 can be used to perform the operation S210 described above, which will not be repeated here.

[0189] The association difference determination module 620 is used to determine the association difference of the data corresponding to the time point in the training sequence, wherein the association difference represents the degree of association between the data and the data corresponding to other time points in the training sequence. In one embodiment, the association difference determination module 620 can be used to perform the operation S220 described above, which will not be repeated here.

[0190] The sequence reconstruction module 630 is used to obtain a reconstructed sequence based on the training sequence and the associated difference. In one embodiment, the sequence reconstruction module 630 can be used to perform the operation S230 described above, which will not be described in detail here.

[0191] The sequence prediction module 640 is used to predict the sequence based on the predicted input data in the tag sequence to obtain predicted output data. In one embodiment, the sequence prediction module 640 can be used to perform the operation S240 described above, which will not be described in detail here.

[0192] The result determination module 650 is used to determine the abnormality detection result of the underwater glider based on the correlation difference, the reconstructed sequence, the predicted output data and the reference output data. In one embodiment, the result determination module 650 can be used to perform the operation S250 described above, which will not be repeated here.

[0193] According to an embodiment of the present disclosure, the data preprocessing module 610 includes a data completion submodule, a data normalization submodule and a sequence determination submodule.

[0194] The data completion submodule is used to complete the data sequence and obtain the data completion result.

[0195] The data normalization submodule is used to normalize the data completion results to obtain a normalized data sequence.

[0196] The sequence determination submodule is used to determine the training sequence and the label sequence based on the normalized data sequence.

[0197] According to an embodiment of the present disclosure, the data completion submodule includes a sub-time determination unit, a time determination unit, a timestamp determination unit, a window determination unit, and a linear interpolation unit.

[0198] The sub-time determination unit is used to determine the start time and end time of each data sequence in the data sequence.

[0199] The time determination unit is used to determine the start collection time and the end collection time of the data sequence based on multiple start times and multiple end times when the data sequence is a multivariate data sequence.

[0200] The time stamp determination unit is used to determine a plurality of resampling time stamps within a collection time interval, wherein the collection time interval is determined according to a start collection time and an end collection time.

[0201] The window determination unit is used to divide the acquisition time interval into a plurality of interpolation windows by using a first sliding window, wherein the preset window length and sliding step of the first sliding window are both first preset lengths.

[0202] The linear interpolation unit is used to interpolate at the resampling timestamp in each interpolation window using a linear interpolation method to obtain a data completion result.

[0203] According to an embodiment of the present disclosure, the underwater glider anomaly detection device 600 based on data sequence further includes a data division module, a label determination module, a detection result determination module and an anomaly determination module.

[0204] The data partitioning module is used to partition the time series data to be detected multiple times to obtain training sequences corresponding to multiple time points.

[0205] The label determination module is used to determine, based on each training sequence, a label sequence corresponding to a time point of the training sequence in the time series data to be detected.

[0206] The detection result determination module is used to determine the abnormal detection result of the underwater glider at a time point based on the training sequence and the label sequence at each time point.

[0207] The abnormality determination module is used to determine the abnormality of the underwater glider based on multiple abnormality detection results.

[0208] According to an embodiment of the present disclosure, the association difference determination module 620 includes an embedded data determination submodule, a fused data determination submodule and an association difference determination submodule.

[0209] The embedded data determination submodule is used to input the training sequence into the first embedding layer of the anomaly detection model to obtain the first embedded data.

[0210] The fused data determination submodule is used to fuse the first embedded data with the first position code of the data sequence to obtain first fused data.

[0211] The association difference determination submodule is used to input the first fused data into the encoder to obtain the association difference of the data corresponding to the time point in the training sequence, wherein the association difference includes a priori association and sequence association, the priori association represents the degree of association between the data corresponding to the time point calculated using the first weight and the training sequence, and the sequence association represents the degree of association between the data corresponding to the time point calculated using the second weight and the training sequence, wherein the weight value assigned by the first weight to the data corresponding to other time points far away from the time point is lower than the weight value assigned by the second weight to the data corresponding to other time points far away from the time point.

[0212] According to an embodiment of the present disclosure, the result determination module 650 includes a first error determination submodule, a second error determination submodule, a difference determination submodule, a score determination submodule and a result determination submodule.

[0213] The first error determination submodule is used to determine the reconstruction loss based on the reconstruction sequence and the training sequence.

[0214] The second error determination submodule is used to determine the prediction loss based on the predicted output data and the reference output data.

[0215] The difference determination submodule is used to determine the association difference based on the prior association and the sequence association.

[0216] The score determination submodule is used to determine the anomaly score of the time series data to be detected based on the association difference, reconstruction loss and prediction loss.

[0217] The result determination submodule is used to determine the abnormal detection result of the underwater glider based on the abnormal score.

[0218] According to an embodiment of the present disclosure, the result determination submodule includes a result comparison unit and a result determination unit.

[0219] The result comparison unit is used to compare the anomaly score with a preset anomaly threshold to determine the comparison result.

[0220] The result determination unit is used to determine that the abnormality detection result of the underwater glider is an abnormal state when the abnormality score represented by the comparison result is greater than the abnormality threshold.

[0221] According to an embodiment of the present disclosure, the sequence reconstruction module 630 includes a data determination submodule and a sequence reconstruction submodule.

[0222] The data determination submodule is used to determine the associated difference corresponding to the data based on the data in the training sequence.

[0223] The sequence reconstruction submodule is used to reconstruct the training sequence based on the data and the association difference to obtain the reconstructed sequence.

[0224] According to an embodiment of the present disclosure, the underwater glider anomaly detection device 600 based on data sequence further includes a sample data preprocessing module, a sample data processing module, a loss determination module and a loss optimization module.

[0225] The sample data preprocessing module is used to preprocess the sample data sequence to obtain the sample data sequence to be detected, wherein the sample data sequence is obtained from a sample data sequence set, the sample data sequence set includes the historical readings of one or more sensors of the underwater glider changing over time, and the sample data sequence to be detected includes a sample training sequence and a sample label sequence.

[0226] The sample data processing module is used to input the sample data sequence to be detected into the initial anomaly detection model to obtain the sample association difference of the sample training sequence, the sample reconstruction sequence and the sample prediction output data determined based on the sample label sequence.

[0227] The loss determination module is used to determine the loss function of the initial anomaly detection model based on the sample association difference, the sample reconstruction sequence and the sample prediction output data.

[0228] The parameter adjustment module is used to adjust the model parameters of the initial anomaly detection model based on the loss function until the loss value determined based on the loss function is minimized.

[0229] According to an embodiment of the present disclosure, the parameter adjustment module includes a size determination submodule, a priori adjustment submodule, a sequence adjustment submodule and a parameter adjustment submodule.

[0230] The size determination submodule is used to determine the size relationship between prior association and sequence association.

[0231] The prior adjustment submodule is used to adjust the prior association based on the minimum strategy and size relationship when the sample sequence association in the loss function is fixed, so as to obtain the adjusted prior association.

[0232] The sequence adjustment submodule is used to maximize the sequence association based on the maximum strategy when the sample prior association in the loss function is fixed, and obtain the adjusted sequence association.

[0233] The parameter adjustment submodule is used to adjust the model parameters of the initial anomaly detection model based on the adjusted prior correlation and the adjusted sequence correlation.

[0234] According to an embodiment of the present disclosure, any multiple modules of the data preprocessing module 610, the association difference determination module 620, the sequence reconstruction module 630, the sequence prediction module 640 and the result determination module 650 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the data preprocessing module 610, the association difference determination module 620, the sequence reconstruction module 630, the sequence prediction module 640 and the result determination module 650 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation modes of software, hardware and firmware or in a suitable combination of any of them. Alternatively, at least one of the data preprocessing module 610, the association difference determination module 620, the sequence reconstruction module 630, the sequence prediction module 640 and the result determination module 650 can be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function can be performed.

[0235] Figure 7A block diagram of an electronic device suitable for implementing a method for detecting underwater glider anomalies based on a data sequence according to an embodiment of the present disclosure is schematically shown.

[0236] like Figure 7 As shown, the electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 to a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include an onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0237] In RAM 703, various programs and data required for the operation of electronic device 700 are stored. Processor 701, ROM 702 and RAM 703 are connected to each other via bus 704. Processor 701 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 702 and / or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0238] According to an embodiment of the present disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to the bus 704. The electronic device 700 may further include one or more of the following components connected to the input / output (I / O) interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 708 including a hard disk, etc.; and a communication portion 709 including a network interface card such as a LAN card, a modem, etc. The communication portion 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage portion 708 as needed.

[0239] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0240] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 702 and / or RAM 703 described above and / or one or more memories other than ROM 702 and RAM 703.

[0241] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided by the embodiment of the present disclosure.

[0242] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 701. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0243] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 709, and / or installed from the removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0244] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0245] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0246] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0247] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0248] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A method for detecting anomalies of underwater gliders based on data sequences, characterized in that: The method comprises: Preprocessing the data sequence collected by the underwater glider to obtain a data sequence to be detected, wherein the data sequence to be detected includes a training sequence and a label sequence, the training sequence includes a data sequence with a length of W in the data sequence to be detected, the length of the label sequence is P, including the last P-1 data sequences in the training data as prediction input data, and a data after the training data in the data sequence to be detected as reference output data; Determining a correlation difference of data corresponding to a time point in the training sequence, wherein the correlation difference represents a degree of correlation between the data and data corresponding to other time points in the training sequence; Based on the training sequence and the associated difference, a reconstructed sequence is obtained; Based on the predicted input data in the label sequence, the sequence is predicted to obtain predicted output data; and based on the associated difference, the reconstructed sequence, the predicted output data and the reference output data, an abnormality detection result of the underwater glider is determined.

2. The method according to claim 1, characterized in that: The preprocessing of the data sequence collected by the underwater glider to obtain the data sequence to be detected includes: Performing data completion on the data sequence to obtain a data completion result; The data completion result is normalized to obtain a normalized data sequence; and based on the normalized data sequence, the training sequence and the label sequence are determined.

3. The method according to claim 2, characterized in that The data sequence includes a multi-element data sequence collected by one or more sensors of the underwater glider; The performing data completion on the data sequence to obtain a data completion result includes: Determine the start time and the end time of each of the data sequences; In the case where the data sequence is the multivariate data sequence, determining a start collection time and an end collection time of the data sequence based on a plurality of the start times and a plurality of the end times; Determine a plurality of resampling time stamps within a collection time interval, wherein the collection time interval is determined according to the start collection time and the end collection time; Using a first sliding window, the acquisition time interval is divided into multiple interpolation windows, wherein the preset window length and sliding step of the first sliding window are both first preset lengths; and using a linear interpolation method, interpolation is performed at the resampling timestamp in each of the interpolation windows to obtain a data completion result.

4. The method according to claim 2, characterized in that: The method further comprises: Dividing the time series data to be detected multiple times to obtain the training sequences corresponding to multiple time points; Based on each of the training sequences, determining the label sequence corresponding to the time point of the training sequence in the time series data to be detected; Based on the training sequence and the label sequence at each of the time points, an abnormality detection result of the underwater glider at the time point is determined; and based on the multiple abnormality detection results, an abnormal situation of the underwater glider is determined.

5. The method according to claim 2, characterized in that: The determining the correlation difference of the data corresponding to the time points in the training sequence includes: Inputting the training sequence into a first embedding layer of the anomaly detection model to obtain first embedded data; fusing the first embedded data with the first position code of the data sequence to obtain first fused data; and The first fused data is input into the encoder to obtain the correlation difference of the data corresponding to the time point in the training sequence, wherein the correlation difference includes a priori correlation and sequence correlation, the priori correlation represents the correlation degree between the data corresponding to the time point calculated using the first weight and the training sequence, and the sequence correlation represents the correlation degree between the data corresponding to the time point calculated using the second weight and the training sequence, wherein the weight value assigned by the first weight to the data corresponding to other time points far away from the time point is lower than the weight value assigned by the second weight to the data corresponding to other time points far away from the time point.

6. The method according to claim 5, characterized in that The determining of the abnormality detection result of the underwater glider based on the association difference, the reconstructed sequence, the predicted output data and the reference output data comprises: Determining a reconstruction loss based on the reconstruction sequence and the training sequence; determining a predicted loss based on the predicted output data and the reference output data; determining an association difference based on the a priori association and the sequence association; Determining an anomaly score of the time series data to be detected based on the association difference, the reconstruction loss, and the prediction loss; and Based on the anomaly score, an anomaly detection result of the underwater glider is determined.

7. The method according to claim 6, characterized in that The determining, based on the anomaly score, an anomaly detection result of the underwater glider comprises: Comparing the anomaly score with a preset anomaly threshold to determine a comparison result; and When the comparison result indicates that the abnormality score is greater than the abnormality threshold, it is determined that the abnormality detection result of the underwater glider is an abnormal state.

8. The method according to claim 1, characterized in that The step of obtaining a reconstructed sequence based on the training sequence and the associated difference comprises: Based on the data in the training sequence, determining an associated difference corresponding to the data; and The training sequence is reconstructed based on the data and the associated difference to obtain the reconstructed sequence.

9. The method according to claim 5, characterized in that The training method of the anomaly detection model includes: Preprocessing the sample data sequence to obtain a sample data sequence to be detected, wherein the sample data sequence is obtained from a sample data sequence set, the sample data sequence set includes historical readings of the one or more sensors of the underwater glider that change over time, and the sample data sequence to be detected includes a sample training sequence and a sample label sequence; Inputting the sample data sequence to be detected into an initial anomaly detection model to obtain sample association differences of the sample training sequence, a sample reconstruction sequence, and sample prediction output data determined based on the sample label sequence; Determining a loss function of the initial anomaly detection model based on the sample association difference, the sample reconstruction sequence, and the sample prediction output data; and Based on the loss function, the model parameters of the initial anomaly detection model are adjusted until the loss value determined based on the loss function is minimized.

10. The method according to claim 9, characterized in that The adjusting the model parameters of the initial anomaly detection model based on the loss function includes: Determining the magnitude relationship between the prior association and the sequence association; In the case where the sample sequence association in the loss function is fixed, adjusting the prior association based on a minimum strategy and the size relationship to obtain an adjusted prior association; When the sample prior correlation in the loss function is fixed, based on a maximum strategy, the sequence correlation is maximized to obtain an adjusted sequence correlation; and Based on the adjusted prior correlation and the adjusted sequence correlation, a model parameter of the initial anomaly detection model is adjusted.

Citation Information

Patent Citations

  • Machine room anomaly detection method and device based on graph structure and abnormal attention mechanism

    CN115018021A

  • Time sequence anomaly detection method based on neighborhood information fusion attention mechanism

    CN116680105A

  • Track geometric irregularity anomaly detection method and device based on deep learning

    CN118035824A

  • Ocean observation data anomaly detection method and system based on Transform structure

    CN118051853A

  • Battery anomaly detection method and device

    CN118444191A

Cited By

  • AUV operation motion forecasting method based on HAM-BiTL combination network model

    CN120257469A

  • Underwater glider trajectory tracking control method based on flow field reconstruction and electronic equipment

    CN122111076A