Abnormal structure mining method, device and readable storage medium based on knowledge graph

Through the hierarchical random walk and pattern transformation method based on the knowledge graph, the abnormal patterns in the knowledge graph are extracted, which solves the problem of difficulty in discovering unknown abnormal structures in the existing technology and realizes the effective mining of abnormal structures in large-scale graph data. .

CN113704326BActive Publication Date: 2024-10-01CHINA UNIONPAY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111005389.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-30
Publication Date
2024-10-01
Estimated Expiration
2041-08-30

AI Technical Summary

Technical Problem

Existing graph-based abnormal structure mining methods are difficult to discover unknown abnormal structures. Especially in scenarios with large amounts of data and no or few labels, simple abnormal structures are easily covered by normal structures, making it impossible to effectively mine abnormal structures.

Method used

An abnormal structure mining method based on knowledge graph is adopted. By constructing a knowledge graph, hierarchical random walk is performed, the node sequence is recorded, converted into a pattern set, and abnormal pattern mining is performed according to the pattern set to extract the abnormal structure. Specific steps include determining nodes, relationships and attributes, extracting entities, relationships and attributes, building a graph, performing bucket sampling and random walks, obtaining node sequences, converting them into patterns, counting the number of pattern occurrences, constructing a suspected abnormal pattern set, and Extracting abnormal patterns through full graph traversal.

Benefits of technology

It can simplify the graph without distortion, effectively mine unknown abnormal structures, improve the detection ability of simple abnormal structures, and is suitable for large-scale graph data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113704326B_ABST
    Figure CN113704326B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, system and computer-readable storage medium for mining abnormal structures based on a knowledge graph, the method comprising: constructing a knowledge graph, the knowledge graph comprising a plurality of nodes and edges determined based on node relationships; selecting an initial node from the knowledge graph to perform a hierarchical random walk, recording the node sequence walked to obtain a node sequence set; converting each node sequence in the node sequence set into a pattern to obtain a pattern set; mining abnormal patterns according to the pattern set to obtain an abnormal structure. Using the above method, a better abnormal structure mining effect can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of graph neural networks, and specifically relates to a method, device and readable storage medium for mining abnormal structures based on knowledge graphs. Background Art

[0002] This section is intended to provide a background or context to embodiments of the invention that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] At present, graph-based abnormal structure mining tends to mine complex structures, such as clusters, rings, chains, star structures, etc., and finds whether there are defined abnormal structures in the graph to achieve abnormal structure discovery. This method is suitable for most scenarios with rich prior knowledge, but it cannot discover unknown abnormal structures.

[0004] Many business scenarios involve large amounts of data with no or few labels. It is difficult to mine a small number of abnormal structures from a large number of nodes and complex relationships in a graph, especially since some simple abnormal structures are easily covered by a large number of normal structures. Therefore, it is necessary to appropriately simplify the graph without distortion.

[0005] Therefore, how to effectively mine abnormal structures is an urgent problem to be solved. Summary of the invention

[0006] In view of the problems existing in the above-mentioned prior art, a method, device and computer-readable storage medium for abnormal structure mining based on knowledge graph are proposed. By using this method, device and computer-readable storage medium, the above-mentioned problems can be solved.

[0007] The present invention provides the following solutions.

[0008] In a first aspect, a method for mining abnormal structures based on a knowledge graph is provided, comprising: constructing a knowledge graph, wherein the knowledge graph comprises a plurality of nodes and edges determined based on node relationships; selecting an initial node from the knowledge graph to perform a hierarchical random walk, and recording the node sequence walked to obtain a node sequence set; converting each node sequence in the node sequence set into a pattern to obtain a pattern set; and mining abnormal patterns according to the pattern set to obtain an abnormal structure.

[0009] Furthermore, the construction of the knowledge graph also includes: determining node constituent entities, node relationships, node attributes, and edge attributes; and constructing the knowledge graph through entity extraction, relationship extraction, and attribute extraction.

[0010] Furthermore, selecting an initial node from the knowledge graph further includes: calculating the out-degree out j of all nodes in the knowledge graph, bucketing the nodes according to the out-degrees of the nodes, wherein the bucket interval is k and the number of buckets is m; performing random sampling on each of the buckets, wherein n nodes are randomly selected from each of the buckets to determine the sampling node S in each of the buckets. i (v), and obtain the initial node set S(v) = {S i (v), i=1, ..., m}, where i is a bucket identifier.

[0011] Furthermore, the random sampling is performed on each of the buckets, and further includes: if the number of nodes in the bucket is less than n, the number of nodes is supplemented by oversampling and duplicating the nodes.

[0012] Furthermore, the hierarchical random walk further comprises: determining an initial node set S(u) by selecting an initial node from the knowledge graph; iteratively executing the following steps until a preset walk end condition is met: taking each node u in the node set S(u) as an initial node for random walk, and not visiting paths that have been visited, and taking the sequence (u, v i ) joins the node sequence set Set(u), the v i is the neighbor node to which node u wanders, and the initial state of the node sequence set Set(u) is an empty set; the node sequence (u, v i ) are combined as new nodes to update the node set S(u).

[0013] Furthermore, the preset walking end condition includes: each initial node in the initial node set S(u) walks more than a preset number of times, and / or the iteration reaches a preset number of rounds.

[0014] Furthermore, converting each node sequence in the node sequence set into a pattern also includes: obtaining a mapping relationship between nodes and node attributes; traversing the node sequence set, converting each node sequence therein into a pattern according to the mapping relationship, wherein the pattern is a sequence of the node attributes, and recording the number of occurrences of each pattern.

[0015] Furthermore, each node sequence in the node sequence set is converted into a pattern to obtain a pattern set, which also includes: obtaining the node sequence set, creating a pattern set Mod (mod, c), the initial state of the pattern set is an empty set, wherein mod indicates the pattern, and c indicates the number of occurrences of the pattern; traversing the node sequence set to iteratively execute the following steps until the node sequence set becomes an empty set: converting the currently traversed node sequence into a corresponding pattern according to the mapping relationship; determining whether the pattern exists in the current pattern set, if not, adding the pattern to the pattern set and recording its number of pattern occurrences as 1, if already exists, adding the number of pattern occurrences of the pattern to 1; removing the traversed node sequence from the current node sequence set.

[0016] Furthermore, performing abnormal pattern mining according to the pattern set also includes: constructing a suspected abnormal pattern set E′(mod) according to the number of occurrences of each pattern in the pattern set; traversing the entire graph of the patterns of the suspected abnormal pattern set E′(mod) to count the number of occurrences of each pattern in the entire graph; and extracting the abnormal pattern set E(mod) from the suspected abnormal pattern set E′(mod) by determining whether the number of occurrences of each pattern in the entire graph is less than a preset threshold.

[0017] Furthermore, based on the number of occurrences of each pattern in the pattern set, a suspected abnormal pattern set E′(mod) is constructed, which also includes: calculating the median value of the number of occurrences of each pattern in the pattern set, and constructing the suspected abnormal pattern set E′(mod) based on patterns whose number of occurrences is less than the median value.

[0018] Furthermore, the method also includes: when the knowledge graph needs to be updated, updating the knowledge graph using an incremental update method.

[0019] Furthermore, the knowledge graph is updated by an incremental update method, which also includes: obtaining graph data to be updated, and constructing a subgraph based on the graph data to be updated; using the above-mentioned hierarchical random walk to obtain an updated node sequence set of the subgraph; adding the subgraph to the original knowledge graph, and performing a full-graph random walk with the connection point between the subgraph and the knowledge graph as a starting point, and adding the obtained node sequence to the updated node sequence set; performing a pattern conversion on the updated node sequence set, and updating the pattern set; updating the abnormal pattern set based on the updated pattern set, wherein, if the pattern of the subgraph is matched with the abnormal pattern, it can be considered that there is an abnormal structure in the subgraph.

[0020] In a second aspect, a device for mining abnormal structures based on a knowledge graph is provided, which is configured to execute the method of the first aspect and includes: a graph construction module, which is used to construct a knowledge graph, wherein the knowledge graph includes multiple nodes and edges based on node relationships; a hierarchical random walk module, which is used to select an initial node from the knowledge graph to perform a hierarchical random walk, and record the node sequence walked to obtain a node sequence set; a pattern conversion module, which is used to convert each node sequence in the node sequence set into a pattern to obtain a pattern set; and an abnormal pattern mining module, which is used to perform abnormal pattern mining according to the pattern set to obtain an abnormal structure.

[0021] In a third aspect, a device for mining abnormal structures based on a knowledge graph is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute: the method of the first aspect.

[0022] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a program, and when the program is executed by a multi-core processor, the multi-core processor executes the method of the first aspect.

[0023] At least one of the above technical solutions adopted in the embodiment of the present application can achieve the following beneficial effects: In this embodiment,.

[0024] It should be understood that the above description is only an overview of the technical solution of the present invention, so that the technical means of the present invention can be more clearly understood and implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described below by way of example. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The advantages and benefits described herein and other advantages and benefits will be apparent to those of ordinary skill in the art by reading the detailed description of the exemplary embodiments below. The accompanying drawings are only used for the purpose of illustrating exemplary embodiments and are not to be considered as limiting the present invention. Moreover, the same reference numerals are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0026] Figure 1 A schematic diagram of a process of an abnormal structure mining method based on a knowledge graph according to an embodiment of the present invention;

[0027] Figure 2 A schematic diagram of constructing a knowledge graph according to an embodiment of the present invention;

[0028] Figure 3 A schematic diagram of a flow chart of an abnormal structure mining method based on a knowledge graph according to another embodiment of the present invention;

[0029] Figure 4 A schematic diagram of a flow chart of an abnormal structure mining method based on a knowledge graph according to another embodiment of the present invention;

[0030] Figure 5 is a schematic diagram of mode conversion according to an embodiment of the present invention;

[0031] Figure 6 A schematic diagram of a flow chart of an abnormal structure mining method based on a knowledge graph according to another embodiment of the present invention;

[0032] Figure 7 A schematic diagram of incremental update based on a knowledge graph according to an embodiment of the present invention;

[0033] Figure 8 A schematic diagram of the structure of an abnormal structure mining device based on a knowledge graph according to another embodiment of the present invention;

[0034] Fig. 9 Schematic diagram of the structure of an abnormal structure mining device based on knowledge graph according to another embodiment of the present invention.

[0035] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0036] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0037] In the description of the embodiments of the present application, it should be understood that terms such as "including" or "having" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in this specification, and are not intended to exclude the possibility of the presence of one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof.

[0038] Unless otherwise specified, “ / ” means or. For example, A / B can mean A or B. The “and / or” in this article is merely a way to describe the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0039] The terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more.

[0040] All codes in this application are exemplary, and those skilled in the art may think of various modifications based on the programming language used, specific needs, personal habits and other factors without departing from the concept of this application.

[0041] It should also be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0042] This embodiment provides an abnormal structure mining method based on knowledge graph to solve the above technical problems.

[0043] Figure 1 This is a flow chart of an abnormal structure mining method based on knowledge graph according to an embodiment of the present application. In this flow, from the device perspective, the execution subject can be one or more electronic devices; from the program perspective, the execution subject can correspondingly be the programs installed on these electronic devices.

[0044] like Figure 1 As shown, the method provided in this embodiment may include the following steps:

[0045] S10, constructing a knowledge graph, the knowledge graph including a plurality of nodes and edges determined based on node relationships;

[0046] S20, perform a hierarchical random walk on the knowledge graph, record the node sequence walked to, and obtain a node sequence set;

[0047] S30, converting each node sequence in the node sequence set into a pattern to obtain a pattern set;

[0048] S40. Perform abnormal pattern mining according to the pattern set to obtain an abnormal structure.

[0049] In this embodiment, the association relationship between nodes is defined according to actual needs, and a knowledge graph is constructed; a starting node is selected to perform a hierarchical random walk in the knowledge graph, and the hierarchical random walk can be: each time only walk to its neighboring nodes, and regard the current node pair as a new node, and then perform the next round of random walks, expanding layer by layer; after multiple rounds of random walks, a node sequence set is obtained, in which the node sequence passed by each path during the above random walk is recorded; then, the node sequence can be converted into a pattern based on the mapping relationship between the node and the node attribute, where the pattern can be understood as a node attribute sequence, and the number of times each pattern appears is counted to obtain a pattern set; finally, abnormal pattern mining is performed based on the pattern set to obtain an abnormal structure.

[0050] In traditional schemes, graph-based abnormal structure mining tends to mine complex structures, such as cluster, ring, chain, star, etc., and finds whether there is a defined abnormal structure in the graph to achieve abnormal structure discovery. This method is suitable for most scenarios with rich prior knowledge, but it cannot discover unknown abnormal structures. This embodiment uses hierarchical random walks and records the node sequences walked to, transforms each node sequence to obtain a pattern set, performs abnormal pattern mining according to the pattern set, obtains abnormal structures, and can mine unknown abnormal structures.

[0051] Furthermore, S10 specifically includes the following steps: determining node constituent entities, node relationships, node attributes, and edge attributes; and constructing a knowledge graph through entity extraction, relationship extraction, and attribute extraction.

[0052] For example, in the marketing fraud clue mining project, by building a knowledge graph based on the information of configuration personnel, marketing activities, merchants, users, institutions, etc., we can mine marketing fraud clues and find suspected fraud activities. The following steps (1)-(5) are used to build a knowledge graph such as Figure 2 The knowledge graph shown.

[0053] (1) First, determine the node constituent entities. The nodes can be composed of five types of nodes: bank card, merchant, activity, configuration personnel, and institution, which are denoted as (v c , v m , v a , v u , v e );

[0054] (2) Determine the node relationship. The configuration relationship between personnel and activities is a configuration relationship, the relationship between merchants and activities is a participation relationship, the restriction relationship between activities and merchants, the restriction relationship between activities and cards, the transaction relationship between cards and merchants, the holding relationship between personnel and merchants, the holding relationship between personnel and cards, and the same relationship between cards (same user), etc.

[0055] The above node relationship can be recorded as:

[0056]

[0057] (3) Determine the entity attributes. For example, card attributes may include online channels; merchant attributes may include MCC, settlement account, network access review, whether it is a scalper, whether it is a small and micro business, activity, marketing sensitivity, whether it is a violation, discount amount, etc.; activity attributes include activity scale, configuration modification, discount amount, proportion of small and micro businesses, etc.;

[0058] (4) Determine the edge attributes, which are the attributes of the node relationship, for example, the merchant's participation in the activity (v m , v a , e join ) attributes include discount amount, number of discounts, number of discount cards, and the transaction relationship between the card and the merchant (v c , v m , e tra ) is active;

[0059] (5) Based on the results of entity extraction, relationship extraction, and attribute extraction, a marketing activity knowledge graph is constructed to obtain Figure 2 The knowledge graph shown.

[0060] Furthermore, since the knowledge graph constructed by the activity is large in scale, more resources will be consumed when performing graph calculations. According to experience, most activities are normal activities, so the nodes in the knowledge graph can be sampled before participating in the calculation of S20.

[0061] The above node sampling specifically includes the following steps (1)-(2):

[0062] (1) Calculate the out-degree out(j) of all entity nodes, define the bucket interval size k, and divide all nodes into buckets and assign all nodes to the corresponding buckets;

[0063] (2) Randomly sample each bucket and define the number of node samples for each bucket as The sampling node for each bucket is

[0064] If the number of nodes in a bucket is less than n, random node replication is used to make up for it.

[0065] Many business scenarios involve large amounts of data with no or few labels. It is difficult to mine a small number of abnormal structures from a large number of nodes and complex relationships in a graph, especially since some simple abnormal structures are easily covered by a large number of normal structures. Therefore, it is necessary to appropriately simplify the graph without distortion, such as the above-mentioned node sampling.

[0066] Further, refer to Figure 3 , the stratified random walk in S20 also includes:

[0067] S201, determining an initial node set S(u) according to the initial node set S(v);

[0068] S202, iteratively perform the following steps until the preset walking end condition is met: take each node u in the node set S(u) as the initial node for random walking, and do not visit the paths that have been visited, and replace the sequence (u, v i ) joins the node sequence set Set(u), v i is the neighboring node that node u wanders to, and the initial state of the node sequence set Set(u) is an empty set; i ) are combined as new nodes to update the node set S(u).

[0069] For example, the hierarchical random walk steps may specifically include the following (1)-(3):

[0070] (1) Define a node sequence set Record the sequences obtained by wandering in the map;

[0071] (2) S(u 0 )=S(v) as the starting node for random walk, the number of walks for each node is x=5, the walk step length is fixed to 2, and only the neighboring nodes can be reached each time;

[0072] (3) In each round, the node and its neighboring nodes are combined into a sequence (u, v i ) is added to the sequence set Set(u) and is considered as a new node As an initial node for the next round of walk, and update the node set S(u 2 )=S(u 0 )+S(u 1 ).

[0073] For example, suppose a node u0 starts to wander, and each wander only once:

[0074] Step 1: Walk Sequence Sequence Set Set(u) = {(u0, v1)};

[0075] Step 2: Walking sequence Sequence Set Set(u) = {(u0, v1), (u0, v1, v2)};

[0076] Step 3: Walking sequence

[0077] Sequence Set Set(u) = {(u0, v1), (u0, v1, v2), (u0, v1, v2, v3)};

[0078] Part 4: Wandering Sequence

[0079] Sequence Set Set(u) = {(u0, v1), (u0, v1, v2), (u0, v1, v2, v3), (u0, v1, v2, v3, v4)};

[0080] Step 5: Walk Sequence

[0081] Sequence set Set(u) = {(u0, v1), (u0, v1, v2), ..., (u0, v1, v2, v3, v4, v5)};

[0082] The preset walking end conditions include: each initial node in the initial node set S(u) walks more than the preset number of times, and / or the iteration reaches the preset number of rounds. For example, it is stipulated that each node walks m=20 times, and each walk to the node's neighboring nodes walks n=50 rounds, and the sequence of each walk is recorded; the final sequence set Set(u) is the sequence set obtained after the walk.

[0083] Furthermore, converting each node sequence in the node sequence set into a pattern in S30 also includes: obtaining a mapping relationship between a node value and a node attribute; traversing the node sequence set, converting each node sequence therein into a pattern according to the mapping relationship, wherein the pattern is a sequence of node attributes, and recording the number of occurrences of each pattern.

[0084] Furthermore, converting each node sequence in the node sequence set into a pattern in S30 further includes:

[0085] S301, obtaining a node sequence set, creating a pattern set Mod (mod, c), the initial state of the pattern set is an empty set, where mod indicates a pattern, and c indicates the number of occurrences of the pattern;

[0086] S302, traverse the node sequence set to iteratively execute the following steps a) to c) until the node sequence set becomes an empty set: a) convert the currently traversed node sequence into the corresponding pattern according to the mapping relationship; b) determine whether the pattern exists in the current pattern set. If not, add the pattern to the pattern set and record its pattern occurrence count as 1. If it already exists, add 1 to the pattern occurrence count of the pattern; c) remove the traversed node sequence from the current node sequence set.

[0087] Further, refer to Figure 4 S40 mines abnormal patterns according to the distribution of each pattern in the pattern set, and also includes:

[0088] S401, constructing a suspected abnormal pattern set E′(mod) according to the number of occurrences of each pattern in the pattern set;

[0089] S402: Traverse the entire graph of the suspected abnormal pattern set E′(mod) and count the number of occurrences of each pattern in the entire graph.

[0090] S403, by determining the number of occurrences of each pattern in the whole picture Whether it is less than a preset threshold, extract the abnormal pattern set E(mod) from the suspected abnormal pattern set E′′(mod).

[0091] Furthermore, the above S401 further includes: calculating the median value of the number of occurrences of each pattern in the pattern set, and constructing a suspected abnormal pattern set E′(mod) according to the patterns whose number of occurrences is less than the median value.

[0092] In one example, after obtaining the node sequence, the point sequence is converted into patterns according to the attributes of the nodes, all the patterns in the graph are obtained, the number of occurrences of all patterns is counted, and abnormal structures are mined.

[0093] (1) Define the mapping relationship between nodes and attributes:

[0094] M=f(V),et V={v u , v a , v m , v c}, M={usr, act, mct, card};

[0095] (2) Initialization mode set

[0096] (3) Operate the sequences in the node sequence set in sequence:

[0097] Step 1: Mod i =f(u i =(u0, v1)) = (usr, act);

[0098] Step 2: Check whether the mode exists in the mode set Mod (mod, c). If not, the mode appears c (mod i )=1, add the new sequence to the pattern set: Mod(mod, c)={(mod i , 1)}; if the mode already exists, c(mod i )=c(mod i )+1;

[0099] Step 3: Remove the processed sequence, Set(u) = Set(u) - Set(u i );

[0100] Step 4: Repeat steps 1 to 3 until the following conditions are met:

[0101] For example, Set(u)={(u0, v1), (u0, v1, v2), (u0, v1, v2, v3), (u0, v1, v2, v3, v4),

[0102] (u0, v1, v2, v3, v4, v5), (u0, v4), (u0, v4, v5)}, and becomes an empty set after STEP1-7 in the following table, which means that the mode conversion has been completed and the mode set is obtained, that is, Figure 5 A collection of mods in .

[0103] (4) The pattern set is divided into the number of occurrences of the pattern c(mod i ) to sort the data and calculate the median mid c , construct the suspected abnormal pattern set E′(mod): mod i ∈E′(mod), ifc(mod i )<mid c , that is, the patterns that appear less than the median can be considered as suspected abnormal patterns.

[0104] (5) Traverse the entire graph of E′(mod) patterns and count the number of times each pattern appears

[0105] (6) Initialize the exception mode set To judge abnormal mode: That is, the number of times a pattern appears in the entire image is extracted from the set of suspected abnormal patterns The patterns that are less than the preset threshold θ are taken as the abnormal pattern set E(mod).

[0106] Furthermore, it also includes: when the knowledge graph needs to be updated, the knowledge graph is updated using an incremental update method.

[0107] Due to the continuous updating of activity data, the scale of the graph will continue to increase and the patterns will become more diverse. The incremental calculation of the graph is to only calculate the new data when updating the graph without updating the entire graph. We plan to use two small-graph random walks instead of full-graph walks to reduce the consumption of computing resources.

[0108] Further, refer to Figure 6 and Figure 7 , using incremental update to update the knowledge graph, also includes:

[0109] S501, obtain the graph data to be updated, and construct a subgraph G based on the graph data to be updated new (V, E);

[0110] S502: Using the above-mentioned hierarchical random walk, obtain the subgraph G new (V, E) updated node sequence set Set new (u);

[0111] S503, subgraph G new (V, E) is added to the original knowledge graph, and a random walk is performed on the entire graph using the connection point between the subgraph and the knowledge graph as the starting point, and the obtained node sequence is added to the updated node sequence set Set new (u);

[0112] S504, update the node sequence set Set new (u) Perform mode conversion and update the mode set Mod (mod, c);

[0113] Among them, it is compared with the original pattern set, and if there is a new pattern, it is added to the pattern set and its occurrence count is updated;

[0114] S505 , updating the abnormal pattern set E(mod) based on the updated pattern set Mod(mod,c), wherein, if the pattern of the subgraph is matched with the abnormal pattern, it can be considered that there is an abnormal structure in the subgraph.

[0115] In general, the purpose of the abnormal structure mining method based on knowledge graph in this application is to mine abnormal structures from knowledge graph and further realize incremental learning of graph. First, the association relationship between nodes is defined according to actual needs, the knowledge graph is constructed, the out-degree of all nodes is calculated, and all nodes are bucketed and sampled according to the out-degree. Secondly, a hierarchical random walk is performed in the graph with the sampling node as the starting point. Each time, only the neighboring nodes are walked, and the current node pair is regarded as a new node. Then, the next round of random walk is performed. After multiple rounds of walks, a node sequence set is obtained. Then, the mapping relationship between node value and attribute value is defined, and the pattern sequence is obtained according to the node sequence. The number of occurrences of each pattern is counted, all the pattern times are sorted in ascending order and the median value is calculated. The whole graph is searched for the patterns less than the median value, and their global times are counted. When the number of occurrences of a certain pattern is less than the specified threshold, it can be considered that the pattern is an abnormal point of all patterns. All abnormal patterns constitute an abnormal pattern set, and the structure formed by its point set is the abnormal structure. Finally, the graph is incrementally learned. First, a subgraph is constructed for the new node and a sequence set is formed by random walk. Then, the connecting edge between the subgraph and the original graph is walked to obtain the entire sequence of the subgraph. The pattern sequence after the new node is connected is obtained through the mapping relationship and compared with the original pattern. If there is an abnormal pattern or a pattern with an occurrence less than the threshold, it is judged as an abnormal pattern, and the pattern set and the abnormal pattern set are updated at the same time.

[0116] In the description of this specification, the description with reference to the terms "some possible implementations", "some embodiments", "examples", "specific examples", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0117] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0118] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0119] About the method flow chart of the embodiment of the present application, some operations are described as different steps performed in a certain order.Such flow chart belongs to illustrative and non-restrictive.Some steps described in this article can be grouped together and performed in a single operation, some steps can be divided into multiple sub-steps, and some steps can be performed in an order different from that shown in this article.The various steps shown in the flow chart can be realized in any way by any circuit structure and / or tangible mechanism (for example, by software, hardware (for example, the logical function realized by processor or chip) etc. running on computer equipment and / or any combination thereof).

[0120] Based on the same technical concept, an embodiment of the present invention also provides an abnormal structure mining device based on a knowledge graph, which is used to execute the abnormal structure mining method based on a knowledge graph provided in any of the above embodiments. Figure 8 A schematic diagram of the structure of an abnormal structure mining device based on a knowledge graph provided in an embodiment of the present invention.

[0121] like Figure 8 As shown, the device 800 includes:

[0122] A graph construction module 801 is used to construct a knowledge graph, wherein the knowledge graph includes a plurality of nodes and edges based on node relationships;

[0123] A hierarchical random walk module 802 is used to select an initial node from the knowledge graph to perform a hierarchical random walk, and record the node sequence walked to obtain a node sequence set;

[0124] A pattern conversion module 803, used to convert each node sequence in the node sequence set into a pattern to obtain a pattern set;

[0125] The abnormal pattern mining module 804 is used to perform abnormal pattern mining according to the pattern set to obtain abnormal structure.

[0126] It should be noted that the knowledge graph-based abnormal structure mining device in the embodiment of the present application can implement the various processes of the embodiment of the aforementioned method and achieve the same effects and functions, which will not be repeated here.

[0127] Fig. 9 According to an embodiment of the present application, an abnormal structure mining device based on a knowledge graph is used to perform Figure 1 The method for mining abnormal structures based on knowledge graphs is shown, and the device includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute the method described in the above embodiment.

[0128] According to some embodiments of the present application, a non-volatile computer storage medium of a knowledge graph-based abnormal structure mining method is provided, on which computer executable instructions are stored, and the computer executable instructions are configured to execute the method described in the above embodiment when executed by a processor.

[0129] Each embodiment in this application is described in a progressive 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 device, equipment, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, their descriptions are simplified, and the relevant parts can be referred to the partial description of the method embodiments.

[0130] The apparatus, device and computer-readable storage medium provided in the embodiments of the present application correspond one-to-one to the method. Therefore, the apparatus, device and computer-readable storage medium also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the apparatus, device and computer-readable storage medium will not be repeated here.

[0131] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0132] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0135] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0136] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0137] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. In addition, although the operations of the method of the present invention are described in a particular order in the accompanying drawings, this does not require or imply that these operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.

[0138] Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.

Claims

1. A method for mining abnormal structures based on knowledge graph, characterized in that: include: Constructing a knowledge graph, wherein the knowledge graph includes a plurality of nodes and edges determined based on node relationships; Selecting an initial node from the knowledge graph to perform a hierarchical random walk, and recording a node sequence reached to obtain a node sequence set; Convert each node sequence in the node sequence set into a pattern to obtain a pattern set; Perform abnormal pattern mining according to the pattern set to obtain an abnormal structure; The performing abnormal pattern mining according to the pattern set also includes: According to the number of occurrences of each pattern in the pattern set, a suspected abnormal pattern set E is constructed. ′ (mod); for the suspected abnormal pattern set E ′ (mod) to traverse the entire graph, and count the number of occurrences of each pattern in the entire graph; by judging whether the number of occurrences of each pattern in the entire graph is less than a preset threshold, select the suspected abnormal pattern set E ′ Extract the abnormal pattern set E(mod) from (mod); When the knowledge graph needs to be updated, the knowledge graph is updated using an incremental update method; The updating of the knowledge graph by incremental updating also includes: Obtain the graph data to be updated, and construct a subgraph based on the graph data to be updated; adopt the above-mentioned hierarchical random walk to obtain an updated node sequence set of the subgraph; add the subgraph to the original knowledge graph, take the connection point between the subgraph and the knowledge graph as the starting point to perform a full-graph random walk, and add the obtained node sequence to the updated node sequence set; perform a pattern conversion on the updated node sequence set, and update the pattern set; update the abnormal pattern set based on the updated pattern set, wherein, if the pattern of the subgraph is matched with the abnormal pattern, it is determined that there is an abnormal structure in the subgraph.

2. The method according to claim 1, characterized in that: The constructing of the knowledge graph further includes: Determine node constituent entities, node relationships, node attributes, and edge attributes; and construct the knowledge graph through entity extraction, relationship extraction, and attribute extraction.

3. The method according to claim 1, characterized in that Selecting an initial node from the knowledge graph also includes: Calculate the out-degree out(j) of all nodes in the knowledge graph, and divide the nodes into buckets according to the out-degree of the nodes, where the bucket interval is k and the number of buckets is m; Random sampling is performed on each of the buckets, wherein n nodes are randomly selected from each of the buckets to determine the sampling nodes S in each of the buckets. i (v), and obtain the initial node set S(v) = {S i (v), i = 1, ..., m}, where i is the bucket identifier and v is the sampling node.

4. The method according to claim 3, characterized in that The step of randomly sampling each of the buckets further includes: If the number of nodes in a bucket is less than n, oversampling and duplicating nodes are used to make up for it.

5. The method according to claim 1, characterized in that The hierarchical random walk further includes: Determine an initial node set S(u) by selecting an initial node from the knowledge graph; Iterate the following steps until the preset end condition of the walk is met: Each node u in the node set S(u) is used as the initial node for random walk, and the paths that have been visited are not visited. The sequence (u,v i ) joins the node sequence set Set(u), the v i is the neighboring node to which node u wanders, and the initial state of the node sequence set Set(u) is an empty set; the node sequence (u,v i ) are combined as new nodes to update the node set S(u).

6. The method according to claim 5, characterized in that The preset walking end condition includes: each initial node in the initial node set S(u) walks more than a preset number of times, and / or the iteration reaches a preset number of rounds.

7. The method according to claim 1, characterized in that Converting each node sequence in the node sequence set into a pattern also includes: Get the mapping relationship between nodes and node attributes; The node sequence set is traversed, and each node sequence is converted into a pattern according to the mapping relationship in turn, wherein the pattern is a sequence of the node attributes, and the number of occurrences of each pattern is recorded.

8. The method according to claim 1, characterized in that Converting each node sequence in the node sequence set into a pattern to obtain a pattern set, further comprising: Obtain the node sequence set, create a pattern set Mod (mod, c), the initial state of the pattern set is an empty set, where mod indicates the mode, and c indicates the number of occurrences of the mode; Traverse the node sequence set to iteratively perform the following steps until the node sequence set becomes an empty set: Convert the currently traversed node sequence into the corresponding mode according to the mapping relationship; Determine whether the pattern exists in the current pattern set. If not, add the pattern to the pattern set and record its pattern occurrence count as 1. If it already exists, add 1 to the pattern occurrence count of the pattern. Remove the traversed node sequence from the current node sequence set.

9. The method according to claim 1, characterized in that: According to the number of occurrences of each pattern in the pattern set, a suspected abnormal pattern set E is constructed. ′ (mod), also includes: Calculate the median of the number of occurrences of each pattern in the pattern set, and construct the suspected abnormal pattern set E based on the patterns whose number of occurrences is less than the median ′ (mod).

10. An abnormal structure mining device based on knowledge graph, characterized in that: is configured to perform the method according to any one of claims 1 to 9, and comprises: A graph construction module, which constructs a knowledge graph, wherein the knowledge graph includes a plurality of nodes and edges based on node relationships; A hierarchical random walk module, used to select an initial node from the knowledge graph to perform a hierarchical random walk, and record the node sequence walked to obtain a node sequence set; A pattern conversion module, used for converting each node sequence in the node sequence set into a pattern to obtain a pattern set; The abnormal pattern mining module is used to mine abnormal patterns according to the pattern set to obtain abnormal structures. The abnormal pattern mining module is also used to construct a suspected abnormal pattern set E^'(mod) according to the number of occurrences of each pattern in the pattern set; perform a full-graph traversal of the patterns of the suspected abnormal pattern set E^'(mod) to count the number of occurrences of each pattern in the full graph; extract the abnormal pattern set E(mod) from the suspected abnormal pattern set E^'(mod) by judging whether the number of occurrences of each pattern in the full graph is less than a preset threshold; A graph updating module, used to update the knowledge graph by incremental updating when the knowledge graph needs to be updated; The graph update module is also used to obtain the graph data to be updated, and construct a subgraph based on the graph data to be updated; adopt the above-mentioned hierarchical random walk to obtain the updated node sequence set of the subgraph; add the subgraph to the original knowledge graph, use the connection point between the subgraph and the knowledge graph as the starting point to perform a full-graph random walk, and add the obtained node sequence to the updated node sequence set; perform a pattern conversion on the updated node sequence set and update the pattern set; update the abnormal pattern set based on the updated pattern set, wherein, if the pattern of the subgraph is matched with the abnormal pattern, it is determined that there is an abnormal structure in the subgraph.

11. An abnormal structure mining device based on knowledge graph, characterized in that: include: at least one processor; And, a memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor to enable the at least one processor to execute: the method as described in any one of claims 1-9.

12. A computer-readable storage medium storing a program, wherein when the program is executed by a multi-core processor, the multi-core processor executes the method according to any one of claims 1 to 9.