Zero-trust behavior anomaly detection method, device, electronic device and storage medium
Through the autoencoder model, the characteristic data of physical devices in the zero-trust network is trained and detected, which solves the problem of low abnormal detection accuracy in the prior art, and achieves higher behavior pattern recognition and abnormal detection accuracy.
Patent Information
- Application Number
- CN202411327891.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-09-23
AI Technical Summary
In zero-trust networks, it is difficult for the prior art to accurately detect abnormal behavior of physical devices, resulting in high false alarm rates for abnormal detection and low accuracy in building behavior patterns.
Using the autoencoder model, by obtaining the test feature data of the entity device, including global feature data, statistical feature data and sequence feature data, it is trained to reflect the behavior pattern of the entity device, and input the test feature data into the model for detection. If it is greater than the preset threshold, it is determined to be abnormal.
It improves the accuracy of physical equipment behavior patterns and the accuracy of abnormal detection, reduces the false alarm rate, and can more effectively identify behavior abnormalities.
Smart Images

Figure CN118869357B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security and data security technology, and in particular to a zero-trust behavior anomaly detection method, device, electronic device and storage medium. Background Art
[0002] In the zero-trust network scenario, it is usually necessary to determine whether the working behavior of each physical device is abnormal, that is, it is necessary to perform anomaly detection on each physical device. In addition, it is necessary to reduce the permissions of the physical devices with abnormal detection results through the anomaly detection results of each physical device, that is, to reduce the permissions of the physical devices with abnormal working behaviors. Therefore, how to achieve anomaly detection of physical devices in a zero-trust network has become an urgent problem to be solved. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a zero-trust behavior anomaly detection method, device, electronic device and storage medium to achieve anomaly detection of physical devices in a zero-trust network. The specific technical solution is as follows:
[0004] The present application provides a zero-trust behavior anomaly detection method, the method comprising:
[0005] Acquire test feature data of each entity device within a test time period, wherein the test feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the test feature data is used to characterize the association relationship between the requesting entity and the resource entity; the requesting entity is the entity device that initiates the behavior between the entity devices, and the resource entity is the entity device to which the behavior is directed; the statistical feature data in the test feature data is used to characterize the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and the sequence feature data in the test feature data is used to characterize the association order of the behavior between the requesting entity and the resource entity;
[0006] Inputting the test feature data into the autoencoder model, and calculating the decoded data output by the autoencoder model;
[0007] If the difference between the decoded data and the test characteristic data is greater than a preset threshold, determining that the physical device behaves abnormally;
[0008] The autoencoder model is pre-trained in the following way:
[0009] Acquire original sample data of each of the physical devices within a first preset time period;
[0010] Dividing the original sample data into a plurality of groups of first sample data according to the time of the behavior; wherein the time of the behavior represented by the first sample data in the same group is within the same first time window;
[0011] For each group of the first sample data, the first sample data is divided into a plurality of groups of second sample data according to the time of the behavior; wherein the time of the behavior represented by the second sample data in the same group is within the same second time window; and the second time window is smaller than the first time window;
[0012] Performing data processing on each group of the second sample data respectively to obtain feature data corresponding to each group of the second sample data;
[0013] For each group of the first sample data, concatenate the feature data corresponding to the second sample data included in the first sample data to obtain the feature data corresponding to the first sample data;
[0014] The feature data corresponding to each group of the first sample data are concatenated to obtain sample feature data; wherein the sample feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the sample feature data is used to characterize the association relationship between the requesting entity and the resource entity, the statistical feature data in the sample feature data is used to characterize the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and the sequence feature data in the sample feature data is used to characterize the association order of the behavior between the requesting entity and the resource entity;
[0015] Inputting the sample feature data into the original autoencoder model, and calculating the predicted decoding data output by the original autoencoder model;
[0016] Based on the difference between the predicted decoding data and the sample feature data, the parameters of the original autoencoder model are adjusted, and the original autoencoder model with adjusted parameters is used as the new original autoencoder model, and the step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the autoencoder model is returned to execute until the first preset termination condition is reached.
[0017] In a possible embodiment, the sample feature data includes global feature data;
[0018] The performing data processing on each group of the second sample data to obtain feature data corresponding to each group of the second sample data includes:
[0019] For each group of the second sample data, taking each of the entity devices as a node, connecting the nodes corresponding to the request entity that initiates the behavior represented by the second sample data and the resource entity targeted by the behavior, obtaining graph data corresponding to the second sample data, and converting the graph data into request global data and resource global data as the first global data corresponding to the second sample data; wherein the request global data is data with the request entity and behavior as dimensions, and the resource global data is data with the resource entity and behavior as dimensions;
[0020] For each group of the first sample data, the feature data corresponding to the second sample data included in the first sample data are concatenated to obtain the feature data corresponding to the first sample data, including:
[0021] For each group of the first sample data, concatenate the first global data corresponding to the second sample data included in the first sample data to obtain the second global data corresponding to the first sample data;
[0022] The step of concatenating the characteristic data corresponding to each group of the first sample data to obtain sample characteristic data includes:
[0023] splicing the second global data corresponding to each group of the first sample data to obtain the global feature data in the sample feature data;
[0024] The autoencoder model includes a graph autoencoder model, and the original autoencoder model includes an original graph autoencoder model;
[0025] The step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the original autoencoder model comprises:
[0026] Inputting the global feature data in the sample feature data into the original image autoencoder model, and calculating and obtaining the first predicted decoding data output by the original image autoencoder model;
[0027] The step of adjusting the parameters of the original autoencoder model based on the difference between the predicted decoded data and the sample feature data, and using the original autoencoder model after parameter adjustment as a new original autoencoder model, returning to execute the step of inputting the sample feature data into the original autoencoder model, and calculating the predicted decoded data output by the autoencoder model until a first preset termination condition is reached includes:
[0028] Based on the difference between the first predicted decoded data and the global feature data in the sample feature data, the parameters of the original image autoencoder model are adjusted, and the original image autoencoder model with adjusted parameters is used as the new original image autoencoder model, and the step of inputting the global feature data in the sample feature data into the original image autoencoder model and calculating the first predicted decoded data output by the original image autoencoder model is returned to execute until a second preset termination condition is reached.
[0029] In a possible embodiment, the sample characteristic data includes statistical characteristic data;
[0030] The performing data processing on each group of the second sample data to obtain feature data corresponding to each group of the second sample data includes:
[0031] For each group of the second sample data, the second sample data is divided into a plurality of groups of third sample data according to the time of the behavior; wherein the time of the behavior represented by the third sample data in the same group is within the same third time window; and the third time window is smaller than the second time window;
[0032] For each group of the second sample data, the third sample data is divided according to the behavior result of the behavior represented by the third sample data to obtain n first request data matrices and m first resource data matrices as first statistical data of the second sample data;
[0033] The i-th row, x-th column, and t-th layer of the n-th first request data matrix is used to characterize the behavior type x of the n-th request entity whose behavior result is i in the t-th group of third sample data included in the second sample data; the i-th row, x-th column, and t-th layer of the m-th first resource data matrix is used to characterize the behavior type x of the m-th resource entity whose behavior result is i in the t-th group of third sample data included in the second sample data;
[0034] For each group of the first sample data, the feature data corresponding to the second sample data included in the first sample data are concatenated to obtain the feature data corresponding to the first sample data, including:
[0035] For each group of the first sample data, concatenate the first statistical data corresponding to the second sample data included in the first sample data to obtain second statistical data corresponding to the first sample data;
[0036] The step of concatenating the characteristic data corresponding to each group of the first sample data to obtain sample characteristic data includes:
[0037] splicing the second statistical data corresponding to each group of the first sample data to obtain statistical feature data in the sample feature data;
[0038] The autoencoder model includes a stacked autoencoder model, and the original autoencoder model includes an original stacked autoencoder model;
[0039] The step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the original autoencoder model comprises:
[0040] Inputting the statistical feature data in the sample feature data into the original stacked autoencoder model, and calculating to obtain the second predicted decoding data output by the original stacked autoencoder model;
[0041] The step of adjusting the parameters of the original autoencoder model based on the difference between the predicted decoded data and the sample feature data, and using the original autoencoder model after parameter adjustment as a new original autoencoder model, returning to execute the step of inputting the sample feature data into the original autoencoder model, and calculating the predicted decoded data output by the autoencoder model until a first preset termination condition is reached includes:
[0042] Based on the difference between the second predicted decoded data and the statistical feature data in the sample feature data, the parameters of the original stacked autoencoder model are adjusted, and the original stacked autoencoder model with adjusted parameters is used as the new original stacked autoencoder model, and the step of inputting the statistical feature data in the sample feature data into the original stacked autoencoder model and calculating the second predicted decoded data output by the original stacked autoencoder model is returned to execute until the third preset termination condition is reached.
[0043] In a possible embodiment, the sample characteristic data includes sequence characteristic data;
[0044] The performing data processing on each group of the second sample data to obtain feature data corresponding to each group of the second sample data includes:
[0045] For each group of the second sample data, the second sample data whose time interval between the behaviors is less than or equal to a preset time threshold are divided into the same group to obtain multiple groups of fourth sample data;
[0046] For each group of the fourth sample data, the fourth sample data is sorted according to the time of the behavior to obtain first request sequence data corresponding to n request entities and first resource sequence data corresponding to m resource entities as first sequence data corresponding to the fourth sample data;
[0047] For each group of the second sample data, concatenate the first request sequence data corresponding to the same request entity in each group of the fourth sample data included in the second sample data, and concatenate the first resource sequence data corresponding to the same resource entity in each group of the fourth sample data included in the second sample data, to obtain the second request sequence data corresponding to n request entities and the second resource sequence data corresponding to m resource entities, as the second sequence data corresponding to the second sample data;
[0048] For each group of the first sample data, the feature data corresponding to the second sample data included in the first sample data are concatenated to obtain the feature data corresponding to the first sample data, including:
[0049] For each group of the first sample data, concatenate the second sequence data corresponding to the second sample data included in the first sample data to obtain the third sequence data corresponding to the first sample data;
[0050] The step of concatenating the characteristic data corresponding to each group of the first sample data to obtain sample characteristic data includes:
[0051] splicing the third sequence data corresponding to each group of the first sample data to obtain sequence feature data in the sample feature data;
[0052] The autoencoder model includes a sequence autoencoder model, and the original autoencoder model includes an original sequence autoencoder model;
[0053] The step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the original autoencoder model comprises:
[0054] Inputting the sequence feature data in the sample feature data into the original sequence autoencoder model, and calculating to obtain third predicted decoding data output by the original sequence autoencoder model;
[0055] The step of adjusting the parameters of the original autoencoder model based on the difference between the predicted decoded data and the sample feature data, and using the original autoencoder model after parameter adjustment as a new original autoencoder model, returning to execute the step of inputting the sample feature data into the original autoencoder model, and calculating the predicted decoded data output by the autoencoder model until a first preset termination condition is reached includes:
[0056] Based on the difference between the third predicted decoding data and the sequence feature data in the sample feature data, the parameters of the original sequence autoencoder model are adjusted, and the original sequence autoencoder model after parameter adjustment is used as the new original sequence autoencoder model, and the step of inputting the sequence feature data in the sample feature data into the original sequence autoencoder model and calculating the third predicted decoding data output by the original sequence autoencoder model is returned to execute until the fourth preset termination condition is reached.
[0057] In a possible embodiment, the autoencoder model includes: a graph autoencoder model, a plurality of stacked autoencoder sub-models, and a plurality of sequence autoencoder sub-models; the graph autoencoder model includes an encoder and a decoder, the encoder is constructed based on a graph convolutional network, and the decoder is constructed based on a vector dot product; the feature dimensionality reduction method of each stacked autoencoder sub-model is different; the feature dimensionality reduction method of each sequence autoencoder sub-model is different;
[0058] The step of inputting the test feature data into the autoencoder model and calculating the decoded data output by the autoencoder model comprises:
[0059] Inputting the global feature data in the test feature data into the graph autoencoder model, and calculating and obtaining the first sub-decoding data output by the graph autoencoder model;
[0060] Inputting the statistical feature data in the test feature data into each of the stacked autoencoder sub-models respectively, to obtain second sub-decoded data output by each of the stacked autoencoder sub-models;
[0061] Inputting the sequence feature data in the test feature data into each of the sequence autoencoder sub-models respectively, obtaining the third sub-decoding data output by each of the sequence autoencoder sub-models, and using the first decoding sub-data, each of the second sub-decoding data and each of the third decoding sub-data as the decoding data output by the autoencoder model;
[0062] The method further comprises:
[0063] Calculating a first difference between the global feature data in the test feature data and the first sub-decoded data;
[0064] respectively calculating second differences between the statistical feature data in the test feature data and each of the second sub-decoded data;
[0065] respectively calculating third differences between the sequence feature data in the test feature data and each of the third sub-decoded data;
[0066] The first difference, each of the second differences and each of the third differences are weighted to obtain a difference between the decoded data and the test feature data.
[0067] In a possible embodiment, in the process of weighting the first difference, each of the second differences and each of the third differences, the weight of each of the second differences is a weight pre-set for the stacked autoencoder sub-model corresponding to the second difference, the weight of each of the third differences is a weight pre-set for the sequence autoencoder sub-model corresponding to the third difference, the stacked autoencoder sub-model corresponding to the second difference is the stacked autoencoder sub-model based on which the second difference is obtained, and the sequence autoencoder sub-model corresponding to the third difference is the sequence autoencoder sub-model based on which the third difference is obtained;
[0068] The weights of each of the stacked autoencoder sub-models and each of the sequence autoencoder sub-models are configured in advance in the following manner, including:
[0069] Respectively determining the sub-model loss of each of the stacked autoencoder sub-models and each of the sequence autoencoder sub-models in the process of training the autoencoder model, wherein the sub-model loss is used to represent the difference between the input of the sub-model and the output of the sub-model;
[0070] Based on the sub-model losses of each of the stacked autoencoder sub-models and each of the sequence autoencoder sub-models, the weights of each of the stacked autoencoder sub-models and each of the sequence autoencoder sub-models are respectively configured, wherein the weight of any sub-model is negatively correlated with the sub-model loss of the sub-model itself, and positively correlated with the sub-model losses of other sub-models.
[0071] In a possible embodiment, the method further includes:
[0072] The autoencoder model is trained according to the sample feature data of each of the physical devices within the last preset time period to obtain a new autoencoder model;
[0073] Within the current preset time length, based on the new autoencoder model, executing the step of inputting the test feature data into the autoencoder model and calculating the decoded data output by the autoencoder model;
[0074] and / or,
[0075] In response to the entity device quantity change instruction, modify the entity device quantity parameter in the autoencoder model to obtain the autoencoder model after the parameter is modified;
[0076] Training the autoencoder model after parameter modification according to the sample feature data within the second preset time period of each of the physical devices to obtain a new autoencoder model;
[0077] Based on the new autoencoder model, the step of inputting the test feature data into the autoencoder model and calculating the decoded data output by the autoencoder model is performed.
[0078] The present application also provides a zero-trust behavior anomaly detection device, the device comprising:
[0079] An acquisition module is used to acquire test feature data of each entity device within a test time period, wherein the test feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the test feature data is used to characterize the association relationship between the requesting entity and the resource entity; the requesting entity is the entity device that initiates the behavior between the entity devices, and the resource entity is the entity device to which the behavior is directed; the statistical feature data in the test feature data is used to characterize the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and the sequence feature data in the test feature data is used to characterize the association order of the behavior between the requesting entity and the resource entity;
[0080] A calculation module, used for inputting the test feature data into the autoencoder model, and calculating and obtaining the decoded data output by the autoencoder model;
[0081] a determination module, configured to determine that the behavior of the physical device is abnormal if the difference between the decoded data and the test characteristic data is greater than a preset threshold;
[0082] The autoencoder model is pre-trained in the following way:
[0083] Acquire original sample data of each of the physical devices within a first preset time period;
[0084] Dividing the original sample data into a plurality of groups of first sample data according to the time of the behavior; wherein the time of the behavior represented by the first sample data in the same group is within the same first time window;
[0085] For each group of the first sample data, the first sample data is divided into a plurality of groups of second sample data according to the time of the behavior; wherein the time of the behavior represented by the second sample data in the same group is within the same second time window; and the second time window is smaller than the first time window;
[0086] Performing data processing on each group of the second sample data respectively to obtain feature data corresponding to each group of the second sample data;
[0087] For each group of the first sample data, concatenate the feature data corresponding to the second sample data included in the first sample data to obtain the feature data corresponding to the first sample data;
[0088] The feature data corresponding to each group of the first sample data are concatenated to obtain sample feature data; wherein the sample feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the sample feature data is used to characterize the association relationship between the requesting entity and the resource entity, the statistical feature data in the sample feature data is used to characterize the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and the sequence feature data in the sample feature data is used to characterize the association order of the behavior between the requesting entity and the resource entity;
[0089] Inputting the sample feature data into the original autoencoder model, and calculating the predicted decoding data output by the original autoencoder model;
[0090] Based on the difference between the predicted decoding data and the sample feature data, the parameters of the original autoencoder model are adjusted, and the original autoencoder model with adjusted parameters is used as the new original autoencoder model, and the step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the autoencoder model is returned to execute until the first preset termination condition is reached.
[0091] The present application also provides an electronic device, including:
[0092] Memory, used to store computer programs;
[0093] The processor is used to implement any of the above-mentioned zero-trust behavior anomaly detection methods when executing a program stored in the memory.
[0094] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned zero-trust behavior anomaly detection methods is implemented.
[0095] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-described zero-trust behavior anomaly detection methods.
[0096] Beneficial effects of the embodiments of the present application:
[0097] The embodiment of the present application provides a zero-trust behavior anomaly detection method, device, electronic device and storage medium. Since the autoencoder model can use input information as a learning target, characterize and learn the input information, and can process the original sample data of each entity device in the first preset time period to obtain sample feature data, the autoencoder model is trained based on the sample feature data, and the sample feature data includes: global feature data for characterizing the association relationship between the request entity and the resource entity, statistical feature data for characterizing the behavior type and behavior result of the behavior between the request entity and the resource entity, and sequence feature data for characterizing the association order of the behavior between the request entity and the resource entity. Therefore, the behavior type that each entity device often performs can be reflected by the data of multiple dimensions of global feature data, statistical feature data and sequence feature data. The autoencoder model is obtained by training the data of multiple dimensions of global feature data, statistical feature data and sequence feature data. The autoencoder model can reflect the behavior type that the entity device may perform, that is, the autoencoder model can reflect the behavior pattern of the entity device, thereby improving the accuracy of the constructed entity device behavior pattern. And the test feature data can be detected based on the behavior pattern, and the test feature data is input into the autoencoder model to obtain the decoded data output by the autoencoder model. Since the autoencoder model can reflect the behavior pattern of the physical device, the decoded data can be regarded as the characteristic data corresponding to the behavior that the physical device should perform according to its own behavior pattern, and the test characteristic data can be regarded as the characteristic data corresponding to the behavior actually performed by the physical device. Therefore, if the physical device works normally according to its own behavior pattern, the difference between the decoded data and the test characteristic data should be small. If the physical device does not work normally according to its own behavior pattern, the difference between the decoded data and the test characteristic data should be large. Then, when the difference between the decoded data and the test characteristic data is greater than the preset threshold, it can be considered that the physical device does not work normally according to its own behavior pattern, and it can be considered that the physical device behaves abnormally. It can be seen that the embodiment of the present application can realize the abnormal detection of the physical device, and since the accuracy of the constructed physical device behavior pattern is high, the accuracy of the abnormal detection of the physical device is also high.
[0098] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0099] In order to more clearly illustrate the embodiments of the present application 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 application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0100] Figure 1 A flowchart of a zero-trust behavior anomaly detection method provided in an embodiment of the present application;
[0101] Figure 2 A schematic diagram of a flow chart of the autoencoder model training method provided in an embodiment of the present application;
[0102] Figure 3 A schematic diagram of graph data provided in an embodiment of the present application;
[0103] Figure 4 A schematic diagram of the structure of a graph autoencoder model provided in an embodiment of the present application;
[0104] Figure 5a A flowchart of a data processing method provided in an embodiment of the present application;
[0105] Figure 5b A schematic diagram of grouping original sample data provided in an embodiment of the present application;
[0106] Figure 6a Another flowchart of the data processing method provided in the embodiment of the present application;
[0107] Figure 6b Another schematic diagram of grouping original sample data provided in an embodiment of the present application;
[0108] Figure 7 A flow chart of a difference determination method provided by the zero-trust behavior anomaly detection method according to an embodiment of the present application;
[0109] Figure 8 A schematic diagram of the structure of a zero-trust behavior anomaly detection device provided in an embodiment of the present application;
[0110] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0111] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0112] In order to more clearly explain the zero-trust behavior anomaly detection method, device, electronic device, and storage medium provided by this application, some terms appearing in this article are explained below:
[0113] Autoencoder model: The autoencoder model consists of an encoder and a decoder. The autoencoder model can compress the input data and then decompress the compressed data to obtain the output decoded data. The autoencoder model can be trained by calculating the difference between the decoded data and the input data. The autoencoder model can compress the input data to obtain the intrinsic characteristics of the input data.
[0114] Graph autoencoder model: The graph autoencoder model refers to the autoencoder model for graph data.
[0115] Zero Trust Gateway: A Zero Trust Gateway is a device that can authenticate all requests for access in a Zero Trust network. The Zero Trust Gateway stores detailed information about all accesses in the Zero Trust network.
[0116] In order to more clearly illustrate the zero-trust behavior anomaly detection method, device, electronic device and storage medium provided by the present application, the possible application scenarios of the zero-trust behavior anomaly detection method, device, electronic device and storage medium provided by the present application will be exemplified below. It can be understood that the following examples are only possible application scenarios of the zero-trust behavior anomaly detection method, device, electronic device and storage medium provided by the present application. In other possible embodiments, the zero-trust behavior anomaly detection method, device, electronic device and storage medium provided by the present application can be applied to other possible application scenarios, and the following examples do not impose any limitations on this.
[0117] When a zero-trust network allocates zero-trust dynamic permissions to each physical device, it usually builds a behavior model for each physical device, then performs anomaly detection based on the difference between the actual behavior of the physical device and the behavior model corresponding to the physical device, and allocates zero-trust dynamic permissions to each physical device based on the results of the anomaly detection. If the difference between the actual behavior of the physical device and the behavior model corresponding to the physical device is large, the anomaly detection result shows that the physical device behaves abnormally, and the zero-trust dynamic permissions of the physical device can be set lower.
[0118] When constructing the behavior model of each entity device, it is necessary to use a security device in bypass monitoring working mode to obtain the import and export traffic of each entity device in the zero-trust network through mirrored traffic. However, the traffic of each entity device obtained by the security device only includes the source IP (Internet Protocol), destination IP, source port, destination port and transmission protocol corresponding to the traffic, so it is impossible to determine the specific behavior corresponding to the traffic of each entity device, and it is impossible to construct a more accurate behavior model, which leads to a high false alarm rate of anomaly detection. In addition, when constructing the behavior model, the above-mentioned anomaly detection method needs to rely on the obtained labeled data, so that the amount of data that can be used to construct the behavior model is small, which makes the accuracy of the constructed behavior model low, and thus the accuracy of anomaly detection is low.
[0119] Based on this, in order to realize the anomaly detection of physical devices in the zero-trust network and improve the accuracy of anomaly detection, this application provides a zero-trust behavior anomaly detection method, see Figure 1 , methods include:
[0120] S101, obtaining test characteristic data of each physical device within a test period.
[0121] The test feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the test feature data is used to characterize the association relationship between the requesting entity and the resource entity; the requesting entity is the entity device that initiates the behavior between the entity devices, and the resource entity is the entity device targeted by the behavior; the statistical feature data in the test feature data is used to characterize the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and the sequence feature data in the test feature data is used to characterize the association order of the behavior between the requesting entity and the resource entity;
[0122] S102, input the test feature data into the autoencoder model, and calculate the decoded data output by the autoencoder model.
[0123] S103: If the difference between the decoded data and the test feature data is greater than a preset threshold, it is determined that the behavior of the physical device is abnormal.
[0124] Among them, the autoencoder model is pre-trained in the following way:
[0125] Acquire original sample data of each physical device within a first preset time period;
[0126] Dividing the original sample data into multiple groups of first sample data according to the time of the behavior; wherein the time of the behavior represented by the first sample data in the same group is within the same first time window;
[0127] For each group of first sample data, the first sample data is divided into multiple groups of second sample data according to the time of the behavior; wherein the time of the behavior represented by the second sample data in the same group is within the same second time window; and the second time window is smaller than the first time window;
[0128] Performing data processing on each group of second sample data respectively to obtain feature data corresponding to each group of second sample data;
[0129] For each group of first sample data, concatenate the feature data corresponding to the second sample data included in the first sample data to obtain the feature data corresponding to the first sample data;
[0130] The feature data corresponding to each group of first sample data are concatenated to obtain sample feature data; wherein the sample feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the sample feature data is used to characterize the association relationship between the request entity and the resource entity, the statistical feature data in the sample feature data is used to characterize the behavior type and behavior result of the behavior between the request entity and the resource entity, and the sequence feature data in the sample feature data is used to characterize the association order of the behavior between the request entity and the resource entity;
[0131] Input the sample feature data into the original autoencoder model, and calculate the predicted decoding data output by the original autoencoder model;
[0132] Based on the difference between the predicted decoding data and the sample feature data, the parameters of the original autoencoder model are adjusted, and the original autoencoder model with adjusted parameters is used as the new original autoencoder model. The step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the autoencoder model is returned to execute until the first preset termination condition is reached.
[0133] In the application of the embodiment of the present application, since the autoencoder model can take the input information as the learning target, characterize and learn the input information, and can process the original sample data of each entity device in the first preset time period to obtain sample feature data, the autoencoder model is trained based on the sample feature data, and the sample feature data includes: global feature data for characterizing the association relationship between the request entity and the resource entity, statistical feature data for characterizing the behavior type and behavior result of the behavior between the request entity and the resource entity, and sequence feature data for characterizing the association order of the behavior between the request entity and the resource entity. Therefore, the behavior type that each entity device often performs can be reflected by the data of multiple dimensions of global feature data, statistical feature data, and sequence feature data. The autoencoder model is obtained by training the data of multiple dimensions of global feature data, statistical feature data, and sequence feature data. The autoencoder model can reflect the behavior type that the entity device may perform, that is, the autoencoder model can reflect the behavior pattern of the entity device, thereby improving the accuracy of the constructed entity device behavior pattern. And the test feature data can be detected based on the behavior pattern, and the test feature data is input into the autoencoder model to obtain the decoded data output by the autoencoder model. Since the autoencoder model can reflect the behavior pattern of the physical device, the decoded data can be regarded as the characteristic data corresponding to the behavior that the physical device should perform according to its own behavior pattern, and the test characteristic data can be regarded as the characteristic data corresponding to the behavior actually performed by the physical device. Therefore, if the physical device works normally according to its own behavior pattern, the difference between the decoded data and the test characteristic data should be small. If the physical device does not work normally according to its own behavior pattern, the difference between the decoded data and the test characteristic data should be large. Then, when the difference between the decoded data and the test characteristic data is greater than the preset threshold, it can be considered that the physical device does not work normally according to its own behavior pattern, and it can be considered that the physical device behaves abnormally. It can be seen that the embodiment of the present application can realize the abnormal detection of the physical device, and since the accuracy of the constructed physical device behavior pattern is high, the accuracy of the abnormal detection of the physical device is also high.
[0134] The above S101-S103 are respectively described by way of example below:
[0135] In S101, the test time period is set by the user according to his own needs. Entity devices can be divided into two types: request entities and resource entities. Request entities refer to entity devices that initiate behaviors between entity devices, that is, entity devices that send requests to other entities. Resource entities refer to entity devices that are targeted by behaviors between entity devices, that is, entity devices that respond to requests. An entity device can belong to both a request entity and a resource entity. In this case, the entity device can send requests to other entity devices and respond to requests sent by other entity devices. Exemplarily, request entities can refer to devices such as PC (Personal Computer) terminals, and resource entities can refer to business service devices, data service devices, management platforms, and other devices.
[0136] In a zero-trust network, the zero-trust gateway has the basic information of all physical devices contained in the zero-trust network and the list of behaviors between each physical device. Therefore, the original test data of each physical device during the test period can be extracted from the zero-trust network. The basic information of the physical device may include: the name of the physical device, the list of authorized behaviors owned by the physical device, etc.
[0137] Exemplarily, the behavior types of behaviors between various entity devices may include: obtaining the URL (Universal Resource Locator) of a resource, FTP (File Transfer Protocol) service file-related operations, IPC (Inter-Process Communication) flow permission operations, etc. Assuming that a certain behavior is: a PC terminal requests the management platform to obtain the URL of a certain file, the time of the behavior is the time when the PC terminal sends the request to the management platform; the requesting entity that initiates the behavior is: the PC terminal; the resource entity targeted by the behavior is: the management platform; the behavior type of the behavior is: obtaining the URL of the resource; if the management platform responds to the request of the PC terminal and sends the URL of the file to the PC terminal, the behavior result of the behavior is: success; if the management platform does not respond to the request of the PC terminal and sends the URL of the file to the PC terminal, the behavior result of the behavior is: failure.
[0138] If the time when the PC terminal sends a request to the management platform is recorded as t1, the PC terminal is recorded as r1, the management platform is recorded as s1, the behavior type of obtaining the resource URL is recorded as b1, the successful behavior result is recorded as o1, and the failed behavior result is recorded as o2, then, in the above example, if the behavior result of the behavior is success, the original test data corresponding to the behavior can be expressed as {t1, r1, s1, b1, o1}; if the behavior result of the behavior is failure, the original test data corresponding to the behavior can be expressed as {t1, r1, s1, b1, o2}.
[0139] The test feature data can be obtained by processing the original test data. The test feature data includes: global feature data, statistical feature data, and sequence feature data. The global feature data in the test feature data can reflect the request entity that initiates the behavior and the resource entity targeted by the behavior for each behavior, and associate each request entity and resource entity through the behavior, that is, the global feature data in the test feature data can characterize the association relationship between the request entity and the resource entity. The statistical feature data in the test feature data can characterize the behavior type and behavior result of the behavior between the request entity and the resource entity, and the behavior between the request entity and the resource entity can be classified and counted according to different behavior types and behavior results to obtain statistical feature data. The sequence feature data in the test feature data can characterize the association order of the behavior between the request entity and the resource entity, and each behavior can be sorted according to the time of each behavior, so that the sorted data can reflect the association order between each behavior, and obtain sequence feature data. The following will exemplify how to process the original test data to obtain the test feature data, which will not be repeated here.
[0140] In S102, as described above for the autoencoder model, the autoencoder model can be trained by calculating the difference between the decoded data output by the model and the input data. And according to the process of obtaining the autoencoder model through the above training, it can be seen that the autoencoder model is obtained by training based on the sample feature data. Similar to the test feature data, the sample feature data also includes: global feature data for characterizing the association relationship between the requesting entity and the resource entity, statistical feature data for characterizing the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and sequence feature data for characterizing the association order of the behavior between the requesting entity and the resource entity. Therefore, the behavior types frequently performed by each entity device can be reflected by the data of multiple dimensions of global feature data, statistical feature data and sequence feature data. The autoencoder model is obtained by training the data of multiple dimensions of global feature data, statistical feature data and sequence feature data. The autoencoder model can reflect the behavior types that the entity device may perform, that is, the autoencoder model can reflect the behavior mode of the entity device. Therefore, the decoded data obtained after the test feature data is input into the autoencoder model can be regarded as the feature data corresponding to the behavior that the entity device should perform according to its own behavior mode.
[0141] In S103, as described in S102 above, the decoded data can be regarded as characteristic data corresponding to the behavior that the physical device should perform according to its own behavior pattern, and the test characteristic data can be regarded as characteristic data corresponding to the behavior actually performed by the physical device. Therefore, if the physical device works normally according to its own behavior pattern, the difference between the decoded data and the test characteristic data should be small. If the physical device does not work normally according to its own behavior pattern, the difference between the decoded data and the test characteristic data should be large. Then, when the difference between the decoded data and the test characteristic data is greater than a preset threshold, it can be considered that the physical device does not work normally according to its own behavior pattern, and it can be considered that the physical device behaves abnormally, thereby achieving abnormal detection of each physical device in the zero-trust network.
[0142] The following is an exemplary description of how to train the autoencoder model. Figure 2 , the methods for training the autoencoder model include:
[0143] S201, obtaining original sample data of each entity device within a first preset time period.
[0144] The first preset time period can be set according to user needs. For example, the first preset time period can be set to within one month of deploying the zero trust network. For example, assuming that the time of deploying the zero trust network is April 1, 2023, the first preset time period is April 1, 2023 to April 30, 2023. The first preset time period can also be set to within 45 days of deploying the zero trust network, etc.
[0145] The original sample data is used to characterize the time of the behavior between each entity device, the requesting entity that initiates the behavior, the resource entity targeted by the behavior, the behavior type of the behavior, and the behavior result of the behavior.
[0146] If each entity device is recorded as E=[r1, r2, r3, …, rn, s1, s2, s3, …, sm], where R=[r1, r2, r3, …, rn] is the request entity and S=[s1, s2, s3, …, sm] is the resource entity; the behavior between each entity device is recorded as B=[b1, b2, b3, …, bx]; t represents the time of the behavior; the successful result of the behavior is recorded as o1, and the failed result of the behavior is recorded as o2, then the original sample data can be expressed as D=[{t1, r1, s1, b1, o1}, {t2, r2, s2, b2, o2}, {t3, r3, s3, b3, o1}, …, {tl, rn, sm, bx, oy}], where y=1 or 2.
[0147] In the original sample data D, {t1, r1, s1, b1, o1} indicates that the time of behavior b1 is t1, the request entity that initiates behavior b1 is r1, the resource entity targeted by behavior b1 is s1, and the behavior result of behavior b1 is o1, that is, the behavior result of behavior b1 is successful. Similarly, {tl, rn, sm, bx, oy} indicates that the time of behavior bx is tl, the request entity that initiates behavior bx is rn, the resource entity targeted by behavior bx is sm, and the behavior result of behavior bx is oy, that is, when y=1, the behavior result of behavior bx is successful; when y=2, the behavior result of behavior bx is failed.
[0148] S202: Divide the original sample data into a plurality of groups of first sample data according to the time of the behavior.
[0149] The time of the behavior represented by the first sample data of the same group is within the same first time window.
[0150] The first time window can be set according to user needs. For example, the first time window can be set to 4 days, 5 days, 7 days, etc. In a possible embodiment, in order to avoid the influence of physical factors such as working days and non-working days, working hours and non-working hours on the behavior data of the physical device, the first time window can be set larger. For example, the first time window is set to 7 days, so that the difference between the behaviors represented by the first sample data of the same group is small. The following will take the first time window of 7 days as an example to illustrate this application.
[0151] For example, when dividing the first sample data, if the first preset time period is 20230401-20230428 (that is, the first preset time period is from April 1, 2023 to April 28, 2023, and the same applies to other time periods below), and the time of behaviors b1-b10 in the original sample data is between 20230401-20230407, the time of behaviors b11-b21 is between 20230408-20230414, the time of behaviors b22-b32 is between 20230415-20230421, and the time of behaviors b33-b45 is between 20230422-20230428, then the original sample data can be divided into The initial sample data are divided into four groups of first sample data, among which the first group of first sample data D1=[{t1, rn, sm, b1, oy},…, {t10, rn, sm, b10, oy}]; the second group of first sample data D2=[{t11, rn, sm, b11, oy},…, {t21, rn, sm, b21, oy}]; the third group of first sample data D3=[{t22, rn, sm, b22, oy},…, {t32, rn, sm, b32, oy}]; the fourth group of first sample data D4=[{t33, rn, sm, b33, oy},…, {t45, rn, sm, b45, oy}].
[0152] S203 , for each group of first sample data, divide the first sample data into multiple groups of second sample data according to the time of the behavior.
[0153] The time of the behavior represented by the second sample data of the same group is located in the same second time window; and the second time window is smaller than the first time window.
[0154] The second time window can be set according to user needs. Since the second sample data is obtained by dividing each first sample data, the time of the behavior represented by the second sample data of the same group is within the same second time window. Therefore, the second time window should be smaller than the first time window. Exemplarily, if the first time window is 7 days, the second time window can be set to 1 day, 2 days, 3 days, etc. The following will take the first time window of 7 days and the second time window of 1 day as an example to illustrate this application.
[0155] Exemplarily, when dividing the second sample data, if the behaviors represented by the first sample data of the ath group are b1-b40, the time of the behaviors represented by the first sample data of the group is between 20230401-20230407, and the time of the behaviors b1-b6 is in 20230401, the time of the behaviors b7-b13 is in 20230402, the time of the behaviors b14-b19 is in 20230403, the time of the behaviors b20-b25 is in 20230404, the time of the behaviors b26-b30 is in 20230405, the time of the behaviors b31-b35 is in 20230406, and the time of the behaviors b36-b40 is in 20230407, then the first sample data of the ath group can be divided into seven groups of second sample data, among which the first group of second sample data D a1 =[{t1, rn, sm, b1, oy},…,{t6, rn, sm, b6, oy}]; The second group of second sample data D a2 =[{t7, rn, sm, b7, oy},…,{t13, rn, sm, b13, oy}]; The third group of second sample data D a3 =[{t14, rn, sm, b14, oy}, …, {t19, rn, sm, b19, oy}]; The fourth group of second sample data D a4 =[{t20, rn, sm, b20, oy},…,{t25, rn, sm, b25, oy}]; The fifth group of second sample data D a5 =[{t26, rn, sm, b26, oy}, ..., {t30, rn, sm, b30, oy}]; The sixth group of second sample data D a6 =[{t31, rn, sm, b31, oy}, ..., {t35, rn, sm, b35, oy}]; The seventh group of second sample data D a7 =[{t36,rn,sm,b36,oy},…,{t40,rn,sm,b40,oy}].
[0156] S204, performing data processing on each group of second sample data respectively to obtain feature data corresponding to each group of second sample data.
[0157] S205 , for each group of first sample data, concatenate the feature data corresponding to the second sample data included in the first sample data to obtain the feature data corresponding to the first sample data.
[0158] Assume that the first sample data of each group are D1, D2, D3, ..., D a The second sample data groups obtained by dividing the first sample data D1 are D 11 , D 12 ,…,D 1b , the characteristic data corresponding to each group of second sample data are T 11 , T 12 ,…,T 1b ; ..., and so on, for the first sample data D a The second sample data of each group obtained by division are D a1 , D a2 ,…,D ab , the characteristic data corresponding to each group of second sample data are T a1 , T a2 ,…,T ab Then, when obtaining the characteristic data corresponding to each group of first sample data, it is necessary to convert the characteristic data T corresponding to the second sample data included in the first sample data D1 into 11 , T 12 ,…,T 1b The feature data T1 corresponding to the first sample data D1 is obtained by splicing; the feature data T1 corresponding to the second sample data included in the first sample data D2 is obtained by splicing. 21 , T 22 ,…,T 2b splicing to obtain the feature data T2 corresponding to the first sample data D2; ..., and so on, the first sample data D a The feature data T corresponding to the second sample data included a1 , T a2 ,…,T ab Splice and get the first sample data D a Corresponding feature data T a .
[0159] S206, concatenating the feature data corresponding to each group of first sample data to obtain sample feature data.
[0160] Among them, the sample feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the sample feature data is used to characterize the association relationship between the request entity and the resource entity, the statistical feature data in the sample feature data is used to characterize the behavior type and behavior result of the behavior between the request entity and the resource entity, and the sequence feature data in the sample feature data is used to characterize the association order of the behavior between the request entity and the resource entity.
[0161] Corresponding to the description in S205 above, the feature data T1, T2, ..., T a Splicing is performed to obtain sample feature data.
[0162] It is understandable that in order to ensure the accuracy of the autoencoder model, the type of data input to the autoencoder model in the training phase should be consistent with the type of data input to the autoencoder model in the model application phase, that is, the type of sample feature data and test feature data should be consistent, and the method of obtaining sample feature data and test feature data should be the same. Therefore, sample feature data also includes: global feature data, statistical feature data, and sequence feature data.
[0163] In the process of obtaining the sample characteristic data, the original sample data needs to be divided in the manner shown in the aforementioned S202-S203 to obtain the second sample data, and the second sample data needs to be processed as shown in the aforementioned S204 to obtain the characteristic data corresponding to the second sample data, and the sample characteristic data is obtained by the two splicings shown in S205-S206. It can be understood that for different types of sample characteristic data, the second sample data should be processed in different ways, and the types of characteristic data corresponding to the obtained second sample data are also different, and the corresponding splicing methods to obtain the sample characteristic data should also be different, that is, the acquisition methods of the three different types of sample characteristic data, namely, global characteristic data, statistical characteristic data, and sequence characteristic data, are different. The following will exemplarily illustrate the acquisition methods of the three different types of sample characteristic data, namely, global characteristic data, statistical characteristic data, and sequence characteristic data, and will not be repeated here.
[0164] S207, inputting the sample feature data into the original autoencoder model, and calculating and obtaining the predicted decoding data output by the original autoencoder model.
[0165] S208, based on the difference between the predicted decoding data and the sample feature data, the parameters of the original autoencoder model are adjusted, and the original autoencoder model with adjusted parameters is used as the new original autoencoder model, and the step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the autoencoder model is returned to execute until the first preset termination condition is reached.
[0166] The first preset termination condition may refer to the difference between the predicted decoded data and the sample feature data being less than the first preset difference threshold, or may refer to the number of parameter adjustments to the original autoencoder model reaching the first preset number threshold, or may be other first preset termination conditions, and the present application does not impose any restrictions on this.
[0167] An exemplary explanation has been given above on how to train the autoencoder model. The following will provide an exemplary explanation of how to obtain the sample feature data in the aforementioned S204-S206 and the process of training the autoencoder model in the aforementioned S207-S208 corresponding to different types of sample feature data.
[0168] When the sample feature data includes global feature data, the method for processing the second sample data is method 1; when the sample feature data includes statistical feature data, the method for processing the second sample data is method 2; when the sample feature data includes sequence feature data, the method for processing the second sample data is method 3. The above methods 1 to 3 will be described exemplarily below.
[0169] Method 1:
[0170] The sample characteristic data includes global characteristic data. The aforementioned S204 includes: for each group of second sample data, taking each entity device as a node, connecting the nodes corresponding to the request entity that initiates the behavior represented by the second sample data and the resource entity targeted by the behavior, obtaining the graph data corresponding to the second sample data, and converting the graph data into request global data and resource global data as the first global data corresponding to the second sample data; wherein the request global data is data with the request entity and behavior as dimensions, and the resource global data is data with the resource entity and behavior as dimensions.
[0171] By taking each entity device as a node and connecting the nodes corresponding to the request entity initiating the behavior represented by the second sample data and the resource entity targeted by the behavior, the graph data obtained by drawing can be as follows Figure 3 See Figure 3 , Figure 3 The solid circles in the figure are the entity devices. Connecting the request entity that initiates the behavior represented by the second sample data and the nodes corresponding to the resource entity targeted by the behavior gives Figure 3 As shown, the edges connecting the two solid circles, one of which represents the time, behavior type and behavior result of a behavior represented by the second sample data, the request entity connected by the edge is the request entity that initiates the behavior, and the resource entity connected by the edge is the resource entity targeted by the behavior.
[0172] For each group of second sample data, the graph data corresponding to the second sample data is converted into request global data and resource global data. The request global data can be represented in the form of an n×x matrix, wherein the nth row and xth column in the request global data is used to represent that the nth request entity rn initiates behavior x; the resource global data can be represented in the form of an m×x matrix, wherein the mth row and xth column in the resource global data is used to represent that the request entity targeted by behavior x is the mth request entity sm. Then the first global data corresponding to the second sample data is two matrices of n×x and m×x.
[0173] The aforementioned S205 includes: for each group of first sample data, concatenating the first global data corresponding to the second sample data included in the first sample data to obtain the second global data corresponding to the first sample data.
[0174] Taking the first time window as 7 days and the second time window as 1 day as an example, each group of first sample data includes 7 groups of second sample data. The first global data corresponding to the 7 groups of second sample data included in the first sample data are spliced to obtain two matrices of n×x×7 and m×x×7. The splicing in the above process refers to: superimposing multiple first global data, that is, superimposing multiple two-dimensional matrices to obtain a three-dimensional matrix. And splicing these two three-dimensional matrices to obtain a (n+m)×x×7 matrix as the second global data corresponding to the first sample data. Among them, the nth row, xth column, and zth layer in the matrix n×x×7 is used to indicate that the nth request entity rn in the zth group of second sample data initiates behavior x; the mth row, xth column, and zth layer in the matrix m×x×7 is used to indicate that the request entity targeted by behavior x in the zth group of second sample data is the mth request entity sm. In the above process, if the three dimensions of the three-dimensional matrix are recorded as row dimension, column dimension, and layer dimension respectively, then concatenating two three-dimensional matrices means: keeping the column dimension and the layer dimension unchanged, and merging the data of the row dimensions of the two matrices.
[0175] The aforementioned S206 includes: concatenating the second global data corresponding to each group of first sample data to obtain the global feature data in the sample feature data.
[0176] The second global data corresponding to each group of first sample data are respectively recorded as dpg1, dpg2, ..., dpg z, and the global feature data is recorded as DPG (data process global). Then, the second global data corresponding to each group of first sample data are spliced, and the global feature data in the obtained sample feature data is DPG=[dpg1, dpg2, ..., dpg z]. In the above process of obtaining the global feature data, splicing means: combining the second global data to obtain a set, and the i-th element in the set is the i-th second global data.
[0177] Corresponding to the sample feature data including the global feature data, the training process of the autoencoder model is as follows:
[0178] The aforementioned autoencoder model includes a graph autoencoder model, and the aforementioned original autoencoder model includes an original graph autoencoder model.
[0179] The aforementioned S207 includes: inputting the global feature data in the sample feature data into the original image autoencoder model, and calculating the first predicted decoding data output by the original image autoencoder model; the aforementioned S208 includes: based on the difference between the first predicted decoding data and the global feature data in the sample feature data, adjusting the parameters of the original image autoencoder model, and using the original image autoencoder model after parameter adjustment as the new original image autoencoder model, returning to execute the step of inputting the global feature data in the sample feature data into the original image autoencoder model, and calculating the first predicted decoding data output by the original image autoencoder model, until the second preset termination condition is reached.
[0180] In this embodiment, the structure of the graph autoencoder model can be as follows Figure 4 As shown in the figure, the graph autoencoder model includes: an encoder and a decoder, the encoder is built based on a graph convolutional network, and the decoder is built based on a vector dot product.
[0181] See also Figure 4 The input of the graph autoencoder model is a graph, that is, the global feature data DPG in the aforementioned sample feature data, and the output of the graph autoencoder model is a reconstructed graph, that is, the aforementioned decoded data. The encoder of the graph autoencoder model is built based on GCN (Graph Convolutional Network). The global feature data DPG in the sample feature data is input into the graph autoencoder model, and the vector Z is obtained through the encoder in the graph autoencoder model. The dot product of the vector z is obtained. Constructing a decoder. Specifically, a two-layer GCN may be used to construct an encoder. In other possible embodiments, a GCN with more layers may also be used to construct an encoder.
[0182] The second preset termination condition may refer to the difference between the first predicted decoded data and the global feature data DPG in the sample feature data being less than a second preset difference threshold, or may refer to the number of parameter adjustments to the original image autoencoder model reaching a second preset number threshold, or may be other second preset termination conditions, and the present application does not impose any restrictions on this.
[0183] By selecting this embodiment, at a global level, based on the behavioral data in the original sample data, graph data can be constructed with each entity device as a node and each behavior data as an edge to obtain sample feature data including global feature data, and the original graph autoencoder model can be trained based on the global feature data to obtain a graph autoencoder model. The graph autoencoder model can reflect the global behavior pattern of each entity device and fully consider the global characteristics of the data, thereby improving the accuracy of the trained graph autoencoder model and further improving the accuracy of abnormality detection of entity devices.
[0184] Method 2:
[0185] Sample characteristic data includes statistical characteristic data; such as Figure 5a As shown, the aforementioned S204 includes:
[0186] S2041 , for each group of second sample data, divide the second sample data into multiple groups of third sample data according to the time of the behavior.
[0187] The time of the behavior represented by the third sample data of the same group is within the same third time window; and the third time window is smaller than the second time window.
[0188] S2042, for each group of second sample data, divide the third sample data according to the behavior results of the behavior represented by the third sample data, and obtain n first request data matrices and m first resource data matrices as first statistical data of the second sample data.
[0189] Among them, the i-th row, x-column and t-layer of the n-th first request data matrix is used to characterize the behavior type x of the n-th request entity whose behavior result is i in the t-th group of third sample data included in the second sample data; the i-th row, x-column and t-layer of the m-th first resource data matrix is used to characterize the behavior type x of the m-th resource entity whose behavior result is i in the t-th group of third sample data included in the second sample data.
[0190] To facilitate the description of the second method, the present application provides a schematic diagram of grouping the original sample data, such as Figure 5b shown.
[0191] See also Figure 5b , divide the original sample data D into a group of first sample data D1, ..., D a , divide the first group of first sample data D1 into b groups of second sample data D 11 ,……,D 1b , and so on, the first sample data of group a is divided into the second sample data of group b a1 ,……,D abThe process of dividing the original sample data to obtain the second sample data refers to the related description of S202-S203 above, which will not be repeated here.
[0192] In S2041, the third time window can be set according to user needs. Since the third sample data is obtained by dividing each second sample data, the time of the behavior represented by the third sample data in the same group is within the same third time window. Therefore, the third time window should be smaller than the second time window. Exemplarily, if the first time window is 7 days and the second time window is 1 day, the third time window can be set to 1 hour, 2 hours, 3 hours, etc. The following will take the first time window as 7 days, the second time window as 1 day, and the third time window as 1 hour as an example to illustrate this application.
[0193] Take the second sample data D 11 For example, when dividing the third sample data, if the second sample data D 11 The behaviors represented are b1-b24, the time of behavior b1 is between 00:01 and 01:00, the time of behavior b2 is between 01:01 and 02:00, ..., the time of behavior b24 is between 23:01 and 24:00, then the second sample data D 11 Divided into 24 groups of third sample data, among which the first group of third sample data D 111 =[{t1, rn, sm, b1, oy}]; The third sample data of the second group D 112 =[{t2, rn, sm, b2, oy}]; ...; The 24th group of second sample data D 1124 =[{t24,rn,sm,b24,oy}].
[0194] See also Figure 5b According to the above division method, the second sample data D 11 Divide into c groups the third sample data D 111 , D 112 ,…,D 11c ; ...; The second sample data D 1b Divide into c groups the third sample data D 1b1 , D 1b2 ,…,D 1bc ; ...; The second sample data D a1 Divide into c groups the third sample data D a11 , D a12 ,…,D a1c ; ...; The second sample data D ab Divide into c groups the third sample data D ab1 , D ab2 ,…,D abc .
[0195] In S2042, the first request data matrix and the first resource data matrix are both three-dimensional matrices of i×x×t, then the i-th row, x-th column, and t-th layer of the n-th first request data matrix is used to characterize the behavior type x whose behavior result is i for the n-th request entity in the t-th group of third sample data included in the second sample data; the i-th row, x-th column, and t-th layer of the m-th first resource data matrix is used to characterize the behavior type x whose behavior result is i for the m-th resource entity in the t-th group of third sample data included in the second sample data.
[0196] See also Figure 5b According to the above method of obtaining the first statistical data corresponding to the second sample data, the second sample data D 11 The corresponding first statistical data can be expressed as: n first request data matrices Q 111 , …, Q 11n And m first resource data matrices Z 111 , …, Z 11m ; ...; The second sample data D 1b The corresponding first statistical data can be expressed as: n first request data matrices Q 1b1 , …, Q 1bn And m first resource data matrices Z 1b1 , …, Z 1bm ; ...; The second sample data D a1 The corresponding first statistical data can be expressed as: n first request data matrices Q a11 , …, Q a1n And m first resource data matrices Z a11 , …, Z a1m ; ...; The second sample data D ab The corresponding first statistical data can be expressed as: n first request data matrices Q ab1 , …, Q abn And m first resource data matrices Z ab1 , …, Z abm .
[0197] In this embodiment, the aforementioned S205 includes: for each group of first sample data, concatenating first statistical data corresponding to the second sample data included in the first sample data to obtain second statistical data corresponding to the first sample data.
[0198] Specifically, for each group of first sample data, the first request data matrices corresponding to the same request entity in each group of second sample data included in the first sample data can be spliced, and the first resource data matrices corresponding to the same resource entity in each group of second sample data included in the first sample data can be spliced to obtain the second request data matrix corresponding to n request entities and the second resource data matrix corresponding to m resource entities, so as to obtain the second statistical data corresponding to the first sample data.
[0199] See also Figure 5b As shown, the second sample data included in the first sample data D1 is D 11 ,……,D 1b , the first request data matrix corresponding to the first request entity is Q 111 , Q 121 , …, Q 1b1 ; The first request data matrix corresponding to the second request entity is Q 112 , Q 122 , …, Q 1b2 ; ...; The first request data matrix corresponding to the nth request entity is Q 11n , Q 12n , …, Q 1bn ; The first request data matrices corresponding to the same request entity are concatenated to obtain n second request data matrices. The first resource data matrix corresponding to the first resource entity is Z 111 , Z 121 , …, Z 1b1 ; The first resource data matrix corresponding to the second resource entity is Z 112 , Z 122 , …, Z 1b2 ; ...; The first resource data matrix corresponding to the mth resource entity is Z 11m , Z 12m , …, Z 1bm ; Splice the first resource data matrices corresponding to the same resource entity to obtain m second resource data matrices. Use the above n second request data matrices and m second resource data matrices as the second statistical data corresponding to the first sample data D1. According to the above splicing method, the second statistical data corresponding to each group of first sample data is obtained. The splicing in the above splicing method refers to: adding an additional dimension that is orthogonal to the original dimension in the space to which the data belongs, and arranging each data into a new data of n+1 dimensions on the newly added dimension, where n is the number of dimensions of each data before splicing.
[0200] Exemplarily, the first time window is 7 days, the second time window is 1 day, and the third time window is 1 hour, and the behavior results of the behavior only include two types: success and failure. Therefore, in this example, the first request data matrix and the first resource data matrix are both 2×x×24 three-dimensional matrices. In addition, each group of first sample data includes 7 groups of second sample data. According to the above splicing method, the first statistical data corresponding to each second sample data included in the first sample data is spliced to obtain n 2×x×24×7 matrices, that is, n second request data matrices, and m 2×x×24×7 matrices, that is, m second resource data matrices. These n 2×x×24×7 matrices and m 2×x×24×7 matrices are used as the second statistical data corresponding to the first sample data.
[0201] In this embodiment, the aforementioned S206 includes: concatenating the second statistical data corresponding to each group of first sample data to obtain statistical feature data in the sample feature data.
[0202] Specifically, the second request data matrix corresponding to the same request entity in each group of first sample data can be spliced, and the second resource data matrix corresponding to the same resource entity in each group of first sample data can be spliced to obtain a third request data matrix corresponding to n request entities and a third resource data matrix corresponding to m resource entities as statistical feature data in the sample feature data.
[0203] The second statistical data corresponding to the first sample data D1 is expressed as: n second request data matrices Q 11 , Q 12 , …, Q 1n and m second resource data matrices Z 11 , Z 12 , …, Z 1m ; ...; The first sample data D a The corresponding second statistical data is expressed as: n second request data matrices Q a1 , Q a2 , …, Q an and m second resource data matrices Z a1 , Z a2 , …, Z am .
[0204] Therefore, the second request data matrix corresponding to the first request entity in each group of first sample data is Q 11 , Q 21 , …, Q a1 ; The second request data matrix corresponding to the second request entity is Q 12 , Q 22 , …, Q a2; ...; The second request data matrix corresponding to the nth request entity is Q 1n , Q 2n ,…,Q an ; The second request data matrices corresponding to the same request entity are concatenated to obtain n third request data matrices, and the n third request data matrices are recorded as drt1, drt2, drt3, ..., drt n.
[0205] The second resource data matrix corresponding to the first resource entity in each group of first sample data is Z 11 , Z 21 , …, Z a1 ; The second resource data matrix corresponding to the second resource entity is Z 12 , Z 22 , …, Z a2 ; ...; The second resource data matrix corresponding to the mth resource entity is Z 1m , Z 2m , …, Z am ; The second resource data matrices corresponding to the same resource entity are spliced to obtain m third resource data matrices, and the m third resource data matrices are recorded as dst1, dst2, dst3, ..., dst m. The splicing in the process of obtaining the third request data matrix and the third resource data matrix refers to: adding an additional dimension orthogonal to the original dimension in the space to which the data belongs, and arranging each data into a new data of n+1 dimensions on the newly added dimension, where n is the number of dimensions of each data before splicing.
[0206] The above n third request data matrices and m third resource data matrices are used as statistical feature data DPT (data process statistics) in the sample feature data, then DPT=[drt1, drt2, drt3, …, drt n], [dst1, dst2, dst3, …, dst m]. In the above process of obtaining statistical feature data, splicing refers to: combining the third request data matrices to obtain a first set, the i-th element in the first set is the i-th third request data matrix; and combining the third resource data matrices to obtain a second set, the i-th element in the second set is the i-th third resource data matrix, and the above first set and second set are used as statistical feature data.
[0207] Corresponding to the sample feature data including statistical feature data, the training process of the autoencoder model is as follows:
[0208] The autoencoder model includes a stacked autoencoder model, and the original autoencoder model includes an original stacked autoencoder model;
[0209] The aforementioned S207 includes: inputting the statistical feature data in the sample feature data into the original stacked autoencoder model, and calculating the second predicted decoding data output by the original stacked autoencoder model; the aforementioned S208 includes: based on the difference between the second predicted decoding data and the statistical feature data in the sample feature data, adjusting the parameters of the original stacked autoencoder model, and using the original stacked autoencoder model after parameter adjustment as the new original stacked autoencoder model, returning to execute the step of inputting the statistical feature data in the sample feature data into the original stacked autoencoder model, and calculating the second predicted decoding data output by the original stacked autoencoder model, until the third preset termination condition is reached.
[0210] In this embodiment, the stacked autoencoder model includes multiple stacked autoencoder sub-models; each stacked autoencoder sub-model has a different feature dimensionality reduction method. The stacked autoencoder sub-model includes an encoder and a decoder, and the encoder can be constructed by a 3-layer fully connected network, and the decoder can be constructed by a 3-layer fully connected network.
[0211] The number of stacked autoencoder sub-models can be set according to user needs. For example, the number of stacked autoencoder sub-models can be 3, 4, 5, etc. If the number of stacked autoencoder sub-models is set to 4, the feature dimensionality reduction methods of each stacked autoencoder sub-model can be: L2 reconstruction, Laplace feature mapping, recursion, and sorting.
[0212] Since different stacked autoencoder sub-models have different feature dimensionality reduction methods, the parameters in different stacked autoencoder sub-models cannot be universal. That is, if only a certain stacked autoencoder sub-model is trained and the parameters in the stacked autoencoder sub-model are used in other stacked autoencoder sub-models, it may cause the accuracy of other stacked autoencoder sub-models to be poor. Therefore, when training to obtain a stacked autoencoder model, it is necessary to perform model training on multiple stacked autoencoder sub-models included in the original stacked autoencoder model through the training method shown in method 2.
[0213] The third preset termination condition may refer to the difference between the second predicted decoding data and the statistical feature data DPT in the sample feature data being less than a third preset difference threshold, or it may refer to the number of parameter adjustments to the original stacked autoencoder model reaching a third preset number threshold, or it may be other third preset termination conditions, and the present application does not impose any restrictions on this.
[0214] By selecting this embodiment, it is possible to distinguish the behavioral data of different types of entity devices at the statistical level based on the behavioral data in the original sample data, obtain a third request data matrix corresponding to multiple request entities and a third resource data matrix corresponding to multiple resource entities as statistical feature data, and construct stacked autoencoder sub-models corresponding to different feature dimensionality reduction methods, integrate multiple stacked autoencoder sub-models into one stacked autoencoder sub-model, train the original stacked autoencoder model based on the statistical feature data to obtain a stacked autoencoder model, so that the stacked autoencoder model can reflect the behavioral pattern of each entity device, fully consider the statistical characteristics of the data, thereby improving the accuracy of the trained stacked autoencoder model, and further improving the accuracy of abnormality detection of entity devices.
[0215] Method 3:
[0216] Sample characteristic data includes sequence characteristic data; e.g. Figure 6a As shown, the aforementioned S204 includes:
[0217] S204a, for each group of second sample data, classify the second sample data whose time intervals between behaviors are less than or equal to a preset time threshold into the same group, to obtain multiple groups of fourth sample data.
[0218] S204b, for each group of fourth sample data, sort the fourth sample data according to the time of the behavior, and obtain the first request sequence data corresponding to the n request entities and the first resource sequence data corresponding to the m resource entities as the first sequence data corresponding to the fourth sample data.
[0219] S204c, for each group of second sample data, concatenate the first request sequence data corresponding to the same request entity in each group of fourth sample data included in the second sample data, and concatenate the first resource sequence data corresponding to the same resource entity in each group of fourth sample data included in the second sample data, to obtain the second request sequence data corresponding to n request entities and the second resource sequence data corresponding to m resource entities, as the second sequence data corresponding to the second sample data.
[0220] To facilitate the description of the third method, the present application provides another schematic diagram of grouping the original sample data, such as Figure 6b shown.
[0221] See also Figure 6b , divide the original sample data D into a group of first sample data D1, ..., D a , divide the first group of first sample data D1 into b groups of second sample data D 11 ,……,D 1b , and so on, the first sample data of group a is divided into the second sample data of group ba1 ,……,D ab The process of dividing the original sample data to obtain the second sample data refers to the related description of S202-S203 above, which will not be repeated here.
[0222] In S204a, the preset time threshold can be set according to user needs. Since the fourth sample data is obtained by dividing each second sample data, the interval between the time of the behavior represented by the fourth sample data in the same group is less than or equal to the preset time threshold, so the preset time threshold should be less than the second time window. Exemplarily, if the first time window is 7 days and the second time window is 1 day, the preset time threshold can be set to 1 hour, 2 hours, 3 hours, etc. The following will take the first time window as 7 days, the second time window as 1 day, and the preset time threshold as 1 hour as an example to illustrate this application.
[0223] Take the second sample data D 11 For example, when dividing the fourth sample data, if the second sample data D 11 The behaviors represented are b1-b24, and the intervals between the four behaviors b1-b4 are all less than or equal to 1 hour, that is, the interval between the time of behavior b1 and the time of behavior b2, the interval between the time of behavior b1 and the time of behavior b3, the interval between the time of behavior b1 and the time of behavior b4, the interval between the time of behavior b2 and the time of behavior b3, the interval between the time of behavior b2 and the time of behavior b4, and the interval between the time of behavior b3 and the time of behavior b4 are all less than or equal to 1 hour, then the behaviors represented by a group of fourth sample data are b1-b4. If this group of fourth sample data is recorded as D 111 , then D 111 =[{t1, rn, sm, b1, oy}, {t2, rn, sm, b2, oy}; {t3, rn, sm, b3, oy}; {t4, rn, sm, b4, oy}].
[0224] See also Figure 6b According to the above division method, the second sample data D 11 Divide into c groups the fourth sample data D 111 ,…,D 11c ; ...; The second sample data D 1b Divide into c groups the fourth sample data D 1b1 ,…,D 1bc ; ...; The second sample data D a1 Divide into c groups the fourth sample data D a11 ,…,D a1c ; ...; The second sample data D ab Divide into c groups the fourth sample data Dab1 ,…,D abc .
[0225] In S204b, it is assumed that the fourth sample data D abc =[{t1, rn, sm, b1, oy}, {t2, rn, sm, b2, oy}; …; {tl, rn, sm, bx, oy}], if the requesting entity that initiates behaviors b1, b5, b6, …, bx is the same requesting entity r1, and the time order of behaviors b1, b5, b6, …, bx is b1<b5<b6<…<bx, then the first request sequence data corresponding to the requesting entity r1 is [b1, b5, b6, …, bx]; if the resource entity targeted by behaviors b1, b3, b2, …, bx is the same resource entity s1, and the time order of behaviors b1, b3, b2, …, bx is b1<b3<b2<…<bx, then the first resource sequence data corresponding to the resource entity s1 is [b1, b3, b2, …, bx]. According to the above data processing method, the first sequence data corresponding to each group of fourth sample data is obtained: the first request sequence data corresponding to the n request entities and the first resource sequence data corresponding to the m resource entities.
[0226] See also Figure 6b According to the above method of obtaining the first sequence data corresponding to the fourth sample data, the fourth sample data D 111 The corresponding first sequence data can be expressed as: n first request sequence data Q 1111 , …, Q 111n and m first resource sequence data Z 1111 , …, Z 111m ; ...; The fourth sample data D 11c The corresponding first sequence data can be expressed as: n first request sequence data Q 11c1 , …, Q 11cn and m first resource sequence data Z 11c1 , …, Z 11cm ; ...; The fourth sample data D 1b1 The corresponding first statistical data can be expressed as: n first request sequence data Q 1b11 , …, Q 1b1n and m first resource sequence data Z 1b11 , …, Z 1b1m ; ...; The fourth sample data D abc The corresponding first sequence data can be expressed as: n first request sequence data Q abc1 , …, Q abcn and m first resource sequence data Z abc1 , …, Z abcm .
[0227] In S204c, see Figure 6b As shown, the second sample data D 11 The fourth sample data included is D 111 ,……,D 11c , the first request sequence data corresponding to the first request entity is Q 1111 , Q 1121 ,…,Q 11c1 ; The first request sequence data corresponding to the second request entity is Q 1112 , Q 1122 ,…,Q 11c2 ; ...; The first request sequence data corresponding to the nth request entity is Q 111n , Q 112n ,…,Q 11cn ; The first request sequence data corresponding to the same request entity are concatenated to obtain n second request sequence data. The first resource sequence data corresponding to the first resource entity is Z 1111 , Z 1121 , …, Z 11c1 ; The first resource sequence data corresponding to the second resource entity is Z 1112 , Z 1122 , …, Z 11c2 ; ...; The first resource sequence data corresponding to the mth resource entity is Z 111m , Z 112m , …, Z 11cm ; The first resource sequence data corresponding to the same resource entity are spliced to obtain m second resource sequence data. The above n second request sequence data and m second resource sequence data are used as the second sample data D 11 According to the above concatenation method, the second sequence data corresponding to each group of second sample data is obtained.
[0228] In this embodiment, the aforementioned S205 includes: for each group of first sample data, concatenating the second sequence data corresponding to the second sample data included in the first sample data to obtain the third sequence data corresponding to the first sample data.
[0229] Specifically, for each group of first sample data, the second request sequence data corresponding to the same request entity in each group of second sample data included in the first sample data can be spliced, and the second resource sequence data corresponding to the same resource entity in each group of second sample data included in the first sample data can be spliced to obtain third request sequence data corresponding to n request entities and third resource sequence data corresponding to m resource entities as the third sequence data corresponding to the first sample data.
[0230] See also Figure 6bAs shown, the second sample data included in the first sample data D1 is D 11 ,……,D 1b , if the second sample data D 11 The corresponding second sequence data is expressed as: n second request sequence data Q 111 ,…,Q 11n and m second resource sequence data Z 111 , …, Z 11m ; ...; The second sample data D 1b The corresponding second sequence data is expressed as: n second request sequence data Q 1b1 ,…,Q 1bn and m second resource sequence data Z 1b1 , …, Z 1bm ; then the second request sequence data corresponding to the first request entity is Q 111 , Q 121 ,…,Q 1b1 ; The second request sequence data corresponding to the second request entity is Q 112 , Q 122 ,…,Q 1b2 ; ...; The second request sequence data corresponding to the nth request entity is Q 11n , Q 12n ,…,Q 1bn ; The second request sequence data corresponding to the same request entity are concatenated to obtain n third request sequence data. The second resource sequence data corresponding to the first resource entity is Z 111 , Z 121 , …, Z 1b1 ; The second resource sequence data corresponding to the second resource entity is Z 112 , Z 122 , …, Z 1b2 ; ...; The second resource sequence data corresponding to the mth resource entity is Z 11m , Z 12m , …, Z 1bm ; Splice the second resource sequence data corresponding to the same resource entity to obtain m third resource sequence data. Use the above n third request sequence data and m third resource sequence data as the third sequence data corresponding to the first sample data D1. According to the above splicing method, the third sequence data corresponding to each group of first sample data is obtained. In the above process of obtaining the second sequence data and the third sequence data, splicing refers to: adding an additional dimension that is orthogonal to the original dimension in the space to which the data belongs, and arranging each data into a new data of n+1 dimensions on the newly added dimension, where n is the number of dimensions of each data before splicing.
[0231] Exemplarily, taking the first time window as 7 days, the second time window as 1 day, and the preset time threshold as 1 hour as an example, assuming that in each group of fourth sample data, a request entity initiates at most 256 behaviors, and at most 256 behaviors are directed to the same resource entity, then in order to make the sequence length of the first sequence data corresponding to the fourth sample data uniform, the sequence length of each first request sequence data and each first resource sequence data in the first sequence data can be set to 256. Then, the first sequence data corresponding to the fourth sample data is: n first request sequence data with a sequence length of 256 and m first resource sequence data with a sequence length of 256. If in the fourth sample data, a request entity initiates less than 256 behaviors, the sequence length of the first request sequence data corresponding to the request entity is filled with NULL or 0 to 256; similarly, if less than 256 behaviors are directed to the same resource entity, the sequence length of the first resource sequence data corresponding to the resource entity is filled with NULL or 0 to 256.
[0232] Assuming that each group of second sample data can be divided into at most 256 groups of fourth sample data, each group of second sample data includes at most 256 groups of fourth sample data. In order to make the number of groups of fourth sample data obtained by dividing each group of second sample data uniform, the number of groups of fourth sample data obtained by dividing each group of second sample data is set to 256, that is, for each group of second sample data, the first request sequence data corresponding to the nth request entity has 256, and the first resource sequence data corresponding to the mth resource entity has 256. If the number of groups of fourth sample data included in a group of second sample data is less than 256, the number of groups of fourth sample data in the group of second sample data is also filled with space or 0 to 256. Therefore, when obtaining the second sequence data corresponding to the second sample data, the first request sequence data corresponding to a certain request entity with a sequence length of 256 is concatenated to obtain the second request sequence data corresponding to the request entity: a 256×256 matrix, and the first resource sequence data corresponding to a certain resource entity with a sequence length of 256 is concatenated to obtain the second resource sequence data corresponding to the resource entity: a 256×256 matrix. Therefore, the second sequence data corresponding to the second sample data is n 256×256 matrices and m 256×256 matrices, that is, n second request sequence data and m second resource sequence data.
[0233] Since the first time window is 7 days and the second time window is 1 day, each group of first sample data includes 7 groups of second sample data. The second sequence data corresponding to each second sample data included in the first sample data are spliced according to the above splicing method, and n 256×256×7 matrices, that is, n third request sequence data, and m 256×256×7 matrices, that is, m third resource sequence data, can be obtained. These n 256×256×7 matrices and m 256×256×7 matrices are used as the third sequence data corresponding to the first sample data.
[0234] In this embodiment, the aforementioned S206 includes: concatenating the third sequence data corresponding to each group of first sample data to obtain sequence feature data in the sample feature data.
[0235] Specifically, the third request sequence data corresponding to the same request entity in each group of first sample data can be spliced, and the third resource sequence data corresponding to the same resource entity in each group of first sample data can be spliced to obtain the fourth request sequence data corresponding to n request entities and the fourth resource sequence data corresponding to m resource entities as the sequence feature data in the sample feature data.
[0236] The third sequence data corresponding to the first sample data D1 is represented as: n third request sequence data Q 11 , Q 12 , …, Q 1n and m third resource sequence data Z 11 , Z 12 , …, Z 1m ; ...; The first sample data D a The corresponding third sequence data is represented as: n third request sequence data Q a1 , Q a2 , …, Q an and m third resource sequence data Z a1 , Z a2 , …, Z am .
[0237] Therefore, the third request sequence data corresponding to the first request entity in each group of first sample data is Q 11 , Q 21 , …, Q a1 ; The third request sequence data corresponding to the second request entity is Q 12 , Q 22 , …, Q a2 ; ...; The third request sequence data corresponding to the nth request entity is Q 1n , Q 2n , …, Q an; The third request sequence data corresponding to the same request entity are concatenated to obtain n fourth request sequence data, and the n fourth request sequence data are respectively recorded as drq1, drq2, drq3, ..., drq n.
[0238] The third resource sequence data corresponding to the first resource entity in each group of first sample data is Z 11 , Z 21 , …, Z a1 ; The third resource sequence data corresponding to the second resource entity is Z 12 , Z 22 , …, Z a2 ; ...; The third resource sequence data corresponding to the mth resource entity is Z 1m , Z 2m , …, Z am ; splice the third resource sequence data corresponding to the same resource entity to obtain m fourth resource sequence data, and record the m fourth resource sequence data as dsq1, dsq2, dsq3, ..., dsqm. In the above process of obtaining the fourth request sequence data and the fourth resource sequence data, splicing means: adding an additional dimension orthogonal to the original dimension in the space to which the data belongs, and arranging each data into a new data of n+1 dimensions on the newly added dimension, where n is the number of dimensions of each data before splicing.
[0239] The n fourth request sequence data and the m fourth resource sequence data are used as the sequence feature data DPQ (data process sequence) in the sample feature data, then DPQ=[drq1, drq2, drq3, …, drq n], [dsq1, dsq2, dsq3, …, dsq m]. In the above process of obtaining the sequence feature data, splicing refers to: combining the fourth request sequence data to obtain a third set, the i-th element in the third set is the i-th fourth request sequence data; and combining the fourth resource sequence data to obtain a fourth set, the i-th element in the fourth set is the i-th fourth resource sequence data, and the above third set and fourth set are used as the sequence feature data.
[0240] Corresponding to the sample feature data including the sequence feature data, the training process of the autoencoder model is as follows:
[0241] The autoencoder model includes a sequence autoencoder model, and the original autoencoder model includes an original sequence autoencoder model;
[0242] The aforementioned S207 includes: inputting the sequence feature data in the sample feature data into the original sequence autoencoder model, and calculating the third predicted decoding data output by the original sequence autoencoder model; the aforementioned S208 includes: based on the difference between the third predicted decoding data and the sequence feature data in the sample feature data, adjusting the parameters of the original sequence autoencoder model, and using the original sequence autoencoder model after parameter adjustment as the new original sequence autoencoder model, returning to execute the step of inputting the sequence feature data in the sample feature data into the original sequence autoencoder model, and calculating the third predicted decoding data output by the original sequence autoencoder model, until the fourth preset termination condition is reached.
[0243] In this embodiment, the sequence autoencoder model includes multiple sequence autoencoder sub-models; each sequence autoencoder sub-model has a different feature dimension reduction method. The sequence autoencoder sub-model includes an encoder and a decoder, and the encoder can be constructed by a bidirectional LSTM (Long Short-Term Memory) network, and the decoder can be constructed by a bidirectional LSTM network.
[0244] The number of sequence autoencoder submodels can be set according to user needs. For example, the number of sequence autoencoder submodels can be 3, 4, 5, etc. If the number of sequence autoencoder submodels is set to 4, the feature dimensionality reduction methods of each sequence autoencoder submodel can be: L2 reconstruction, Laplace eigenmapping, recursion, and sorting. It can be understood that the feature dimensionality reduction methods listed here are only possible examples, and it is not limited to the present application that only the feature dimensionality reduction methods listed here can be used. In other possible embodiments, other feature dimensionality reduction methods can also be used, and this example does not make any limitation on this.
[0245] Since different sequence autoencoder sub-models have different feature dimensionality reduction methods, the parameters in different sequence autoencoder sub-models cannot be universal, that is, if only a certain sequence autoencoder sub-model is trained and the parameters in the sequence autoencoder sub-model are used in other sequence autoencoder sub-models, it may cause the accuracy of other sequence autoencoder sub-models to be poor. Therefore, when training to obtain a sequence autoencoder model, it is necessary to train the multiple sequence autoencoder sub-models included in the original sequence autoencoder model through the training method shown in method three.
[0246] The fourth preset termination condition may refer to the difference between the third predicted decoding data and the sequence feature data DPQ in the sample feature data being less than a fourth preset difference threshold, or it may refer to the number of parameter adjustments to the original sequence autoencoder model reaching a fourth preset number threshold, or it may be other fourth preset termination conditions, and the present application does not impose any restrictions on this.
[0247] By selecting this embodiment, the second sample data can be divided according to the intervals between the behaviors in time, and the behavior data in the fourth sample data can be sorted based on the behavior time to obtain the first sequence data corresponding to the fourth sample data, and by splicing, fourth request sequence data corresponding to multiple request entities and fourth resource sequence data corresponding to multiple resource entities can be obtained as sequence feature data, and sequence autoencoder sub-models corresponding to different feature dimensionality reduction methods can be constructed, and multiple sequence autoencoder sub-models can be integrated into a sequence autoencoder model. The original sequence autoencoder model is trained based on the sequence feature data to obtain a sequence autoencoder model, so that the sequence autoencoder model can reflect the behavior pattern of each entity device, fully considering the sequence characteristics of the data, thereby improving the accuracy of the trained sequence autoencoder model, and then improving the accuracy of abnormality detection of the entity device.
[0248] As described in S206 above, the sample feature data includes: global feature data, statistical feature data, and sequence feature data. When obtaining the sample feature data, it is necessary to obtain the global feature data according to the above method one, obtain the statistical feature data according to the above method two, and obtain the sequence feature data according to method three, thereby obtaining the global feature data, statistical feature data, and sequence feature data included in the sample feature data.
[0249] Correspondingly, the autoencoder model includes: a graph autoencoder model, a stacked autoencoder model and a sequence autoencoder model. The graph autoencoder model is obtained by the model training method in the aforementioned method one, the stacked autoencoder model is obtained by the model training method in the aforementioned method two, and the sequence autoencoder model is obtained by the model training method in the aforementioned method three. When performing anomaly detection, it is necessary to process the original test data according to the above-mentioned method one to obtain global feature data, process the original test data according to the above-mentioned method two to obtain statistical feature data, and process the original test data according to the method three to obtain sequence feature data, thereby obtaining the global feature data, statistical feature data and sequence feature data included in the test feature data, input the global feature data included in the test feature data into the graph autoencoder model, and obtain the anomaly detection result according to the aforementioned S102-S103 method, input the statistical feature data included in the test feature data into the stacked autoencoder model, and obtain the anomaly detection result according to the aforementioned S102-S103 method, and input the sequence feature data included in the test feature data into the sequence autoencoder model, and obtain the anomaly detection result according to the aforementioned S102-S103 method, and input the sequence feature data included in the test feature data into the sequence autoencoder model, and obtain the anomaly detection result according to the aforementioned S102-S103 method, and combine the anomaly detection results obtained by the above-mentioned three models to obtain the final anomaly detection result.
[0250] As described in S206 above, the method of obtaining the sample feature data and the test feature data is the same. Therefore, the method of obtaining the test feature data is the same as the method of obtaining the sample feature data above, that is, the global feature data, statistical feature data, and sequence feature data in the test feature data can be obtained in the following manner, including:
[0251] For the global feature data in the test feature data: divide the original test data into multiple groups of first test data according to the time of the behavior; wherein the time of the behavior represented by the first test data in the same group is within the same first time window; for each group of first test data, divide the first test data into multiple groups of second test data according to the time of the behavior; wherein the time of the behavior represented by the second test data in the same group is within the same second time window; the second time window is smaller than the first time window; for each group of second test data, take each entity device as a node, connect the request entity that initiates the behavior represented by the second test data and the node corresponding to the resource entity targeted by the behavior, obtain the graph data corresponding to the second test data, and convert the graph data into request test data and resource test data as the third global data corresponding to the second test data; wherein the request test data is data with the request entity and the behavior as the dimensions, and the resource test data is data with the resource entity and the behavior as the dimensions; for each group of first test data, splice the third global data corresponding to the second test data included in the first test data to obtain the fourth global data corresponding to the first test data; splice the fourth global data corresponding to each group of first test data to obtain the global feature data in the test feature data.
[0252] For the statistical characteristic data in the test characteristic data: divide the original test data into multiple groups of first test data according to the time of the behavior; wherein the time of the behavior represented by the first test data in the same group is within the same first time window; for each group of first test data, divide the first test data into multiple groups of second test data according to the time of the behavior; wherein the time of the behavior represented by the second test data in the same group is within the same second time window; the second time window is smaller than the first time window; for each group of second test data, divide the second test data into multiple groups of third test data according to the time of the behavior; wherein the time of the behavior represented by the third test data in the same group is within the same third time window; the third time window is smaller than the second time window; for each group of second test data, perform the third test according to the behavior result of the behavior represented by the third test data. The data is divided to obtain n fourth request data matrices and m fourth resource data matrices as the third statistical data of the second test data; wherein the i-th row, x-th column, and t-th layer of the n-th fourth request data matrix is used to characterize the behavior type x of the n-th request entity with the behavior result i in the t-th group of third test data included in the second test data; the i-th row, x-th column, and t-th layer of the m-th fourth resource data matrix is used to characterize the behavior type x of the m-th resource entity with the behavior result i in the t-th group of third test data included in the second test data; for each group of first test data, the third statistical data corresponding to the second test data included in the first test data are spliced to obtain the fourth statistical data corresponding to the first test data; the fourth statistical data corresponding to each group of first test data are spliced to obtain the statistical feature data in the test feature data.
[0253] For the sequence feature data in the test feature data: divide the original test data into multiple groups of first test data according to the time of the behavior; wherein the time of the behavior represented by the first test data in the same group is within the same first time window; for each group of first test data, divide the first test data into multiple groups of second test data according to the time of the behavior; wherein the time of the behavior represented by the second test data in the same group is within the same second time window; the second time window is smaller than the first time window; for each group of second test data, divide the second test data whose interval between the time of the behavior is less than or equal to the preset time threshold into the same group to obtain multiple groups of fourth test data; for each group of fourth test data, sort the fourth test data according to the time of the behavior to obtain the fifth request sequence data corresponding to n request entities and the fifth request sequence data corresponding to m resource entities. The fifth resource sequence data is used as the fourth sequence data corresponding to the fourth test data; for each group of second test data, the fifth request sequence data corresponding to the same request entity in each group of fourth test data included in the second test data is spliced, and the fifth resource sequence data corresponding to the same resource entity in each group of fourth test data included in the second test data is spliced to obtain the sixth request sequence data corresponding to n request entities and the sixth resource sequence data corresponding to m resource entities as the fifth sequence data corresponding to the second test data; for each group of first test data, the fifth sequence data corresponding to the second test data included in the first test data is spliced to obtain the sixth sequence data corresponding to the first test data; the sixth sequence data corresponding to each group of first test data is spliced to obtain the sequence feature data in the test feature data. The specific implementation method of obtaining the global feature data, statistical feature data, and sequence feature data in the test feature data can refer to the implementation method of obtaining the global feature data, statistical feature data, and sequence feature data in the sample feature data in the above-mentioned methods 1 to 3, which will not be repeated here.
[0254] As described above in the first, second and third methods for the autoencoder model, the sample feature data and the test feature data include: global feature data, statistical feature data, and sequence feature data, then the autoencoder model includes: a graph autoencoder model, a stacked autoencoder model and a sequence autoencoder model, and the stacked autoencoder model includes multiple stacked autoencoder sub-models, and the sequence autoencoder model includes multiple sequence autoencoder sub-models. Therefore, the autoencoder model includes: a graph autoencoder model, multiple stacked autoencoder sub-models and multiple sequence autoencoder sub-models.
[0255] Correspondingly, the decoded data output by the autoencoder model can be obtained in the following manner, that is, the aforementioned S102 includes: inputting the global feature data in the test feature data into the graph autoencoder model, and calculating the first sub-decoding data output by the graph autoencoder model; inputting the statistical feature data in the test feature data into each stacked autoencoder sub-model, and obtaining the second sub-decoding data output by each stacked autoencoder sub-model; inputting the sequence feature data in the test feature data into each sequence autoencoder sub-model, and obtaining the third sub-decoding data output by each sequence autoencoder sub-model, and using the first decoding sub-data, each second sub-decoding data and each third decoding sub-data as the decoding data output by the autoencoder model.
[0256] Moreover, in this embodiment, since the stacked autoencoder model includes multiple stacked autoencoder sub-models, and the sequence autoencoder model also includes multiple sequence autoencoder sub-models, when performing anomaly detection, each encoder sub-model will output corresponding sub-decoding data, and the difference between the sub-decoding data output by different autoencoder sub-models and the test feature data is different. In this case, how to determine the difference between the output result of the autoencoder model and the test feature data becomes a problem to be solved. Based on this, the present application also provides a method for determining the difference between decoding data and test feature data, such as Figure 7 As shown, the method includes:
[0257] S701, calculating a first difference between global feature data in the test feature data and first sub-decoded data.
[0258] The first difference may refer to the difference between the first sub-decoded data output by the graph autoencoder model and the global feature data in the test feature data, or may refer to the loss calculated by the loss function based on the difference between the first sub-decoded data output by the graph autoencoder model and the global feature data in the test feature data. Hereinafter, the first difference will be taken as an example of the loss calculated by the loss function to exemplify the present application.
[0259] S702: Calculate the second differences between the statistical feature data in the test feature data and each second sub-decoded data respectively.
[0260] The second difference may refer to the difference between the second sub-decoded data output by the stacked autoencoder sub-model and the statistical feature data in the test feature data, or may refer to the loss calculated by the loss function based on the difference between the second sub-decoded data output by the stacked autoencoder sub-model and the statistical feature data in the test feature data. Hereinafter, the present application will be exemplarily described by taking the second difference as the loss calculated by the loss function as an example.
[0261] S703, respectively calculating third differences between the sequence feature data in the test feature data and each third sub-decoded data.
[0262] The third difference may refer to the difference between the third sub-decoded data output by the sequence autoencoder sub-model and the sequence feature data in the test feature data, or may refer to the loss calculated by the loss function according to the difference between the third sub-decoded data output by the sequence autoencoder sub-model and the sequence feature data in the test feature data. Hereinafter, the present application will be exemplarily described by taking the third difference as the loss calculated by the loss function as an example.
[0263] S704, weighting the first difference, each second difference and each third difference to obtain the difference between the decoded data and the test feature data.
[0264] The weight of the first difference can be set according to user needs. For example, the weight of the first difference can be set to 1, 2, etc.
[0265] The weight of each second difference is a weight pre-set for the stacked autoencoder sub-model corresponding to the second difference, and the weight of each third difference is a weight pre-set for the sequence autoencoder sub-model corresponding to the third difference. Among them, the stacked autoencoder sub-model corresponding to the second difference is the stacked autoencoder sub-model based on which the second difference is obtained. Exemplarily, the statistical feature data in the test feature data is input into the stacked autoencoder sub-model 1 to obtain the second sub-decoding data 1 output by the stacked autoencoder sub-model 1, and the second difference 1 between the second sub-decoding data 1 and the statistical feature data in the test feature data is calculated. Then, the stacked autoencoder sub-model 1 is the stacked autoencoder sub-model corresponding to the second difference 1. Similarly, the sequence autoencoder sub-model corresponding to the third difference is the sequence autoencoder sub-model based on which the third difference is obtained.
[0266] Specifically, the weights of each stacked autoencoder sub-model and each sequence autoencoder sub-model can be configured in the following ways, including:
[0267] The sub-model losses of each stacked autoencoder sub-model and each sequence autoencoder sub-model in the process of training the autoencoder model are respectively determined, wherein the sub-model loss is used to represent the difference between the input of the sub-model and the output of the sub-model.
[0268] The difference between the input of the sub-model and the output of the sub-model can be directly used as the sub-model loss, or the sub-model loss can be calculated by a loss function based on the difference between the input of the sub-model and the output of the sub-model.
[0269] At the end of model training, the sub-model losses corresponding to each encoder sub-model are counted from the perspective of the request entity and the perspective of the resource entity. The sub-model loss can refer to the loss between the sub-prediction decoding data output by each sub-model and the sample feature data during the last cycle of model training; it can also refer to the loss between the sub-prediction decoding data output by each encoding sub-model and the new sample feature data after the model training is completed, when the new sample feature data is input into the autoencoder model.
[0270] Taking the example of inputting new sample feature data into the autoencoder model to obtain the loss between the sub-prediction decoding data output by each encoding sub-model and the new sample feature data, the statistical feature data in the new sample feature data can be input into each stacked autoencoder sub-model respectively to obtain the second prediction sub-decoding data output by each stacked autoencoder sub-model, and the loss between the statistical feature data in the new sample feature data and each second prediction sub-decoding data is calculated as the sub-model loss of each stacked autoencoder sub-model in the process of training the autoencoder model.
[0271] The sequence feature data in the new sample feature data are respectively input into each sequence autoencoder sub-model to obtain the third prediction sub-decoding data output by each sequence autoencoder sub-model, and the loss between the sequence feature data in the new sample feature data and each third prediction sub-decoding data is calculated as the sub-model loss of each sequence autoencoder sub-model in the process of training the autoencoder model.
[0272] Based on the sub-model losses of each stacked autoencoder sub-model and each sequence autoencoder sub-model, the weights of each stacked autoencoder sub-model and each sequence autoencoder sub-model are configured respectively, wherein the weight of any sub-model is negatively correlated with the sub-model loss of the sub-model itself, and positively correlated with the sub-model losses of other sub-models.
[0273] Since the stacked autoencoder model includes multiple stacked autoencoder sub-models and the sequence autoencoder model also includes multiple sequence autoencoder sub-models, the model structures are relatively similar, so the stacked autoencoder model and the sequence autoencoder model can be integrated to obtain an integrated autoencoder model, and the integrated autoencoder model includes multiple stacked autoencoder sub-models and multiple sequence autoencoder sub-models. The following will take the number of stacked autoencoder sub-models as 4 and the number of sequence autoencoder sub-models as 4 as an example to illustrate the configuration of the weights of each sub-model. That is, the stacked autoencoder model includes 4 stacked autoencoder sub-models, the sequence autoencoder model includes 4 sequence autoencoder sub-models, and the integrated autoencoder model includes 4 stacked autoencoder sub-models and 4 sequence autoencoder sub-models.
[0274] For ease of description, the sub-model losses of each stacked autoencoder sub-model and each sequence autoencoder are referred to as sub-model losses, and the weights of each stacked autoencoder sub-model and each sequence autoencoder are referred to as sub-model weights. The sub-model weights can be obtained by normalizing the inverse ratio of each sub-model loss to the total loss. Exemplarily, taking the integrated autoencoder model as an example, for the request entity, the sub-model losses of each sub-model are: 1, 2, 3, 4, 1, 2, 3, 4; among them, the first 4 sub-model losses are the sub-model losses corresponding to the 4 stacked autoencoder sub-models for the request entity, and the last 4 sub-model losses are the sub-model losses corresponding to the 4 sequence autoencoder sub-models for the request entity.
[0275] The proportion of sub-model loss of each sub-model in the total loss is: 1 / 20, 2 / 20, 3 / 20, 4 / 20, 1 / 20, 2 / 20, 3 / 20, 4 / 20; the inverse ratio of each sub-model loss to the total loss is: 20 / 1, 20 / 2, 20 / 3, 20 / 4, 20 / 1, 20 / 2, 20 / 3, 20 / 4; the inverse ratio of each sub-model loss to the total loss is normalized: x1 / (x1+x2+x3+x4+x5+x6+x7+x8), and the data obtained are: 12 / 50, 6 / 50, 4 / 50, 3 / 50, 12 / 50, 6 / 50, 4 / 50, 3 / 50. The sub-model weights corresponding to each sub-model are: 12 / 50, 6 / 50, 4 / 50, 3 / 50, 12 / 50, 6 / 50, 4 / 50, 3 / 50. If the sub-model losses corresponding to the four stacked autoencoder sub-models for the request entity are recorded as WRT1, WRT2, WRT3, and WRT4, and the sub-model losses corresponding to the four sequence autoencoder sub-models for the request entity are recorded as WRQ1, WRQ2, WRQ3, and WRQ4, then WRT1=12 / 50, WRT2=6 / 50, WRT3=4 / 50, WRT4=3 / 50, WRQ1=12 / 50, WRQ2=6 / 50, WRQ3=4 / 50, and WRQ4=3 / 50.
[0276] Repeat the above steps for the resource entity, and obtain the sub-model losses WST1, WST2, WST3, and WST4 corresponding to the four stacked autoencoder sub-models, and the sub-model losses WSQ1, WSQ2, WSQ3, and WSQ4 corresponding to the four sequence autoencoder sub-models. According to the above calculation process, it can be seen that the weight of any sub-model is negatively correlated with the sub-model loss of the sub-model itself, and positively correlated with the sub-model losses of other sub-models.
[0277] After calculating the sub-model weights for the request entity and the sub-model weights for the resource entity, the obtained sub-model weights can be solidified and stored together with the trained autoencoder model.
[0278] Taking the integrated autoencoder model as an example, if the sub-model differences corresponding to the four stacked autoencoder sub-models are recorded as ModelSDA1, ModelSDA2, ModelSDA3, and ModelSDA4; and the sub-model differences corresponding to the four sequence autoencoder sub-models are recorded as ModelL1, ModelL2, ModelL3, and ModelL4, then for the request entity, the difference between the decoded data and the test feature data is WRT1×ModelSDA1+WRT2×ModelSDA2+WRT3×ModelSDA3+WRT4×ModelSDA4+WRQ1×ModelL1+WRQ2×ModelL2+WRQ3×ModelL3+WRQ4×ModelL4. For the resource entity, the difference between the decoded data and the test feature data is WST1×ModelSDA1+WST2×ModelSDA2+WST3×ModelSDA3+WST4×ModelSDA4+WSQ1×ModelL1+WSQ2×ModelL2+WSQ3×ModelL3+WSQ4×ModelL4.
[0279] By selecting this embodiment, effective weight allocation can be performed on the sub-model differences corresponding to the respective encoder sub-models included in the autoencoder model, so that anomaly detection can be performed using the autoencoder model including multiple autoencoder sub-models. The autoencoder model including multiple autoencoder sub-models can better process test feature data through multiple feature dimensionality reduction methods, thereby improving the accuracy of anomaly detection.
[0280] The above has been described in an exemplary manner how to determine the difference between the decoded data and the test feature data. Due to changes in time and changes in the working conditions of each entity device, the behavior pattern of each entity device will change, so it is necessary to update the autoencoder model. Based on this, the present application also provides a model update method, which includes model update method 1 and / or model update method 2. The following will respectively describe the model update method 1 and the model update method 2 as an example.
[0281] Model update method 1:
[0282] The autoencoder model is trained according to the sample feature data of each entity device within the previous preset time length to obtain a new autoencoder model; within the current preset time length, based on the new autoencoder model, the test feature data is input into the autoencoder model to calculate the decoded data output by the autoencoder model.
[0283] The preset duration can be set according to user needs. For example, the preset duration can be set to 3 months, 4 months, 6 months, etc. If the preset duration is set to 3 months, the autoencoder model is updated and trained every 3 months.
[0284] The autoencoder model is trained according to the sample feature data of each entity device within the previous preset time period. The specific training method for obtaining a new autoencoder model can be found in the relevant instructions of the above S201-S203 and will not be repeated here.
[0285] After the model is updated to obtain a new autoencoder model, if anomaly detection is required, the test feature data should be input into the new autoencoder model, and the decoded data output by the new autoencoder model should be calculated. If the difference between the decoded data and the test feature data is greater than the preset threshold, the behavior of the physical device is determined to be abnormal.
[0286] Model update method 2:
[0287] In response to the instruction to change the number of physical devices, modify the parameter of the number of physical devices in the autoencoder model to obtain the autoencoder model with modified parameters; train the autoencoder model with modified parameters according to the sample feature data within the second preset time period of each physical device to obtain a new autoencoder model; based on the new autoencoder model, execute the step of inputting the test feature data into the autoencoder model and calculating the decoded data output by the autoencoder model.
[0288] If there are changes in physical devices in the zero-trust network, such as adding PCs or service devices, the corresponding physical device quantity parameters in the autoencoder model need to be modified. If the number of resource entities changes, the corresponding resource entity device quantity parameters in the autoencoder model need to be modified; if the number of request entities changes, the corresponding request entity device quantity parameters in the autoencoder model need to be modified.
[0289] The second preset time period can be set according to user needs. Since the number of physical devices has changed, the second preset time period should be set to the time period after the number of physical devices has changed. For example, the second preset time period can be set to within 1 month after the number of physical devices has changed, within 45 days after the number of physical devices has changed, etc.
[0290] The parameter-modified autoencoder model is trained according to the sample feature data within the second preset time period of each entity device. The specific training method for obtaining the new autoencoder model can be found in the relevant descriptions of the aforementioned S201-S203 and will not be repeated here.
[0291] After the model is updated to obtain a new autoencoder model, if anomaly detection is required, the test feature data should be input into the new autoencoder model, and the decoded data output by the new autoencoder model should be calculated. If the difference between the decoded data and the test feature data is greater than the preset threshold, the behavior of the physical device is determined to be abnormal.
[0292] By selecting this embodiment, the autoencoder model can be updated in different ways according to the changes in time and the changes in the working conditions of each physical device in the zero-trust network, so that the behavior pattern reflected by the autoencoder model is more accurate, thereby improving the accuracy of anomaly detection.
[0293] Corresponding to the aforementioned zero-trust behavior anomaly detection method, the present application embodiment also provides a zero-trust behavior anomaly detection device, such as Figure 8 As shown, the device comprises:
[0294] The acquisition module 801 is used to acquire the test feature data of each entity device within the test time period, wherein the test feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the test feature data is used to characterize the association relationship between the requesting entity and the resource entity; the requesting entity is the entity device that initiates the behavior between the entity devices, and the resource entity is the entity device targeted by the behavior; the statistical feature data in the test feature data is used to characterize the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and the sequence feature data in the test feature data is used to characterize the association order of the behavior between the requesting entity and the resource entity;
[0295] A calculation module 802 is used to input the test feature data into the autoencoder model and calculate the decoded data output by the autoencoder model;
[0296] A determination module 803, configured to determine that the behavior of the physical device is abnormal if the difference between the decoded data and the test characteristic data is greater than a preset threshold;
[0297] Among them, the autoencoder model is pre-trained in the following way:
[0298] Acquire original sample data of each physical device within a first preset time period;
[0299] Dividing the original sample data into multiple groups of first sample data according to the time of the behavior; wherein the time of the behavior represented by the first sample data in the same group is within the same first time window;
[0300] For each group of first sample data, the first sample data is divided into multiple groups of second sample data according to the time of the behavior; wherein the time of the behavior represented by the second sample data in the same group is within the same second time window; and the second time window is smaller than the first time window;
[0301] Performing data processing on each group of second sample data respectively to obtain feature data corresponding to each group of second sample data;
[0302] For each group of first sample data, concatenate the feature data corresponding to the second sample data included in the first sample data to obtain the feature data corresponding to the first sample data;
[0303] The feature data corresponding to each group of first sample data are concatenated to obtain sample feature data; wherein the sample feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the sample feature data is used to characterize the association relationship between the request entity and the resource entity, the statistical feature data in the sample feature data is used to characterize the behavior type and behavior result of the behavior between the request entity and the resource entity, and the sequence feature data in the sample feature data is used to characterize the association order of the behavior between the request entity and the resource entity;
[0304] Input the sample feature data into the original autoencoder model, and calculate the predicted decoding data output by the original autoencoder model;
[0305] Based on the difference between the predicted decoding data and the sample feature data, the parameters of the original autoencoder model are adjusted, and the original autoencoder model with adjusted parameters is used as the new original autoencoder model. The step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the autoencoder model is returned to execute until the first preset termination condition is reached.
[0306] In a possible embodiment, the sample feature data includes global feature data;
[0307] Data processing is performed on each group of second sample data to obtain feature data corresponding to each group of second sample data, including:
[0308] For each group of second sample data, each entity device is used as a node, and the nodes corresponding to the requesting entity that initiates the behavior represented by the second sample data and the resource entity targeted by the behavior are connected to obtain graph data corresponding to the second sample data, and the graph data is converted into request global data and resource global data as the first global data corresponding to the second sample data; wherein the request global data is data with the requesting entity and the behavior as dimensions, and the resource global data is data with the resource entity and the behavior as dimensions;
[0309] For each group of first sample data, the feature data corresponding to the second sample data included in the first sample data are concatenated to obtain the feature data corresponding to the first sample data, including:
[0310] For each group of first sample data, concatenate the first global data corresponding to the second sample data included in the first sample data to obtain the second global data corresponding to the first sample data;
[0311] The characteristic data corresponding to each group of first sample data are concatenated to obtain sample characteristic data, including:
[0312] The second global data corresponding to each group of first sample data are concatenated to obtain global feature data in the sample feature data;
[0313] The autoencoder model includes a graph autoencoder model, and the original autoencoder model includes an original graph autoencoder model;
[0314] Input the sample feature data into the original autoencoder model and calculate the predicted decoding data output by the original autoencoder model, including:
[0315] Inputting the global feature data in the sample feature data into the original graph autoencoder model, and calculating and obtaining the first predicted decoding data output by the original graph autoencoder model;
[0316] Based on the difference between the predicted decoding data and the sample feature data, the parameters of the original autoencoder model are adjusted, and the original autoencoder model after the parameter adjustment is used as the new original autoencoder model, and the sample feature data is input into the original autoencoder model to calculate the predicted decoding data output by the autoencoder model, until the first preset termination condition is reached, including:
[0317] Based on the difference between the first predicted decoded data and the global feature data in the sample feature data, the parameters of the original image autoencoder model are adjusted, and the original image autoencoder model with adjusted parameters is used as the new original image autoencoder model, and the step of inputting the global feature data in the sample feature data into the original image autoencoder model and calculating the first predicted decoded data output by the original image autoencoder model is returned to execute until the second preset termination condition is reached.
[0318] In a possible embodiment, the sample characteristic data includes statistical characteristic data;
[0319] Data processing is performed on each group of second sample data to obtain feature data corresponding to each group of second sample data, including:
[0320] For each group of second sample data, the second sample data is divided into multiple groups of third sample data according to the time of the behavior; wherein the time of the behavior represented by the third sample data in the same group is within the same third time window; and the third time window is smaller than the second time window;
[0321] For each group of second sample data, the third sample data is divided according to the behavior result of the behavior represented by the third sample data to obtain n first request data matrices and m first resource data matrices as first statistical data of the second sample data;
[0322] The i-th row, x-th column, and t-th layer of the n-th first request data matrix is used to characterize the behavior type x of the n-th request entity whose behavior result is i in the t-th group of third sample data included in the second sample data; the i-th row, x-th column, and t-th layer of the m-th first resource data matrix is used to characterize the behavior type x of the m-th resource entity whose behavior result is i in the t-th group of third sample data included in the second sample data;
[0323] For each group of first sample data, the feature data corresponding to the second sample data included in the first sample data are concatenated to obtain the feature data corresponding to the first sample data, including:
[0324] For each group of first sample data, concatenate first statistical data corresponding to second sample data included in the first sample data to obtain second statistical data corresponding to the first sample data;
[0325] The characteristic data corresponding to each group of first sample data are concatenated to obtain sample characteristic data, including:
[0326] splicing the second statistical data corresponding to each group of first sample data to obtain statistical feature data in the sample feature data;
[0327] The autoencoder model includes a stacked autoencoder model, and the original autoencoder model includes an original stacked autoencoder model;
[0328] Input the sample feature data into the original autoencoder model and calculate the predicted decoding data output by the original autoencoder model, including:
[0329] Inputting the statistical feature data in the sample feature data into the original stacked autoencoder model, and calculating and obtaining the second predicted decoding data output by the original stacked autoencoder model;
[0330] Based on the difference between the predicted decoding data and the sample feature data, the parameters of the original autoencoder model are adjusted, and the original autoencoder model after the parameter adjustment is used as the new original autoencoder model, and the sample feature data is input into the original autoencoder model to calculate the predicted decoding data output by the autoencoder model, until the first preset termination condition is reached, including:
[0331] Based on the difference between the second predicted decoded data and the statistical feature data in the sample feature data, the parameters of the original stacked autoencoder model are adjusted, and the original stacked autoencoder model after parameter adjustment is used as the new original stacked autoencoder model, and the step of inputting the statistical feature data in the sample feature data into the original stacked autoencoder model and calculating the second predicted decoded data output by the original stacked autoencoder model is returned to execute until the third preset termination condition is reached.
[0332] In a possible embodiment, the sample characteristic data includes sequence characteristic data;
[0333] Data processing is performed on each group of second sample data to obtain feature data corresponding to each group of second sample data, including:
[0334] For each group of second sample data, second sample data whose time intervals between behaviors are less than or equal to a preset time threshold are divided into the same group to obtain multiple groups of fourth sample data;
[0335] For each group of fourth sample data, the fourth sample data is sorted according to the time of the behavior to obtain the first request sequence data corresponding to the n request entities and the first resource sequence data corresponding to the m resource entities as the first sequence data corresponding to the fourth sample data;
[0336] For each group of second sample data, concatenate the first request sequence data corresponding to the same request entity in each group of fourth sample data included in the second sample data, and concatenate the first resource sequence data corresponding to the same resource entity in each group of fourth sample data included in the second sample data, to obtain the second request sequence data corresponding to n request entities and the second resource sequence data corresponding to m resource entities, as the second sequence data corresponding to the second sample data;
[0337] For each group of first sample data, the feature data corresponding to the second sample data included in the first sample data are concatenated to obtain the feature data corresponding to the first sample data, including:
[0338] For each group of first sample data, concatenate the second sequence data corresponding to the second sample data included in the first sample data to obtain the third sequence data corresponding to the first sample data;
[0339] The characteristic data corresponding to each group of first sample data are concatenated to obtain sample characteristic data, including:
[0340] splicing the third sequence data corresponding to each group of first sample data to obtain sequence feature data in the sample feature data;
[0341] The autoencoder model includes a sequence autoencoder model, and the original autoencoder model includes an original sequence autoencoder model;
[0342] Input the sample feature data into the original autoencoder model and calculate the predicted decoding data output by the original autoencoder model, including:
[0343] Inputting the sequence feature data in the sample feature data into the original sequence autoencoder model, and calculating and obtaining the third predicted decoding data output by the original sequence autoencoder model;
[0344] Based on the difference between the predicted decoding data and the sample feature data, the parameters of the original autoencoder model are adjusted, and the original autoencoder model after the parameter adjustment is used as the new original autoencoder model, and the sample feature data is input into the original autoencoder model to calculate the predicted decoding data output by the autoencoder model, until the first preset termination condition is reached, including:
[0345] Based on the difference between the third predicted decoding data and the sequence feature data in the sample feature data, the parameters of the original sequence autoencoder model are adjusted, and the original sequence autoencoder model after parameter adjustment is used as the new original sequence autoencoder model, and the step of inputting the sequence feature data in the sample feature data into the original sequence autoencoder model and calculating the third predicted decoding data output by the original sequence autoencoder model is returned to execute until the fourth preset termination condition is reached.
[0346] In a possible embodiment, the autoencoder model includes: a graph autoencoder model, a plurality of stacked autoencoder sub-models, and a plurality of sequence autoencoder sub-models; the graph autoencoder model includes an encoder and a decoder, the encoder is constructed based on a graph convolutional network, and the decoder is constructed based on a vector dot product; each stacked autoencoder sub-model has a different feature dimensionality reduction method; each sequence autoencoder sub-model has a different feature dimensionality reduction method;
[0347] Input the test feature data into the autoencoder model and calculate the decoded data output by the autoencoder model, including:
[0348] Inputting the global feature data in the test feature data into the graph autoencoder model, and calculating and obtaining the first sub-decoding data output by the graph autoencoder model;
[0349] Inputting the statistical feature data in the test feature data into each stacked autoencoder sub-model respectively, to obtain the second sub-decoding data output by each stacked autoencoder sub-model;
[0350] Inputting the sequence feature data in the test feature data into each sequence autoencoder sub-model respectively, obtaining the third sub-decoding data output by each sequence autoencoder sub-model, and using the first decoding sub-data, each second sub-decoding data and each third decoding sub-data as the decoding data output by the autoencoder model;
[0351] The device also includes:
[0352] A first difference calculation module, used for calculating a first difference between the global feature data in the test feature data and the first sub-decoded data;
[0353] A second difference calculation module, used for respectively calculating the second difference between the statistical feature data in the test feature data and each second sub-decoded data;
[0354] A third difference calculation module, used for respectively calculating the third differences between the sequence feature data in the test feature data and each third sub-decoded data;
[0355] The weighting module is used to weight the first difference, each second difference and each third difference to obtain the difference between the decoded data and the test feature data.
[0356] In a possible embodiment, in the process of weighting the first difference, each second difference and each third difference, the weight of each second difference is a weight pre-set for the stacked autoencoder sub-model corresponding to the second difference, the weight of each third difference is a weight pre-set for the sequence autoencoder sub-model corresponding to the third difference, the stacked autoencoder sub-model corresponding to the second difference is the stacked autoencoder sub-model based on which the second difference is obtained, and the sequence autoencoder sub-model corresponding to the third difference is the sequence autoencoder sub-model based on which the third difference is obtained;
[0357] The weights of each stacked autoencoder sub-model and each sequence autoencoder sub-model are configured in advance in the following ways, including:
[0358] Determine the sub-model loss of each stacked autoencoder sub-model and each sequence autoencoder sub-model in the process of training the autoencoder model, wherein the sub-model loss is used to represent the difference between the input of the sub-model and the output of the sub-model;
[0359] Based on the sub-model losses of each stacked autoencoder sub-model and each sequence autoencoder sub-model, the weights of each stacked autoencoder sub-model and each sequence autoencoder sub-model are configured respectively, wherein the weight of any sub-model is negatively correlated with the sub-model loss of the sub-model itself, and positively correlated with the sub-model losses of other sub-models.
[0360] In a possible embodiment, the device further includes:
[0361] The first model training module is used to train the autoencoder model according to the sample feature data of each entity device within the previous preset time length to obtain a new autoencoder model; within the current preset time length, based on the new autoencoder model, execute the step of inputting the test feature data into the autoencoder model and calculating the decoded data output by the autoencoder model;
[0362] and / or,
[0363] The second model training module is used to modify the parameter of the number of physical devices in the autoencoder model in response to the instruction to change the number of physical devices, so as to obtain the autoencoder model after the parameter modification; train the autoencoder model after the parameter modification according to the sample feature data within the second preset time period of each physical device to obtain a new autoencoder model; based on the new autoencoder model, execute the step of inputting the test feature data into the autoencoder model and calculating the decoded data output by the autoencoder model.
[0364] The present application also provides an electronic device, such as Fig. 9 As shown, including:
[0365] Memory 901, used for storing computer programs;
[0366] The processor 902 is used to execute the program stored in the memory 901, and implements the following steps:
[0367] Acquire test feature data of each entity device within the test time period, wherein the test feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the test feature data is used to characterize the association relationship between the requesting entity and the resource entity; the requesting entity is the entity device that initiates the behavior between the entity devices, and the resource entity is the entity device targeted by the behavior; the statistical feature data in the test feature data is used to characterize the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and the sequence feature data in the test feature data is used to characterize the association order of the behavior between the requesting entity and the resource entity;
[0368] Input the test feature data into the autoencoder model and calculate the decoded data output by the autoencoder model;
[0369] If the difference between the decoded data and the test feature data is greater than a preset threshold, it is determined that the physical device behaves abnormally;
[0370] Among them, the autoencoder model is pre-trained in the following way:
[0371] Acquire original sample data of each physical device within a first preset time period;
[0372] Dividing the original sample data into multiple groups of first sample data according to the time of the behavior; wherein the time of the behavior represented by the first sample data in the same group is within the same first time window;
[0373] For each group of first sample data, the first sample data is divided into multiple groups of second sample data according to the time of the behavior; wherein the time of the behavior represented by the second sample data in the same group is within the same second time window; and the second time window is smaller than the first time window;
[0374] Performing data processing on each group of second sample data respectively to obtain feature data corresponding to each group of second sample data;
[0375] For each group of first sample data, concatenate the feature data corresponding to the second sample data included in the first sample data to obtain the feature data corresponding to the first sample data;
[0376] The feature data corresponding to each group of first sample data are concatenated to obtain sample feature data; wherein the sample feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the sample feature data is used to characterize the association relationship between the request entity and the resource entity, the statistical feature data in the sample feature data is used to characterize the behavior type and behavior result of the behavior between the request entity and the resource entity, and the sequence feature data in the sample feature data is used to characterize the association order of the behavior between the request entity and the resource entity;
[0377] Input the sample feature data into the original autoencoder model, and calculate the predicted decoding data output by the original autoencoder model;
[0378] Based on the difference between the predicted decoding data and the sample feature data, the parameters of the original autoencoder model are adjusted, and the original autoencoder model with adjusted parameters is used as the new original autoencoder model. The step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the autoencoder model is returned to execute until the first preset termination condition is reached.
[0379] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 902, the communication interface, and the memory 901 communicate with each other via the communication bus.
[0380] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0381] The communication interface is used for communication between the above electronic device and other devices.
[0382] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0383] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0384] In another embodiment provided in the present application, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned zero-trust behavior anomaly detection methods are implemented.
[0385] In another embodiment provided in the present application, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any zero-trust behavior anomaly detection method in the above embodiments.
[0386] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0387] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0388] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, electronic device, computer-readable storage medium, and computer program product containing instructions, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0389] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A zero-trust behavior anomaly detection method, characterized in that: The method comprises: Acquire test feature data of each entity device within a test time period, wherein the test feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the test feature data is used to characterize the association relationship between the requesting entity and the resource entity; the requesting entity is the entity device that initiates the behavior between the entity devices, and the resource entity is the entity device to which the behavior is directed; the statistical feature data in the test feature data is used to characterize the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and the sequence feature data in the test feature data is used to characterize the association order of the behavior between the requesting entity and the resource entity; Inputting the test feature data into the autoencoder model, and calculating the decoded data output by the autoencoder model; If the difference between the decoded data and the test characteristic data is greater than a preset threshold, determining that the physical device behaves abnormally; The autoencoder model is pre-trained in the following way: Acquire original sample data of each of the physical devices within a first preset time period; Dividing the original sample data into a plurality of groups of first sample data according to the time of the behavior; wherein the time of the behavior represented by the first sample data in the same group is within the same first time window; For each group of the first sample data, the first sample data is divided into a plurality of groups of second sample data according to the time of the behavior; wherein the time of the behavior represented by the second sample data in the same group is within the same second time window; and the second time window is smaller than the first time window; Performing data processing on each group of the second sample data respectively to obtain feature data corresponding to each group of the second sample data; For each group of the first sample data, concatenate the feature data corresponding to the second sample data included in the first sample data to obtain the feature data corresponding to the first sample data; The feature data corresponding to each group of the first sample data are concatenated to obtain sample feature data; wherein the sample feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the sample feature data is used to characterize the association relationship between the requesting entity and the resource entity, the statistical feature data in the sample feature data is used to characterize the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and the sequence feature data in the sample feature data is used to characterize the association order of the behavior between the requesting entity and the resource entity; Inputting the sample feature data into the original autoencoder model, and calculating the predicted decoding data output by the original autoencoder model; Based on the difference between the predicted decoding data and the sample feature data, the parameters of the original autoencoder model are adjusted, and the original autoencoder model with adjusted parameters is used as the new original autoencoder model, and the step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the autoencoder model is returned to execute until the first preset termination condition is reached.
2. The method according to claim 1, characterized in that The sample feature data includes global feature data; The performing data processing on each group of the second sample data to obtain feature data corresponding to each group of the second sample data includes: For each group of the second sample data, taking each of the entity devices as a node, connecting the nodes corresponding to the request entity that initiates the behavior represented by the second sample data and the resource entity targeted by the behavior, obtaining graph data corresponding to the second sample data, and converting the graph data into request global data and resource global data as the first global data corresponding to the second sample data; wherein the request global data is data with the request entity and behavior as dimensions, and the resource global data is data with the resource entity and behavior as dimensions; For each group of the first sample data, the feature data corresponding to the second sample data included in the first sample data are concatenated to obtain the feature data corresponding to the first sample data, including: For each group of the first sample data, concatenate the first global data corresponding to the second sample data included in the first sample data to obtain the second global data corresponding to the first sample data; The step of concatenating the characteristic data corresponding to each group of the first sample data to obtain sample characteristic data includes: splicing the second global data corresponding to each group of the first sample data to obtain the global feature data in the sample feature data; The autoencoder model includes a graph autoencoder model, and the original autoencoder model includes an original graph autoencoder model; The step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the original autoencoder model comprises: Inputting the global feature data in the sample feature data into the original image autoencoder model, and calculating and obtaining the first predicted decoding data output by the original image autoencoder model; The step of adjusting the parameters of the original autoencoder model based on the difference between the predicted decoded data and the sample feature data, and using the original autoencoder model after parameter adjustment as a new original autoencoder model, returning to execute the step of inputting the sample feature data into the original autoencoder model, and calculating the predicted decoded data output by the autoencoder model until a first preset termination condition is reached includes: Based on the difference between the first predicted decoded data and the global feature data in the sample feature data, the parameters of the original image autoencoder model are adjusted, and the original image autoencoder model with adjusted parameters is used as the new original image autoencoder model, and the step of inputting the global feature data in the sample feature data into the original image autoencoder model and calculating the first predicted decoded data output by the original image autoencoder model is returned to execute until a second preset termination condition is reached.
3. The method according to claim 1, characterized in that: The sample characteristic data includes statistical characteristic data; The performing data processing on each group of the second sample data to obtain feature data corresponding to each group of the second sample data includes: For each group of the second sample data, the second sample data is divided into a plurality of groups of third sample data according to the time of the behavior; wherein the time of the behavior represented by the third sample data in the same group is within the same third time window; and the third time window is smaller than the second time window; For each group of the second sample data, the third sample data is divided according to the behavior result of the behavior represented by the third sample data to obtain n first request data matrices and m first resource data matrices as first statistical data of the second sample data; The i-th row, x-th column, and t-th layer of the n-th first request data matrix is used to characterize the behavior type x of the n-th request entity whose behavior result is i in the t-th group of third sample data included in the second sample data; the i-th row, x-th column, and t-th layer of the m-th first resource data matrix is used to characterize the behavior type x of the m-th resource entity whose behavior result is i in the t-th group of third sample data included in the second sample data; For each group of the first sample data, the feature data corresponding to the second sample data included in the first sample data are concatenated to obtain the feature data corresponding to the first sample data, including: For each group of the first sample data, concatenate the first statistical data corresponding to the second sample data included in the first sample data to obtain second statistical data corresponding to the first sample data; The step of concatenating the characteristic data corresponding to each group of the first sample data to obtain sample characteristic data includes: splicing the second statistical data corresponding to each group of the first sample data to obtain statistical feature data in the sample feature data; The autoencoder model includes a stacked autoencoder model, and the original autoencoder model includes an original stacked autoencoder model; The step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the original autoencoder model comprises: Inputting the statistical feature data in the sample feature data into the original stacked autoencoder model, and calculating to obtain the second predicted decoding data output by the original stacked autoencoder model; The step of adjusting the parameters of the original autoencoder model based on the difference between the predicted decoded data and the sample feature data, and using the original autoencoder model after parameter adjustment as a new original autoencoder model, returning to execute the step of inputting the sample feature data into the original autoencoder model, and calculating the predicted decoded data output by the autoencoder model until a first preset termination condition is reached includes: Based on the difference between the second predicted decoded data and the statistical feature data in the sample feature data, the parameters of the original stacked autoencoder model are adjusted, and the original stacked autoencoder model with adjusted parameters is used as the new original stacked autoencoder model, and the step of inputting the statistical feature data in the sample feature data into the original stacked autoencoder model and calculating the second predicted decoded data output by the original stacked autoencoder model is returned to execute until the third preset termination condition is reached.
4. The method according to claim 1, characterized in that: The sample characteristic data includes sequence characteristic data; The performing data processing on each group of the second sample data to obtain feature data corresponding to each group of the second sample data includes: For each group of the second sample data, the second sample data whose time interval between the behaviors is less than or equal to a preset time threshold are divided into the same group to obtain multiple groups of fourth sample data; For each group of the fourth sample data, the fourth sample data is sorted according to the time of the behavior to obtain first request sequence data corresponding to n request entities and first resource sequence data corresponding to m resource entities as first sequence data corresponding to the fourth sample data; For each group of the second sample data, concatenate the first request sequence data corresponding to the same request entity in each group of the fourth sample data included in the second sample data, and concatenate the first resource sequence data corresponding to the same resource entity in each group of the fourth sample data included in the second sample data, to obtain the second request sequence data corresponding to n request entities and the second resource sequence data corresponding to m resource entities, as the second sequence data corresponding to the second sample data; For each group of the first sample data, the feature data corresponding to the second sample data included in the first sample data are concatenated to obtain the feature data corresponding to the first sample data, including: For each group of the first sample data, concatenate the second sequence data corresponding to the second sample data included in the first sample data to obtain the third sequence data corresponding to the first sample data; The step of concatenating the characteristic data corresponding to each group of the first sample data to obtain sample characteristic data includes: splicing the third sequence data corresponding to each group of the first sample data to obtain sequence feature data in the sample feature data; The autoencoder model includes a sequence autoencoder model, and the original autoencoder model includes an original sequence autoencoder model; The step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the original autoencoder model comprises: Inputting the sequence feature data in the sample feature data into the original sequence autoencoder model, and calculating to obtain third predicted decoding data output by the original sequence autoencoder model; The step of adjusting the parameters of the original autoencoder model based on the difference between the predicted decoded data and the sample feature data, and using the original autoencoder model after parameter adjustment as a new original autoencoder model, returning to execute the step of inputting the sample feature data into the original autoencoder model, and calculating the predicted decoded data output by the autoencoder model until a first preset termination condition is reached includes: Based on the difference between the third predicted decoding data and the sequence feature data in the sample feature data, the parameters of the original sequence autoencoder model are adjusted, and the original sequence autoencoder model after parameter adjustment is used as the new original sequence autoencoder model, and the step of inputting the sequence feature data in the sample feature data into the original sequence autoencoder model and calculating the third predicted decoding data output by the original sequence autoencoder model is returned to execute until the fourth preset termination condition is reached.
5. The method according to claim 1, characterized in that The autoencoder model includes: a graph autoencoder model, multiple stacked autoencoder sub-models and multiple sequence autoencoder sub-models; the graph autoencoder model includes an encoder and a decoder, the encoder is constructed based on a graph convolutional network, and the decoder is constructed based on a vector dot product; the feature dimensionality reduction method of each stacked autoencoder sub-model is different; the feature dimensionality reduction method of each sequence autoencoder sub-model is different; The step of inputting the test feature data into the autoencoder model and calculating the decoded data output by the autoencoder model comprises: Inputting the global feature data in the test feature data into the graph autoencoder model, and calculating and obtaining the first sub-decoding data output by the graph autoencoder model; Inputting the statistical feature data in the test feature data into each of the stacked autoencoder sub-models respectively, to obtain second sub-decoded data output by each of the stacked autoencoder sub-models; Inputting the sequence feature data in the test feature data into each of the sequence autoencoder sub-models respectively, obtaining the third sub-decoded data output by each of the sequence autoencoder sub-models, and using the first sub-decoded data, each of the second sub-decoded data, and each of the third sub-decoded data as the decoded data output by the autoencoder model; The method further comprises: Calculating a first difference between the global feature data in the test feature data and the first sub-decoded data; respectively calculating second differences between the statistical feature data in the test feature data and each of the second sub-decoded data; respectively calculating third differences between the sequence feature data in the test feature data and each of the third sub-decoded data; The first difference, each of the second differences and each of the third differences are weighted to obtain a difference between the decoded data and the test feature data.
6. The method according to claim 5, characterized in that In the process of weighting the first difference, each of the second differences and each of the third differences, the weight of each of the second differences is a weight pre-set for the stacked autoencoder sub-model corresponding to the second difference, the weight of each of the third differences is a weight pre-set for the sequence autoencoder sub-model corresponding to the third difference, the stacked autoencoder sub-model corresponding to the second difference is the stacked autoencoder sub-model based on which the second difference is obtained, and the sequence autoencoder sub-model corresponding to the third difference is the sequence autoencoder sub-model based on which the third difference is obtained; The weights of each of the stacked autoencoder sub-models and each of the sequence autoencoder sub-models are configured in advance in the following manner, including: Respectively determining the sub-model loss of each of the stacked autoencoder sub-models and each of the sequence autoencoder sub-models in the process of training the autoencoder model, wherein the sub-model loss is used to represent the difference between the input of the sub-model and the output of the sub-model; Based on the sub-model losses of each of the stacked autoencoder sub-models and each of the sequence autoencoder sub-models, the weights of each of the stacked autoencoder sub-models and each of the sequence autoencoder sub-models are respectively configured, wherein the weight of any sub-model is negatively correlated with the sub-model loss of the sub-model itself, and positively correlated with the sub-model losses of other sub-models.
7. The method according to claim 1, characterized in that The method further comprises: The autoencoder model is trained according to the sample feature data of each of the physical devices within the last preset time period to obtain a new autoencoder model; Within the current preset time length, based on the new autoencoder model, executing the step of inputting the test feature data into the autoencoder model and calculating the decoded data output by the autoencoder model; and / or, In response to the entity device quantity change instruction, modify the entity device quantity parameter in the autoencoder model to obtain the autoencoder model after the parameter is modified; Training the autoencoder model after parameter modification according to the sample feature data within the second preset time period of each of the physical devices to obtain a new autoencoder model; Based on the new autoencoder model, the step of inputting the test feature data into the autoencoder model and calculating the decoded data output by the autoencoder model is performed.
8. A zero-trust behavior anomaly detection device, characterized in that: The device comprises: An acquisition module is used to acquire test feature data of each entity device within a test time period, wherein the test feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the test feature data is used to characterize the association relationship between the requesting entity and the resource entity; the requesting entity is the entity device that initiates the behavior between the entity devices, and the resource entity is the entity device to which the behavior is directed; the statistical feature data in the test feature data is used to characterize the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and the sequence feature data in the test feature data is used to characterize the association order of the behavior between the requesting entity and the resource entity; A calculation module, used for inputting the test feature data into the autoencoder model, and calculating and obtaining the decoded data output by the autoencoder model; a determination module, configured to determine that the behavior of the physical device is abnormal if the difference between the decoded data and the test characteristic data is greater than a preset threshold; The autoencoder model is pre-trained in the following way: Acquire original sample data of each of the physical devices within a first preset time period; Dividing the original sample data into a plurality of groups of first sample data according to the time of the behavior; wherein the time of the behavior represented by the first sample data in the same group is within the same first time window; For each group of the first sample data, the first sample data is divided into a plurality of groups of second sample data according to the time of the behavior; wherein the time of the behavior represented by the second sample data in the same group is within the same second time window; and the second time window is smaller than the first time window; Performing data processing on each group of the second sample data respectively to obtain feature data corresponding to each group of the second sample data; For each group of the first sample data, concatenate the feature data corresponding to the second sample data included in the first sample data to obtain the feature data corresponding to the first sample data; The feature data corresponding to each group of the first sample data are concatenated to obtain sample feature data; wherein the sample feature data includes: global feature data, statistical feature data, and sequence feature data; the global feature data in the sample feature data is used to characterize the association relationship between the requesting entity and the resource entity, the statistical feature data in the sample feature data is used to characterize the behavior type and behavior result of the behavior between the requesting entity and the resource entity, and the sequence feature data in the sample feature data is used to characterize the association order of the behavior between the requesting entity and the resource entity; Inputting the sample feature data into the original autoencoder model, and calculating the predicted decoding data output by the original autoencoder model; Based on the difference between the predicted decoding data and the sample feature data, the parameters of the original autoencoder model are adjusted, and the original autoencoder model with adjusted parameters is used as the new original autoencoder model, and the step of inputting the sample feature data into the original autoencoder model and calculating the predicted decoding data output by the autoencoder model is returned to execute until the first preset termination condition is reached.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-7 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
