Anomaly detection method, electronic device and storage medium in zero-trust environment
By building access subject behavior characterization and correlation models in a zero-trust environment and establishing behavioral baselines, the problem of traditional network security being unable to detect new power system anomalies is solved, and efficient security monitoring and risk discovery of the power system are achieved.
Patent Information
- Application Number
- CN202410889042.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-04
AI Technical Summary
Traditional network security boundary protection cannot comprehensively detect anomalies in new power systems, and cannot effectively protect against external attacks and internal theft risks.
In a zero-trust environment, by acquiring end-user log files and power grid entity identity data, we build access subject behavior characterization and correlation models, establish self- and group behavior baselines, determine abnormal results based on preset anomaly detection models, and improve detection accuracy.
It achieves comprehensive anomaly detection of the power system, promptly detects abnormal activities that deviate from the normal baseline, explores potential risks, and improves system security.
Smart Images

Figure CN118432952B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to an anomaly detection method, electronic device and storage medium in a zero-trust environment. Background Art
[0002] With the continuous development of new power systems, emerging technologies such as "cloud, big data, Internet of Things, mobile, intelligence, chain and edge" have been widely used in the power industry, with more diverse participants, wider edge distribution and richer interaction methods.
[0003] However, with the rapid development of new technologies and the widespread deployment of the information industry, the network security boundaries of the new power system are gradually blurred, and new risks such as external attackers infiltrating and internal personnel stealing secrets exist in the company's intranet. The traditional power grid security risk control system, which mainly focuses on network security boundary protection and defaults to trusting users, devices and applications in the system to a certain extent, can no longer fully meet the security protection requirements of the new power system and cannot fully detect abnormal situations in the power system. Summary of the invention
[0004] The present invention provides an anomaly detection method, electronic device and storage medium in a zero-trust environment to solve the problem of incomplete detection of abnormal conditions existing in a power system.
[0005] According to one aspect of the present invention, a method for anomaly detection in a zero-trust environment is provided, wherein the method comprises:
[0006] In a power system in a zero-trust environment, a terminal user log file and a power grid entity identity data are obtained, and an access subject behavior characterization and association model is constructed according to the terminal user log file and the power grid entity identity data;
[0007] Obtaining subject access behavior data associated with the access subject in the access subject behavior characterization and association model, and constructing the access subject's own behavior baseline according to the subject access behavior data;
[0008] According to the attribute type of the power grid entity of the access subject, the group access behavior data of the power grid entities with the same attribute are obtained in the access subject behavior characterization and association model, and the group behavior baseline of the entities with the same attribute is constructed according to the group access behavior data;
[0009] The baseline evaluation information of the self-behavior baseline and the group behavior baseline are respectively determined based on a preset anomaly detection model, and an abnormal result is determined according to the baseline evaluation information.
[0010] According to another aspect of the present invention, a device for detecting anomalies in a zero-trust environment is provided, wherein the device comprises:
[0011] A model building module is used to obtain terminal user log files and grid entity identity data in a power system in a zero-trust environment, and to build an access subject behavior characterization and association model based on the terminal user log files and the grid entity identity data;
[0012] A first baseline construction module is used to obtain subject access behavior data associated with the access subject in the access subject behavior characterization and association model, and to construct the access subject's own behavior baseline according to the subject access behavior data;
[0013] A second baseline construction module is used to obtain group access behavior data of power grid entities with the same attribute in the access subject behavior characterization and association model according to the power grid entity attribute type of the access subject, and to construct a group behavior baseline of entities with the same attribute according to the group access behavior data;
[0014] The anomaly detection module is used to determine the baseline evaluation information of the self-behavior baseline and the group behavior baseline respectively based on a preset anomaly detection model, and determine the abnormal result according to the baseline evaluation information.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0016] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the anomaly detection method in a zero-trust environment described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the anomaly detection method in a zero-trust environment described in any embodiment of the present invention when executed.
[0018] The technical solution of the embodiment of the present invention obtains the terminal user log file and the grid entity identity data in the power system under the zero-trust environment, and constructs the access subject behavior characterization and association model according to the terminal user log file and the grid entity identity data, so as to facilitate the analysis of the information related to the access subject and comprehensively display the association relationship between the access subject and the behavior entity. By extracting the access subject behavior characteristics from different dimensions, constructing the access subject's own behavior baseline and group access behavior data, constructing the group behavior baseline of entities with the same attributes according to the group access behavior data, and determining the baseline evaluation information of the self-behavior baseline and the group behavior baseline respectively based on the preset anomaly detection model, and determining the abnormal result according to the baseline evaluation information, the accuracy of anomaly detection is improved, and the safety of the power system is improved.
[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a flowchart of an anomaly detection method in a zero-trust environment provided according to Embodiment 1 of the present invention;
[0022] Figure 2 is a flowchart of an anomaly detection method in a zero-trust environment provided according to Embodiment 2 of the present invention;
[0023] Figure 3 is a flowchart of an anomaly detection method in a zero-trust environment provided according to Embodiment 3 of the present invention;
[0024] Figure 4 This is an example diagram of a zero-trust security architecture provided according to Embodiment 3 of the present invention;
[0025] Figure 5 is a schematic diagram of a process of training a preset anomaly detection model according to Embodiment 3 of the present invention;
[0026] Figure 6 is a structural diagram of an anomaly detection system in a zero-trust environment provided according to Embodiment 3 of the present invention;
[0027] Figure 7is a structural schematic diagram of an anomaly detection device in a zero-trust environment provided according to a fourth embodiment of the present invention;
[0028] Figure 8 It is a structural schematic diagram of an electronic device that implements an anomaly detection method in a zero-trust environment according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] Embodiment 1
[0032] Figure 1 This is a flowchart of an anomaly detection method in a zero-trust environment provided according to the first embodiment of the present invention. This embodiment is applicable to the case of performing anomaly detection on a power system in a zero-trust environment. The method can be executed by an anomaly detection device in a zero-trust environment. The anomaly detection device in a zero-trust environment can be implemented in the form of hardware and / or software. The anomaly detection device in a zero-trust environment can be configured in an electronic device. Figure 1 As shown, the method includes:
[0033] S110. In a power system under a zero-trust environment, terminal user log files and grid entity identity data are obtained, and access subject behavior characterization and association models are constructed based on the terminal user log files and grid entity identity data.
[0034] Among them, the zero-trust environment refers to a network security protection concept and strategy. In a zero-trust environment, no entity inside or outside the network is trusted by default, including users, devices, and networks. At the same time, strict identity authentication and authorization are performed on each access request to ensure that only legitimate entities can access resources.
[0035] The terminal user log file can be understood as a file that records the activities and operations of the terminal user when using the power system. The terminal user log file at least includes: access subject identification, behavior entity identification, access duration and access behavior.
[0036] Among them, the access subject identification can be understood as the subject identification information of the operation access. In one embodiment, the access subject may include a user or a terminal. The terminal may include but is not limited to a charging pile, an electrical device, etc. The behavior entity identification can be understood as the identification of the entity being accessed or performing the behavior. The behavior entity may include a terminal. Exemplarily, the access subject identification and the behavior entity identification may include but are not limited to a user name, a terminal identification number (Identity document, ID), a user Internet Protocol Address (Internet Protocol Address, IP) address, etc. The access behavior can be understood as the operation behavior of the access subject on the behavior entity, for example, a user accesses a charging pile to charge.
[0037] The grid entity identity data can be understood as identity information data related to various entities in the power system. The grid entity identity data includes at least: user identity and terminal identity. The corresponding user or terminal can be searched in the grid entity identity data according to the access subject identifier or the behavior entity identifier. It can be understood that the user or terminal stored in the grid entity identity data is stored in correspondence with the identifier.
[0038] The access subject behavior characterization and association model refers to a model used to analyze the relationship between the access subject and the behavior entity. In the actual operation process, the access subject behavior characterization and association model can be in the form of a directed graph, which can clearly show the relationship between the access subject, the behavior entity and the access behavior.
[0039] In an embodiment, in a power system under a zero-trust environment, terminal user log files and grid entity identity data can be collected. According to the access subject identifier, the corresponding access subject is searched in the grid entity identity data, and according to the behavior entity identifier, the corresponding behavior entity is searched in the grid entity identity data. The user identities corresponding to all users in the grid entity identity data form a user set, and the user identities of each user in the user set are respectively used as user nodes. At the same time, for each user node, the access behavior corresponding to the access subject identifier matching the user node is searched in the terminal user log file, and the behavior entity identifier corresponding to the access behavior is determined. The terminal corresponding to the behavior entity identifier is used as a terminal node, and the terminal identities of the terminal nodes corresponding to each user node are divided into terminal node sets. The access behavior is extracted from the terminal user log file to form a behavior set, each access behavior in the behavior set is used as a behavior node, and the behavior hierarchical relationship between different access behaviors in the behavior set is determined; the access relationship between the user node and the terminal node is determined according to the access behavior and the behavior hierarchical relationship. With user nodes, terminal nodes and behavior nodes as nodes and access relationships as edges, a directed graph is constructed as an access subject behavior characterization and association model.
[0040] In one embodiment, the access relationship may include a usage relationship between a user and a terminal, a corresponding relationship between an access subject and an access behavior, and a hierarchical relationship between behavior entities. In one embodiment, for each user node in a user set, the access behavior corresponding to each user node is grouped according to the terminal nodes involved, and a terminal node set corresponding to the node is generated, then all terminal nodes in the set have a usage relationship between the user and the terminal with the corresponding user node. The behavior hierarchical relationship determines the access subject and behavior entity corresponding to the access behavior of each level layer by layer, and according to the users and terminal nodes involved in the behavior, a corresponding relationship between the access subject and the behavior entity is established between different behavior nodes based on the hierarchical relationship set, and a hierarchical relationship between the behavior entities is established between the behavior node and its corresponding terminal node.
[0041] S120, obtaining the subject access behavior data associated with the access subject in the access subject behavior characterization and association model, and constructing the access subject's own behavior baseline according to the subject access behavior data.
[0042] Among them, the subject access behavior data can be understood as the access behavior of the access subject in historical time. The subject access behavior data associated with the access subject can be queried in the access subject behavior characterization and association model. The self-behavior baseline can be understood as an indicator used to measure whether the access subject has access anomalies. Specifically, the historical access behaviors can be arranged in chronological order as the access subject's own behavior baseline.
[0043] In an embodiment, the access behavior from the user node to the terminal node corresponding to the access subject can be extracted in the access subject behavior characterization and association model, the access behavior of historical events can be collected longitudinally to obtain the subject access behavior data, and the subject access behavior data can be sorted in chronological order as the access subject's own behavior baseline.
[0044] S130. According to the attribute type of the power grid entity of the access subject, the group access behavior data of the power grid entities with the same attribute are obtained in the access subject behavior characterization and association model, and the group behavior baseline of the entities with the same attribute is constructed according to the group access behavior data.
[0045] Among them, group access behavior data can be understood as the access behavior of access subjects of the same power grid entity attribute type, which can be access behavior within a period of time or access behavior at the current moment. The subject access behavior data associated with the power grid entity attribute type can be queried in the access subject behavior characterization and association model. The group behavior baseline can be understood as an indicator used to measure whether there is an access anomaly for the subject in the same attribute type as the access subject. The access subject may include but is not limited to users and terminals. Power grid entities with the same attributes can be understood as power grid entities that implement the same function or unified behavior. Exemplarily, in the behavior of charging, charging piles, charging equipment, etc. can be used as power grid entities with the same attributes.
[0046] In an embodiment, the access behaviors corresponding to user nodes and / or terminal nodes corresponding to the attribute types of power grid entities can be extracted in the access subject behavior characterization and association model, the access behaviors can be collected horizontally to obtain group access behavior data, and the group access behavior data can be sorted in chronological order as the group behavior baseline of the attribute type of power grid entity; or, all the group access behavior data can be used as the group behavior baseline.
[0047] S140: Determine baseline assessment information of the own behavior baseline and the group behavior baseline respectively based on a preset anomaly detection model, and determine abnormal results according to the baseline assessment information.
[0048] Among them, the preset anomaly detection model can be a model for evaluating whether there is an abnormality in the baseline of its own behavior or the baseline of group behavior. In the actual operation process, the preset anomaly detection model is built based on a multi-head attention mechanism network and a convolutional neural network. The baseline evaluation information refers to the result information of inputting the baseline of its own behavior or the baseline of group behavior into the preset anomaly detection model. Among them, the baseline evaluation information may include normal or abnormal. When any of the baseline evaluation information corresponding to the baseline of its own behavior or the baseline of group behavior is abnormal, it can be considered that there is an abnormality in the power system.
[0049] In an embodiment, the self-behavior baseline and the group behavior baseline can be respectively input into a preset abnormality detection model to generate baseline evaluation information corresponding to the self-behavior baseline and the group behavior baseline. When the baseline evaluation information corresponding to the self-behavior baseline or the group behavior baseline is abnormal, it can be considered that there is an abnormality in the power system. In other words, as long as there is an abnormality in the baseline evaluation information of the self-behavior baseline or the baseline evaluation information of the group behavior baseline, it is considered that there is an abnormality in the power system. When the baseline evaluation information corresponding to the self-behavior baseline or the group behavior baseline is normal, the power system is considered to be normal.
[0050] The embodiment of the present invention obtains the terminal user log file and the grid entity identity data in the power system under the zero-trust environment, and constructs the access subject behavior characterization and association model according to the terminal user log file and the grid entity identity data, so as to facilitate the analysis of the information related to the access subject and comprehensively display the association relationship between the access subject and the behavior entity. By extracting the access subject behavior characteristics from different dimensions, constructing the access subject's own behavior baseline and group access behavior data, constructing the group behavior baseline of entities with the same attributes according to the group access behavior data, and determining the baseline evaluation information of the self-behavior baseline and the group behavior baseline respectively based on the preset anomaly detection model, and determining the abnormal results according to the baseline evaluation information, it is possible to timely discover abnormal activities that deviate from the normal baseline, discover potential risks, improve the accuracy of anomaly detection, and enhance the safety of the power system.
[0051] In one embodiment, the anomaly detection method in a zero-trust environment further includes:
[0052] After obtaining the subject access behavior data, the subject access behavior data is cleaned and normalized;
[0053] After obtaining the group access behavior data, the group access behavior data is cleaned and normalized.
[0054] In the embodiment, the subject access behavior data and the group access behavior data can be cleaned to improve the data quality and availability. Specifically, the subject access behavior data and the group access behavior data can be removed with obviously erroneous information, and missing values can be deleted. The subject access behavior data and the group access behavior data can be normalized by applying the Min-Max Normalization, and the corresponding formula is as follows:
[0055] ;
[0056] Where x is the original data, x min is the minimum value of the sample data, x max is the maximum value, For normalized data, this operation can avoid imbalance in feature weights while improving the generalization ability of the model and ensure that the feature value is in the range of [0, 1].
[0057] In one embodiment, the training of the preset anomaly detection model includes:
[0058] Determine a cross entropy loss function as a network loss function of a preset anomaly detection model;
[0059] Based on the Adam optimizer with a learning rate, the preset anomaly detection model is iterated according to the back propagation algorithm through the parameter gradient of the network loss function until the result value of the network loss function is less than or equal to the preset loss threshold, and the parameters of the preset anomaly detection model are adjusted during the iteration process.
[0060] Among them, the cross entropy loss function is a smooth function, and the network loss function can be used to calculate the difference between the result of each iteration of the neural network and the true value, so as to guide the next step of training in the right direction. The network loss function can quantify the difference between the model prediction result and the true label. When the prediction is accurate, the value of the cross entropy loss function tends to be minimum; when the prediction is wrong, the value of the loss function will increase. In one embodiment, the cross entropy loss function can be:
[0061] ;
[0062] Where L is the loss function, n represents the number of co-existing events, and y i Represents the value of a single event, and its value range is [0, 1], p i for y i The corresponding probability distribution.
[0063] The Adam optimizer is a random optimizer that can calculate the adaptive learning rate of different parameters. In one embodiment, the learning rate of the Adam optimizer can be set by business personnel based on experience. The back propagation algorithm can be an algorithm used to train a preset anomaly detection model. The Adam optimizer has the ability to adaptively adjust each parameter, thereby automatically updating the model parameters, which can speed up the training of the model. Therefore, using the Adam optimizer can speed up the running speed and prediction accuracy of the detection model. The rules of the Adam optimizer are as follows:
[0064] ;
[0065] ;
[0066] ;
[0067] ;
[0068] ;
[0069] Among them, g t is the parameter gradient, and are two weighted average attenuation coefficients, and is the deviation-corrected moving average of the gradient, Including the weight matrix and bias vector of the neural network, is the updated parameter, is the learning rate, is a very small constant used to avoid the denominator being 0, where the parameter gradient g t It is the partial derivative of the loss function with respect to the model parameters. The rest of the information is set in the initial stage of the optimizer. Generally, it is the default parameter, which has been defined in advance in the implementation of the Adam optimizer. Its effectiveness has been verified through extensive experiments and basically does not require manual adjustment.
[0070] In an embodiment, the parameter gradient of the network loss function can be used to adjust the weights and biases of the neural network in the anomaly detection model so that the output of the model gradually approaches the true label of the training data, and the updated parameters and , , , , It is used as a built-in parameter for training in the forward propagation and back propagation process of the next round of iteration. After multiple rounds of iterations, the purpose of using the Adam optimizer to reduce the cross entropy loss function to improve the accuracy of the prediction is achieved.
[0071] Embodiment 2
[0072] Figure 2 1 is a flowchart of an anomaly detection method in a zero-trust environment provided according to Embodiment 2 of the present invention. This embodiment is a further description of an anomaly detection method in a zero-trust environment based on the above embodiment. Figure 2 As shown, the method includes:
[0073] S201. In a power system under a zero-trust environment, obtain terminal user log files and grid entity identity data, determine the access subject corresponding to the access subject identifier through the grid entity identity data, and determine the behavior entity corresponding to the behavior entity identifier through the grid entity identity data.
[0074] Among them, the access subject can be understood as an individual, entity or component that accesses specific resources or information, and the access subject can include a user or a terminal; the behavior entity can be understood as the entity that is accessed or performs the behavior, and the behavior entity can include a terminal.
[0075] In an embodiment, the corresponding access subject may be searched in the grid entity identity data through the access subject identifier, and the corresponding behavior entity may be searched in the grid entity identity data through the access entity identifier.
[0076] S202: The user identities corresponding to all users in the power grid entity identity data are grouped into a user set, and the user identity of each user in the user set is used as a user node.
[0077] Among them, the user node can be understood as a node representing a single user in the access subject behavior characterization and association model, and the user identity of each user can be used as a user node.
[0078] In an embodiment, user identities corresponding to all users in the grid entity identity data may be extracted, the user identities may be grouped into a user set, and the user identity of each user in the user set may be used as a user node.
[0079] S203. For each user node in the user set, search the terminal user log file for the access behavior corresponding to the access subject identifier that matches the user node, determine the terminal corresponding to the behavior entity identifier corresponding to the access behavior as the behavior entity corresponding to the user node, take the terminal as the terminal node, and divide the terminal identities of the terminal nodes corresponding to each user node into a terminal node set.
[0080] The access behavior can be understood as the behavior of the access subject accessing the behavior entity, for example, a user accessing a terminal.
[0081] In an embodiment, the access subject identifier that matches the user node can be searched in the terminal user log file, the access behavior corresponding to each access subject identifier can be determined, the terminals corresponding to the behavior entities involved can be grouped according to the access behavior corresponding to each user node, and each terminal can be used as a terminal node, and the terminal identity of the terminal node corresponding to each user node can be divided into a terminal node set.
[0082] S204: extract access behaviors from the terminal user log file to form a behavior set, take each access behavior in the behavior set as a behavior node, and determine the behavior hierarchical relationship between different access behaviors in the behavior set.
[0083] Among them, the behavior hierarchical relationship refers to the relationship between various access behaviors organized according to a certain hierarchical structure.
[0084] In an embodiment, all access behaviors can be extracted from the terminal user log file to form a behavior set, and each access behavior is determined as a behavior node. There is a behavior hierarchical relationship between different access behaviors in the behavior set, and the behavior hierarchical relationship between different access behaviors can be determined. Exemplarily, in the process of completing access behavior 1, access behavior 2 and access behavior 3 need to be completed before access behavior 1 can be completed. At this time, access behavior 1 can be considered as the upper level of access behavior 2 and access behavior 3.
[0085] S205: Determine the access relationship between the user node and the terminal node according to the access behavior and the behavior hierarchy relationship.
[0086] The access relationship at least includes the usage relationship between the user and the terminal, the corresponding relationship between the access subject and the access behavior, and the hierarchical relationship between the behavior entities.
[0087] Among them, the usage relationship between the user and the terminal can refer to the access relationship between the terminal node in each terminal node set and the user node corresponding to the terminal node set, that is, the user has a usage relationship with the terminal. There is an access subject and an access behavior between each access behavior, and there is a corresponding relationship between the access subject and the access behavior. There can be a hierarchical relationship between different behavior entities. For example, in the process of accessing behavior entity 1, it is necessary to first access behavior entity 2 and then access behavior entity 3 to complete the access to behavior entity 1. At this time, behavior entity 1 is the upper level of behavior entity 2 and behavior entity 3.
[0088] In one embodiment, determining the access relationship between the user node and the terminal node according to the access behavior and the behavior hierarchy relationship includes:
[0089] Determine an access relationship between a terminal node in each terminal node set and a user node corresponding to the terminal node set as a usage relationship between the user and the terminal;
[0090] Determine the access subject and behavior entity corresponding to each level of access behavior layer by layer according to the behavior hierarchy relationship;
[0091] Based on the behavior hierarchical relationship, a corresponding relationship between the access subject and the behavior entity is established between different behavior nodes, and a hierarchical relationship between the behavior entities is established between the behavior node and its corresponding terminal node.
[0092] In the embodiment, after determining the terminal node set, it can be considered that all the terminals in the set have a user-terminal usage relationship with the user. At the same time, the access subject and behavior entity corresponding to the access behavior of each level can be expanded layer by layer according to the behavior hierarchy relationship, and the corresponding relationship between the access subject and the behavior entity can be established between the corresponding behavior nodes according to the behavior relationship, and the hierarchical relationship between the behavior entities can be established between the behavior nodes and their corresponding terminal nodes.
[0093] S206: With user nodes, terminal nodes and behavior nodes as nodes and access relationships as edges, a directed graph is constructed as an access subject behavior characterization and association model.
[0094] In an embodiment, user nodes, terminal nodes and behavior nodes may be respectively used as nodes, and access relationships may be used as edges to form a directed graph, and the directed graph may be used as an access subject behavior characterization and association model.
[0095] S207. In the access subject behavior characterization and association model, the access behavior from the user node to the terminal node corresponding to the access subject is extracted and collected vertically to obtain the subject access behavior data.
[0096] In an embodiment, in the access subject behavior characterization and association model, the access behavior from the user node to the terminal node corresponding to the access subject can be collected longitudinally, that is, only the data corresponding to the access subject is collected in the historical time to obtain the subject access behavior data.
[0097] S208: Sort the subject's access behavior data in chronological order as the access subject's own behavior baseline.
[0098] In an embodiment, the subject access behavior data may be sorted in chronological order to construct the access subject's own behavior baseline.
[0099] S209. In the access subject behavior characterization and association model, the access behaviors corresponding to the user nodes and / or terminal nodes corresponding to the power grid entity attribute types are horizontally collected to obtain group access behavior data.
[0100] In an embodiment, for the grid entity attribute type of the access subject, access behaviors with the same grid entity attribute type can be collected to obtain group access behavior data. In one embodiment, when the access entity is a user node, the access behaviors corresponding to the user nodes with the same grid entity attribute type can be horizontally collected as group access behavior data; when the access entity is a terminal node, the access behaviors corresponding to the terminal nodes with the same grid entity attribute type can be horizontally collected as group access behavior data.
[0101] S210 , sorting the group access behavior data in chronological order as a group behavior baseline of a power grid entity attribute type.
[0102] In an embodiment, the group access behavior data may be sorted in chronological order to construct a group behavior baseline of the access subject.
[0103] S211, inputting the own behavior baseline and the group behavior baseline into the preset anomaly detection model respectively to obtain corresponding baseline evaluation information.
[0104] Among them, the preset anomaly detection model is built based on a multi-head attention mechanism network and a convolutional neural network.
[0105] In an embodiment, the self-behavior baseline and the group behavior baseline may be respectively input into a preset anomaly detection model, and the baseline evaluation information corresponding to the self-behavior baseline and the group behavior baseline may be determined by the preset anomaly detection model.
[0106] S212: When any baseline assessment information shows that an abnormality exists, it is determined that an abnormality exists in the power system.
[0107] In an embodiment, when there is a case where the baseline assessment information is abnormal, it is determined that there is an access abnormality in the power system.
[0108] S213. When all baseline assessment information is normal, determine that the power system is normal.
[0109] The embodiments of the present invention fully mine the relationship between users and entities in the network behavior data of the power system through anomaly detection in a zero-trust environment, and construct an access subject behavior characterization and association model through directed graph technology, so as to evaluate users and power grid entities. At the same time, the characteristic dimensions are decomposed to respectively characterize the group behavior baseline and the self-behavior baseline, so as to facilitate the discovery of abnormal activities that deviate from the normal baseline and explore potential threats in the system.
[0110] Embodiment 3
[0111] Figure 3 This is a flowchart of an anomaly detection method in a zero-trust environment provided by Embodiment 3 of the present invention. This embodiment takes the pre-construction of a zero-trust security architecture for the power system network for collecting terminal user log files and power grid entity identity data as an example to further illustrate an anomaly detection method in a zero-trust environment. Figure 3 As shown, the method includes:
[0112] S310. Build a zero-trust security architecture for the power system network, collect power system terminal user log files and grid entity identity data, and establish an access subject row association model through data association and collection for the collected data.
[0113] In one embodiment, Figure 4 is an example diagram of a zero-trust security architecture provided according to Embodiment 3 of the present invention, such as Figure 4 As shown in Figure 1, the zero-trust security architecture consists of a network security awareness platform, a power IoT security protection system, device trust assessment, and network access control. Among them, the power IoT security protection system can transmit terminal device status and power IoT business data, and the device trust assessment includes an authoritative center that can perform identity authentication and data detection on the terminal device status, power IoT business data, and power IoT security protection system.
[0114] In one embodiment, a zero-trust security architecture for the power system network can be constructed to collect power system terminal user log files and grid entity identity data. For the collected data set, a behavioral association model of the access subject is constructed, which is recorded as a directed graph G=(N, E, f, g, h). Among them, N represents the set of nodes, E represents the set of edges; f is the mapping function between nodes and labels, that is, f: N→Lab, Lab is a set of labels, and each node n in the set N has a unique label, that is, f(n)∈Lab; g is the relationship type mapping function, that is, g: E→R ty , R ty is a set of relation types, and each edge e in E must belong to a certain relation type in the relation set, that is, g(e)∈R ty ; h represents the node attribute mapping function, that is, h: Lab→Att, Att is the node attribute set, and each type of node has its corresponding attribute.
[0115] According to the given end-user log file and grid entity identity data, a label set Lab = {Usr, Term, Act} is constructed. Among them, the user set Usr = {Usr 1 , Usr 2 , …, Usr i}, terminal set Term ={ Term 1 ,Term 2 ,…,Term j}, behavior set Act = {Act 1 , Act 2 , …, Act k}. And construct the access relation set R ty ={R u, R c, R h}. Among them, R u Represents the usage relationship between the user and the terminal, R c The corresponding relationship between the access subject and the behavior entity, R hRepresents the hierarchical relationship between behavior entities. Construct the attribute set of the node Att = { Act L,1 , Act L,2 , …, Act L,t}. Among them, L∈Lab, Act L,t Indicates the first node in type L Construct a hierarchical relationship set Hie(Act) between access behaviors; for each user node Usr in the user set Usr 1 , Usr 2 , …, Usr i , according to the behavior data corresponding to each user node, group the terminal nodes involved and generate the terminal node set Term corresponding to the node (Usr i ), then all terminal nodes in the set have R u Based on the behavior data node Act in the data set Act k According to the users and terminal nodes involved in the behavior, R is established between different behavior nodes based on the hierarchical relationship set. c Type relationship, establish R between the behavior node and its corresponding terminal node h With user sets, terminal sets, and behavior sets as nodes and access relationships as edges, a model for describing the behavior of access subjects and their association is finally formed.
[0116] S320: For the access subject, historical data information of activities between the user node and the terminal node is longitudinally collected to build the behavior baseline of the access subject.
[0117] S330 , based on the attribute types of power grid entities, horizontally collect user nodes and terminal nodes, filter out group behavior data of power grid entities with the same attributes, and construct a group behavior baseline.
[0118] S340: clean the subject access behavior data and the group access behavior data, check the data consistency, and normalize them.
[0119] In an embodiment, Min-Max Normalization may be applied to normalize the subject access behavior data and the group access behavior data. The corresponding formula is as follows:
[0120] ;
[0121] Where x is the original data, x min is the minimum value of the sample data, x max is the maximum value, For normalized data, this operation can avoid imbalance in feature weights while improving the generalization ability of the model and ensure that the feature value is in the range of [0, 1].
[0122] S350. Use a deep learning anomaly detection method based on a hybrid attention mechanism to detect the self-behavior baseline and the group behavior baseline respectively, integrate the baseline evaluation information of each baseline, and determine the final anomaly detection result.
[0123] In one embodiment, a preset anomaly detection model may be used to detect the self-behavior baseline and the group behavior baseline respectively to obtain baseline assessment information.
[0124] In one embodiment, Figure 5 1 is a flow chart of a preset anomaly detection model training process provided according to Embodiment 3 of the present invention. The preset anomaly detection model is built based on a multi-head attention mechanism network and a convolutional neural network. Figure 5 As shown in the figure, the pre-training process of building the preset anomaly detection model is as follows:
[0125] Step 1: The convolutional neural network includes three one-dimensional convolutional layers and the corresponding maximum pooling layer for operations such as extracting and compressing data features of the data set. The convolutional layers are defined from top to bottom with 32, 64, and 128 filters, a convolution kernel of a fixed size of 3, and an activation function f(x). The activation function f(x) is defined as follows:
[0126] f(x)=max(0,x);
[0127] This activation function is used in this model to detect whether the feature is relevant to the task, so that only useful features are retained and irrelevant features are removed to complete feature extraction.
[0128] Step 2: Considering the need for lightweight, a new convolutional layer is set. The difference from the above three convolutional layers is that the training step size of this convolutional layer is 2. Skipping the processing of some data reduces the size of the feature map and increases the receptive field of each neuron, thereby achieving better learning effects.
[0129] Step 3: The spatial attention mechanism can capture the correlation of input data in the spatial dimension, making the model more capable of learning dependencies between different locations. However, it treats the features in each channel equally and ignores the information interaction between channels. Therefore, the multi-head attention mechanism is used to process the features. The multi-head attention mechanism uses multiple queries to select multiple pieces of information from the input information in parallel and then concatenate them. Specifically:
[0130] First, the number of heads is set to 4 in the network construction, and then the number of channels of the output feature map is evenly divided into 3 parts. Then, the input data x is convolved through three separate convolutional layers "conv1", "conv2", and "conv3" to obtain the query (q, query), key (k, key), and value (v, value). For each head, the dot product operation of q and k is calculated to obtain the attention score matrix, and the matrix is normalized using the softmax function to obtain the attention weight matrix. Then, the weight is multiplied by v to obtain the attention output result. Finally, the outputs of all heads are cascaded together to form the final output result out att ;
[0131] Step 4: In order to enable the model to process time series data and capture the position information in the sequence, use the position function to generate a position encoding tensor (pe). Position encoding is a way to add position information to the input. The specific implementation process is:
[0132] First, create two tensors loc according to the height H and width W of the input data w and loc h , representing the position encoding in the horizontal and vertical directions respectively.
[0133] For the horizontal direction, W values are uniformly generated in the range [-1, 1]. These values represent the relative coordinates of each horizontal position of the input data, that is, the x coordinate. Then this tensor is copied H times in the vertical direction to match the height of the input data, thereby encoding the horizontal position information of the input data into the position encoding tensor.
[0134] For the vertical direction, the relative coordinates of the vertical position are also generated, representing the relative coordinates of each vertical position of the input data, that is, the y coordinate, and are copied W times to match the width of the input data, thereby encoding the vertical position information of the input data into the position encoding tensor.
[0135] Finally, the horizontal and vertical positional encoding tensors are concatenated to form a positional encoding tensor containing the x and y coordinate information for each position, with an extra dimension added at the outermost layer to match the batch dimension of the input data.
[0136] The dimension is the same as the input data, and the x and y coordinate information of each position of the data is included in the channel dimension. The introduction of position information can help the model better understand the spatial structure of the input data, thereby more effectively capturing the dependencies between inputs. Then, through the convolution layer defined in the spatial attention, q is multiplied by pe, so that the model can take into account the relative position information of each data. By convolving this information, the output out is further obtained.conv .
[0137] Step 5: Concatenate the output channels of multi-head attention and spatial attention, pass through the fully connected layer and the depth-separable convolution layer, and use rate1 and rate2 to convert the output channels into att and out conv Perform weighted operations to form the final comprehensive features as input for subsequent models.
[0138] Step 6: Since the features obtained by the above steps are high-dimensional data, they may cause dimensionality disasters and overfitting. Therefore, in order to reduce computational complexity and storage overhead, the extracted features are flattened to convert the features that originally existed in the form of high-dimensional data into one-dimensional data. At the same time, the redundancy of the data can be reduced, and the data features originally represented in the form of two-dimensional tensors are converted into one-dimensional arrays, where each element represents a feature. Then, the data is classified through the fully connected layer and the output layer, and pruned with a probability of 0.6. In each training batch, there is a 60% probability of discarding the output of the current layer, thereby reducing the complexity of the neural network, making the overall network unable to over-rely on specific neurons, and reducing the risk of overfitting.
[0139] Step 7: Finally, compile the model and calculate the accuracy of the classification effect of the model based on the test set and experimental set divided in the initial stage. The sensitivity of the classification effect is verified by the size of the loss function. This solution uses the adam optimizer to process the loss function based on the gradient information. Its main purpose is to minimize the value of the loss function to a certain extent, thereby improving the accuracy of the prediction. Since this solution is aimed at the binary classification problem, the loss function applied is the cross entropy loss function, and its specific formula is as follows:
[0140] ;
[0141] In this formula, L is the loss function, n represents the number of co-existing events, and y i Represents the value of a single event, and its value range is [0, 1], p i for y i Corresponding to the probability distribution, the cross entropy loss function can quantify the difference between the model prediction result and the true label. When the prediction is accurate, the value of the cross entropy loss function tends to be minimum; when the prediction is wrong, the value of the loss function will increase.
[0142] The Adam optimizer has the ability to adaptively adjust each parameter, thereby automatically updating the model parameters, which can speed up the training of the model. Therefore, using the Adam optimizer can speed up the running speed and prediction accuracy of the detection model. The Adam optimizer rules are as follows:
[0143] ;
[0144] ;
[0145] ;
[0146] ;
[0147] ;
[0148] The specific parameters are: t is the parameter gradient, and are two weighted average attenuation coefficients, and is the deviation-corrected moving average of the gradient, Including the weight matrix and bias vector of the neural network, is the updated parameter, is the learning rate, is a very small constant used to avoid the denominator being 0, where the parameter gradient g t It is the partial derivative of the loss function with respect to the model parameters. The rest of the information is set in the initial stage of the optimizer. Generally, it is the default parameter, which has been defined in advance in the implementation of the Adam optimizer. Its effectiveness has been verified through extensive experiments and basically does not require manual adjustment.
[0149] For the Adam optimizer, the input mainly includes two aspects: gradient g t , and the learnable parts of the model, including the weights and biases in the neural network. The learnable parameters are set in the initialization phase as mentioned above, so the Adam optimizer is part of the model training, which mainly inputs the parameter gradient g that tells the optimizer the direction and rate of change of the current parameters. t According to the above calculation rules, while minimizing the loss function, the gradient information of the loss function is used to adjust the weights and biases of the neural network in the anomaly detection model, so that the output of the model gradually approaches the true label of the training data, and the updated parameters and , , , , It is used as a built-in parameter for training in the forward propagation and back propagation process of the next round of iteration. After multiple rounds of iterations, the purpose of using the Adam optimizer to reduce the cross entropy loss function to improve the accuracy of the prediction is achieved.
[0150] In one embodiment, Figure 6is a schematic diagram of the structure of an anomaly detection system in a zero-trust environment provided according to Embodiment 3 of the present invention. Taking the deep learning detection model based on the attention mechanism as an example of the preset anomaly detection model, as shown in FIG. Figure 6 As shown, the system includes: a data acquisition module, a data processing module and an anomaly detection module.
[0151] Among them, the data collection module is used to collect the power system terminal user log data and power system network entity identity data based on the power system network of the zero-trust architecture;
[0152] The data processing module is used to construct a behavioral characterization and association model for the visiting subject, determine the baseline of the individual behavior and the baseline of the group behavior, and clean and normalize the data;
[0153] The anomaly detection module is used to detect anomalies of its own behavior and group behavior based on the deep learning detection model of the attention mechanism to determine the baseline assessment information. When any baseline assessment information is abnormal, it is determined that the power system is abnormal; when all baseline assessment information is normal, it is determined that the power system is normal.
[0154] Embodiment 4
[0155] Figure 7 Schematic diagram of the structure of an anomaly detection device in a zero-trust environment provided by Embodiment 4 of the present invention. Figure 7 As shown, the device includes: a model building module 71, a first baseline building module 72, a second baseline building module 73 and an anomaly detection module 74.
[0156] Among them, the model building module 71 is used to obtain terminal user log files and grid entity identity data in the power system under the zero-trust environment, and build an access subject behavior characterization and association model based on the terminal user log files and grid entity identity data.
[0157] The first baseline construction module 72 is used to obtain the subject access behavior data associated with the access subject in the access subject behavior characterization and association model, and construct the access subject's own behavior baseline according to the subject access behavior data.
[0158] The second baseline construction module 73 is used to obtain group access behavior data of power grid entities with the same attribute in the access subject behavior characterization and association model according to the power grid entity attribute type of the access subject, and construct a group behavior baseline of entities with the same attribute according to the group access behavior data.
[0159] The anomaly detection module 74 is used to determine the baseline evaluation information of the own behavior baseline and the group behavior baseline respectively based on the preset anomaly detection model, and determine the abnormal result according to the baseline evaluation information.
[0160] In the embodiment of the present invention, the terminal user log file and the grid entity identity data are obtained in the power system under the zero-trust environment through the model construction module, and the access subject behavior characterization and association model is constructed according to the terminal user log file and the grid entity identity data, so as to facilitate the analysis of the information related to the access subject and comprehensively display the association relationship between the access subject and the behavior entity. The first baseline construction module and the second baseline construction module extract the access subject behavior characteristics from different dimensions, construct the access subject's own behavior baseline and group access behavior data, and construct the group behavior baseline of entities with the same attributes according to the group access behavior data. The anomaly detection module determines the baseline evaluation information of the self-behavior baseline and the group behavior baseline respectively based on the preset anomaly detection model, and determines the abnormal result according to the baseline evaluation information, so as to realize the timely discovery of abnormal activities that deviate from the normal baseline, explore potential risks, improve the accuracy of anomaly detection, and enhance the safety of the power system.
[0161] In one embodiment, the terminal user log file includes at least: an access subject identifier, a behavior entity identifier, an access duration, and an access behavior;
[0162] The grid entity identity data includes at least: user identity and terminal identity;
[0163] Accordingly, the model building module 71 includes:
[0164] An identity determination unit, used to determine an access subject corresponding to the access subject identifier through the grid entity identity data, and to determine a behavior entity corresponding to the behavior entity identifier through the grid entity identity data;
[0165] A user node determination unit, used to form a user set by combining user identities corresponding to all users in the power grid entity identity data, and to use the user identity of each user in the user set as a user node;
[0166] A terminal node determination unit is used to search, for each user node in the user set, the access behavior corresponding to the access subject identifier matching the user node in the terminal user log file, determine the terminal corresponding to the behavior entity identifier corresponding to the access behavior as the behavior entity corresponding to the user node, use the terminal as the terminal node, and divide the terminal identity of the terminal node corresponding to each user node into a terminal node set;
[0167] A hierarchical determination unit is used to extract access behaviors from the terminal user log file to form a behavior set, take each access behavior in the behavior set as a behavior node, and determine the behavior hierarchical relationship between different access behaviors in the behavior set;
[0168] A hierarchical determination unit, used to determine the access relationship between the user node and the terminal node according to the access behavior and the behavior hierarchical relationship; wherein the access relationship at least includes the use relationship between the user and the terminal, the corresponding relationship between the access subject and the access behavior, and the hierarchical relationship between the behavior entities;
[0169] The model building unit is used to construct a directed graph as an access subject behavior characterization and association model using user nodes, terminal nodes, and behavior nodes as nodes and access relationships as edges.
[0170] In one embodiment, the level determination unit is specifically configured to:
[0171] Determine an access relationship between a terminal node in each terminal node set and a user node corresponding to the terminal node set as a usage relationship between the user and the terminal;
[0172] Determine the access subject and behavior entity corresponding to each level of access behavior layer by layer according to the behavior hierarchy relationship;
[0173] Based on the behavior hierarchical relationship, a corresponding relationship between the access subject and the behavior entity is established between different behavior nodes, and a hierarchical relationship between the behavior entities is established between the behavior node and its corresponding terminal node.
[0174] In one embodiment, the first baseline building module 72 includes:
[0175] The first data acquisition unit is used to extract the access behavior from the user node to the terminal node corresponding to the access subject in the access subject behavior characterization and association model, and collect it vertically to obtain the subject access behavior data;
[0176] The first baseline construction unit is used to sort the subject access behavior data in chronological order as the access subject's own behavior baseline.
[0177] In one embodiment, the second baseline building module 73 includes:
[0178] The second data acquisition unit is used to horizontally collect access behaviors corresponding to user nodes and / or terminal nodes corresponding to the attribute types of power grid entities in the access subject behavior characterization and association model to obtain group access behavior data;
[0179] The second baseline construction unit is used to sort the group access behavior data in chronological order as a group behavior baseline of a power grid entity attribute type.
[0180] In one embodiment, the anomaly detection module 74 includes:
[0181] An evaluation information determination unit is used to input the self-behavior baseline and the group behavior baseline into a preset anomaly detection model to obtain corresponding baseline evaluation information; the preset anomaly detection model is built based on a multi-head attention mechanism network and a convolutional neural network;
[0182] A first detection unit is used to determine that an abnormality exists in the power system when any baseline assessment information is abnormal;
[0183] The second detection unit is used to determine that the power system is normal when all baseline assessment information is normal.
[0184] In one embodiment, the anomaly detection device in a zero-trust environment further includes:
[0185] A loss function determination module, used to determine a cross entropy loss function as a network loss function of a preset anomaly detection model;
[0186] The model training module is used to iterate the preset anomaly detection model according to the back propagation algorithm based on the Adam optimizer with a learning rate, through the parameter gradient of the network loss function, until the result value of the network loss function is less than or equal to the preset loss threshold, and adjust the parameters of the preset anomaly detection model during the iteration process.
[0187] In one embodiment, the anomaly detection device in a zero-trust environment further includes:
[0188] A first data processing module is used to perform data cleaning and normalization processing on the subject access behavior data after obtaining the subject access behavior data;
[0189] The second data processing module is used to perform data cleaning and normalization processing on the group access behavior data after acquiring the group access behavior data.
[0190] The anomaly detection device in a zero-trust environment provided by an embodiment of the present invention can execute the anomaly detection method in a zero-trust environment provided by any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0191] Embodiment 5
[0192] Figure 8It is a structural schematic diagram of an electronic device for implementing an anomaly detection method in a zero-trust environment of an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0193] like Figure 8 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The I / O interface 15 is also connected to the bus 14.
[0194] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0195] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as an anomaly detection method in a zero-trust environment.
[0196] In some embodiments, the anomaly detection method in a zero-trust environment may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the anomaly detection method in a zero-trust environment described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the anomaly detection method in a zero-trust environment in any other appropriate manner (e.g., by means of firmware).
[0197] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0198] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0199] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0200] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0201] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0202] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0203] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0204] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An anomaly detection method in a zero-trust environment, It is characterized in that include: In a power system in a zero-trust environment, a terminal user log file and a power grid entity identity data are obtained, and an access subject behavior characterization and association model is constructed according to the terminal user log file and the power grid entity identity data; wherein the access subject behavior characterization and association model is a directed graph, which is used to analyze the relationship between the access entity and the behavior entity; Obtaining subject access behavior data associated with the access subject in the access subject behavior characterization and association model, and constructing the access subject's own behavior baseline according to the subject access behavior data; According to the attribute type of the power grid entity of the access subject, the group access behavior data of the power grid entities with the same attribute are obtained in the access subject behavior characterization and association model, and the group behavior baseline of the entities with the same attribute is constructed according to the group access behavior data; Based on a preset anomaly detection model, the baseline evaluation information of the self-behavior baseline and the group behavior baseline are respectively determined, and the abnormal result is determined according to the baseline evaluation information; wherein the preset anomaly detection model is based on a deep learning anomaly detection method of a hybrid attention mechanism to respectively determine the baseline evaluation information of the self-behavior baseline and the group behavior baseline; the preset anomaly detection model is built based on a multi-head attention mechanism network and a convolutional neural network; The terminal user log file includes at least: access subject identification, behavior entity identification, access duration and access behavior; The grid entity identity data includes at least: user identity and terminal identity; Accordingly, the access subject behavior characterization and association model is constructed according to the terminal user log file and the grid entity identity data, including: Determine the access subject corresponding to the access subject identifier through the power grid entity identity data, and determine the behavior entity corresponding to the behavior entity identifier through the power grid entity identity data; The user identities corresponding to all users in the power grid entity identity data are grouped into a user set, and the user identity of each user in the user set is used as a user node; For each user node in the user set, search the terminal user log file for an access behavior corresponding to an access subject identifier matching the user node, determine a terminal corresponding to a behavior entity identifier corresponding to the access behavior as a behavior entity corresponding to the user node, use the terminal as a terminal node, and divide the terminal identities of the terminal nodes corresponding to each user node into a terminal node set; Extracting the access behaviors from the terminal user log file to form a behavior set, taking each access behavior in the behavior set as a behavior node, and determining a behavior hierarchical relationship between different access behaviors in the constituent behavior set; Determining the access relationship between the user node and the terminal node according to the access behavior and the behavior hierarchical relationship; wherein the access relationship at least includes the usage relationship between the user and the terminal, the corresponding relationship between the access subject and the access behavior, and the hierarchical relationship between the behavior entities; The user node, the terminal node and the behavior node are used as nodes and the access relationship is used as an edge to form a directed graph as the access subject behavior characterization and association model.
2. The method according to claim 1, It is characterized in that The determining the access relationship between the user node and the terminal node according to the access behavior and the behavior hierarchical relationship includes: Determine the access relationship between the terminal node in each of the terminal node sets and the user node corresponding to the terminal node set as a usage relationship between the user and the terminal; Determine the access subject and behavior entity corresponding to the access behavior at each level layer by layer according to the behavior hierarchical relationship; Based on the corresponding relationship between the access subject and the behavior entity is established between different behavior nodes in the behavior hierarchical relationship, and the hierarchical relationship between the behavior entities is established between the behavior node and its corresponding terminal node.
3. The method according to claim 1, It is characterized in that The step of acquiring subject access behavior data associated with the access subject in the access subject behavior characterization and association model for the access subject, and constructing the access subject's own behavior baseline according to the subject access behavior data includes: In the access subject behavior characterization and association model, the access behavior from the user node to the terminal node corresponding to the access subject is extracted for longitudinal collection to obtain the subject access behavior data; The subject access behavior data is sorted in chronological order as the access subject's own behavior baseline.
4. The method according to claim 1, It is characterized in that The grid entity attribute type for the access subject obtains group access behavior data of grid entities with the same attribute in the access subject behavior characterization and association model, and constructs a group behavior baseline of entities with the same attribute according to the group access behavior data, including: In the access subject behavior characterization and association model, the access behaviors corresponding to the user nodes and / or terminal nodes corresponding to the attribute types of the power grid entities are horizontally collected to obtain group access behavior data; The group access behavior data are sorted in chronological order as a group behavior baseline for the attribute type of the power grid entity.
5. The method according to claim 1, It is characterized in that The determining of the baseline evaluation information of the self-behavior baseline and the group behavior baseline based on the preset abnormality detection model, and determining the abnormal result according to the baseline evaluation information, includes: Inputting the self-behavior baseline and the group behavior baseline into the preset abnormality detection model respectively to obtain corresponding baseline evaluation information; when any of the baseline evaluation information is abnormal, determining that the power system is abnormal; When all of the baseline assessment information is normal, it is determined that the power system is normal.
6. The method according to claim 1, It is characterized in that The training of the preset anomaly detection model includes: Determining a cross entropy loss function as a network loss function of the preset anomaly detection model; Based on the Adam optimizer with a learning rate, the preset anomaly detection model is iterated according to the back propagation algorithm through the parameter gradient of the network loss function until the result value of the network loss function is less than or equal to the preset loss threshold, and the parameters of the preset anomaly detection model are adjusted during the iteration process.
7. The method according to claim 1, It is characterized in that Also includes: After obtaining the subject access behavior data, performing data cleaning and normalization processing on the subject access behavior data; After the group access behavior data is acquired, data cleaning and normalization processing is performed on the group access behavior data.
8. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the anomaly detection method in a zero-trust environment as described in any one of claims 1-7.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the anomaly detection method in a zero-trust environment as described in any one of claims 1-7 when executed.
Citation Information
Patent Citations
Electric power mobile internet service security protection method and system
CN114125848A
