A graph search method, apparatus, device and storage medium

By receiving search vertices and patterns at the front end, determining the appropriate algorithm, and displaying the search results, the problem of offline algorithms not being able to return and visualize in real time in graph search is solved, and real-time visualization of graph models is realized.

CN114385864BActive Publication Date: 2026-05-15WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WEBANK (CHINA)
Filing Date
2021-12-28
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, complex graph searches can only be achieved through offline backend algorithms, lacking real-time returns and visualization solutions.

Method used

A graph search method is provided, which receives the search vertices and selected search mode input from the search entry on the front-end page, determines the adaptation algorithm, executes the adaptation algorithm to perform the search, and uses a visualization plugin to display the search results.

Benefits of technology

It supports online analysis and processing of ultra-large-scale datasets and visualization of various graph models, and realizes real-time search result return and visualization graph display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114385864B_ABST
    Figure CN114385864B_ABST
Patent Text Reader

Abstract

The application provides a graph search method, device and equipment and a storage medium. The method comprises the following steps: receiving a search vertex input in a search entrance of a front-end page and a selected search mode; the search vertex is a point in a directed acyclic graph; determining an adaptive algorithm corresponding to the search mode, and performing the adaptive algorithm to search based on the search vertex to obtain a search result; and displaying the search result through a visual plug-in.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology in financial technology (Fintech), and includes, but is not limited to, a graph search method, apparatus, device, and storage medium. Background Technology

[0002] With the development of computer computing, more and more technologies are being applied in the financial field. The traditional financial industry is gradually transforming into financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher demands are also being placed on technology.

[0003] In the fintech sector, enterprises have various graph search scenarios, such as data lineage search, application lineage search, etc. Typically, the amount of graph model data in an enterprise is very large. Currently, complex graph searches can only be achieved through backend offline algorithms, without a real-time return and visualization solution. Summary of the Invention

[0004] This application provides a graph search method, apparatus, device, and storage medium to address the problem in related technologies that complex graph searches can only be achieved through offline backend algorithms, lacking a real-time return and visualization solution.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] This application provides a graph search method, including:

[0007] The system receives a search vertex and a selected search mode input at the search entry point on the front-end page; wherein the search vertex is a point in a directed acyclic graph.

[0008] Determine the adaptation algorithm corresponding to the search pattern, and execute the adaptation algorithm to search based on the search vertex to obtain the search results;

[0009] The search results are displayed using a visualization plugin.

[0010] This application provides an image search device, including:

[0011] The display module is used to show the search entry point on the front-end page;

[0012] A receiving module is used to receive the search vertex and the selected search mode input at the search entry point; wherein, the search vertex is a point in a directed acyclic graph;

[0013] The processing module is used to determine the adaptation algorithm corresponding to the search mode, and execute the adaptation algorithm to search based on the search vertex to obtain the search results;

[0014] The display module is used to display the search results through a visualization plugin.

[0015] This application provides an image search device, including:

[0016] The memory is used to store executable instructions; the processor is used to implement the above method when executing the executable instructions stored in the memory.

[0017] This application provides a storage medium storing executable instructions for inducing a processor to execute the above-described method.

[0018] The embodiments of this application have the following beneficial effects:

[0019] This solution receives search vertices and selected search modes from the search entry point on the front-end page; where search vertices are points in a directed acyclic graph (DAG); determines the appropriate adaptation algorithm for the search mode, executes the adaptation algorithm to perform a search based on the search vertices, and obtains the search results; the search results are then displayed through a visualization plugin. This solution addresses the problem in related technologies where complex graph searches can only be achieved through offline backend algorithms, lacking a real-time return and visualization solution. It provides a complete solution supporting complex scenario searches in Online Analytical Processing (OLAP) for ultra-large datasets and the visualization of various graph models. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of an optional server architecture provided in an embodiment of this application;

[0021] Figure 2 This is a flowchart illustrating the graph search method provided in the embodiments of this application. Figure 1 ;

[0022] Figure 3 This is a schematic diagram of the architecture of the graph visualization analysis system provided in the embodiments of this application;

[0023] Figure 4 This is a flowchart illustrating the graph search method provided in the embodiments of this application. Figure 2 ;

[0024] Figure 5 This is a schematic diagram of the directed acyclic graph G and the interval label graph of the vertices provided in the embodiments of this application;

[0025] Figure 6 This is a schematic diagram of the directed acyclic graph G and the forward and reverse breadth layers and forward and reverse topological layers of the vertices provided in the embodiments of this application. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiments of this application pertain. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit the application.

[0028] The following describes exemplary applications of the graph search device provided in this application. The graph search device provided in this application can be implemented as any terminal with a screen display function, such as a laptop, tablet, desktop computer, mobile device (e.g., mobile phone, portable music player, personal digital assistant, dedicated messaging device, portable gaming device), or intelligent robot, or as a server. The following will describe exemplary applications when the graph search device is implemented as a server.

[0029] See Figure 1 , Figure 1 This is a schematic diagram of the structure of the server 100 provided in the embodiments of this application. Figure 1 The server 100 shown includes at least one processor 110, at least one network interface 120, a user interface 130, and memory 150. The various components of server 100 are coupled together via a bus system 140. It is understood that the bus system 140 is used to implement communication between these components. In addition to a data bus, the bus system 140 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 1 The general labeled all buses as Bus System 140.

[0030] The processor 110 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0031] User interface 130 includes one or more output devices 131 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 130 also includes one or more input devices 132, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0032] Memory 150 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. Memory 150 may optionally include one or more storage devices physically located remote from processor 110. Memory 150 may include volatile memory or non-volatile memory, or both. Non-volatile memory may be read-only memory (ROM), and volatile memory may be random access memory (RAM). The memory 150 described in this application embodiment is intended to include any suitable type of memory. In some embodiments, memory 150 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.

[0033] Operating system 151 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;

[0034] The network communication module 152 is used to reach other computing devices via one or more (wired or wireless) network interfaces 120, such as Bluetooth, Wi-Fi, and Universal Serial Bus (USB).

[0035] The input processing module 153 is used to detect and translate one or more user inputs or interactions from one or more input devices 132.

[0036] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 1A graph search device 154 stored in memory 150 is shown. This graph search device 154 can be a graph search device in server 100, and can be software in the form of programs and plug-ins, including the following software modules: display module 1541, receiving module 1542, and processing module 1543. These modules are logically linked and can therefore be arbitrarily combined or further divided according to their implemented functions. The functions of each module will be described below.

[0037] In other embodiments, the apparatus provided in this application can be implemented in hardware. As an example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the graph search method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0038] The graph search method provided in this application will be described below with reference to exemplary applications and implementations of the server 100 provided in the embodiments of this application. See also Figure 2 , Figure 2 This is an optional flowchart illustrating the graph search method provided in this application embodiment, which will be combined with... Figure 2 The steps shown are explained below.

[0039] Step S201: Receive the search term and selected search mode entered at the search entry on the front-end page.

[0040] The search vertex is a point in a directed acyclic graph.

[0041] In this embodiment of the application, a directed acyclic graph (DAG) is a dataset consisting of vertices and edges. A vertex represents an entity, and an edge represents the relationship between entities. Here, G = (V, E) is used to represent a directed acyclic graph, or simply a graph. V represents the set of vertices in graph G, and E represents the set of edges in graph G.

[0042] In this embodiment of the application, during the search process, the number of search vertices input is greater than or equal to 1. When there are multiple search vertices, the search modes include the mode corresponding to reachability analysis and the mode corresponding to path search between two points; when there is only a single search vertex, the search modes include the mode corresponding to K-step search with a single search vertex as the specific vertex. Reachability refers to the following: for any two vertices u and v in the graph, if there exists a path from u to v, then vertex u is reachable from vertex v. A path refers to: a path from vertex u to vertex v is a vertex sequence (u, u1, ..., v) starting from vertex u and terminating at vertex v.

[0043] In this embodiment, during the search process, the graph database used for querying and storing the graph model can be an open-source distributed graph database, such as Nebulagraph, which supports millisecond-level queries on ultra-large-scale datasets. When searching through the search entry on the front-end page, it can be done through the search engine on the front-end page. The search engine can be a distributed full-text search engine, such as Elasticsearch, which supports word segmentation, indexing, and fast retrieval of massive amounts of data.

[0044] In practical applications, enterprises face various graph search scenarios, including but not limited to data lineage searches during data tracing and application lineage searches during application tracing. Given the massive amounts of graph model data in enterprises, this application provides a search and visualization platform. This platform presents a front-end page to users, allowing them to perform various graph-related searches.

[0045] Step S202: Determine the adaptation algorithm corresponding to the search mode, and execute the adaptation algorithm to search based on the search vertices to obtain the search results.

[0046] In this application embodiment, different search modes correspond to different adaptation algorithms; the adaptation algorithm in this application is a search method used during the search process for the input search point. It should be noted that in this application embodiment, the adaptation algorithm is an algorithm design for the graph model in the graph database, involving operations on the graph model; in the algorithm implementation process, this application decomposes the algorithm's graph operations into basic graph semantic operations, such as viewing vertex attributes, obtaining adjacent vertices, and obtaining the edges between two points—the most basic graph semantic operations. That is, during the search process, the adaptation algorithm's operations on the graph database are decomposed into basic graph semantic atomic operations, thereby reducing the complexity of graph operations; Elasticsearch is used for searching, indexing all algorithm features, and the search results can be obtained with only a one-time retrieval using the index, improving the overall stability of the service.

[0047] In some embodiments of this application, when the adaptation algorithm performs a search based on the search vertices, it can adopt a breadth-first search (BFS) approach, which processes vertices according to their levels. The vertex closest to the starting point is visited first, and the vertices in the graph are traversed in order of distance.

[0048] Step S203: Display the search results using a visualization plugin.

[0049] In this application embodiment, the visualization plugin includes, but is not limited to, the CYSOSCAPE.JS visualization plugin. The visualization plugin can flexibly assemble the backend-packaged visualization structure into various graph visualizations and perform rendering and color matching. In some embodiments, the visualization plugin can flexibly assemble the visualization structure into various graphs in the following ways: using the input search vertex as the root node, and then expanding outward layer by layer to construct the entire complete graph relationship chain; specifically, the set of all vertices and edges between any two vertices of the structure, and then, using the input search vertex as the root node, the visualization plugin constructs the complete graph layer by layer outward.

[0050] In practical applications, users can perform various graph-related searches on the platform. Furthermore, the platform can return the search results in real time via a visualization plugin and display the results graphically. Therefore, the graph search method provided in this application is applicable to various OLAP search scenarios for graphs, such as reachability analysis, two-point link search, and k-step search. During the search process, various search conditions can be flexibly configured through the search entry point on the front-end page, thereby obtaining various visualization results of graph models.

[0051] Therefore, this application establishes a complete graph analysis and visualization framework, which enables users to configure different conditions for querying various types of graph relationship data (lineage data, risk control data, etc.) in different search scenarios on the front-end World Wide Web (WEB) page, thereby achieving visualized search.

[0052] The graph search method provided in this application receives search vertices and a selected search mode input through the search entry on the front-end page; wherein the search vertices are points in a directed acyclic graph; determines the adaptation algorithm corresponding to the search mode, and executes the adaptation algorithm to search based on the search vertices to obtain search results; and displays the search results through a visualization plugin; it solves the problem in related technologies that complex graph searches can only be implemented through back-end offline algorithms, without a real-time return and visualization solution, and provides a complete solution supporting OLAP complex scene search and visualization of various graph models.

[0053] Furthermore, in a graph search scenario, this application proposes a schematic diagram of a graph search architecture, see [link to diagram]. Figure 3 As shown, the architecture of graph search can also be called a graph visualization and analysis system. This system consists of two main parts: a front-end web service and a graph analysis engine. The front-end web service includes the following components: a front-end search entry point and a CYSOSCAPE.JS visualization plugin. The front-end search entry point, serving as the search entry point on the front-end page, supports search modes such as graph reachability, paths between two points, and K-step search for specific vertices, and can be configured with various search conditions. The CYSOSCAPE.JS visualization plugin, as a front-end graph visualization plugin, can flexibly assemble the visualization structure packaged on the back-end into various graph visualization graphics and perform rendering and color matching. The graph analysis engine includes the following components: an Application Programming Interface (API), standardized templates, adapters and strategy factories, an algorithm library, and a graph atomic semantic operation layer. Here, the graph analysis engine corresponding to the API provides graph analysis functions for various scenarios through Spring Boot microservices. The standardized templates define the standardized steps for the entire process from API to final packaging. The standardized steps are: add root node -> adapt algorithm strategy -> execute search algorithm -> adapt packaging strategy -> execute packaging method -> return packaging structure. Adapters and strategy factories can adapt different algorithm strategies and packaging strategies based on various search patterns and conditions input from the front end. The algorithm library, as a self-developed high-performance search algorithm integration library, supports reachability analysis, path search between two points, and K-step search for specific vertices, among other search patterns. Elasticsearch is used to index various features of vertices, such as degree, label range, breadth level, and topological level. The graph atomic semantic operation layer refers to decomposing the various algorithms in the algorithm library into the smallest atomic operations on semantics, such as viewing vertex attributes, obtaining adjacent vertices, and obtaining edges between two points. The graph model is stored and queried using the Nebulagraph graph database.

[0054] Furthermore, in conjunction with the above Figure 3 The graph search architecture shown combines Figure 4 The graph search process in this application will be described in three stages:

[0055] The first stage, the relationship between search patterns and algorithms: The various search patterns input by the front end determine the specific algorithms adapted by the back end, namely the adaptation algorithms mentioned above. For example, when the front end searches whether two application vertices are related, the algorithm adapter will automatically match the reachability analysis strategy and call the reachability analysis algorithm.

[0056] The second stage involves the relationship between search conditions and pruning strategies: The search conditions configured on the front end are categorized into different condition classes based on the search mode, pruning the search results. For example, during a K-step search, if a table's upstream dependency table (within 10 degrees) is searched and a time interval condition is configured, BFS will prune the graph based on this time condition. Here, pruning refers to removing vertices and edges that do not meet the conditions during graph traversal, improving the time and space efficiency of the traversal algorithm.

[0057] The third stage, returning the structure: The search results need to be packaged into a JSON structure of vertices and edges. The vertex set is the set of all vertices on the path, and the edge set is the set of directed edges between two adjacent vertices. The CYSOSCAPE.JS plugin will automatically assemble and render the returned structure. The specific assembly process is to add the input node to the root node, and then expand outward layer by layer from the upstream and downstream edges of the root node to build a complete graph relationship link.

[0058] The graph search process of this application is further explained below:

[0059] In other embodiments of this application, the search vertices include vertex u and vertex v. In step S202, the adaptation algorithm is executed to search based on the search vertices and obtain the search results. This can be achieved through the following steps:

[0060] A11. The adaptation algorithm is executed based on recursive calls to determine whether vertex u and vertex v meet the reachability condition.

[0061] A12. If the reachability condition between vertices u and v is satisfied, perform a search based on the relationship between the out-degree outDeg(u, G) of vertex u and the in-degree inDeg(v, G) of vertex v to obtain the search results, where G represents a directed acyclic graph.

[0062] In this embodiment, the vertex degree refers to the number of adjacent vertices of that vertex. In a directed graph, the vertex degree is the sum of the vertex's out-degree and in-degree. inDeg(u, G) represents the in-degree of u, i.e., the number of vertices pointing to u, and outDeg(u, G) represents the out-degree of u, i.e., the number of vertices pointed to by u.

[0063] In other embodiments of this application, determining whether vertex u and vertex v satisfy the reachability condition in A11 can be achieved through the following steps:

[0064] A111. Determine the interval label relationship between vertex u and vertex v;

[0065] A112. Determine the relationship between the forward breadth level and the reverse breadth level of vertices u and v;

[0066] A113. Determine the relationship between the forward and reverse topological layers of vertices u and v;

[0067] A114. Based on at least one of the interval label relationship, the forward breadth layer relationship and the reverse breadth layer relationship, and the forward topology layer relationship and the reverse topology layer relationship, determine whether vertex u and vertex v satisfy the reachability condition.

[0068] In some scenarios, see Figure 5 As shown, each vertex in graph G has two interval labels. For example, vertex v has a first interval label for vertex v. and the second interval label of vertex v in, and in This represents the starting value of the i-th interval. Indicate the end value of the i-th interval, where i = 1, 2. The label of the first interval of vertex v. The labels obtained during the forward traversal of the child vertices of vertex v in a preorder traversal are the starting values ​​of the interval. The minimum initial value and the minimum ending value among the child vertices of the current vertex. This is the order value of v during subsequent traversals; the second interval label. The label is obtained by traversing the child vertices in reverse order during the second preorder traversal of vertex v. The minimum initial value among the child vertices contained in the current vertex. This is the order value for visiting vertex v during subsequent traversals. Figure 5 middle The first value inside the first square bracket. It is the second value inside the first set of square brackets; for example, for vertex 1... It is 1. It is 10. The first value inside the second set of square brackets. It is the second value inside the second set of square brackets; for example, for vertex 1, the value corresponding to... It is 1. It is 10.

[0069] Further, see Figure 6 As shown, regarding the above Figure 5 In the directed graph G shown, the forward breadth level and the backward breadth level of vertex v are defined. Figure 5 The number of forward breadth levels for each vertex is Figure 6The value before the comma before the separator is the reverse breadth-first depth number, and the value after the comma is the reverse breadth-first depth number. For example, for vertex 1, the forward breadth-first depth number is 1, and the reverse breadth-first depth number is 6. The specific definition of the forward breadth-first depth number is as follows:

[0070]

[0071] Wherein, inN(v, G) represents the in-degree of vertex v. Vertices with an in-degree of 0 have a forward breadth level of 1. Otherwise, the forward breadth level is equal to the minimum of the forward breadth levels of all in-degree vertices plus 1. That is, the forward breadth level of vertex v is equal to the level value of the parent node of v when performing breadth-first traversal on graph G plus 1.

[0072] The inverse breadth level rebre(v) of vertex v is obtained by reversing all directed edges of graph G and then performing the same calculation to obtain the inverse breadth level of all vertices.

[0073] See Figure 6 As shown, regarding the above Figure 5 For the directed graph G shown, define the forward topological layer number and the reverse topological layer number of vertex v. Figure 5 The number of forward topological layers for each vertex is Figure 6 The value before the comma following the mid-partition graph indicates the inverse topological layer number, while the value after the comma indicates the reverse topological layer number. For example, the forward topological layer number for vertex 1 is 1, and the inverse topological layer number is also 1. The specific definition of the forward topological layer number is as follows:

[0074]

[0075] In this case, the forward topological layer number of a vertex with an in-degree of 0 is 1; otherwise, the forward topological layer number is equal to the maximum value of the forward topological layer numbers of all vertices with in-degree of the vertex plus 1. That is, the forward topological layer number of vertex v is equal to the traversal order value when performing a preorder traversal on vertices with an in-degree of 0.

[0076] The specific definition of the number of reverse topology layers is as follows:

[0077]

[0078] Among them, the reverse topological layer number of the vertex with an out-degree of 0 is the length of the longest path in the current graph, and the reverse topological layer number of other vertex v is the minimum value after subtracting 1 from the reverse topological layer number of all out-degree vertices of v.

[0079] In other embodiments of this application, A111 determines the interval label relationship between vertex u and vertex v, which can be achieved through the following steps: determining the first interval label of vertex v. Is the label in the first interval of vertex u? Within, and the second interval label of vertex v. Is the label in the second interval of vertex u? Within;

[0080] The first interval label of each vertex is the label obtained when the child vertices of each vertex are traversed in the forward order during the preorder traversal of each vertex, and the second interval label of each vertex is the label obtained when the child vertices are traversed in the reverse order during the second preorder traversal of each vertex.

[0081] Whether vertex u and vertex v satisfy the reachability condition includes: if exist Inside and exist Within this range, determine whether vertex u and vertex v satisfy the reachability condition.

[0082] In other words, in this embodiment of the application, for any two vertices u and v in a given directed acyclic graph G, if or Then u->v is unreachable.

[0083] In other embodiments of this application, A112 determines the relationship between the forward breadth level and the reverse breadth level of vertices u and v through the following steps:

[0084] Determine whether the positive breadth level of vertex v, bre(v), is greater than the positive breadth level of vertex u, bre(u);

[0085] Determine whether the inverse breadth level rebre(u) of vertex u is greater than the inverse breadth level febre(v) of vertex v;

[0086] The determination of whether vertex u and vertex v satisfy the reachability condition includes: if bre(v)≤bre(u) and rebre(u)≤rebre(v), then vertex u and vertex v satisfy the reachability condition.

[0087] In other words, in the embodiments of this application, for any two vertices u and v in a given directed acyclic graph G, if bre(v)-bre(u)>0 or rebre(u)-rebre(v)>0, then u->v is unreachable.

[0088] In other embodiments of this application, A113 determines the relationship between the forward and reverse topological layers of vertices u and v through the following steps:

[0089] Determine whether the number of forward topological layers of vertex u, topo(u), is less than the number of forward topological layers of vertex v, topo(v);

[0090] Determine whether the number of reverse topological layers of vertex u, retopo(u), is less than the number of reverse topological layers of vertex v, retopo(v);

[0091] The determination of whether vertex u and vertex v satisfy the reachability condition includes either topo(u) < topo(v) or retopo(u) < retopo(v), thus confirming that vertex u and vertex v satisfy the reachability condition.

[0092] In other words, in this embodiment of the application, for any two vertices u and v in a given directed acyclic graph G, if topo(u) >= topo(v) or retopo(u) >= retopo(v), then u->v is unreachable.

[0093] In other embodiments of this application, when the search mode includes the mode corresponding to reachability analysis, A11 executes the adaptation algorithm to determine whether vertex u and vertex v meet the reachability condition based on a recursive call method, including the following steps:

[0094] Determine the vertex u that is the input of the recursive call. i and vertex v i Are they equal? ​​Where, vertex u i The set of vertex u and its child nodes, vertex v i The set of parent nodes of v and v;

[0095] Here, if u i =v i Then vertices u and v are reachable, and the recursion terminates, where u i The set of vertex u and its child nodes, v i The set of nodes that belong to vertex v and its parent nodes.

[0096] However, if vertex u i Not equal to vertex v i The recursive call method is used to determine whether the reachability condition between vertex u and vertex v is met.

[0097] In determining whether the reachability condition is met, there are three scenarios in which unreachability is confirmed:

[0098] Determine the interval label of vertex v and Check if the vertex is within the range label of vertex u. If not, it is unreachable, and stop traversing.

[0099] Determine the relationship between the forward breadth and backward breadth of vertices v and u. If bre(v)-bre(u)>0 or rebre(u)-rebre(v)>0, then the vertex is unreachable, and stop traversing.

[0100] Determine the relationship between the forward and reverse topological layers of vertices v and u. If topo(u) ≥ topo(v) or retopo(u) ≥ retopo(v), then the vertex is unreachable and the traversal stops.

[0101] Furthermore, under the reachability analysis pattern, a bidirectional search method is employed to perform a search based on the relationship between the out-degree outDeg(u, G) of vertex u and the in-degree inDeg(v, G) of vertex v in A12, yielding the search results, including the following steps:

[0102] If outDeg(u, G) ≤ inDeg(v, G), for each vertex u in the set of adjacent child nodes of vertex u... i Recursively call vertex v to obtain the search results;

[0103] If outDeg(u, G) > inDeg(v, G), for each vertex v in the set of all parent nodes of vertex u and vertex v... i Execute the recursive call to obtain the search results.

[0104] In practical applications, when the search pattern includes the pattern corresponding to reachability analysis, the algorithm features are updated daily via offline computation: the Spark engine is used to calculate the interval labels of all vertices in the graph model. and And the forward breadth layer number bre(v), the reverse breadth layer number rebre(v), the forward topology layer number topo(v), and the reverse topology layer number retopo(v) for all labels; then upsert all vertex features into the Elasticsearch index.

[0105] The Flasticsearch vertex feature index structure is as follows:

[0106]

[0107] This paper employs online OLAP analysis, recursively calling a bidirectional search pruning algorithm. The algorithm's graph operations are decomposed into basic atomic semantic layer operations, and the Nebulagraph client is used for graph semantic atomic queries. The algorithm prunes based on interval labels, breadth level, and topological level. When selecting the bidirectional search direction based on vertex degree, only one retrieval is performed in Elasticsearch to retrieve all feature values ​​of the target vertex's upper table for calculation. This application significantly reduces the latency of OLAP analysis on large-scale graph datasets by integrating a bidirectional pruning search algorithm. The algorithm implementation process is adapted by decomposing all graph operations into atomic semantic operations and indexing features of various dimensions into a high-performance distributed search engine through daily offline batch feature engineering calculations, ensuring the efficiency and stability of the algorithm implementation.

[0108] The steps of the path search algorithm between two points are the same as those of the reachability algorithm, except that the complete links need to be recorded in a linked list during the traversal process. That is, given vertex u and vertex v, search for all links between vertex u and vertex v.

[0109] In other embodiments of this application, the search mode includes the mode corresponding to the path search between two points. The A11 execution adaptation algorithm determines whether the reachability condition between vertex u and vertex v is met based on the recursive call method, including the following steps:

[0110] Create linked lists v1 and v2; add vertex u as the head node to linked list v1, and add vertex v as the head node to linked list v2.

[0111] Determine the vertex u that is the input of the recursive call. i and vertex v i Are they equal? ​​Where, vertex u i The set of vertex u and its child nodes, vertex v i The set of parent nodes of v and v;

[0112] If u i =v i Then vertices u and v are reachable, and the recursion terminates, where u i The set of vertex u and its child nodes, v i The set of nodes belonging to vertex v and its parent nodes. Reverse the linked list link2, then remove the tail node from the linked list link1 and concatenate it with the linked list link2, returning the concatenated linked list set.

[0113] However, if vertex u i Not equal to vertex v i The recursive call method is used to determine whether the reachability condition between vertex u and vertex v is met.

[0114] Furthermore, in the case of the path search pattern between two points, a bidirectional search method is adopted to perform a search based on the relationship between the out-degree outDeg(u,G) of vertex u and the in-degree inDeg(v,G) of vertex v in A12, and obtain the search results, including the following steps:

[0115] If outDeg(u,G)≤inDeg(v,G), for each vertex u in the set of adjacent child nodes of vertex u i Perform a recursive call on vertex v, clone the current out-degree vertex list and add u. i As the tail node, it yields the search results for all links between vertex u and vertex v;

[0116] If outDeg(u,G)>inDeg(v,G), for each vertex v in the set of all parent nodes of vertex u and vertex v... i Execute the recursive call, clone the current in-degree vertex list and add v. i As the tail node, it yields the search results for all links between vertex u and vertex v.

[0117] In other embodiments of this application, the search mode includes the mode corresponding to K-step search, which adopts breadth-first search. When searching for adjacent level nodes of a vertex using breadth-first search, a batch search mode can be used to search them all at once. Combined with search conditions, each time an adjacent fixed point is found, the search conditions are used to prune the nodes, which can greatly speed up the search and quickly obtain the search results.

[0118] The following continues to describe the exemplary structure of the graph search device 154 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 1 As shown, the software module stored in the graph search device 154 in the memory 150 can be the graph search device in the server 100, including:

[0119] Display module 1541 is used to display the search entry point on the front-end page;

[0120] The receiving module 1542 is used to receive the search vertex and the selected search mode input at the search entry point; wherein, the search vertex is a point in a directed acyclic graph;

[0121] The processing module 1543 is used to determine the adaptation algorithm corresponding to the search mode, and execute the adaptation algorithm to search based on the search vertex to obtain the search results;

[0122] Display module 1541 is used to display search results via a visualization plugin.

[0123] In some embodiments, the search vertices include vertices u and v. The processing module 1543 is used to execute an adaptation algorithm to determine whether vertex u and vertex v meet the reachability condition based on a recursive call method. If vertex u and vertex v meet the reachability condition, a search is performed based on the relationship between the out-degree outDeg(u, G) of vertex u and the in-degree inDeg(v, G) of vertex v to obtain the search results, where G represents a directed acyclic graph.

[0124] In some embodiments, the processing module 1543 is configured to determine the interval label relationship between vertex u and vertex v; determine the forward breadth-depth relationship and the reverse breadth-depth relationship between vertex u and vertex v; determine the forward topology-depth relationship and the reverse topology-depth relationship between vertex u and vertex v; and determine whether vertex u and vertex v satisfy the reachability condition based on at least one of the interval label relationship, the forward breadth-depth relationship and the reverse breadth-depth relationship, and the forward topology-depth relationship and the reverse topology-depth relationship.

[0125] In some embodiments, the processing module 1543 is used to determine the first interval label of vertex v. Is the label in the first interval of vertex u? Within, and the second interval label of vertex v. Is the label in the second interval of vertex u? Within; where the first interval label of each vertex is the positive direction of the child vertices of each vertex when performing a preorder traversal of each vertex;

[0126] The labels obtained during traversal are as follows: the second interval label for each vertex is the label obtained during the second preorder traversal of each vertex, traversing in reverse order of its child vertices; where, whether vertex u and vertex v satisfy the reachability condition includes: if exist Inside and exist Within this range, determine whether vertex u and vertex v satisfy the reachability condition.

[0127] In some embodiments, the processing module 1543 is used to determine whether the difference between the positive breadth layer number bre(v) of vertex v and the positive breadth layer number bre(u) of vertex u is greater than 0.

[0128] Determine if the difference between the inverse breadth level rebre(u) of vertex u and the inverse breadth level rebre(v) of vertex v is greater than 0;

[0129] The determination of whether vertex u and vertex v satisfy the reachability condition includes: if bre(v)-bre(u)<0 and rebre(u)-rebre(v)<0, then vertex u and vertex v satisfy the reachability condition.

[0130] In some embodiments, the processing module 1543 is used to determine whether the number of forward topological layers of vertex u, topo(u), is less than the number of forward topological layers of vertex v, topo(v);

[0131] Determine whether the number of reverse topological layers of vertex u, retopo(u), is less than the number of reverse topological layers of vertex v, retopo(v);

[0132] The determination of whether vertex u and vertex v satisfy the reachability condition includes either topo(u) < topo(v) or retopo(u) < retopo(v), thus confirming that vertex u and vertex v satisfy the reachability condition.

[0133] In some embodiments, the search pattern includes the pattern corresponding to reachability analysis, and the processing module 1543 is used to determine the vertex u input by the recursive call. i and vertex v i Are they equal? ​​Where, vertex u i The set of vertex u and its child nodes, vertex v i It belongs to the set of v and v's parent nodes; if vertex u i Not equal to vertex v i The recursive call method is used to determine whether the reachability condition between vertex u and vertex v is met.

[0134] In some embodiments, the processing module 1543 is configured to, if outDeg(u, G) ≤ inDeg(v, G), process each vertex u in the set of neighboring child nodes of vertex u. i Recursively call vertex v to obtain the search results;

[0135] If outDeg(u, G) > inDeg(v, G), for each vertex v in the set of all parent nodes of vertex u and vertex v... i Execute the recursive call to obtain the search results.

[0136] In some embodiments, the search mode includes the mode corresponding to the path search between two points. The processing module 1543 is used to create linked list v1 and linked list v2; wherein, linked list v1 adds vertex u as the head node, and linked list v2 adds vertex v as the head node.

[0137] Determine the vertex u that is the input of the recursive call. i and vertex v i Are they equal? ​​Where, vertex u i The set of vertex u and its child nodes, vertex v i The set of parent nodes of v and v;

[0138] If vertex u i Not equal to vertex vi The recursive call method is used to determine whether the reachability condition between vertex u and vertex v is met.

[0139] In some embodiments, the processing module 1543 is configured to, if outDeg(u, G) ≤ inDeg(v, G), process each vertex u in the set of neighboring child nodes of vertex u. i Perform a recursive call on vertex v, clone the current out-degree vertex list and add u. i As the tail node, it yields the search results for all links between vertex u and vertex v;

[0140] If outDeg(u, G) > inDeg(v, G), for each vertex v in the set of all parent nodes of vertex u and vertex v... i Execute the recursive call, clone the current in-degree vertex list and add v. i As the tail node, it yields the search results for all links between vertex u and vertex v.

[0141] The graph search device provided in this application receives search vertices and selected search modes input through the search entry on the front-end page; wherein, the search vertices are points in a directed acyclic graph; it determines the adaptation algorithm corresponding to the search mode, executes the adaptation algorithm to search based on the search vertices, and obtains search results; and displays the search results through a visualization plugin; it solves the problem in related technologies that complex graph searches can only be implemented through back-end offline algorithms, without a real-time return and visualization solution, and provides a complete solution supporting OLAP complex scene search and visualization of various graph models.

[0142] It should be noted that the description of the apparatus in this application embodiment is similar to the description of the method embodiment described above, and has similar beneficial effects as the method embodiment; therefore, it will not be repeated. For technical details not disclosed in this apparatus embodiment, please refer to the description of the method embodiment of this application for understanding.

[0143] This application provides a storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to perform the method provided in this application, for example... Figure 2 The method shown.

[0144] The storage medium provided in this application embodiment receives the search vertex and selected search mode input at the search entry on the front-end page; wherein the search vertex is a point in a directed acyclic graph; determines the adaptation algorithm corresponding to the search mode, and executes the adaptation algorithm to search based on the search vertex to obtain the search results; and displays the search results through a visualization plugin; it solves the problem in related technologies that complex graph searches can only be implemented through back-end offline algorithms, without a real-time return and visualization graphic display solution, and supports a complete solution for OLAP complex scene search and visualization display of various graph models.

[0145] In some embodiments, the storage medium may be a computer-readable storage medium, such as a ferromagnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic surface memory, optical disc, or a compact disk-read-only memory (CD-ROM); or it may be a device that includes one or any combination of the above-mentioned memories.

[0146] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0147] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file containing other programs or data, for example, in one or more scripts within a Hyper Text Markup Language (HTL) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files storing one or more modules, subroutines, or code sections). As an example, executable instructions may be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0148] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A graph search method, characterized in that, include: The system receives a search vertex and a selected search mode input at the search entry point on the front-end page; wherein the search vertex is a point in a directed acyclic graph. Determine the adaptation algorithm corresponding to the search pattern, and execute the adaptation algorithm to search based on the search vertex to obtain the search results; The search results are displayed through a visualization plugin; the search vertices include vertex u and vertex v, and the adaptation algorithm is executed based on the search vertices to obtain the search results, including: The adaptation algorithm is executed to determine whether the reachability condition between vertex u and vertex v is met based on a recursive call method; If the reachability condition is satisfied between vertex u and vertex v, a search is performed based on the relationship between the out-degree outDeg(u,G) of vertex u and the in-degree inDeg(v,G) of vertex v to obtain the search result, where G represents the directed acyclic graph; Determining whether vertex u and vertex v satisfy the reachability condition includes: Determine the interval label relationship between the vertex u and the vertex v; Determine the relationship between the forward breadth layer number and the reverse breadth layer number of the vertex u and the vertex v; Determine the relationship between the forward and reverse topological layers of vertex u and vertex v; Based on at least one of the interval label relationship, the forward breadth-depth relationship and the reverse breadth-depth relationship, and the forward topology relationship and the reverse topology relationship, determine whether the reachability condition is satisfied between vertex u and vertex v; The search pattern includes the pattern corresponding to reachability analysis. The execution of the adaptation algorithm, based on a recursive call method, determines whether the reachability condition is satisfied between vertex u and vertex v, including: Determine the vertex of the input in the recursive call. and vertex Are they equal? ​​Wherein, the vertex Belonging to the set of vertex u and its child nodes, vertex The set of nodes that belong to v and its parent nodes; If the vertex Not equal to the vertex The recursive call method is used to determine whether the reachability condition between vertex u and vertex v is met. The search mode includes the mode corresponding to the path search between two points. The execution of the adaptation algorithm, based on a recursive call method, determines whether the reachability condition is met between vertex u and vertex v, including: Create linked lists v1 and v2; wherein, linked list v1 adds vertex u as the head node, and linked list v2 adds vertex v as the head node; Determine the vertex of the input in the recursive call. and vertex Are they equal? ​​Wherein, the vertex Belonging to the set of vertex u and its child nodes, vertex The set of nodes that belong to v and its parent nodes; If the vertex Not equal to the vertex The recursive call method is used to determine whether the reachability condition between vertex u and vertex v is met.

2. The method according to claim 1, characterized in that, The determination of the interval label relationship between vertex u and vertex v includes: Determine the first interval label of vertex v Is it the label of the first interval of vertex u? Within, and the second interval label of the vertex v. Is the label in the second interval of vertex u? Within; wherein, the first interval label of each vertex is the label obtained when the child vertices of each vertex are traversed in the forward order during the preorder traversal of each vertex, and the second interval label of each vertex is the label obtained when the child vertices are traversed in the reverse order during the second preorder traversal of each vertex. Wherein, whether vertex u and vertex v satisfy the reachability condition includes: if the vertex u and vertex v satisfy the reachability condition. In the Within and the stated In the Within this range, it is determined that the reachability condition is satisfied between the vertex u and the vertex v.

3. The method according to claim 1, characterized in that, The determination of the relationship between the forward breadth level and the reverse breadth level of vertex u and vertex v includes: Determine whether the positive breadth level bre(v) of vertex v is greater than the positive breadth level bre(u) of vertex u; Determine whether the inverse breadth level rebre(u) of vertex u is greater than the inverse breadth level rebre(v) of vertex v; The determination of whether vertex u and vertex v satisfy the reachability condition includes: if bre(v)≤bre(u) and rebre(u)≤rebre(v), then vertex u and vertex v satisfy the reachability condition.

4. The method according to claim 1, characterized in that, The determination of the relationship between the forward and reverse topological layers of vertex u and vertex v includes: Determine whether the number of forward topological layers of vertex u, topo(u), is less than the number of forward topological layers of vertex v, topo(v); Determine whether the number of reverse topological layers of vertex u, retopo(u), is less than the number of reverse topological layers of vertex v, retopo(v); The determination of whether vertex u and vertex v satisfy the reachability condition includes: topo(u) < topo(v) or retopo(u) < retopo(v), thus determining that vertex u and vertex v satisfy the reachability condition.

5. The method according to claim 1, characterized in that, The search is performed based on the relationship between the out-degree outDeg(u,G) of vertex u and the in-degree inDeg(v,G) of vertex v, and the search results are obtained, including: If outDeg(u,G)≤inDeg(v,G), for each vertex in the set of adjacent child nodes of vertex u... The search result is obtained by performing a recursive call on vertex v. If outDeg(u,G)>inDeg(v,G), for each vertex in the set of all parent nodes of vertex u and vertex v... Execute the recursive call to obtain the search results.

6. The method according to claim 1, characterized in that, The search is performed based on the relationship between the out-degree outDeg(u,G) of vertex u and the in-degree inDeg(v,G) of vertex v, and the search results are obtained, including: If outDeg(u,G)≤inDeg(v,G), for each vertex in the set of adjacent child nodes of vertex u... Perform a recursive call on vertex v, clone the current out-degree vertex list and add it. As the tail node, obtain the search results for all links between vertex u and vertex v; If outDeg(u,G)>inDeg(v,G), for each vertex in the set of all parent nodes of vertex u and vertex v... Execute the recursive call, clone the current in-degree vertex list and add it. As the tail node, obtain the search results for all links between vertex u and vertex v.

7. A graph search device, characterized in that, include: The display module is used to show the search entry point on the front-end page; A receiving module is used to receive the search vertex and the selected search mode input at the search entry point; wherein, the search vertex is a point in a directed acyclic graph; The processing module is used to determine the adaptation algorithm corresponding to the search mode, and execute the adaptation algorithm to search based on the search vertex to obtain the search results; The display module is used to display the search results through a visualization plugin; The search vertices include vertices u and v. The processing module is used to execute the adaptation algorithm to determine whether vertices u and v meet the reachability condition based on recursive calls. If vertices u and v meet the reachability condition, the search is performed based on the relationship between the out-degree outDeg(u,G) of vertex u and the in-degree inDeg(v,G) of vertex v to obtain the search results, where G represents a directed acyclic graph. The processing module is used to determine the interval label relationship between vertices u and v; determine the forward breadth-depth relationship and the reverse breadth-depth relationship between vertices u and v; determine the forward topological depth relationship and the reverse topological depth relationship between vertices u and v; and determine whether vertices u and v satisfy the reachability condition based on at least one of the interval label relationship, the forward breadth-depth relationship and the reverse breadth-depth relationship, and the forward topological depth relationship and the reverse topological depth relationship. The search pattern includes the pattern corresponding to reachability analysis. The execution of the adaptation algorithm, based on a recursive call method, determines whether the reachability condition is satisfied between vertex u and vertex v, including: Determine the vertex of the input in the recursive call. and vertex Are they equal? ​​Wherein, the vertex Belonging to the set of vertex u and its child nodes, vertex The set of nodes that belong to v and its parent nodes; If the vertex Not equal to the vertex The recursive call method is used to determine whether the reachability condition between vertex u and vertex v is met. The search mode includes the mode corresponding to the path search between two points. The execution of the adaptation algorithm, based on a recursive call method, determines whether the reachability condition is met between vertex u and vertex v, including: Create linked lists v1 and v2; wherein, linked list v1 adds vertex u as the head node, and linked list v2 adds vertex v as the head node; Determine the vertex of the input in the recursive call. and vertex Are they equal? ​​Wherein, the vertex Belonging to the set of vertex u and its child nodes, vertex The set of nodes that belong to v and its parent nodes; If the vertex Not equal to the vertex The recursive call method is used to determine whether the reachability condition between vertex u and vertex v is met.

8. A graph search device, characterized in that, include: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the method according to any one of claims 1 to 6.

9. A storage medium, characterized in that, It stores executable instructions for causing a processor to execute, thereby implementing the method of any one of claims 1 to 6.