Social network anomaly detection method, system and device for missing time series data and storage medium

Through the combination of Gaussian kernel function and graph structure learning mechanism, the problem of missing time series data in social networks is solved, more accurate anomaly detection and pattern mining are achieved, and the effect of anomaly detection is improved.

CN118690296APending Publication Date: 2024-09-24ZHEJIANG BANGSUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410741997.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Existing technologies cannot effectively handle missing information in social network time series data, resulting in poor anomaly detection results, and do not fully consider data information in the time and space dimensions.

Method used

The Gaussian kernel function is used for data interpolation completion, and the missing information is integrated for anomaly detection through a graph structure learning mechanism based on node embedding and a graph attention mechanism based on multi-scale information.

Benefits of technology

It realizes automatic completion of missing data, improves interpolation accuracy and anomaly detection effects, and can effectively capture patterns in data and handle the interconnections between different social network time series data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690296A
    Figure CN118690296A
Patent Text Reader

Abstract

The invention discloses a missing time series data-oriented social network anomaly detection method, system and device and a storage medium, which can automatically complement and utilize missing parts in time series data in a social network and complete anomaly detection. According to the method, the time sequence correlation in a window is captured by utilizing a Gaussian kernel function, and interpolation completion can be carried out on missing data; data missing information is fused into a feature extraction part, a graph structure learning mechanism based on node embedding and a graph attention mechanism fusing multi-scale information such as node embedding and missing information are provided, and anomaly detection analysis is carried out on data. According to the method, the interpolation process can be adjusted in a self-learning mode, and better interpolation accuracy is achieved. According to the method, the mutual relation between different social network time series data is considered, and the potential data mode can be mined, so that the method has a better effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of time series data anomaly detection, and in particular to a social network anomaly detection method, system, device and storage medium for missing time series data. Background Art

[0002] In social network scenarios, there is a large amount of time series data, such as user activity records: records of various activities of users on social networks, such as posting, commenting, liking, sharing, following or unfollowing other users. Another example is social network indicators: social network platforms usually record and count some key indicators, such as the number of users, daily active users, number of likes, number of shares, number of comments, etc. Anomaly detection analysis of these data can help to discover potential value. For example, anomaly detection of indicators such as the number of likes and shares of users can detect malicious exposure. However, in many cases, during the process of data collection, transmission, storage, etc., there will be some missing of real data. For example, users cannot access some indicators due to privacy settings, or the indicator types of different user types are not exactly the same, and there will be missing after alignment. Missing data will have a negative impact on anomaly detection methods.

[0003] Current anomaly detection algorithms, such as the Internet of Things anomaly detection method and device based on graph structure learning (CN117688504A), do not fully consider the complexity of real data and cannot effectively deal with the situation when there is partial missing input data. For the missing information in the input data, most of them use some deterministic algorithms to supplement the data in the preprocessing stage, which is a two-stage process independent of the subsequent anomaly detection task, and the effect is not good.

[0004] Most methods also fail to effectively process data information in the time and space dimensions, and therefore cannot fully explore patterns in the data, greatly affecting the actual effect of anomaly detection tasks. For example, current anomaly detection methods do not consider the interconnections between different social network time series data, but instead treat all social network time series data as a high-dimensional data. Summary of the invention

[0005] The purpose of the present invention is to address the deficiencies of the prior art and propose a social network anomaly detection method, system, device and storage medium for missing time series data. The missing parts in the time series data in the social network can be automatically supplemented and utilized, and anomaly detection can be completed. In order to deal with the situation where the obtained data is partially missing, the present invention proposes to use the Gaussian kernel function to capture the time series correlation in the window, and the missing data can be interpolated and supplemented; the present invention integrates the missing data information into the feature extraction part, and proposes a graph structure learning mechanism based on node embedding and a graph attention mechanism that integrates node embedding, missing information and other multi-scale information to perform anomaly detection and analysis on the data.

[0006] The objective of the present invention is achieved through the following technical solutions: In a first aspect, the present invention provides a social network anomaly detection method for missing time series data, the method comprising the following steps:

[0007] (1) Obtain time series data from social networks, mark missing data, and divide time windows;

[0008] (2) interpolating each dimension of data in each time window based on the Gaussian kernel function;

[0009] (3) Define node embedding and construct a graph structure to represent the interconnections between dimensions of social network time series data;

[0010] (4) extracting high-level features from the interpolated data based on the set of neighbor nodes obtained from the graph structure;

[0011] (5) The high-level features of each dimension are bit-wise multiplied and fused with the corresponding node embeddings and input into the multi-layer perceptron for prediction of the data at the next moment, thus completing the training process;

[0012] (6) Obtain the social network time series data to be detected and divide it into time windows, calculate the anomaly score of each feature dimension with the actual data and predicted data and standardize it, and calculate the anomaly of the entire data point based on the standardized anomaly score.

[0013] Furthermore, in step (1), the marked missing data is constructed into a missing mask matrix, which is a 0, 1 matrix with the same dimension as the social network time series data, representing the missing state of the data. If the value of each site is 0, it means that the corresponding value of the social network time series data is missing.

[0014] Furthermore, in step (2), the Gaussian kernel function measures the influence of any time point in the time series window on the time dimension of the target time point. The overall time series information at the data point is obtained based on the Gaussian kernel function. In order to model the data intensive information of the corresponding data point, the intensity function is introduced for control to obtain the data of the target time point in the time window.

[0015] Furthermore, in step (3), the number of node embeddings is the same as the characteristic dimension of the social network time series data, and a candidate set of characteristic dimensions is constructed. When calculating the characteristic dimension associated dimension nodes, the K dimensions with the highest corresponding node embedding similarity are selected from the candidate set and the adjacency matrix is ​​updated to construct the graph structure. K is a hyperparameter used to limit the sparsity of the adjacency matrix.

[0016] Furthermore, in step (4), the feature dimension in the time window and the corresponding input data of the neighbor nodes obtained in the graph structure are connected with the corresponding data missing information respectively, and are linearly transformed into a vector of the same length as the node embedding. Based on the attention weighted calculation, high-level features are extracted through the activation function.

[0017] Furthermore, in step (6), the median and interquartile range of the predicted anomaly scores of the feature dimension at all time points are used as the standardized mean and variance, wherein the interquartile range is calculated as follows: firstly, the data is divided into four equal parts, and then the difference between the third quartile and the first quartile is taken as the interquartile range; the standardized anomaly score is compared with the anomaly threshold to determine whether the data is abnormal.

[0018] In a second aspect, the present invention further provides a social network anomaly detection system for missing time series data, the system comprising a data acquisition module, a pre-interpolation module, a node embedding module, a high-level feature extraction module, an information fusion module and an anomaly detection module;

[0019] The data acquisition module is used to acquire social network time series data, mark missing data and divide time windows;

[0020] The pre-interpolation module is used to perform interpolation based on the Gaussian kernel function on each dimension of data in each time window;

[0021] The node embedding module is used to define node embedding and construct a graph structure to represent the interconnections between dimensions of social network time series data;

[0022] The high-level feature extraction module is used to extract high-level features from the interpolated data based on the neighbor node set obtained from the graph structure;

[0023] The information fusion module is used to perform bitwise multiplication and fusion of the high-level features of each dimension and the corresponding node embedding, and input them into the multi-layer perceptron for prediction of the data at the next moment, thus completing the training process;

[0024] The anomaly detection module is used to obtain the social network time series data to be detected and divide it into time windows, calculate the anomaly score of each feature dimension with actual data and predicted data and standardize it, and calculate the anomaly of the entire data point based on the standardized anomaly score.

[0025] In a third aspect, the present invention also provides a social network anomaly detection device for missing time series data, comprising a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, the social network anomaly detection method for missing time series data is implemented.

[0026] In a fourth aspect, the present invention further provides a computer-readable storage medium having a program stored thereon, and when the program is executed by a processor, the method for detecting anomalies in a social network with missing time series data is implemented.

[0027] In a fifth aspect, the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the social network anomaly detection method for missing time series data.

[0028] Beneficial effects of the present invention:

[0029] 1. The current anomaly detection algorithm does not fully consider the complexity of real data and cannot effectively deal with the situation when there is partial missing of input data. For the missing information in the input data, most of them use some deterministic algorithms to supplement the data in the preprocessing stage, which is a two-stage process independent of the subsequent anomaly detection task, and the effect is not good. This method can automatically fill in the missing data in the process without additional processing, and has better convenience. In addition, the algorithm can adjust the interpolation process by self-learning, and has better interpolation accuracy.

[0030] 2. Traditional methods do not effectively process data information in the time and space dimensions, so they cannot fully explore the patterns in the data, which greatly affects the actual effect of anomaly detection tasks. For example, the current anomaly detection method does not consider the mutual connection between different social network time series data, but processes all data as a high-dimensional data. This method takes into account the mutual connection between different social network time series data, and is more capable of mining potential data patterns, so it has better results.

[0031] 3. The method of the present invention is an end-to-end one-stage method and is easy to maintain. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0033] Figure 1 It is the overall flow chart of the method of the present invention.

[0034] Figure 2 It is a schematic diagram of the improved graph attention mechanism of the present invention.

[0035] Figure 3 It is a structural diagram of a social network time series data anomaly detection device for missing data provided by the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with the accompanying drawings and implementation examples. It should be understood that the specific implementation examples described herein are only used to explain the present invention and are not used to limit the present invention.

[0037] like Figure 1 As shown, the present invention provides a social network time series data anomaly detection method for missing data, which is more in line with the complex data patterns in actual application scenarios and can automatically process the missing parts in the social network time series data without additional preprocessing. At the same time, in the anomaly detection process, it can process the mutual connection between different dimensions of social network time series data and can better capture potential data anomalies.

[0038] The process of the present invention is divided into a data training process and an anomaly detection process. First, the steps of the model training process are described:

[0039] 1. The collected social network time series data is expressed as: X = {X1, X2, ..., X i , ..., X N} represents a time series set with a dimension of N, where N is the number of users in the social network, and X i ∈R T , 1≤i≤N, represents the behavior of the i-th user in the social network at different times, such as likes, attention, sharing, etc. It is a T-dimensional feature vector, where T is the time window length of the user data. In addition, for the missing part in the social network time series data, it is expressed as: M={M1,M2,...,M i , ..., M N}, where M i ∈R T, 1≤i≤N, and M i,k ∈{0, 1}, 1≤k≤T, that is, M is a 0, 1 matrix with the same dimension as X, which is used to characterize the missing data. If the value of each site is 0, it means that the corresponding value of X is missing, so the model should not access the corresponding data. Divide X and M into time windows of length w, where w is a hyperparameter.

[0040] 2. For each user behavior data, interpolate based on the Gaussian kernel function to complete the missing data, as follows. Consider the i-th user behavior data X i , the Gaussian kernel function can be mathematically expressed as: Its meaning is to measure the relative value of any time point t in the time series window to the target time point t * The time dimension of α i is a learnable parameter used to adjust the influence of each user’s time series behavior. The overall parameter α = [α1, α2, ..., α N ], N is the number of users. Based on the Gaussian kernel function, the sequence X i Data point at target time The overall timing information obtained at the location is: in Indicates the corresponding value of the missing mask matrix, indicating whether the data point exists. represents the data of the i-th user at time point t. In order to model the data-intensive information of the corresponding data point, the intensity function is introduced The value of is further controlled by: in It means the i-th user at time point t in the time window * The data of the entire time window is expressed as Finally, the interpolation work of the first step is completed, which is expressed as: The interpolation operation

[0041] 3. Define node embedding: v i ∈R d , 1≤i≤N, the node embedding is N d-dimensional vectors. The present invention constructs a graph structure from the node embedding to simulate the mutual connection between different user temporal behaviors in different social networks. Specifically: Among them C i represents the candidate set of users with associated relationships, N represents the number of users. When calculating the associated dimension node of user i, the candidate set C i Select the K dimensions with the highest embedding similarity of the corresponding nodes and update the adjacency matrix, where K is a hyperparameter; e ji vi and v j The connecting edges represent the mutual connection between users’ temporal behaviors. Finally, the graph structure is constructed: A ij =1{j∈TopK({e ki :k∈C i})}, where A represents the final adjacency matrix, and the TopK function returns the index position of the largest K numbers in its input, which is used to limit the sparsity of the matrix. 4. Output of step 2 Perform high-level feature extraction to complete the anomaly detection process. Figure 2 Specifically, express The high-level features extracted by the i-th user are: in, represents the input features of the i-th user, The corresponding data is missing information. represents the connection operation, ReLU represents the ReLU activation function, Represents the set of neighbor nodes obtained from the learned graph structure, W∈R d×(2w) , is a learnable parameter, which means that the input data and missing data information are linearly transformed into a vector of the same length as the node embedding for downstream operations. i,j Represents the attention score weight. Its calculation process is similar to the standard GAT. This method adds two aspects: data missing information and graph node embedding: in, Indicates the connection operation, v i represents the dynamic node embedding corresponding to node i, and LeakyReLU represents the LeakyReLU activation function.

[0042] 5. For the high-level feature representation obtained in step 4, specifically, for the extracted high-level features For each dimension of the high-level features The result is multiplied and fused bit by bit with the corresponding node embedding, and the final result is output to the multi-layer perceptron for prediction of the data at the next moment, which can be expressed mathematically as: Among them, f θ Represents the feature extraction function. This model is implemented as a multi-layer perceptron. represents the bitwise multiplication operation. The loss function is designed as x (t) Indicates the real data corresponding to the predicted data.

[0043] After the model is trained according to the above process, anomaly detection will be performed, and the process is as follows:

[0044] 1. Exactly the same as the first step in the training process, the input data is obtained and divided into time windows.

[0045] 2. First, calculate the anomaly of each feature dimension: Err i (t) represents the predicted anomaly score of dimension i at time t. If the corresponding real data exists, the real value is used directly, otherwise the mean of the interpolated values ​​is used as the real value. In order to eliminate the possible characteristics and scale differences of data of different dimensions, the anomaly score needs to be further standardized. The specific calculation is: in, Represents the predicted anomaly score Err of dimension i at all time points i The median and interquartile range (IQR) of (t). The interquartile range is calculated by first dividing the data into four equal parts, and then taking the difference between the third quartile and the first quartile as the interquartile range. The standardized anomaly score of each dimension of the data will be used to calculate the anomaly of the entire data point at time t: A(t) = max i a i (t). The abnormal threshold is set as: Threshold = max t A s (t), where A s (t) represents the result after applying the simple sliding mean (SMA) to A(t) and performing threshold calculation in the validation set. All data with anomaly scores exceeding the Threshold are considered as abnormal data.

[0046] Corresponding to the aforementioned embodiment of a method for detecting anomalies in time series data of a social network with missing data, the present invention further provides an embodiment of a device for detecting anomalies in time series data of a social network with missing data.

[0047] See also Figure 3 An embodiment of the present invention provides a social network time series data anomaly detection device for missing data, including a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, it is used to implement a social network time series data anomaly detection method for missing data in the above embodiment.

[0048] An embodiment of a social network time series data anomaly detection device for missing data provided by the present invention can be applied to any device with data processing capabilities, and the device with data processing capabilities can be a device or apparatus such as a computer. The device embodiment can be implemented through software, or through hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of any device with data processing capabilities in which it is located reading the corresponding computer program instructions in the non-volatile memory into the internal memory for execution. From a hardware perspective, if Figure 3 As shown, it is a hardware structure diagram of any device with data processing capability where a social network time series data anomaly detection device for missing data provided by the present invention is located, except Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiments is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.

[0049] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0050] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.

[0051] An embodiment of the present invention further provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, a social network time series data anomaly detection method for missing data in the above embodiment is implemented.

[0052] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capability. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.

[0053] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the social network time series data anomaly detection method for missing data.

[0054] The above embodiments are used to illustrate the present invention rather than to limit the present invention. Any modification and change made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.

Claims

1. A social network anomaly detection method for missing time series data, characterized in that: The method comprises the following steps: (1) Obtain time series data from social networks, mark missing data, and divide time windows; (2) interpolating each dimension of data in each time window based on the Gaussian kernel function; (3) Define node embedding and construct a graph structure to represent the interconnections between dimensions of social network time series data; (4) extracting high-level features from the interpolated data based on the set of neighbor nodes obtained from the graph structure; (5) The high-level features of each dimension are bit-wise multiplied and fused with the corresponding node embeddings and input into the multi-layer perceptron for prediction of the data at the next moment, thus completing the training process; (6) Obtain the social network time series data to be detected and divide it into time windows, calculate the anomaly score of each feature dimension with the actual data and predicted data and standardize it, and calculate the anomaly of the entire data point based on the standardized anomaly score.

2. According to the method of claim 1, the social network anomaly detection method for missing time series data is characterized in that: In step (1), the marked missing data is constructed into a missing mask matrix, which is a 0, 1 matrix with the same dimension as the social network time series data, representing the missing data. If the value of each site is 0, it means that the corresponding value of the social network time series data is missing.

3. According to the method of claim 1, the social network anomaly detection method for missing time series data is characterized in that: In step (2), the Gaussian kernel function measures the influence of any time point in the time series window on the time dimension of the target time point. The overall time series information at the data point is obtained based on the Gaussian kernel function. In order to model the data intensive information of the corresponding data point, the intensity function is introduced for control to obtain the data of the target time point in the time window.

4. According to claim 1, a social network anomaly detection method for missing time series data is characterized in that: In step (3), the number of node embeddings is the same as the feature dimension of the social network time series data. A candidate set of feature dimensions is constructed. When calculating the feature dimension associated dimension nodes, the K dimensions with the highest corresponding node embedding similarity are selected from the candidate set and the adjacency matrix is ​​updated to construct the graph structure. K is a hyperparameter used to limit the sparsity of the adjacency matrix.

5. The social network anomaly detection method for missing time series data according to claim 1, characterized in that: In step (4), the feature dimension in the time window and the corresponding input data of the neighbor nodes obtained in the graph structure are connected with the corresponding data missing information respectively, and are linearly transformed into vectors of the same length as the node embedding. Based on the attention weighted calculation, high-level features are extracted through the activation function.

6. The social network anomaly detection method for missing time series data according to claim 1, characterized in that: In step (6), the median and interquartile range of the predicted anomaly scores of the feature dimension at all time points are used as the standardized mean and standard deviation, where the interquartile range is calculated as follows: first divide the data into four equal parts, then take the difference between the third quartile and the first quartile as the interquartile range; the standardized anomaly score is compared with the anomaly threshold to determine whether the data is abnormal.

7. A social network anomaly detection system for missing time series data that implements the social network anomaly detection method according to any one of claims 1 to 6, characterized in that: The system has a data acquisition module, a pre-interpolation module, a graph structure learning module, a spatiotemporal information extraction module, an information fusion prediction module and an anomaly detection module; The data acquisition module is used to acquire social network time series data, mark missing data and divide time windows; The pre-interpolation module is used to perform interpolation based on the Gaussian kernel function on each dimension of data in each time window; The graph structure learning module is used to define node embedding and construct a graph structure to represent the interconnections between dimensions of social network time series data; The spatiotemporal information extraction module is used to extract high-level features from the interpolated data based on the neighbor node set obtained from the graph structure; The information fusion prediction module is used to perform bitwise multiplication and fusion of the high-level features of each dimension and the corresponding node embedding, and input them into the multi-layer perceptron for prediction of the data at the next moment, thus completing the training process; The anomaly detection module is used to obtain the social network time series data to be detected and divide it into time windows, calculate the anomaly score of each feature dimension with actual data and predicted data and standardize it, and calculate the anomaly of the entire data point based on the standardized anomaly score.

8. A social network anomaly detection device for missing time series data, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that: When the processor executes the executable code, a social network anomaly detection method for missing time series data according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, a social network anomaly detection method for missing time series data according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for detecting anomalies in a social network for time series missing data as described in any one of claims 1 to 6 is implemented.