A graph relationship path positioning method and system

By performing ID processing and graph model conversion on relational data, the problem that graph relationship paths cannot be accurately positioned is solved, accurate relationship path prompts are achieved, and the accuracy of information display is improved.

CN111752943BActive Publication Date: 2024-11-05BEIJING WANGSIKEPING TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010426630.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-19
Publication Date
2024-11-05
Estimated Expiration
2040-05-19

Smart Images

  • Figure CN111752943B_ABST
    Figure CN111752943B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method, system, device and computer-readable storage medium for locating a graph relationship path, wherein the method comprises: performing ID processing on relational data to determine the ID corresponding to each relational data; the relational data is data containing the relationship between nodes; converting the relational data into node relationship data according to a preset graph model; using the node relationship data to render a visual graph of nodes and edges; determining whether a graph element is a node or an edge: highlighting the first-degree connection information of the node or edge, obtaining the ID information contained in all edges connected to the node or edge; searching for other edges containing the same ID information in the entire graph, and highlighting the first-degree connection information of the other edges found. It can effectively solve the problem that the relationship path cannot be accurately located, and provide users with accurate relationship path prompts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer processing technology, and specifically to a graph relationship path positioning method, system, device and computer-readable storage medium. Background Art

[0002] Knowledge graphs describe concepts, nodes and their relationships in the objective world in a structured form, expressing information in a form closer to the human cognitive world, providing a way to better organize, manage and understand massive amounts of information. Currently, knowledge graphs have been widely used in industries such as public security and finance, providing a visual analysis method for data analysis.

[0003] However, in some scenarios, the graph visualization solution currently has the problem that the graph relationship path cannot be accurately located. This problem is described as follows:

[0004] The following table is a relational data, which records the information about what tools the source IP used to attack the target IP. Among them, 36.227.12.1 used sqlmap to attack 172.16.22.34, and 54.47.12.101 used sqlmap and scantool to attack 172.16.17.42.

[0005]

[0006] After visualizing this data map, as shown in the attached Figure 1 After the source IP finds the tool sqlmap based on the connection, it is impossible to determine which source IP uses sqlmap to attack which target IP. The problem in this case is that the graph relationship path cannot accurately locate the problem. This problem graph lacks accuracy in displaying information, which brings great trouble to the analysis. Summary of the invention

[0007] To this end, the embodiments of the present application provide a method, system, device and computer-readable storage medium for locating a graph relationship path, which can effectively solve the problem that the above-mentioned relationship path cannot be accurately located and provide users with accurate relationship path prompts.

[0008] According to a first aspect of an embodiment of the present application, a graph relationship path positioning method is provided, the method comprising:

[0009] Performing ID processing on relational data to determine an ID corresponding to each piece of relational data; the relational data is data containing a relationship between nodes;

[0010] Convert the relational data into node relational data according to a preset graph model; wherein the relational attributes in the node relational data include ID information;

[0011] Use node relationship data to render a visual graph of nodes and edges;

[0012] Determine whether the graph element is a node or an edge: if it is a node, highlight the first-degree connection information of the node and obtain the ID information contained in all the edges connected to the node; if it is an edge, highlight the first-degree connection information of the edge and obtain all the ID information contained in the edge;

[0013] Search the entire graph for other edges containing the same ID information, and highlight the first-degree connection information of the other edges found.

[0014] Optionally, performing ID processing on the relational data to determine an ID corresponding to each piece of relational data includes:

[0015] An ID is generated for each piece of relational data and attached to the relational data; the ID is generated by a hash algorithm or is composed of multiple fields.

[0016] Optionally, the relationship attribute in the node relationship data is a relationship data ID between two nodes that is added to the relationship between the two nodes.

[0017] Optionally, the first-degree connection information of the node includes the node and all edges directly connected to the node; the first-degree connection information of the edge includes the edge and two nodes directly connected to the edge.

[0018] According to a second aspect of an embodiment of the present application, a graph relationship path positioning system is provided, the system comprising:

[0019] An ID processing module is used to perform ID processing on relational data and determine the ID corresponding to each piece of relational data; the relational data is data containing the relationship between nodes;

[0020] A data conversion module is used to convert relational data into node relational data according to a preset graph model; wherein the relational attributes in the node relational data include ID information;

[0021] A rendering module, used for rendering a visual graph of nodes and edges using the node relationship data;

[0022] A graph element judgment module is used to judge whether a graph element is a node or an edge: if it is a node, the first-degree connection information of the node is highlighted, and the ID information contained in all the edges connected to the node is obtained; if it is an edge, the first-degree connection information of the edge is highlighted, and all the ID information contained in the edge is obtained;

[0023] The prompt module is used to search for other edges containing the same ID information in the entire graph and highlight the first-degree connection information of the other edges found.

[0024] Optionally, the ID processing module is specifically used to:

[0025] An ID is generated for each piece of relational data and attached to the relational data; the ID is generated by a hash algorithm or is composed of multiple fields.

[0026] Optionally, the relationship attribute in the node relationship data is a relationship data ID between two nodes that is added to the relationship between the two nodes.

[0027] Optionally, the first-degree connection information of the node includes the node and all edges directly connected to the node; the first-degree connection information of the edge includes the edge and two nodes directly connected to the edge.

[0028] According to a third aspect of an embodiment of the present application, a device is provided, comprising: a data acquisition device, a processor and a memory; the data acquisition device is used to acquire data; the memory is used to store one or more program instructions; the processor is used to execute one or more program instructions to execute a method as described in any one of the first aspects.

[0029] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer storage medium contains one or more program instructions, and the one or more program instructions are used to execute the method as described in any one of the first aspects.

[0030] In summary, the embodiments of the present application provide a method, system, device and computer-readable storage medium for locating a graph relationship path, by performing ID processing on relational data to determine the ID corresponding to each relational data; the relational data is data containing the relationship between nodes; the relational data is converted into node relationship data according to a preset graph model; wherein the relationship attributes in the node relationship data contain ID information; the node relationship data is used to render a visual graph of nodes and edges; it is determined whether the graph element is a node or an edge: if it is a node, the first-degree connection information of the node is highlighted, and the ID information contained in all edges connected to the node is obtained; if it is an edge, the first-degree connection information of the edge is highlighted, and all ID information contained in the edge is obtained; other edges containing the same ID information are searched in the entire graph, and the first-degree connection information of the other edges searched is highlighted. It can effectively solve the problem that the above-mentioned relationship path cannot be accurately located, and provide users with accurate relationship path prompts. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0032] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[0033] Figure 1 A schematic diagram of data visualization in the prior art provided in the embodiments of the present application;

[0034] Figure 2 A schematic diagram of a flow chart of a graph relationship path positioning method provided in an embodiment of the present application;

[0035] Figure 3 The processing process of relational data provided in the embodiment of the present application;

[0036] Figure 4 The accurate positioning process of the graph relationship path provided in the embodiment of the present application;

[0037] Figure 5 A graph node-edge visibility diagram provided for an embodiment of the present application;

[0038] Figure 6 A visual diagram of the graph nodes and edges provided in the embodiment of the present application, which indicates the number of each edge and the attribute ID information;

[0039] Figure 7 A graph showing a highlighted graph relationship path after selecting an edge element provided in an embodiment of the present application;

[0040] Figure 8 A graph showing a highlighted graph relationship path after a node element is selected provided in an embodiment of the present application;

[0041] Fig. 9 A block diagram of a graph relationship path positioning system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are 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 are within the scope of protection of the present invention.

[0043] Figure 2 A schematic diagram of a graph relationship path positioning process provided by an embodiment of the present application is shown. Figure 2 As shown, the method includes:

[0044] Step 201: Perform ID processing on relational data to determine the ID corresponding to each piece of relational data; the relational data is data containing the relationship between nodes.

[0045] Step 202: Convert the relational data into node relational data according to a preset graph model; wherein the relational attributes in the node relational data include ID information.

[0046] Step 203: Use the node relationship data to render a visual graph of nodes and edges.

[0047] Step 204: Determine whether the graph element is a node or an edge: if it is a node, highlight the first-degree connection information of the node, and obtain the ID information contained in all edges connected to the node; if it is an edge, highlight the first-degree connection information of the edge, and obtain all ID information contained in the edge.

[0048] Step 205: Search the entire graph for other edges containing the same ID information, and highlight the first-degree connection information of the other edges found.

[0049] In a possible implementation, in step 201, an ID is generated for each piece of relational data and attached to the relational data; the ID is generated by a hash algorithm or is formed by combining multiple fields.

[0050] In a possible implementation manner, the relationship attribute in the node relationship data is that the relationship data ID between two nodes is added to the relationship between the two nodes.

[0051] In a possible implementation manner, the first-degree connection information of the node includes the node and all edges directly connected to the node; the first-degree connection information of the edge includes the edge and two nodes directly connected to the edge.

[0052] Figure 3 For relational data processing, such as Figure 3As shown, the relational data ID processing in S101 is to perform ID processing on the relational data so that each relational data has a unique ID; wherein the relational data refers to data containing the relationship between nodes, as shown in Table 1 below:

[0053] Table 1

[0054]

[0055] There are three relational data records in the above table, which record what tools the source IP used to attack the target IP. The source IP 36.227.12.1 used the tool sql map to attack the target IP 172.16.22.34, the source IP 36.227.12.1 used the tool sql map to attack the target IP 172.16.22.34, and the source IP 36.227.12.1 used the tool sql map to attack the target IP 172.16.22.34. ID processing of the above relational data means generating a unique ID for each relational data and attaching it to the relational data. The processed data is shown in Table 2 below:

[0056] Table 2

[0057]

[0058] As shown in Table 2, a unique ID is generated for each piece of original relational data.

[0059] In a possible implementation, the unique ID may be generated using a hash algorithm, or multiple fields may be combined as the unique ID.

[0060] Further, S102 converts the data into node relationship data according to the graph model, and the relationship attributes include ID information. The data conversion is performed using a preset graph model, and then S103 uses this data to render the data into Figure 5 The node-edge visual graph shown.

[0061] More specifically, the relationship attribute including ID information means that the relationship data ID recording the relationship between two nodes is added to the relationship between the two nodes.

[0062] It should be further explained that after the node relationship data is rendered to form a node-edge visual graph, the ID information in the original relationship attribute is correspondingly attached to the edge attribute. For the convenience of the following explanation, Figure 6 As shown, each edge is numbered and labeled, and the attribute ID information in each edge is displayed one by one. Figure 4 It is the process of accurately locating the graph relationship path.

[0063] exist Figure 4 In S201, a graph element is selected, and then S202 determines whether the graph element is a node or an edge, and displays it according to the following two graph relationship path positioning logics:

[0064] (1) If it is a node, S205 highlights the first-degree connection information of the node. The first-degree connection information of the node includes the node and all edges directly connected to the node. Figure 6 For reference, assume that the selected graph element is node 54.47.12.101, and its first-degree connection information includes: node 54.47.12.101, edges 1 and 3, then S206 obtains the ID information contained in all edges connected to this node, and the attribute ID sets of edge 1 and edge 3 are n1e36653a and m3nn2154b, and then S207 searches for other edges containing the same ID information in the entire graph, and searches for other edges containing n1e36653a or m3nn2154b in the entire graph, and searches for edges 2 and 4. Finally, S208 highlights the first-degree connection information of other searched edges, and highlights the first-degree connection information of edges 2 and 4. The first-degree connection information of an edge includes this edge and the two nodes directly connected to this edge, so the first-degree connection information of edge 2 and edge 4 includes: edge 2, edge 4, node sqlmap, node scantool, node 172.16.17.42. So far, Figure 8 All the exact attack relationship paths of node 54.47.12.101 are highlighted.

[0065] (2) If it is an edge, S203 highlights the first-degree connection information of this edge, and the same Figure 6 For reference, assume that the selected graph element is edge 3, and its first-degree connection information includes: edge 3, node 54.47.12.101, node sqlmap, and then S204 obtains all ID information contained in this edge. The ID information contained in edge 3 is only m3nn2154b, and then S207 searches for other edges containing the same ID information in the entire graph, and searches for other edges containing m3nn2154b in the entire graph, and searches for edge 4. Finally, S208 highlights the first-degree connection information of other searched edges, and highlights the first-degree connection information of edge 4: edge 4, node sqlmap, node 172.16.17.42. So far, Figure 7 , highlighting the accurate attack relationship path associated with edge 3.

[0066] In summary, the embodiment of the present application provides a method for locating a graph relationship path, by performing ID processing on the relational data, determining the ID corresponding to each relational data; the relational data is data containing the relationship between nodes; the relational data is converted into node relationship data according to a preset graph model; wherein the relationship attributes in the node relationship data contain ID information; the node relationship data is used to render a visual graph of nodes and edges; it is determined whether the graph element is a node or an edge: if it is a node, the first-degree connection information of the node is highlighted, and the ID information contained in all edges connected to the node is obtained; if it is an edge, the first-degree connection information of the edge is highlighted, and all ID information contained in the edge is obtained; other edges containing the same ID information are searched in the entire graph, and the first-degree connection information of the other edges searched is highlighted. It can effectively solve the problem that the above-mentioned relationship path cannot be accurately located, and provide users with accurate relationship path prompts.

[0067] Based on the same technical concept, the present application embodiment also provides a graph relationship path positioning system, such as Fig. 9 As shown, the system comprises:

[0068] The ID processing module 901 is used to perform ID processing on relational data to determine the ID corresponding to each piece of relational data; the relational data is data containing the relationship between nodes.

[0069] The data conversion module 902 is used to convert the relational data into node relationship data according to a preset graph model; wherein the relationship attributes in the node relationship data include ID information.

[0070] The rendering module 903 is used to render a visual graph of nodes and edges using the node relationship data.

[0071] The graph element judgment module 904 is used to judge whether the graph element is a node or an edge: if it is a node, the first-degree connection information of the node is highlighted, and the ID information contained in all edges connected to the node is obtained; if it is an edge, the first-degree connection information of the edge is highlighted, and all ID information contained in the edge is obtained.

[0072] The prompt module 905 is used to search for other edges containing the same ID information in the entire graph, and highlight the first-degree connection information of the other edges found.

[0073] In a possible implementation, the ID processing module 901 is specifically used to: generate an ID for each piece of relational data and attach it to the relational data; the ID is generated by a hash algorithm or is composed of multiple fields.

[0074] In a possible implementation manner, the relationship attribute in the node relationship data is that the relationship data ID between two nodes is added to the relationship between the two nodes.

[0075] In a possible implementation manner, the first-degree connection information of the node includes the node and all edges directly connected to the node; the first-degree connection information of the edge includes the edge and two nodes directly connected to the edge.

[0076] Based on the same technical concept, an embodiment of the present application also provides a device, which includes: a data acquisition device, a processor and a memory; the data acquisition device is used to collect data; the memory is used to store one or more program instructions; the processor is used to execute one or more program instructions to execute a method as described in any one of the above methods.

[0077] Based on the same technical concept, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer storage medium contains one or more program instructions, and the one or more program instructions are used to execute a method as described in any one of the above methods.

[0078] In this specification, each embodiment of the above method 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. For relevant parts, refer to the partial description of the method embodiment.

[0079] It should be noted that, although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that the operations must be performed in the specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0080] Although the present application provides method operation steps such as embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent a unique execution order. When the device or client product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "includes", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements.

[0081] The units, devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described separately by functions divided into various modules. Of course, when implementing this application, the functions of each module can be implemented in the same or more software and / or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0082] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.

[0083] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0084] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0085] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.

[0086] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A graph relationship path positioning method, characterized in that: The method comprises: Performing ID processing on relational data to determine an ID corresponding to each piece of relational data; the relational data is data containing a relationship between nodes; Convert the relational data into node relational data according to a preset graph model; wherein the relational attribute in the node relational data includes ID information; the relational attribute in the node relational data is that the relational data ID between two nodes is added to the relationship between the two nodes; Use node relationship data to render a visual graph of nodes and edges; Determine whether a graph element is a node or an edge: if it is a node, highlight the first-degree connection information of the node, and obtain the ID information contained in all the edges connected to the node; if it is an edge, highlight the first-degree connection information of the edge, and obtain all the ID information contained in the edge; the first-degree connection information of the node includes the node and all the edges directly connected to the node; the first-degree connection information of the edge includes the edge and the two nodes directly connected to the edge; Search for other edges with the same ID information in the entire graph, and highlight the first-degree connection information of the other edges found; The ID processing of the relational data to determine the ID corresponding to each piece of relational data includes: An ID is generated for each piece of relational data and attached to the relational data; the ID is generated by a hash algorithm or is composed of multiple fields.

2. A graph relationship path positioning system, characterized in that: The system comprises: An ID processing module is used to perform ID processing on relational data and determine the ID corresponding to each piece of relational data; the relational data is data containing the relationship between nodes; A data conversion module is used to convert relational data into node relational data according to a preset graph model; wherein the relational attribute in the node relational data includes ID information; the relational attribute in the node relational data is that the relational data ID between two nodes is added to the relationship between the two nodes; A rendering module, used for rendering a visual graph of nodes and edges using the node relationship data; A graph element judgment module is used to judge whether a graph element is a node or an edge: if it is a node, the first-degree connection information of the node is highlighted, and the ID information contained in all the edges connected to the node is obtained; if it is an edge, the first-degree connection information of the edge is highlighted, and all the ID information contained in the edge is obtained; the first-degree connection information of the node includes the node and all the edges directly connected to the node; the first-degree connection information of the edge includes the edge and the two nodes directly connected to the edge; A prompt module is used to search for other edges containing the same ID information in the entire graph and highlight the first-degree connection information of the other edges found; The ID processing module is specifically used for: An ID is generated for each piece of relational data and attached to the relational data; the ID is generated by a hash algorithm or is composed of multiple fields.

3. A graph relationship path positioning device, characterized in that: The graph relationship path positioning device includes: a data acquisition device, a processor and a memory; The data acquisition device is used to acquire data; the memory is used to store one or more program instructions; and the processor is used to execute one or more program instructions to execute the method according to claim 1.

4. A computer-readable storage medium, characterized in that: The computer-readable storage medium contains one or more program instructions, and the one or more program instructions are used to execute the method according to claim 1.