Route searching method, association recognition method and device
By probing the paths of source and destination nodes in the topology graph in parallel, the efficiency and accuracy issues of topology graph path determination in big data environments are solved, and efficient path probing is achieved.
Patent Information
- Application Number
- CN202211078659.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-05
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-09-05
AI Technical Summary
As the amount of data increases, how to efficiently and accurately determine the path between two nodes from a complex topology graph has become an urgent problem to be solved.
By acquiring a pathfinding request carrying information about the source and destination nodes, node detection is performed in a pre-established topology graph with the source and destination nodes as detection starting points respectively. The first and second detection sets obtained by the detection are compared at preset intervals. If there is an intersection, the target path between the source and destination nodes is determined.
It improves the efficiency of node detection, avoids the inefficiency of one-way detection, and ensures the accuracy of path determination and the effective use of resources.
Smart Images

Figure CN115481292B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of graph data processing, in particular to a path finding method. The present application also relates to an association identifying method, a path finding device, an association identifying device, a computing device, and a computer readable storage medium. BACKGROUND
[0002] With the development of Internet technology, the amount of data generated in a project is increasing, and direct storage of data cannot meet the subsequent data analysis requirements.
[0003] In the prior art, the data generated in the project is stored in the form of a topology graph, the nodes in the topology graph represent objects, and the edges in the topology graph represent the association relationship between objects, so that the data characteristics can be further mined in data analysis.
[0004] However, with the increase of data volume, the number of nodes and edges of the topology graph also increases accordingly, and how to efficiently and accurately determine the path between two nodes from a complex topology graph is a problem to be solved. SUMMARY
[0005] Therefore, the embodiments of the present application provide a path finding method to solve the technical defects in the prior art. The embodiments of the present application also provide an association identifying method, a path finding device, an association identifying device, a computing device, and a computer readable storage medium.
[0006] According to a first aspect of the embodiments of the present application, a path finding method is provided, comprising:
[0007] obtaining a path finding request, wherein the path finding request carries node information of a source node and a destination node;
[0008] According to the node information of the source node and the destination node, performing node detection in a pre-established topology graph, taking the source node and the destination node as detection starting points respectively, and comparing a first detection set and a second detection set obtained by detection at a preset interval;
[0009] In the case that the first detection set and the second detection set have an intersection, determining a target path between the source node and the destination node according to the current first detection set and the second detection set.
[0010] According to a second aspect of the embodiments of the present application, an association identifying method is provided, comprising:
[0011] obtaining an association identifying request, wherein the association identifying request carries object information of a source object and a destination object;
[0012] According to the object information of the source object and the destination object, a source node corresponding to the source object and a destination node corresponding to the destination object are determined from a pre-established relationship topology graph;
[0013] In the topology graph, node detection is performed respectively with the source node and the destination node as detection starting points, and a first detection set and a second detection set obtained through detection are compared at a preset interval;
[0014] If the first detection set and the second detection set have an intersection, it is determined that there is an association between the source object and the destination object.
[0015] According to a third aspect of an embodiment of the present application, a path searching device is provided, comprising:
[0016] The first obtaining module is configured to obtain a path searching request, wherein the path searching request carries node information of a source node and a destination node;
[0017] The first node detection module is configured to perform node detection respectively with the source node and the destination node as detection starting points in a pre-established topology graph according to the node information of the source node and the destination node, and compare a first detection set and a second detection set obtained through detection at a preset interval;
[0018] The first determining module is configured to determine a target path between the source node and the destination node according to the current first detection set and the second detection set if the first detection set and the second detection set have an intersection.
[0019] According to a fourth aspect of an embodiment of the present application, an association identification device is provided, comprising:
[0020] The second obtaining module is configured to obtain an association identification request, wherein the association identification request carries object information of a source object and a destination object;
[0021] The node determining module is configured to determine a source node corresponding to the source object and a destination node corresponding to the destination object from a pre-established relationship topology graph according to the object information of the source object and the destination object;
[0022] The second node detection module is configured to perform node detection respectively with the source node and the destination node as detection starting points in the topology graph, and compare a first detection set and a second detection set obtained through detection at a preset interval;
[0023] The second determining module is configured to determine that there is an association between the source object and the destination object if the first detection set and the second detection set have an intersection.
[0024] According to a fifth aspect of an embodiment of the present application, a computing device is provided, comprising:
[0025] a memory and a processor;
[0026] The memory is configured to store computer executable instructions, and the processor executes the computer executable instructions to implement the steps of the path searching method and the association identification method.
[0027] According to a sixth aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores computer executable instructions, and the instructions are executed by a processor to implement the steps of the path searching method and the association identification method.
[0028] According to a seventh aspect of the embodiments of the present application, a chip is provided, which stores a computer program, and the computer program is executed by the chip to implement the steps of the path searching method and the association identification method.
[0029] In one or more embodiments of the present application, a path searching request is acquired, wherein the path searching request carries node information of a source node and a destination node, and according to the node information of the source node and the destination node, node detection is performed in a pre-established topology graph, respectively taking the source node and the destination node as a detection starting point, and a first detection set and a second detection set are compared at a preset interval, and in a case where there is an intersection between the first detection set and the second detection set, a target path between the source node and the destination node is determined according to the current first detection set and the second detection set. The node detection is performed in parallel from the source node and the destination node to obtain the first detection set and the second detection set, and in a case where there is an intersection, the target path can be determined, which avoids unidirectional node detection from the source node and only the target path can be obtained after the destination node is detected, and the efficiency of detecting the target path is improved. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 is a topology graph structure diagram in the prior art;
[0031] Figure 2 is a flowchart of a path searching method provided by an embodiment of the present application;
[0032] Figure 3 is a topology graph structure diagram provided by an embodiment of the present application;
[0033] Figure 4 is a flowchart of an association identification method provided by an embodiment of the present application;
[0034] Figure 5 is a processing flowchart of a path searching method applied to company equity change provided by an embodiment of the present application;
[0035] Figure 6 is a structure diagram of a path searching device provided by an embodiment of the present application;
[0036] Figure 7is a structural schematic diagram of an association recognition device provided by an embodiment of the present application.
[0037] Figure 8 is a structural block diagram of a computing device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0038] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be practiced without the specific details, and the present application is not limited to the specific embodiments described herein. In other instances, well-known methods, procedures, components, and circuits have not been described in detail as not to unnecessarily obscure aspects of the present application.
[0039] The terminology used in this description is for the purpose of describing particular embodiments only and is not intended to limit one or more embodiments of the present application. As used in one or more embodiments of the present application and the accompanying claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in one or more embodiments of the present application, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0040] It will be understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal or chronological order. Rather, these terms are used only to distinguish one from another. For example, a first can be termed a second, and, similarly, a second can be also termed a first, without departing from the scope of one or more embodiments of the present application.
[0041] First, the noun terms related to one or more embodiments of the present application are explained.
[0042] Topology graph: an association structure diagram between objects composed of nodes and edges, wherein the nodes are used to represent different objects, and the edges are used to represent the association relationship between the objects. The nodes in the topology graph present a multi-level structure. Figure 1 A topology graph structure schematic diagram in the prior art is shown. As shown in Figure 1 There are node 1, node 2, node 3, node 4, node 5, and node 6 in the topology graph, a total of six nodes, connected by edges. For node 1, node 2, node 3, and node 4 are directly connected to it, so node 2, node 3, and node 4 are in the first level, node 5 is connected to node 3, and node 6 is connected to node 2, so node 5 and node 6 are in the second level. The storage mode of the topology graph includes: array storage (adjacency matrix storage) and adjacency list storage, wherein, as shown in Figure 1As shown, the specific form of the corresponding array storage is {(node 1, node 2), (node 1, node 3), (node 1, node 4), (node 2, node 6), (node 3, node 5)}, and the specific form of the corresponding adjacency list storage is {node 1->node 2->node 6; node 1->node 3->node 5; node 1->node 4}. The topological graph in the specification of the present application is taken as an example of adjacency list storage.
[0043] Traversal: along a certain path direction, sequentially performing node detection on each node in the topological graph.
[0044] Deep traversal: starting from a source node, performing node detection on nodes in a certain path direction until there is no node, then returning to the source node to perform node detection on nodes in another path direction, and repeating this process to complete node detection on all nodes in each path direction. As shown, Figure 1 Taking node 1 as the source node, first performing node detection on nodes in the path direction of node 2, i.e., performing node detection on node 2 and node 6, returning to node 1, then performing node detection on nodes in the path direction of node 3, i.e., performing node detection on node 3 and node 5, returning to node 1, and finally performing node detection on nodes in the path direction of node 4.
[0045] Breadth traversal: starting from a source node, performing node detection on the first level of nodes directly connected to the source node in each path direction, then performing node detection on the second level of nodes directly connected to the first level of nodes, and repeating this process to complete node detection on all nodes in each path direction. As shown, Figure 1 Taking node 1 as the source node, first performing node detection on the first level of nodes in each path direction, i.e., performing node detection on node 2, node 3, and node 4, then performing node detection on the second level of nodes directly connected to the first level of nodes, i.e., performing node detection on node 5 and node 6.
[0046] Currently, with the growth of data volume, the topological graph structure constructed will not be as simple as shown in Figure 1 For example, for a customer database of an application program, each commodity is stored as an object and represented by a node in the topological graph, and the number of nodes in the topological graph can even reach the level of 10 9 ; secondly, the directory of commodities can have multiple levels, and the number of commodities in each level is also extremely large; in addition, since there is no correlation between any commodities, the topological graph will contain multiple topological subgraphs.
[0047] Because the topological graph is stored in the computer storage in the form of an array or an adjacency list, the storage object represented by each node is in the form of "node value + next neighbor node address", and thus each node needs to be traversed to obtain the target path between the source node and the destination node.
[0048] However, for such a high-complexity topological graph, the traditional traversal method needs to consume a large amount of time to detect the target path between the source node and the destination node, resulting in insufficient detection efficiency.
[0049] To solve the above problems, a path finding method is provided in the present application. The present application also relates to a path finding device, a computing device, and a computer readable storage medium, which are described in detail in the following embodiments.
[0050] Figure 2 A flowchart of a path finding method provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0051] Step 202: Obtain a path finding request, wherein the path finding request carries node information of a source node and a destination node;
[0052] The application scenarios of the embodiments of the present application include: constructing a network topological graph with nodes representing network nodes and edges representing network connections, and finding a network route between any two network nodes for data transmission; analyzing how a user realizes the purchase of a target product through operations (collection, purchase, browsing, search, etc.) on the product by taking nodes to represent users and products and edges to represent the operations; and determining the relationship path between organizations or individuals by taking nodes to represent organizations and individuals and edges to represent the relationships between organizations, the relationships between organizations and individuals, and the relationships between individuals. The above are examples of application scenarios of the present application, and do not mean that the present application can only be applied to the above scenarios. In any scenario of storing object data and object relationship in a topological graph, the present application can determine the relationship path between any two nodes, thereby improving the efficiency of detecting the target path.
[0053] The path finding request is an instruction for the terminal to detect at least one target path between the source node and the destination node.
[0054] The source node is the starting point of the target path requested by the terminal for detection, and the destination node is the ending point of the target path requested by the terminal for detection. Both the source node and the destination node are nodes in the topological graph for representing physical objects.
[0055] The node information is unique identification information of the nodes stored in the topology graph. The node information is unique identification information of the nodes marked when the topology graph is constructed in advance. For example, for a network node, the unique identification information marked is (00-01-6C-06-A6-29; 192.168.2.32; 255.255.255.0), for an organization, the unique identification information can be an organization code, and for a person, the unique identification information can be an ID number.
[0056] Exemplarily, the user sends a route request through the terminal: RouteRequest{node information of a source node: P1011 (an organization); node information of a destination node: P1037 (an organization)}.
[0057] By obtaining the route request carrying the node information of the source node and the destination node, an information basis is provided for subsequent accurate positioning of the source node and the destination node in the topology graph.
[0058] In step 204, according to the node information of the source node and the destination node, node detection is performed with the source node and the destination node as detection starting points in the topology graph established in advance, and a first detection set and a second detection set obtained by detection are compared at a preset interval.
[0059] The topology graph in the embodiment of the application is a non-directional topology graph, that is, the edges between the nodes do not have a direction.
[0060] The topology graph established in advance is stored in an object database, and the node information of each node in the topology graph is set as a query index. Before node detection, the corresponding nodes are queried according to the node information of the source node and the destination node.
[0061] The node detection is a detection of a single or single-level node in a traversal process. The specific manner of the node detection can be depth-first traversal or breadth-first traversal. The node detection is performed with the source node and the destination node as detection starting points. The specific manner includes synchronous detection and asynchronous detection. The synchronous detection is symmetrical node detection from the source node and the destination node, that is, single or single-level node detection is first completed in one direction, and the node detection in the direction waits for completion of node detection in the other direction, and then the node detection is continued. The asynchronous detection is asymmetrical node detection from the source node and the destination node, that is, single or single-level node detection is completed in one direction, and the node detection is continued.
[0062] The preset interval is a preset comparison time period, that is, every preset interval, the first detection set and the second detection set are compared. The preset interval is greater than or equal to the node detection time of a single node, for example, the average time of completing node detection of a single node is 0.3s, that is, after 0.3s, the first detection set and the second detection set each add a node that has performed node detection, and then comparison is performed. This avoids repeated and invalid comparison and fully utilizes the configuration resources of the routing.
[0063] The first detection set is a node set recording all nodes that have performed node detection with the source node as a detection starting point, for example, as shown in Figure 1 The node 1 is the source node, the node 1 is taken as the detection starting point, and node detection of all nodes in Figure 1 The first detection set obtained is {(node 1, node 2, node 6) (node 1, node 3, node 5) (node 1, node 6)}.
[0064] The second detection set is a node set recording all nodes that have performed node detection with the destination node as a detection starting point, for example, as shown in Figure 1 The node 6 is the destination node, the node 6 is taken as the detection starting point, and node detection of all nodes in Figure 1 The second detection set obtained is {(node 6, node 2, node 1, node 4) (node 6, node 2, node 1, node 3, node 5)}.
[0065] According to the node information of the source node and the destination node, node detection is performed in the pre-established topology graph with the source node and the destination node as the detection starting points, and the specific manner is as follows: according to the node information of the source node and the destination node, node detection is performed in the pre-established topology graph with the source node and the destination node as the detection starting points, and a double thread is called for node detection.
[0066] The first detection set and the second detection set obtained by comparison detection are compared at a preset interval, and the specific manner is as follows: the nodes that have completed node detection are recorded in the first detection set and the second detection set, and the first detection set and the second detection set are compared at a preset interval.
[0067] Exemplarily, according to the node information "P1011 (A organization)" of the source node and the node information "P1037 (B organization)" of the destination node, in the pre-established topology graph (inter-organization relationship topology graph), the source node P1011 is taken as the starting point of detection, the first thread Thread_1 is called to perform node detection, the destination node P1037 is taken as the starting point of detection, the second thread Thread_2 is called to perform node detection. The nodes P1012, P1013, P1014 that have completed node detection on the first thread are recorded into the first detection set {(P1011, P1012) (P1011, P1013) (P1011, P1014)}, the nodes P1036, P1035 that have completed node detection on the second thread are recorded into the second detection set {(P1037, P1036) (P1037, P1035)}, and the first detection set and the second detection set are compared at a preset interval.
[0068] According to the node information of the source node and the destination node, in the pre-established topology graph, the source node and the destination node are respectively taken as the starting points of detection to perform node detection, and the first detection set and the second detection set obtained by detection are compared at a preset interval. The node detection is started from the source node and the destination node in parallel to obtain the first detection set and the second detection set, which avoids one-way node detection starting from the source node and improves the efficiency of node detection.
[0069] Step 206: In the case that the first detection set and the second detection set have an intersection, the target path between the source node and the destination node is determined according to the current first detection set and the second detection set.
[0070] The intersection is the same node recorded in the first detection set and the second detection set, which can be one or multiple, and is related to the node detection mode and is not limited here.
[0071] The target path is a path composed of multiple intermediate nodes between the source node and the destination node, and adjacent nodes have an association relationship, which corresponds to an edge in the topology graph. For example, as shown in FIG. 6, the source node is node 5 and the destination node is node 6, and the target path between the two is (node 5, node 3, node 1, node 2, node 6). Figure 1
[0072] According to the current first detection set and the second detection set, the target path between the source node and the destination node is determined, and the specific mode is as follows: a reference path including the intersection in the first detection set and the second detection set is determined, and the target path between the source node and the destination node is determined according to the reference path.
[0073] Exemplarily, the first probe set {(P1011, P1012,..., P1020), (P1011, P1013,..., P1024), (P1011, P1014,..., P1028)}, the second probe set {(P1037, P1036,..., 1028), (P1037, P1035,..., P1028, 1027)}, the intersection is {P1027, P1028}, the reference paths are determined as (P1011, P1014,..., P1028), (P1037, P1036,..., 1028) and (P1037, P1035,..., P1028, 1027), and the target paths between the source node and the destination node are (P1011, P1014,..., P1028,..., P1036, P1037) and (P1011, P1014,..., P1027, P1028,..., P1035, P1037) according to the reference paths.
[0074] In the embodiment, the routing request is acquired, wherein the routing request carries node information of the source node and the destination node, node detection is performed with the source node and the destination node as the detection starting points in the pre-established topology graph according to the node information of the source node and the destination node, and the first probe set and the second probe set obtained by detection are compared at a preset interval. In a case where there is an intersection between the first probe set and the second probe set, the target path between the source node and the destination node is determined according to the current first probe set and the second probe set. The node detection is performed from the source node and the destination node in parallel to obtain the first probe set and the second probe set, and the target path can be determined in a case where there is an intersection, which avoids unidirectional node detection from the source node and the target path can be obtained only after the destination node is detected, and improves the efficiency of detecting the target path.
[0075] Optionally, before step 204, the method further includes the following specific steps:
[0076] The topology graph is constructed, wherein each node in the topology graph carries a node number and a group number, and the initial group number of each node is the same as the node number;
[0077] The group number of the first node is updated based on the current group number of the first node and the current group number of each first neighbor node, wherein the first node is any node in the topology graph, and the first neighbor node is a neighbor node of the first node;
[0078] Correspondingly, the node detection is performed with the source node and the destination node as the detection starting points in the pre-established topology graph according to the node information of the source node and the destination node in step 204, including the following specific steps:
[0079] According to the node information of the source node and the destination node, a group number of the source node and the destination node is obtained in a pre-established topology graph;
[0080] In a case where the group numbers of the source node and the destination node are the same, node detection is performed with the source node and the destination node as a detection starting point respectively.
[0081] The node number is a unique number of each node in the topology graph, and the node number is not modifiable.
[0082] The group number is a number of a topology subgraph of each node in the topology graph, and the group number is modifiable. The topology subgraph is a topology graph composed of grouped nodes between any two nodes. If the group numbers of two nodes in the topology graph are consistent, it indicates that there is a path between the two nodes, i.e., the two nodes belong to the same topology subgraph.
[0083] The topology graph is constructed, and the specific manner is as follows: a plurality of nodes and a plurality of associated relationships between the nodes are obtained, the associated relationships between the plurality of nodes are determined as edges between the nodes, the topology graph is constructed according to the nodes and the edges, and a node number and an initial group number same as the node number are set for each node.
[0084] Figure 3 A topology graph structure diagram provided by an embodiment of the present application is shown. As shown in Figure 3 The topology graph includes two topology subgraphs, a topology subgraph Figure 1 includes node 1, node 2, node 3 and node 4, and a topology subgraph Figure 2 includes node 5 and node 6. Table 1 shows a record table of a node number, an initial group number and adjacent nodes corresponding to Figure 3 .
[0085] Table 1 Node number, initial group number and adjacent node record table
[0086] Node Initial group number Node number Adjacent node Node 1 V1 X1 X2, X3 Node 2 V2 X2 X1, X4 Node 3 V3 X3 X1 Node 4 V4 X4 X2 Node 5 V5 X5 X6 Node 6 V6 X6 X5
[0087] Optionally, the group number of the first node is updated based on the current group number of the first node and the current group numbers of the first neighbor nodes, and the updating includes the following specific steps:
[0088] A destination group number meeting a preset updating condition is determined from the current group number of the first node and the current group numbers of the first neighbor nodes;
[0089] The current group number of the first node is updated to the destination group number, and the step of determining the destination group number meeting the preset updating condition from the current group number of the first node and the current group numbers of the first neighbor nodes is returned to be executed until the group numbers of the nodes in the topology graph no longer change.
[0090] The preset update condition is an update condition preset according to the number size of the group number, and the group number of the first node is updated to the destination group number when the preset update condition is met. The destination group number meeting the preset update condition can be the smallest group number among the current group number of the first node and the current group numbers of the first neighbor nodes, or the largest group number among the current group number of the first node and the current group numbers of the first neighbor nodes. The embodiment of the application takes the smallest group number as the destination group number.
[0091] For example, node 1 (X1) in Table 1 is determined as the first node, the neighbor nodes of the first node are node 2 (X2) and node 3 (X3), the smallest group number among the three is the group number of node 1 (V1), V1 is determined as the destination group number, and the group number of the first node is determined as the destination group number V1. Similarly, the above operation is performed on node 2, node 3, node 4, node 5 and node 6. After the first update, the group number of node 2 is V1, the group number of node 3 is V1, the group number of node 4 is V2, the group number of node 5 is V5, and the group number of node 6 is V6, as shown in Table 2. Table 2 shows a record table of node numbers, first updated group numbers and neighbor nodes corresponding to Figure 3 .
[0092] Table 2 shows a record table of node numbers, first updated group numbers and neighbor nodes
[0093] Returning to the step of determining the destination group number meeting the preset update condition from the current group number of the first node and the current group numbers of the first neighbor nodes, for node 4 (X4) and the neighbor node of node 4 (X4), node 2 (X2), the smallest group number (V1) among the group number (V2) of node 4 and the group number (V1) of node 2 is determined as the destination group number, and the group number of node 4 is updated to the destination group number (V1), as shown in Table 3. Table 3 shows a record table of node numbers, second updated group numbers and neighbor nodes corresponding to Figure 3 .
[0094] Table 3 shows a record table of node numbers, second updated group numbers and neighbor nodes
[0095]
[0096]
[0097] In the case that the group numbers of the source node and the destination node are the same, it is indicated that the source node and the destination node belong to the same topological subgraph, for example, the source node is node 1 in Figure 3 , and the destination node isFigure 3 The path of (node 1, node 2, node 4) exists in the case that the group numbers of node 4 in the two paths are the same.
[0098] Optionally, in the case that the group numbers of the source node and the destination node are the same, before the node detection starting from the source node and the destination node respectively, the method further comprises the following specific steps:
[0099] The first route searching feedback is sent to the terminal.
[0100] The first route searching feedback is information feedback indicating that the target path exists between the source node and the destination node.
[0101] Exemplarily, the first route searching feedback ReplyRoute_1{“P1011 and P1037 exist target path”} is sent to the terminal.
[0102] Based on the current group number of the first node and the current group numbers of the first neighbor nodes, the group number of the first node is updated, which lays a data foundation for subsequent node detection starting from the source node and the destination node as the detection nodes in the topology graph, and improves the efficiency and accuracy of the node detection. In the case that the group numbers of the source node and the destination node are the same, the node detection starting from the source node and the destination node respectively ensures the effectiveness and accuracy of the node detection.
[0103] From the current group number of the first node and the current group numbers of the first neighbor nodes, the destination group number meeting the preset updating condition is determined, and the current group number of the first node is updated to the destination group number. The step of determining the destination group number meeting the preset updating condition from the current group number of the first node and the current group numbers of the first neighbor nodes is returned to be executed until the group numbers of the nodes in the topology graph no longer change. The group number can more accurately represent that the target path exists between the source node and the destination node, and the effectiveness and accuracy of the node detection are ensured.
[0104] Optionally, after the group numbers of the source node and the destination node are obtained in the topology graph established in advance according to the node information of the source node and the destination node, the method further comprises the following specific steps:
[0105] In the case that the group numbers of the source node and the destination node are different, it is determined that the target path does not exist between the source node and the destination node.
[0106] At present, after the source node and the destination node are determined, the node detection needs to be performed starting from the source node. When the node detection continues without the association relationship of the nodes, the destination node is still not detected, and it is determined that the target path does not exist between the source node and the destination node.
[0107] However, such a routing method needs to complete node detection of all nodes in the topology graph to determine that there is no target path between the source node and the destination node, a large number of invalid routing is performed, the effectiveness and accuracy of node detection cannot be guaranteed, the efficiency of node detection is reduced, and resource consumption of routing is increased.
[0108] Exemplarily, the source node is node 1 in Table 1, and the destination node is node 6 in Table 1. Figure 3 Figure 3 According to Table 3, the group number of node 1 is V1, and the group number of node 6 is V5, which are different, indicating that node 1 and node 6 do not belong to the same topology subgraph, and there is no path between them.
[0109] Optionally, after determining that there is no target path between the source node and the destination node, the method further includes the following specific steps:
[0110] The second routing feedback is sent to the terminal.
[0111] The second routing feedback is information feedback indicating that there is no target path between the source node and the destination node.
[0112] Exemplarily, the second routing feedback ReplyRoute_2 {“P1011 and P1037 do not have a target path”} is sent to the terminal.
[0113] In the case where the group numbers of the source node and the destination node are different, it is determined that there is no target path between the source node and the destination node. By comparing the group numbers of the source node and the destination node in advance, in the case where the group numbers are different, invalid routing is avoided, the effectiveness and accuracy of node detection are guaranteed, the efficiency of node detection is improved, and resource consumption of routing is reduced.
[0114] Optionally, in step 204, according to the node information of the source node and the destination node, node detection is performed in the pre-established topology graph with the source node and the destination node as the detection starting points, including the following specific steps:
[0115] According to the node information of the source node and the destination node, the source node and the destination node are determined in the pre-established topology graph;
[0116] According to the association relationship between the nodes in the topology graph, node detection is performed with the source node and the destination node as the detection starting points;
[0117] According to the detection order, nodes that have been detected with the source node as the detection starting point are added to the first detection set, and nodes that have been detected with the destination node as the detection starting point are added to the second detection set.
[0118] According to the association relationship between the nodes in the topology graph, node detection is performed with the source node and the destination node as the detection starting points, and the node detection is performed layer by layer.
[0119] The first detection set and the second detection set each include a plurality of arrays, and each array includes the detected nodes recorded in the detection order from the detection starting point. Figure 1 For the example of FIG. 1, the node 1 is the source node, and the node 1 is the detection starting point. The first detection set including three arrays obtained by recording the detected nodes in the detection order is {(node 1, node 2, node 6), (node 1, node 3, node 5), (node 1, node 6)}.
[0120] The detection order is the order of detection layer by layer from the detection starting point.
[0121] Exemplarily, according to the node information “P1011 (A organization)” of the source node and the node information “P1037 (B organization)” of the destination node, the source node P1011 and the destination node P1037 are determined in the pre-established topology graph (inter-organizational relationship topology graph). With the source node P1011 as the detection starting point, the first detection set obtained after the first level is detected is {(P1011, P1012), (P1011, P1013), (P1011, P1014)}; with the destination node P1037 as the detection starting point, the second detection set obtained after the first level is detected is {(P1037, P1036), (P1037, P1035)}. After the second level is detected, the first detection set is {(P1011, P1012, P1015), (P1011, P1013, P1016), (P1011, P1014, P1017)}, and the second detection set is {(P1037, P1036, P1033), (P1037, P1035, P1034)}.
[0122] According to the node information of the source node and the destination node, the source node and the destination node are determined in the pre-established topology graph. According to the association relationship between the nodes in the topology graph, node detection is performed with the source node and the destination node as the detection starting points. The detected nodes with the source node as the detection starting point are added to the first detection set in the detection order, and the detected nodes with the destination node as the detection starting point are added to the second detection set. The node detection according to the association relationship ensures the accuracy of the node detection. The detected nodes are added to the first detection set and the second detection set in the detection order, which ensures the accuracy of the target path determined subsequently.
[0123] Optionally, in step 204, according to the node information of the source node and the destination node, node detection is performed in the pre-established topology graph with the source node and the destination node as the detection starting points, respectively, including the following specific steps:
[0124] According to the node information of the source node and the destination node, node detection is performed in the pre-established topology graph with the source node and the destination node as the detection starting points, respectively, and synchronously.
[0125] Correspondingly, in step 206, the following specific steps are included:
[0126] In the case that the first detection set and the second detection set have an intersection, the intersection node in the intersection is obtained.
[0127] According to the first detection set, the first path from the source node to the intersection node is determined, and according to the second detection set, the second path from the intersection node to the destination node is determined.
[0128] The first path and the second path are fused to obtain the target path between the source node and the destination node.
[0129] The intersection node is a node that is contained in both the first detection set and the second detection set.
[0130] The fusion processing is a processing of taking the union of the nodes of the first path and the second path and eliminating the repeated intersection nodes.
[0131] The node detection is performed synchronously with the source node and the destination node as the detection starting points, and the specific manner is as follows: after the node detection of the symmetrical levels in both directions is completed, the node detection of the next level is performed with the source node and the destination node as the detection starting points, respectively.
[0132] Exemplarily, in the topology graph, for the node detection direction of the source node, there are at least 6 levels, which are level 1, level 2, level 3, level 4, level 5, and level 6, and for the node detection direction of the destination node, there are also 6 levels, which are level 6, level 5, level 4, level 3, level 2, and level 1. After the node detection of level 1 in the node detection direction of the source node is completed, it is confirmed that the node detection of level 6 in the node detection direction of the destination node is also completed. The node detection of level 2 in the node detection direction of the source node is performed, and the node detection of level 5 in the node detection direction of the destination node is performed.
[0133] According to the first probe set, a first path from the source node to the intersection node is determined, and according to the second probe set, a second path from the intersection node to the destination node is determined. Specifically, the nodes containing the intersection node are determined as the first path according to the nodes recorded in the first probe set in the probe order, and the nodes containing the intersection node are determined as the second path according to the nodes recorded in the second probe set in the probe order.
[0134] The first path and the second path are fused to obtain a target path between the source node and the destination node. Specifically, the intersection nodes that are repeated in the first path and the second path are removed, and a union set is taken to obtain the target path between the source node and the destination node.
[0135] Exemplarily, according to the nodes recorded in the first probe set {(P1011, P1012…P1020) (P1011, P1013…P1024) (P1011, P1014…P1028)} in the probe order, the nodes (P1011, P1014…P1028) containing the intersection nodes {P1027, P1028} are determined as the first path; according to the nodes recorded in the second probe set {(P1037, P1036…1028) (P1037, P1035…P1028, 1027)} in the probe order, the nodes (P1037, P1036…1028) (P1037, P1035…P1028, 1027) containing the intersection nodes {P1027, P1028} are determined as the second path. The intersection nodes that are repeated in the first path and the second path are removed, and a union set (P1011, P1014…P1028)∪(P1037, P1036…), (P1011, P1014…)∪(P1011, P1014…P1028) (P1037, P1035…P1028, 1027) is taken to obtain the target path (P1011, P1014…P1028…P1036, P1037) and (P1011, P1014…P1027, P1028…P1035, P1037) between the source node and the destination node.
[0136] According to the node information of the source node and the destination node, node detection is synchronously performed in a pre-established topology graph with the source node and the destination node as the probe starting points. In the case that the first probe set and the second probe set have an intersection, the intersection nodes in the intersection are obtained. According to the first probe set, a first path from the source node to the intersection node is determined, and according to the second probe set, a second path from the intersection node to the destination node is determined. The first path and the second path are fused to obtain a target path between the source node and the destination node. The accuracy of path finding is ensured, and the efficiency of path finding is further improved.
[0137] Optionally, the number of intersection nodes is one;
[0138] Correspondingly, according to the first probe set, a first path from the source node to the intersection node is determined, and according to the second probe set, a second path from the intersection node to the destination node is determined, including the following specific steps:
[0139] Each second node between the source node and the intersection node is determined from the first probe set, and a first path composed of the source node, each second node and the intersection node is determined;
[0140] Each third node between the destination node and the intersection node is determined from the second probe set, and a second path composed of the intersection node, each third node and the destination node is determined;
[0141] Correspondingly, the first path and the second path are fused to obtain a target path between the source node and the destination node, including the following specific steps:
[0142] The first path and the second path are spliced to obtain a target path between the source node and the destination node.
[0143] The second node is an intermediate node between the source node and the intersection node which has been detected by node detection with the source node as the detection starting point.
[0144] The third node is an intermediate node between the destination node and the intersection node which has been detected by node detection with the destination node as the detection starting point.
[0145] Exemplarily, the first probe set is {(P1011, P1012……, P1019, P1020)(P1011, P1013……P1023, P1024)(P1011, P1014……P1027, P1028)}, the intersection node is P1028, the second node is {P1014……P1027}, and a first path (P1011, P1014……P1027, P1028) composed of the source node, each second node and the intersection node is determined; the second probe set is {(P1037, P1035……P1030, P1028)}, the intersection node is P1028, the third node is {P1035……1030}, and a second path (P1037, P1035……1030, P1028) composed of the destination node, each third node and the intersection node is determined. The first path (P1011, P1014……P1027, P1028) and the second path (P1037, P1035……1030, P1028) are spliced to obtain a target path (P1011, P1014……P1027, P1028, P1030……P1035, P1037) between the source node and the destination node.
[0146] When the number of intersection nodes is one, each second node between the source node and the intersection node is determined from the first probe set, a first path composed of the source node, each second node and the intersection node is determined, each third node between the intersection node and the destination node is determined from the second probe set, a second path composed of the intersection node, each third node and the destination node is determined, the first path and the second path are spliced to obtain a target path between the source node and the destination node. The first path and the second path are determined through each second node and each third node respectively, and the target path is obtained by splicing, which improves the efficiency and accuracy of path finding.
[0147] Optionally, the number of intersection nodes is multiple;
[0148] Correspondingly, according to the first probe set, a first path from the source node to the intersection node is determined, and according to the second probe set, a second path from the intersection node to the destination node is determined, including the following specific steps:
[0149] A specified intersection node in the intersection nodes is determined;
[0150] Each fourth node between the source node and the specified intersection node is determined from the first probe set, and a first path composed of the source node, each fourth node and the specified intersection node is determined;
[0151] Each fifth node between the destination node and the specified intersection node is determined from the second probe set, and a second path composed of the specified intersection node, each fifth node and the destination node is determined;
[0152] Correspondingly, the first path and the second path are fused to obtain a target path between the source node and the destination node, including the following specific steps:
[0153] The first path and the second path are spliced to obtain a target path between the source node and the destination node.
[0154] The specified intersection node is any one of the intersection nodes. For example, when the intersection nodes are {node 8, node 9, node 10}, node 8 can be determined as the specified intersection node, node 9 can be determined as the specified intersection node, and node 10 can be determined as the specified intersection node. By determining the specified intersection node, it is ensured that the subsequent determination of the first path and the second path will not miss or repeat due to multiple intersection nodes, resulting in node repetition or node omission in the subsequent spliced target path.
[0155] The fourth node is an intermediate node between the source node and the specified intersection node which has been detected by node detection with the source node as the detection starting point.
[0156] The fifth node is an intermediate node between the destination node and the specified intersection node which has been detected by node detection with the destination node as the detection starting point.
[0157] Exemplarily, the intersection nodes are {P1027, P1028}, it is determined that the designated intersection node is P1028, the first detection set is {(P1011, P1012, …, P1019, P1020), (P1011, P1013, …, P1023, P1024), (P1011, P1014, …, P1027, P1028)}, it is determined that the fourth nodes are {P1014, …, P1027}, and it is determined that the first path is composed of the source node, the fourth nodes, and the designated intersection node (P1011, P1014, …, P1027, P1028); the second detection set is {(P1037, P1035, …, P1030, P1028)}, the fifth nodes are {P1035, …, 1030}, and it is determined that the second path is composed of the destination node, the fifth nodes, and the designated intersection node (P1037, P1035, …, 1030, P1028). The first path (P1011, P1014, …, P1027, P1028) and the second path (P1037, P1035, …, 1030, P1028) are spliced to obtain the target path (P1011, P1014, …, P1027, P1028, P1030, …, P1035, P1037) between the source node and the destination node.
[0158] When the number of intersection nodes is multiple, a designated intersection node in the intersection nodes is determined.
[0159] The fourth nodes between the source node and the designated intersection node are determined from the first detection set, the first path is determined to be composed of the source node, the fourth nodes, and the designated intersection node, the fifth nodes between the destination node and the designated intersection node are determined from the second detection set, the second path is determined to be composed of the designated intersection node, the fifth nodes, and the destination node, and the first path and the second path are spliced to obtain the target path between the source node and the destination node. By determining the designated intersection node, node repetition or node omission in the subsequent spliced target path is avoided, and the accuracy of path finding is improved. The first path and the second path are respectively determined through the fourth nodes and the fifth nodes, and the target path is obtained by splicing, so that the efficiency and accuracy of path finding are improved.
[0160] Optionally, after step 206, the method further includes the following specific steps:
[0161] The third path finding feedback is sent to the terminal.
[0162] The third path finding feedback is information feedback containing the target path between the source node and the destination node.
[0163] Exemplarily, a third route searching feedback ReplyRoute_3{“the target path between P1011 and P1037 is (P1011, P1014……P1027, P1028, P1030……P1035, P1037)”} is sent to the terminal.
[0164] Figure 4 A flow chart of a correlation identification method provided by an embodiment of the present application is shown, and specifically includes the following steps:
[0165] In step 402, a correlation identification request is acquired, wherein the correlation identification request carries object information of a source object and a target object.
[0166] The correlation identification request is an instruction for determining whether there is a correlation between the source object and the target object in a request sent by a terminal.
[0167] The source object is any one of two physical objects requested to be identified by the terminal, and can be a network node, an organization, an individual, etc. The target object is the other one of the two physical objects requested to be identified by the terminal except the source object, and can be a network node, an organization, an individual, etc.
[0168] The object information is relevant identification information corresponding to the source object and the target object. For example, for a network node, the object information can be network address information (00-01-6C-06-A6-29; 192.168.2.32; 255.255.255.0) and node location information: M city. For an organization, the object information can be organization code, personnel structure of the organization, business direction of the organization, location information of the organization, etc. For an individual, the object information can be an ID number, personal work information, personal education information, personal asset information, personal activity information, and personal residence information, etc.
[0169] Exemplarily, a user sends a correlation identification request RelationRequest{object information of the source object: XXXX (C personal ID number); object information of the target object: YYYY (D personal ID number)} through a terminal.
[0170] By acquiring the correlation identification request carrying the object information of the source object and the target object, an information basis is provided for subsequent accurate positioning of the source object and the target object in a topology graph.
[0171] In step 404, a source node corresponding to the source object and a target node corresponding to the target object are determined from a pre-established relationship topology graph according to the object information of the source object and the target object.
[0172] The relationship topology graph in the embodiment of the present application is an undirected topology graph, i.e., the edges between nodes do not have a direction.
[0173] The pre-established relationship topology graph is stored in an object database, object information corresponding to each node in the relationship topology graph is set as a query index, and before node detection, the source node and the destination node corresponding to the source object and the destination object are queried according to the object information of the source object and the destination object.
[0174] For example, according to the object information of the source object: XXXX (C personal identity card number) and the object information of the destination object: YYYY (D personal identity card number), the corresponding source node: node 1 and the destination node: node 4 in the relationship topology graph are determined.
[0175] According to the object information of the source object and the destination object, the corresponding source node and the destination node are determined from the pre-established relationship topology graph, which lays a foundation for subsequent node detection.
[0176] Step 406: In the relationship topology graph, the source node and the destination node are respectively taken as the starting points of detection for node detection, and the first detection set and the second detection set obtained by detection are compared at a preset interval.
[0177] Step 408: If the first detection set and the second detection set have an intersection, it is determined that the source object and the destination object have an association.
[0178] The specific implementation modes of steps 406 and 408 have been described in detail in the above Figure 2 Embodiments, and will not be described here.
[0179] In the embodiments of the application, an association identification request is obtained, wherein the association identification request carries object information of a source object and a destination object, a source node corresponding to the source object and a destination node corresponding to the destination object are determined from a pre-established relationship topology graph according to the object information of the source object and the destination object, node detection is performed in the topology graph respectively starting from the source node and the destination node as the starting points of detection, and the first detection set and the second detection set obtained by detection are compared at a preset interval. If the first detection set and the second detection set have an intersection, it is determined that the source object and the destination object have an association. According to the source object and the destination object, the source node and the destination node in the relationship topology graph are determined, and then node detection is performed from the source node and the destination node in parallel. In the case where there is an intersection, it is determined that there is an association, which avoids one-way node detection starting from the source node and only recognizes the association after the destination node is detected, thereby improving the efficiency of recognizing the association.
[0180] Optionally, after step 408, the following specific steps are further included:
[0181] According to the current first detection set and the second detection set, a target path between the source node and the destination node is determined.
[0182] According to the target path, the association information between the source object and the destination object is determined.
[0183] The specific implementation manner of determining the target path between the source node and the destination node according to the current first probe set and the second probe set has been described in detail in the above Figure 2 embodiments, and will not be described here again.
[0184] The association information is information composed of objects and object information corresponding to each node on the target path.
[0185] Exemplarily, the target path is (node 1, node 2, node 4), the object corresponding to node 1 is C person, the object information of the source object is XXXX (C personal ID number), the object corresponding to node 2 is F person, the object information is ZZZZ (F personal ID number), the destination object corresponding to node 4 is D person, and the object information of the destination object is YYYY (D personal ID number). The association information is {(C person, XXXX)-(F person, ZZZZ)-(D person, YYYY)}.
[0186] According to the target path, the association information between the source object and the destination object is determined.
[0187] The following will be described in detail with reference to the accompanying Figure 5 The path finding method provided in the present application is applied to the company equity change as an example, and the path finding method is further described. Among them, Figure 5 a processing flowchart of a path finding method applied to company equity change provided by an embodiment of the present application is shown, and specifically includes the following steps:
[0188] Step 502: Obtain company, equity owner and equity change data;
[0189] Step 504: Determine the company and the equity owner as nodes, and the equity change data as edges, and construct a topology graph;
[0190] Each node in the topology graph carries a node number and a group number, and the initial group number of each node is the same as the node number.
[0191] Step 506: Determine the minimum group number from the current group number of the first node and the current group number of each first neighbor node as the destination group number;
[0192] The first node is any node in the topology graph, and the first neighbor node is a neighbor node of the first node.
[0193] Step 508: updating the current group number of the first node to the target group number, and returning to the step of determining the target group number from the current group number of the first node and the current group numbers of the first neighbor nodes until the group numbers of the nodes in the topology graph no longer change;
[0194] Step 510: determining the source node corresponding to the source object and the target node corresponding to the target object in the topology graph according to the object information of the source object and the target object;
[0195] The source node is a historical holding enterprise or a historical holding individual requiring to query the change of the stock right, and the target node is a current holding enterprise or a current holding individual requiring to query the change of the stock right.
[0196] Step 512: in the case that the group numbers of the source node and the target node are the same, calling two threads to perform node detection with the source node and the target node as the detection starting points, respectively;
[0197] Step 514: in the case that the group numbers of the source node and the target node are different, determining that there is no stock right change path between the source node and the target node;
[0198] Step 516: adding the nodes that have been detected with the source node as the detection starting point in the first detection set and the nodes that have been detected with the target node as the detection starting point in the second detection set according to the detection order;
[0199] Step 518: if the first detection set and the second detection set have an intersection, obtaining the intersection nodes in the intersection;
[0200] Step 520: determining a first path from the source node to the intersection node according to the first detection set, and determining a second path from the intersection node to the target node according to the second detection set;
[0201] Step 522: performing fusion processing on the first path and the second path to obtain a target path between the source node and the target node;
[0202] Step 524: determining a stock right change path between the source object and the target object according to the target path.
[0203] In the embodiment of the application, the topology graph is numbered in advance. When the group numbers of the source node and the destination node are different, it is quickly determined that there is no stock right change path, and invalid path searching is avoided. The effectiveness and accuracy of path searching are ensured, the efficiency of path searching is improved, and the resource consumption of path searching is reduced. If the node numbers of the source node and the destination node are the same, that is, there is a stock right change path, two threads are used to search paths from the source node and the destination node respectively, and the intersection of the first detection set and the second detection set is obtained. If there is an intersection, the first path and the second path are fused to obtain the target path between the source node and the destination node. The accuracy of path searching is ensured, and the efficiency of path searching is further improved. According to the target path, the stock right change path between the source object and the destination object is determined, and the efficiency and accuracy of determining the stock right change path are improved.
[0204] Corresponding to the above-mentioned path searching method embodiment, the application also provides a path searching device embodiment, Figure 6 The structure of a path searching device provided by an embodiment of the application is shown. As shown in the figure, Figure 6 The device comprises:
[0205] The first acquisition module 602 is configured to acquire a path searching request, wherein the path searching request carries node information of a source node and a destination node;
[0206] The first node detection module 604 is configured to perform node detection in a pre-established topology graph with the source node and the destination node as the detection starting points according to the node information of the source node and the destination node, and compare the first detection set and the second detection set obtained by detection at a preset interval.
[0207] The first determination module 606 is configured to determine a target path between the source node and the destination node according to the current first detection set and the second detection set when the first detection set and the second detection set have an intersection.
[0208] Optionally, the device further comprises:
[0209] The group number determination module is configured to construct a topology graph, wherein each node in the topology graph carries a node number and a group number, and the initial group number of each node is the same as the node number. The group number of the first node is updated based on the current group number of the first node and the current group numbers of the first neighbor nodes, wherein the first node is any node in the topology graph, and the first neighbor node is a neighbor node of the first node.
[0210] Correspondingly, the first node detection module 604 is further configured to:
[0211] According to the node information of the source node and the destination node, the source node and the destination node are determined in the pre-established topology graph, and node detection is performed with the source node and the destination node as the detection starting points respectively.
[0212] Optionally, the group number determination module is further configured to:
[0213] The destination group number meeting the preset update condition is determined from the current group number of the first node and the current group numbers of the first neighbor nodes, the current group number of the first node is updated to the destination group number, and the step of determining the destination group number meeting the preset update condition from the current group number of the first node and the current group numbers of the first neighbor nodes is returned until the group numbers of the nodes in the topology graph no longer change.
[0214] Optionally, the apparatus further comprises:
[0215] The third determination module is configured to determine that the target path does not exist between the source node and the destination node in the case where the group numbers of the source node and the destination node are different.
[0216] Optionally, the first node detection module 604 is further configured to:
[0217] According to the node information of the source node and the destination node, the source node and the destination node are determined in the pre-established topology graph, and node detection is performed with the source node and the destination node as the detection starting points respectively.
[0218] Optionally, the first node detection module 604 is further configured to:
[0219] According to the node information of the source node and the destination node, the source node and the destination node are determined in the pre-established topology graph, and node detection is performed with the source node and the destination node as the detection starting points respectively.
[0220] Correspondingly, the first node detection module 604 is further configured to:
[0221] In the case where the first detection set and the second detection set have an intersection, an intersection node in the intersection is obtained, a first path from the source node to the intersection node is determined according to the first detection set, a second path from the intersection node to the destination node is determined according to the second detection set, the first path and the second path are fused to obtain a target path between the source node and the destination node.
[0222] Optionally, the number of intersection nodes is one.
[0223] Correspondingly, the first node detection module 604 is further configured to:
[0224] determine each second node between the source node and the intersection node from the first detection set, determine a first path composed of the source node, each second node and the intersection node, determine each third node between the intersection node and the destination node from the second detection set, and determine a second path composed of the intersection node, each third node and the destination node;
[0225] Correspondingly, the first determination module 606 is further configured to:
[0226] splice the first path and the second path to obtain a target path between the source node and the destination node.
[0227] Optionally, the number of intersection nodes is a plurality.
[0228] Correspondingly, the first node detection module 604 is further configured to:
[0229] determine a specified intersection node in the intersection nodes, determine each fourth node between the source node and the specified intersection node from the first detection set, determine a first path composed of the source node, each fourth node and the specified intersection node, determine each fifth node between the destination node and the specified intersection node from the second detection set, and determine a second path composed of the specified intersection node, each fifth node and the destination node;
[0230] Correspondingly, the first determination module 606 is further configured to:
[0231] splice the first path and the second path to obtain a target path between the source node and the destination node.
[0232] In the embodiments of the application, a routing request is obtained, wherein the routing request carries node information of the source node and the destination node, node detection is performed with the source node and the destination node as detection starting points in a pre-established topology graph according to the node information of the source node and the destination node, and a first detection set and a second detection set obtained by detection are compared at a preset interval. In the case that there is an intersection between the first detection set and the second detection set, a target path between the source node and the destination node is determined according to the current first detection set and the second detection set. The node detection is performed from the source node and the destination node in parallel to obtain the first detection set and the second detection set, and in the case that there is an intersection, the target path can be determined, which avoids unidirectional node detection from the source node and obtaining of the target path only after the destination node is detected, and improves the efficiency of detecting the target path.
[0233] The above is a schematic scheme of the route searching device in the embodiment. It should be noted that the technical scheme of the route searching device and the technical scheme of the route searching method described above belong to the same concept, and the details of the technical scheme of the route searching device that are not described in detail can be referred to the description of the technical scheme of the route searching method.
[0234] Corresponding to the above-mentioned association identification method embodiment, the present application also provides an association identification device embodiment, Figure 7 A structural schematic diagram of an association identification device provided by an embodiment of the present application is shown. As shown in the figure, Figure 7 The device comprises:
[0235] The second acquisition module 702 is configured to acquire an association identification request, wherein the association identification request carries object information of a source object and a destination object;
[0236] The node determination module 704 is configured to determine a source node corresponding to the source object and a destination node corresponding to the destination object from a pre-established relationship topology graph according to the object information of the source object and the destination object;
[0237] The second node detection module 706 is configured to perform node detection with the source node and the destination node as the detection starting points in the topology graph respectively, and compare a first detection set and a second detection set obtained through detection at a preset interval;
[0238] The second determination module 708 is configured to determine that there is an association between the source object and the destination object if there is an intersection between the first detection set and the second detection set.
[0239] Optionally, the device further comprises:
[0240] The fourth determination module is configured to determine a target path between the source node and the destination node according to the current first detection set and the second detection set, and determine association information between the source object and the destination object according to the target path.
[0241] In the embodiment of the present application, the association identification request is acquired, wherein the association identification request carries object information of the source object and the destination object, the source node corresponding to the source object and the destination node corresponding to the destination object are determined from the pre-established relationship topology graph according to the object information of the source object and the destination object, the node detection is performed with the source node and the destination node as the detection starting points in the topology graph, and the first detection set and the second detection set obtained by detection are compared at a preset interval. If there is an intersection between the first detection set and the second detection set, it is determined that there is an association between the source object and the destination object. According to the source object and the destination object, the source node and the destination node in the relationship topology graph are determined, and then the node detection is performed from the source node and the destination node in parallel to obtain the first detection set and the second detection set. In the case of intersection, it is determined that there is an association, which avoids the one-way node detection from the source node and the association can be identified only after the destination node is detected, thereby improving the efficiency of identifying the association.
[0242] The above is a schematic scheme of the association identification device of the embodiment. It should be noted that the technical scheme of the association identification device belongs to the same concept as the technical scheme of the association identification method described above. The details of the technical scheme of the association identification device which are not described in detail can be referred to the description of the technical scheme of the association identification method.
[0243] Figure 8 A structural block diagram of a computing device provided by an embodiment of the present application is shown. The components of the computing device 800 include but are not limited to a memory 810 and a processor 820. The processor 820 is connected with the memory 810 through a bus 830, and a database 850 is used to save data.
[0244] The computing device 800 also includes an access device 840 that enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or combinations of these and / or other types of networks that are suitable for the communication of data intended for the computing device 800. The access device 840 can include one or more of any type of network interface (for example, a network interface card (NIC)), wired or wireless, such as an IEEE 802.11 wireless local area networks (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and / or the like.
[0245] In one embodiment of the present application, the above-described components of the computing device 800, as well as other components not shown in FIG. 8, can be connected to each other by a bus. It should be understood that Figure 8 Figure 8 The computing device structure diagram shown is merely for the purpose of example, and is not a limitation on the scope of the present application. Other components can be added or replaced as needed by those skilled in the art.
[0246] The computing device 800 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (for example, a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, and / or the like), a mobile phone (for example, a smartphone), a wearable computing device (for example, a smartwatch, smartglasses, and / or the like), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. The computing device 800 can also be a mobile or stationary server.
[0247] The processor 820 is configured to execute instructions for the routing method.
[0248] The above is a schematic scheme of the computing device of the embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the route searching method described above belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the route searching method.
[0249] An embodiment of the present application further provides a computer readable storage medium storing computer instructions, which are executed by a processor to implement the route searching method.
[0250] The above is a schematic scheme of the computer readable storage medium of the embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the route searching method described above belong to the same concept, and the details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the route searching method.
[0251] The computer instructions include computer program codes, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable medium can include any entity or device capable of carrying the computer program codes, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0252] An embodiment of the present application further provides a chip storing a computer program, which is executed by the chip to implement the steps of the route searching method.
[0253] It should be noted that, for the foregoing method embodiments, in order to facilitate description, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, some steps can be performed in other order or at the same time. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0254] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0255] The preferred embodiments of the application disclosed above are only to facilitate the explanation of the application. Alternative embodiments do not describe all the details and do not limit the application to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of the application. The application selects and describes these embodiments in order to better explain the principles and practical applications of the application, so that those skilled in the art can well understand and utilize the application. The application is limited by the claims and their full scope and equivalents.
Claims
1. A pathfinding method, characterized in that, include: Obtain a pathfinding request, wherein the pathfinding request carries node information of a source node and a destination node, the source node and the destination node are nodes in a topology graph used to represent physical objects, the topology graph includes: a topology graph constructed with nodes representing users and products and edges representing user operations on products, the operations including favorites and / or purchases and / or browsing and / or searching; Based on the node information of the source node and the destination node, in the pre-established topology graph, the source node and the destination node are respectively used as the detection starting point, and dual threads are invoked to perform node detection. The first detection set and the second detection set obtained by the detection are compared at preset intervals. If the first detection set and the second detection set have an intersection, the target path between the source node and the destination node is determined based on the current first detection set and the second detection set.
2. The method according to claim 1, characterized in that, Before performing node detection in a pre-established topology graph based on the node information of the source node and the destination node, using the source node and the destination node as detection starting points respectively, the method further includes: Construct a topology graph, wherein each node in the topology graph carries a node number and a group number, and the initial group number of each node is the same as the node number; Based on the current group number of the first node and the current group numbers of each first neighbor node, update the group number of the first node, where the first node is any node in the topology graph and the first neighbor node is the neighbor node of the first node. The step of probing nodes in a pre-established topology graph based on the node information of the source node and the destination node, using the source node and the destination node as the starting points respectively, includes: Based on the node information of the source node and the destination node, the group number of the source node and the destination node is obtained in the pre-established topology graph; If the group numbers of the source node and the destination node are the same, node detection is performed with the source node and the destination node as the detection starting points, respectively.
3. The method according to claim 2, characterized in that, The step of updating the group number of the first node based on the current group number of the first node and the current group numbers of each of the first neighbor nodes includes: Determine the target group number that meets the preset update conditions from the current group number of the first node and the current group numbers of each of the first neighbor nodes; Update the current group number of the first node to the destination group number, and return to the step of determining the destination group number that meets the preset update conditions from the current group number of the first node and the current group numbers of each first neighbor node, until the group numbers of each node in the topology graph no longer change.
4. The method according to claim 2, characterized in that, After obtaining the group numbers of the source node and the destination node in a pre-established topology graph based on the node information of the source node and the destination node, the method further includes: If the group numbers of the source node and the destination node are different, it is determined that there is no target path between the source node and the destination node.
5. The method according to claim 1, characterized in that, The step of probing nodes in a pre-established topology graph based on the node information of the source node and the destination node, using the source node and the destination node as the starting points respectively, includes: Based on the node information of the source node and the destination node, the source node and the destination node are determined in the pre-established topology graph; Based on the relationships between nodes in the topology graph, node detection is performed with the source node and the destination node as the detection starting points, respectively. According to the detection order, nodes that have been detected with the source node as the detection starting point are added to the first detection set, and nodes that have been detected with the destination node as the detection starting point are added to the second detection set.
6. The method according to any one of claims 1-5, characterized in that, The step of probing nodes in a pre-established topology graph based on the node information of the source node and the destination node, using the source node and the destination node as the starting points respectively, includes: Based on the node information of the source node and the destination node, node detection is performed synchronously in the pre-established topology graph, with the source node and the destination node as the detection starting points respectively. When the first detection set and the second detection set intersect, determining the target path between the source node and the destination node based on the current first detection set and the second detection set includes: If the first detection set and the second detection set have an intersection, obtain the intersection nodes in the intersection set; Based on the first detection set, a first path from the source node to the intersecting node is determined, and based on the second detection set, a second path from the intersecting node to the destination node is determined. The first path and the second path are fused to obtain the target path between the source node and the destination node.
7. The method according to claim 6, characterized in that, The number of intersecting nodes is one; The step of determining a first path from the source node to the intersecting node based on the first probe set, and determining a second path from the intersecting node to the destination node based on the second probe set, includes: Determine each second node between the source node and the intersecting node from the first detection set, and determine the first path composed of the source node, the second nodes, and the intersecting nodes; Determine each third node between the destination node and the intersecting node from the second detection set, and determine the second path composed of the intersecting node, the third nodes, and the destination node; The step of fusing the first path and the second path to obtain the target path between the source node and the destination node includes: By concatenating the first path and the second path, the target path between the source node and the destination node is obtained.
8. The method according to claim 6, characterized in that, The number of intersecting nodes is multiple; The step of determining a first path from the source node to the intersecting node based on the first probe set, and determining a second path from the intersecting node to the destination node based on the second probe set, includes: Determine a specific intersecting node among the intersecting nodes; Determine each fourth node between the source node and the designated intersecting node from the first detection set, and determine the first path composed of the source node, each fourth node, and the designated intersecting node; Determine each fifth node between the destination node and the designated intersecting node from the second detection set, and determine the second path composed of the designated intersecting node, the fifth nodes, and the destination node; The step of fusing the first path and the second path to obtain the target path between the source node and the destination node includes: By concatenating the first path and the second path, the target path between the source node and the destination node is obtained.
9. A method for association identification, characterized in that, include: Obtain an association identification request, wherein the association identification request carries object information of the source object and the destination object; Based on the object information of the source object and the destination object, the source node corresponding to the source object and the destination node corresponding to the destination object are determined from the pre-established relational topology graph. The source node and the destination node are nodes used to represent physical objects in the topology graph. The topology graph includes: a topology graph constructed with nodes representing users and products and edges representing user operations on products. The operations include collection and / or purchase and / or browsing and / or searching. In the topology graph, the source node and the destination node are used as the starting points for detection, and dual threads are invoked to detect nodes. The first detection set and the second detection set obtained by detection are compared at preset intervals. If the first probe set and the second probe set have an intersection, then it is determined that there is an association between the source object and the destination object.
10. The method according to claim 9, characterized in that, After determining that there is an association between the source object and the destination object if the first probe set and the second probe set have an intersection, the method further includes: Based on the current first detection set and second detection set, determine the target path between the source node and the destination node; Based on the target path, determine the association information between the source object and the destination object.
11. A pathfinding device, characterized in that, include: The first acquisition module is configured to acquire a pathfinding request, wherein the pathfinding request carries node information of a source node and a destination node. The source node and the destination node are nodes used to represent physical objects in a topology graph. The topology graph includes a topology graph constructed with nodes representing users and products and edges representing user operations on products. The operations include collection and / or purchase and / or browsing and / or searching. The first node detection module is configured to, based on the node information of the source node and the destination node, in a pre-established topology graph, call dual threads to perform node detection, taking the source node and the destination node as detection starting points respectively, and compare the first detection set and the second detection set obtained by the detection at preset intervals. The first determining module is configured to determine the target path between the source node and the destination node based on the current first and second detection sets when there is an intersection between the first detection set and the second detection set.
12. An association identification device, characterized in that, include: The second acquisition module is configured to acquire an association identification request, wherein the association identification request carries object information of the source object and the destination object; The node determination module is configured to determine the source node corresponding to the source object and the destination node corresponding to the destination object from a pre-established relational topology graph based on the object information of the source object and the destination object. The source node and the destination node are nodes used to represent physical objects in the topology graph. The topology graph includes a topology graph constructed with nodes representing users and products and edges representing user operations on products. The operations include collection and / or purchase and / or browsing and / or searching. The second node detection module is configured to, in the topology graph, use the source node and the destination node as detection starting points respectively, call dual threads to perform node detection, and compare the first detection set and the second detection set obtained by detection at preset intervals; The second determining module is configured to determine that there is an association between the source object and the destination object if there is an intersection between the first probe set and the second probe set.
13. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the pathfinding method according to any one of claims 1 to 8 or the association identification method according to any one of claims 9 and 10.
14. A computer-readable storage medium storing computer instructions, characterized in that, When executed by the processor, this instruction implements the steps of the pathfinding method according to any one of claims 1 to 8 or the association identification method according to any one of claims 9 and 10.
Citation Information
Patent Citations
Path acquisition method, access method, device and equipment
CN113300962A
Power grid graph database path searching method and device, terminal and storage medium
CN113468223A