A circuit structure fuzzy search method and device based on reinforcement learning
Through the circuit structure fuzzy search method based on reinforcement learning, the problem of low matching efficiency of circuit modules in large graph data sets in the existing technology is solved, accurate matching is achieved within a limited time, and the efficiency of circuit sorting is improved.
Patent Information
- Application Number
- CN202410970072.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-19
AI Technical Summary
The existing technology lacks an accurate and efficient fuzzy search method, and cannot complete the matching of circuit modules with the same function but local differences in structure in a large graph data set within a limited time. Especially in the process of large-scale circuit sorting, traditional algorithms The amount of calculation is too large and efficiency cannot be effectively improved.
The circuit structure fuzzy search method based on reinforcement learning is used to determine the query tree return by constructing a circuit network graph, specifying the subgraph to be searched, determining the search order of nodes and candidate node sets, constructing a query tree, sampling trajectories and training a policy network The top K largest structures are selected to select the optimal matching results.
Accurately complete the fuzzy matching of circuit modules within a limited time, which improves the efficiency of large-scale circuit sorting. It can effectively identify circuit modules with the same functions but local differences in structure, reduce the amount of calculation, and increase the number of matching recalls.
Smart Images

Figure CN118503312B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of chip reverse engineering, and in particular to a circuit structure fuzzy search method and device based on reinforcement learning. Background Art
[0002] In chip reverse engineering, large-scale circuit organization plays an important role in chip understanding and design. For flat circuit standard units and their connection relationships, the goal of circuit organization is to divide them into multiple modules and identify the functions and categories of each module. In the early stage of circuit organization, common small-scale circuit structures are searched from huge circuits. These structures can then be merged into larger modules to form a multi-level module division of the circuit. Accurate and efficient structural search can greatly improve efficiency and shorten the working hours in the early stage of circuit organization.
[0003] The existing structural search algorithms are relatively traditional and are divided into two categories: full matching and fuzzy matching. The shortcoming of the full matching algorithm is that modules with the same function can have many different variant structures, and this type of algorithm cannot recall these variants. Engineers can only generate templates of different variants one by one, which reduces the number of matching recalls and increases the overall time required for circuit sorting. Traditional fuzzy matching algorithms, such as G-Finder, can find subgraphs with similar structures by calculating the loss function and recursively expanding the structure. However, the width and depth of the recursion cause the amount of calculation to increase dramatically as the module scale increases, and it is impossible to obtain matching results within a limited time.
[0004] Therefore, the existing technology still lacks an accurate and efficient fuzzy search method that can match modules with the same functions but local differences in structure when facing large graph data sets. Summary of the invention
[0005] The present invention provides a circuit structure fuzzy search method and device based on reinforcement learning, so that circuit modules with the same functions but local differences in structure can be matched.
[0006] In a first aspect, an embodiment of the present invention provides a circuit structure fuzzy search method based on reinforcement learning, comprising:
[0007] S1. Constructing a circuit network graph D, wherein the circuit network graph D includes a network structure and node features;
[0008] S2, specifying a subgraph Q to be searched in the circuit network graph D, calculating the similarity of node pairs in the circuit network graph D and the subgraph Q, and obtaining a similarity matrix;
[0009] S3, determine the search order and search starting point of the nodes in the subgraph Q;
[0010] S4, determining a candidate node set of a search starting point in the circuit network graph D;
[0011] S5, constructing a query tree for the subgraph Q according to the candidate node set of the search starting point;
[0012] S6, sampling multiple trajectories from each query tree;
[0013] S7. Based on the sampled trajectories, a reinforcement learning algorithm is used to train the policy network to determine the top K structures with the largest query tree returns;
[0014] S8. Filter out the best top N structures from all top K structures as the matching results of subgraph Q.
[0015] Optionally, after S2, the method further includes:
[0016] The similarity between the nodes in the circuit network graph D and the nodes in the subgraph Q is calculated, and the nodes in the circuit network graph D that are not related to the subgraph Q are removed according to the calculated similarity.
[0017] Optionally, calculating the similarity between the nodes in the circuit network graph D and the nodes in the subgraph Q, and removing the nodes in the circuit network graph D that are not related to the subgraph Q according to the calculated similarity, specifically includes:
[0018] The node feature vectors in the circuit network graph D and the subgraph Q are averaged within the t-degree neighborhood, and the averaged node feature vectors are used to calculate the similarity of the node pairs in the circuit network graph D and the subgraph Q;
[0019] If the similarity of the node pair is less than a preset similarity threshold, the node in the node pair belonging to the circuit network graph D is deleted.
[0020] Optionally, the S3 specifically includes:
[0021] Based on the idea of topological order, the search order of nodes in subgraph Q is generated, and the first node in the search order is used as the search starting point.
[0022] Optionally, the S4 specifically includes:
[0023] Starting from the search starting point, for each node in the subgraph Q, use the similarity matrix to select all nodes in the circuit network graph D whose similarity with the corresponding node is greater than a preset threshold as the candidate node set of the corresponding node in the subgraph Q;
[0024] The similarity matrix is calculated using the eigenvector of the node, and the calculation formula is:
[0025] in, q feature is the node feature matrix of subgraph Q,d feature is the node feature matrix of the circuit network graph D.
[0026] Optionally, the S5 specifically includes:
[0027] S51, constructing a query table for each candidate node of the root node;
[0028] S52, starting from a query table of the root node, according to the search order in S3, select a node from the subgraph Q each time, build a query table for it, and record the node of the subgraph Q corresponding to the query table as q;
[0029] S53, constructing a query table of all neighbors of q;
[0030] S54, recursively execute S52 and S53. When q traverses all nodes in the subgraph Q, a query tree is constructed.
[0031] Optionally, the S6 includes:
[0032] Define the state space, action space, reward function, and return function for reinforcement learning;
[0033] According to the search order of nodes in the subgraph Q, the agent selects an action from the action space at each step and collects the set formed by the combination of state and action at each step as the trajectory.
[0034] Optionally, the reward function reward = - cost;
[0035] Among them, cost = missing_nodes_cost + missing_edges_cost + ivn_cost;
[0036] missing_nodes_cost represents the node loss of the search results compared to the subgraph Q, missing_edges represents the missing edge loss, and ivn_cost represents the redundant interval node loss;
[0037] Reward Function , where T is the final time; t is the sampling time; γ is the discount factor.
[0038] Optionally, the S7 includes:
[0039] After sampling multiple trajectories, the policy network is optimized with the maximum reward as the goal, and the reinforcement learning algorithm is used to complete the training of the policy network;
[0040] Subgraph matching is performed according to the search order of nodes in subgraph Q. Each time a match is made, the trained policy network outputs an action based on the current state to find the matching subgraph of subgraph Q in the circuit network graph D.
[0041] From all possible matching subgraphs, find the top K structures with the largest reward value for a query tree.
[0042] In a second aspect, an embodiment of the present invention further provides a fuzzy search device based on a circuit structure of reinforcement learning, comprising:
[0043] A circuit network graph D construction module, used to construct a circuit network graph D, wherein the circuit network graph D includes a network structure and node features;
[0044] A subgraph Q specifying module, used for specifying a subgraph Q to be searched in the circuit network graph D;
[0045] A search order and search starting point determination module, used to determine the search order and search starting point of nodes in the subgraph Q;
[0046] A candidate node set determination module, used to determine a candidate node set of a search starting point in the circuit network graph D;
[0047] A query tree construction module, used to construct a query tree for the subgraph Q according to the candidate node set of the search starting point;
[0048] A trajectory sampling module, used to sample multiple trajectories from each query tree;
[0049] The top K structure determination module is used to train the policy network using a reinforcement learning algorithm based on the sampled trajectories to determine the top K structures with the largest query tree returns;
[0050] The matching result screening module is used to screen out the best top N structures from all the top K structures as the matching results of the subgraph Q.
[0051] Beneficial effects of the present invention:
[0052] The present invention first constructs a circuit network diagram, then specifies the subgraph to be searched and determines the search order and search starting point of the nodes in the subgraph, determines the candidate node set corresponding to each node in the circuit network diagram according to the search order and the search starting point, constructs a query tree according to each candidate node in the candidate node set, then samples multiple trajectories from each query tree, and uses a reinforcement learning algorithm to train a strategy network according to the sampled trajectories to determine the top K structures with the largest return of the query tree, and then selects the best top N structures from all K structures as the matching results of the subgraph Q. Among them, the top K structures contain circuit modules with the same functions but local differences in structure. When the scale of the subgraph Q is large, the calculation amount of the traditional fuzzy matching algorithm grows in a Cartesian product manner, and the fuzzy matching cannot be completed within a limited time. The present invention uses a reinforcement learning algorithm to replace the recursive calculation in the traditional fuzzy matching algorithm, obtains experience through trajectory sampling, and gradually obtains the global optimal solution with the largest return, which can accurately complete the fuzzy matching of the circuit module within a limited time. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 A flowchart of a circuit structure fuzzy search method based on reinforcement learning provided by an embodiment of the present invention;
[0054] Figure 2 A query graph provided by an embodiment of the present invention;
[0055] Figure 3 for Figure 2 The matching subgraph corresponding to the query graph in ;
[0056] Figure 4 for Figure 2 Another matching subgraph corresponding to the query graph in . DETAILED DESCRIPTION
[0057] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings. Example
[0058] Figure 1 A flowchart of a circuit structure fuzzy search method based on reinforcement learning provided by an embodiment of the present invention includes the following steps:
[0059] S1. Construct a circuit network graph D, wherein the circuit network graph D includes a network structure and node features.
[0060] The circuit network graph D in this embodiment is an undirected graph, D=(V, E).
[0061] Among them, V and E represent the network structure of the circuit network graph D, V is the node set composed of standard units, and E is the edge between standard units.
[0062] Node features can use the category information of standard units or the embedding vector obtained by pre-training models.
[0063] S2. Specify the subgraph Q to be searched in the circuit network graph D, calculate the similarity between the node pairs in the circuit network graph D and the subgraph Q, and obtain a similarity matrix.
[0064] In which, a subgraph Q to be searched is specified in the circuit network D, and the goal is to find all matching subgraphs with similar structures to the subgraph Q in the circuit network graph D.
[0065] Specifically, if there are n q There are n nodes in the circuit network graph D. d nodes, then the similarity matrix is n q *n d The node feature matrix of subgraph Q is q feature , the node feature matrix of the circuit network graph D is d feature , then the similarity matrix of the node can be calculated using the eigenvector of the node, the formula is:
[0066] .
[0067] Furthermore, after S2, the circuit network graph D is pruned to remove the parts that are irrelevant to the subgraph Q, so that the scale of the circuit network graph is reduced.
[0068] Specifically, the node feature vectors in the circuit network graph D and the subgraph Q are averaged within the t-degree neighborhood, and the averaged node feature vectors are used to calculate the similarity of the node pair, which is called smoothed similarity. If the similarity of the node pair is less than the preset similarity threshold, it is determined that the node in the node pair belonging to the circuit network graph D is irrelevant to the subgraph Q, and the irrelevant node is deleted, so that the pruned circuit network is obtained, which is still recorded as D.
[0069] S3. Determine the search order and search starting point of the nodes in the subgraph Q.
[0070] Based on the idea of topological order, the search order of nodes in the subgraph Q is generated, and the first node r_Q in the search order is used as the search starting point, where r_Q is the root node. The topological order is used for directed acyclic graphs. Since there are loops in the circuit graph, each time the next node is selected, if there is no node with an in-degree of 0, a node is randomly selected and all the in-edges of the node are deleted. In the process of generating the search order, the parent-child relationship between nodes is recorded.
[0071] S4. Determine a candidate node set for the search starting point in the circuit network graph D.
[0072] In this embodiment, all nodes whose similarity to the search starting point is greater than a preset threshold are selected from the circuit network graph D using the similarity matrix as a candidate node set for the search starting point.
[0073] S5. Construct a query tree for the subgraph Q according to the candidate node set of the search starting point.
[0074] The query tree in this embodiment is composed of multiple query tables, each query table corresponds to a node in a subgraph Q, and stores its candidate node set information in the circuit network graph D. Each candidate node in the candidate node set needs to record the source node adj, the number of nodes IVN between adj and adj, and the similarity SIM with the Q node. The query table structure of each node is as follows:
[0075]
[0076] This embodiment uses a dynamic recursive method to construct a query tree with the above structure. First, a query table is constructed for each candidate node of the root node r_Q. Taking a query table of the root node r_Q as the starting point, according to the search order in S3, a node is selected from the subgraph Q each time to build a query table for it, and the subgraph Q node corresponding to the query table is q; a query table for all neighbors of q is constructed. The above steps are performed recursively, and when q traverses all nodes in the subgraph Q, a query tree T is constructed.
[0077] S6. Sample multiple trajectories from each query tree.
[0078] In this embodiment, the state space, action space, reward function and return function of reinforcement learning are first defined. Among them, the state represents the state of the current matching subgraph, including the nodes contained in the current matching subgraph, the reward value of the current matching subgraph, the Q graph node currently being matched, etc. The action space is selectable in a given state, including all nodes in the D graph that match the current q node to be matched, that is, the candidate node set of the q node. The reward function defines the reward value obtained after performing a certain action. According to the accuracy of the match, the loss function is defined as:
[0079] cost = missing_nodes_cost + missing_edges_cost + ivn_cost
[0080] Among them, missing_nodes_cost represents the node loss of the search result compared to Q, missing_edges represents the missing edge loss, and ivn_cost represents the redundant interval node loss.
[0081] The reward function is defined as: reward = - cost;
[0082] The reward function is the discounted sum of future rewards:
[0083] ;
[0084] Among them, T is the final time; t is the sampling time; γ is the discount factor, which is used to evaluate the discounted value of the current action on the subsequent state.
[0085] According to the search order in S3, the agent selects an action from the action space at each step, that is, selects a D graph node that matches the q node in the current subgraph Q. The trajectory is a set formed by the combination of the state and action at each step, and several such trajectories are collected.
[0086] S7. Based on the sampled trajectories, a reinforcement learning algorithm is used to train the policy network to determine the top K structures with the largest query tree returns.
[0087] After collecting several trajectories, a reinforcement learning algorithm is used to train a policy network, which can output an action based on the current state, that is, output the D graph node that matches the current q node to be matched. The policy network is trained by continuously interacting with the environment and optimizing the policy network with the goal of maximizing the reward.
[0088] In this embodiment, the environment refers to a graph dataset, and the policy network selects the D graph node to be matched according to the current state and obtains a reward according to the matching result.
[0089] After the training is completed, the trained policy network is used to perform subgraph matching. Subgraph matching is performed according to the search order in step S3, and each time the policy network outputs an action based on the current state, thereby guiding the matching process of the query subgraph Q in the target graph D.
[0090] Specifically, the policy network outputs the selection of the next node to be matched based on the currently matched nodes, edges, and the state of the target graph D. Then, the selected node is matched and the state is updated. This process is repeated until a matching subgraph is found or it is determined that a matching subgraph cannot be found. Then, from all possible matching subgraphs, the top K structures with the largest reward value for a query tree are found.
[0091] S8. Filter out the best top N structures from all top K structures as the matching results of subgraph Q.
[0092] After obtaining the top K results of each query tree, the globally optimal N results can be uniformly sorted and selected. These results are the matching subgraphs with similar structures to subgraph Q found in the circuit network graph D, where the results with higher ranking are more similar to the structure of subgraph Q.
[0093] The first K structures in this embodiment may include circuit modules with the same function but partially different structures, so the circuit modules with the same function but partially different structures can be matched through the fuzzy search method of the circuit structure.
[0094] Based on the above embodiment, when the query graph is as follows Figure 2 When using the fuzzy search method proposed by the present invention, it is possible to search for Figure 3 and Figure 4 In the graph structure. Figure 3 In the example, the matching node of query graph node u3 is v3, but there is no edge between v3 and the matching node v2 of query graph node u2, nor between v3 and the matching node v4 of query graph node u4, that is, Figure 3 for Figure 2 Incomplete matching subgraphs. Figure 4 In the query graph, the matching node of query graph node u3 is v3. In the query graph, nodes u3 and u4 are directly connected, while v3 is connected through v 3_i The node is connected to the matching node v4 of the query graph node u4.
[0095] Traditional search methods cannot search for the above-mentioned incomplete matching subgraphs, but the fuzzy search method proposed in the present invention can meet this requirement, thereby improving the efficiency of circuit arrangement work for circuit arrangement engineers.
[0096] The embodiment of the present invention further provides a fuzzy search device based on a circuit structure of reinforcement learning, comprising:
[0097] A circuit network graph D construction module, used to construct a circuit network graph D, wherein the circuit network graph D includes a network structure and node features;
[0098] A subgraph Q specifying module, used for specifying a subgraph Q to be searched in the circuit network graph D;
[0099] A search order and search starting point determination module, used to determine the search order and search starting point of nodes in the subgraph Q;
[0100] A candidate node set determination module, used to determine a candidate node set of a search starting point in the circuit network graph D;
[0101] A query tree construction module, used to construct a query tree for the subgraph Q according to the candidate node set of the search starting point;
[0102] A trajectory sampling module, used to sample multiple trajectories from each query tree;
[0103] The top K structure determination module is used to train the policy network using a reinforcement learning algorithm based on the sampled trajectories to determine the top K structures with the largest query tree returns;
[0104] The matching result screening module is used to screen out the best top N structures from all the top K structures as the matching results of the subgraph Q.
[0105] Furthermore, the device also includes a node filtering module, which is used to:
[0106] The similarity between the nodes in the circuit network graph D and the nodes in the subgraph Q is calculated, and the nodes in the circuit network graph D that are not related to the subgraph Q are removed according to the calculated similarity.
[0107] Specifically, the similarity between the nodes in the circuit network graph D and the nodes in the subgraph Q is calculated, and the nodes in the circuit network graph D that are not related to the subgraph Q are removed according to the calculated similarity, specifically including:
[0108] The node feature vectors in the circuit network graph D and the subgraph Q are averaged within the t-degree neighborhood, and the averaged node feature vectors are used to calculate the similarity of the node pairs in the circuit network graph D and the subgraph Q;
[0109] If the similarity of the node pair is less than a preset similarity threshold, the node in the node pair belonging to the circuit network graph D is deleted.
[0110] Optionally, a search order and search starting point determination module is specifically used to:
[0111] Based on the idea of topological order, the search order of nodes in subgraph Q is generated, and the first node in the search order is used as the search starting point.
[0112] Optionally, the candidate node set determination module is specifically used to:
[0113] Starting from the search starting point, for each node in the subgraph Q, use the similarity matrix to select all nodes in the circuit network graph D whose similarity with the corresponding node is greater than a preset threshold as the candidate node set of the corresponding node in the subgraph Q;
[0114] The similarity matrix is calculated using the eigenvector of the node, and the calculation formula is:
[0115]
[0116] in, q feature is the node feature matrix of subgraph Q, d feature is the node feature matrix of the circuit network graph D.
[0117] Optional, query tree construction module, specifically used for:
[0118] S51, build a query table for each candidate node of the root node;
[0119] S52, starting from a query table of the root node, according to the search order in S3, select a node from Q each time, build a query table for it, and record the node of the subgraph Q corresponding to the query table as q;
[0120] S53, construct a query table of all neighbors of q;
[0121] S54, recursively execute S52 and S53. When q traverses all nodes in the subgraph Q, a query tree is constructed.
[0122] Optionally, the trajectory sampling module is specifically used for:
[0123] Define the state space, action space, reward function, and return function for reinforcement learning;
[0124] According to the search order of nodes in the subgraph Q, the agent selects an action from the action space at each step and collects the set formed by the combination of state and action at each step as the trajectory.
[0125] Among them, the reward function reward = - cost;
[0126] Among them, cost = missing_nodes_cost + missing_edges_cost + ivn_cost;
[0127] missing_nodes_cost represents the node loss of the search results compared to the subgraph Q, missing_edges represents the missing edge loss, and ivn_cost represents the redundant interval node loss;
[0128] Reward Function , where T is the final time; t is the sampling time; γ is the discount factor.
[0129] The first K structure determination modules are specifically used for:
[0130] After sampling multiple trajectories, the policy network is optimized with the maximum reward as the goal, and reinforcement learning is used to complete the training of the policy network;
[0131] Subgraph matching is performed according to the search order of nodes in subgraph Q. Each time a match is made, the trained policy network outputs an action based on the current state to find the matching subgraph of subgraph Q in the circuit network graph D.
[0132] From all possible matching subgraphs, find the top K structures with the largest reward value for a query tree.
[0133] A circuit structure fuzzy search device based on reinforcement learning provided in an embodiment of the present invention can execute a circuit structure fuzzy search method based on reinforcement learning provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0134] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A circuit structure fuzzy search method based on reinforcement learning, characterized in that: include: S1. Constructing a circuit network graph D, wherein the circuit network graph D includes a network structure and node features; S2, specifying a subgraph Q to be searched in the circuit network graph D, calculating the similarity of node pairs in the circuit network graph D and the subgraph Q, and obtaining a similarity matrix; S3, determine the search order and search starting point of the nodes in the subgraph Q; S4, determining a candidate node set corresponding to each node in Q in the circuit network graph D according to the search order and the search starting point; S5. construct a query tree according to each candidate node in the candidate node set; S6, sampling multiple trajectories from each query tree; S7. Based on the sampled trajectories, a reinforcement learning algorithm is used to train the policy network to determine the top K structures with the largest query tree returns; S8. Select the best top N structures from all the top K structures as the matching results of the subgraph Q, where K and N are both positive integers and K>N.
2. The method according to claim 1, characterized in that After S2, it also includes: The similarity between the nodes in the circuit network graph D and the nodes in the subgraph Q is calculated, and the nodes in the circuit network graph D that are not related to the subgraph Q are removed according to the calculated similarity.
3. The method according to claim 2, characterized in that Calculate the similarity between the nodes in the circuit network graph D and the nodes in the subgraph Q, and remove the nodes in the circuit network graph D that are not related to the subgraph Q according to the calculated similarity, specifically including: The node feature vectors in the circuit network graph D and the subgraph Q are averaged within the t-degree neighborhood, and the averaged node feature vectors are used to calculate the similarity of the node pairs in the circuit network graph D and the subgraph Q; If the similarity of the node pair is less than a preset similarity threshold, the node in the node pair belonging to the circuit network graph D is deleted.
4. The method according to claim 1, characterized in that: The S3 specifically includes: Based on the idea of topological order, the search order of nodes in subgraph Q is generated, and the first node in the search order is used as the search starting point.
5. The method according to claim 1, characterized in that The S4 specifically includes: Starting from the search starting point, for each node in the subgraph Q, use the similarity matrix to select all nodes in the circuit network graph D whose similarity with the corresponding node is greater than a preset threshold as the candidate node set of the corresponding node in the subgraph Q; The similarity matrix is calculated using the eigenvector of the node, and the calculation formula is: ; in, q feature is the node feature matrix of subgraph Q, d feature is the node feature matrix of the circuit network graph D.
6. The method according to claim 1, characterized in that The S5 specifically includes: S51, constructing a query table for each candidate node of the root node; S52, starting from a query table of the root node, according to the search order in S3, select a node from the subgraph Q each time, build a query table for it, and record the node of the subgraph Q corresponding to the query table as q; S53, constructing a query table of all neighbors of q; S54, recursively execute S52 and S53. When q traverses all nodes in the subgraph Q, a query tree is constructed.
7. The method according to claim 1, characterized in that The S6 includes: Define the state space, action space, reward function, and return function for reinforcement learning; According to the search order of nodes in the subgraph Q, the agent selects an action from the action space at each step and collects the set formed by the combination of state and action at each step as the trajectory.
8. The method according to claim 7, characterized in that The reward function reward = - cost; Among them, cost = missing_nodes_cost + missing_edges_cost + ivn_cost; missing_nodes_cost represents the node loss of the search results compared to the subgraph Q, missing_edges_cost represents the missing edge loss, and ivn_cost represents the redundant interval node loss; Reward Function , where T is the final time, t is the sampling time, γ is the discount factor.
9. The method according to claim 1, characterized in that: The S7 includes: After sampling multiple trajectories, the policy network is optimized with the maximum reward as the goal, and the reinforcement learning algorithm is used to complete the training of the policy network; Subgraph matching is performed according to the search order of nodes in subgraph Q. Each time a match is made, the trained policy network outputs an action based on the current state to find the matching subgraph of subgraph Q in the circuit network graph D. From all possible matching subgraphs, find the top K structures with the largest reward value for a query tree.
10. A fuzzy search device based on a circuit structure of reinforcement learning, characterized in that: include: A circuit network graph D construction module, used to construct a circuit network graph D, wherein the circuit network graph D includes a network structure and node features; A subgraph Q specifying module, used for specifying a subgraph Q to be searched in the circuit network graph D; A search order and search starting point determination module, used to determine the search order and search starting point of nodes in the subgraph Q; A candidate node set determination module, used to determine the candidate node set corresponding to each node in Q in the circuit network graph D according to the search order and the search starting point; A query tree construction module, used for constructing a query tree according to each candidate node in the candidate node set; A trajectory sampling module, used to sample multiple trajectories from each query tree; The top K structure determination module is used to train the policy network using a reinforcement learning algorithm based on the sampled trajectories to determine the top K structures with the largest query tree returns; The matching result screening module is used to screen out the best top N structures from all the top K structures as the matching results of the subgraph Q.
Citation Information
Patent Citations
Graph pattern matching method for supporting fuzzy constraint relation
CN105138601A
Sub-graph matching method for improving traditional processing mode
CN113947695A
