CN114817647A - Sub-graph retrieval method and device and electronic equipment - Google Patents

Sub-graph retrieval method and device and electronic equipment Download PDF

Info

Publication number
CN114817647A
CN114817647A CN202210469593.0A CN202210469593A CN114817647A CN 114817647 A CN114817647 A CN 114817647A CN 202210469593 A CN202210469593 A CN 202210469593A CN 114817647 A CN114817647 A CN 114817647A
Authority
CN
China
Prior art keywords
sub
retrieval
graph
rule
chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210469593.0A
Other languages
Chinese (zh)
Inventor
刘寒
高歌
顾明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Original Assignee
Tsinghua University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tsinghua University filed Critical Tsinghua University
Priority to CN202210469593.0A priority Critical patent/CN114817647A/en
Publication of CN114817647A publication Critical patent/CN114817647A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for searching a sub-graph and electronic equipment, wherein the method comprises the following steps: the retrieval requirements of the user are obtained; converting the retrieval requirement into a sub-graph template and a value constraint rule according to a preset conversion rule; establishing a rule chain based on the subgraph template and the value constraint rule; and inputting the regular chain into a preset knowledge graph for retrieval to obtain a subgraph conforming to the regular chain. According to the invention, the regular chain is established, and the sub-graphs matched with the regular chain are directly screened from the knowledge graph spectrum, so that the data processing amount is reduced, a large amount of computing resources are saved, the computing speed is higher, and the retrieval efficiency is effectively improved.

Description

Sub-graph retrieval method and device and electronic equipment
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a device for sub-graph retrieval and electronic equipment.
Background
The object-oriented graph data is a general term of a common data representation and storage method, and the data is composed of nodes and edges with types, and commonly includes RDF semantic web data, industrial data such as STEP and IFC, and data of a graph database such as Neo4 j. Currently, the rule representation of subgraph retrieval is generally composed of two parts, namely a subgraph template and a value constraint rule: the subgraph template is a template for representing paths and structures in a retrieval target subgraph, is usually a tree structure or a directed acyclic graph structure with branches from some type of root nodes and is used for searching subgraphs matched with the root node in object-oriented graph data; the value constraint rule represents the constraint condition and logic rule that the value, character string value and the like should satisfy for each subgraph matched with the subgraph template.
Based on the rule expression, the existing retrieval method for the object-oriented graph data comprises two steps of sub-graph matching and value constraint checking, firstly, matched sub-graphs are searched in the whole graph data, and the value constraint rule checking is carried out on each sub-graph one by one. When the data volume is large, the existing method has the problems of complex calculation, long consumed time and low efficiency.
Disclosure of Invention
In view of this, the embodiment of the present invention provides a sub-graph retrieval method to solve the problems of complex calculation, long time consumption and low efficiency in the current data retrieval process.
In order to achieve the purpose, the invention provides the following technical scheme:
the embodiment of the invention provides a method for sub-graph retrieval, which comprises the following steps:
acquiring retrieval requirements of a user;
converting the retrieval requirement into a sub-graph template and a value constraint rule according to a preset conversion rule;
establishing a rule chain based on the subgraph template and a value constraint rule;
and inputting the regular chain into a preset knowledge graph for retrieval to obtain a subgraph conforming to the regular chain.
Optionally, the inputting the regular chain into the knowledge graph to retrieve to obtain a sub-graph conforming to the regular chain includes:
comparing the knowledge graph with the regular chain to obtain a plurality of paths which can pass through the regular chain;
and backtracking the paths to obtain a plurality of subgraphs which accord with the regular chain.
Optionally, the backtracking the multiple paths to obtain multiple subgraphs conforming to a regular chain includes:
backtracking along the path from the last node of the current subgraph, and judging whether each node on the paths is connected with a branch node except the nodes on the paths;
and if the nodes on the paths are connected with branch nodes except the nodes on the paths, deleting the branch nodes to obtain a plurality of sub-images conforming to the regular chain.
Optionally, the establishing a rule chain based on the subgraph template and the value constraint rule includes:
establishing a plurality of rule segments based on a node set and a value constraint rule in the subgraph template, wherein the rule segments comprise an attribute segment, a measurement segment and a composite segment;
and connecting the plurality of rule segments in sequence according to the element attributes of the node sets in each measurement segment to obtain a rule chain.
Optionally, the attribute segment is obtained by:
acquiring the attribute of each node set in the sub-graph template;
and establishing a mapping relation between the node sets based on the attributes of the node sets to obtain attribute segments.
Optionally, the metric segment is obtained by:
obtaining a metric value of each node set, wherein the metric value comprises the type and the number of nodes;
screening the node set based on the metric values and the value constraint rules;
and establishing a mapping relation among all nodes in the node set according to the screening result to obtain a measurement section.
Optionally, the composite section is obtained by:
and combining one or more regular segments to obtain a composite segment.
The embodiment of the invention also provides a device for sub-graph retrieval, which comprises:
the acquisition module is used for acquiring the retrieval requirement of a user;
the conversion module is used for converting the retrieval requirement into a sub-graph template and a value constraint rule according to a preset conversion rule;
the establishing module is used for establishing a rule chain based on the sub-graph template and a value constraint rule;
and the retrieval module is used for inputting the regular chain into a preset knowledge graph to retrieve to obtain a subgraph conforming to the regular chain.
An embodiment of the present invention further provides an electronic device, including:
the subgraph searching method comprises a memory and a processor, wherein the memory and the processor are mutually connected in a communication mode, computer instructions are stored in the memory, and the processor executes the computer instructions so as to execute the subgraph searching method provided by the embodiment of the invention.
The embodiment of the invention also provides a computer-readable storage medium, which stores computer instructions, wherein the computer instructions are used for enabling the computer to execute the subgraph retrieval method provided by the embodiment of the invention.
The technical scheme of the invention has the following advantages:
the invention provides a sub-image retrieval method, which is characterized in that retrieval requirements of users are acquired; converting the retrieval requirement into a sub-graph template and a value constraint rule according to a preset conversion rule; establishing a rule chain based on the subgraph template and the value constraint rule; and inputting the regular chain into a preset knowledge graph for retrieval to obtain a subgraph conforming to the regular chain. In the prior art, subgraphs matched with the subgraph templates are screened from the knowledge graph, and the subgraphs are checked one by one through a value constraint rule, so that the data processing capacity is large, the speed is low, and the efficiency is low. According to the invention, the regular chain is established, and the subgraphs matched with the regular chain are directly screened from the knowledge graph spectrum, so that the data processing amount is reduced, a large amount of computing resources are saved, the computing speed is higher, and the retrieval efficiency is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a method of sub-graph retrieval in an embodiment of the present invention;
FIG. 2 is a flow chart of the establishment of a regular chain in an embodiment of the present invention;
FIG. 3 is a flow chart of creating an attribute segment in an embodiment of the present invention;
FIG. 4 is a diagram of an attribute segment in an embodiment of the present invention;
FIG. 5 is a flow chart of establishing a metric segment in an embodiment of the present invention;
FIG. 6 is a schematic diagram of a single metric segment in an embodiment of the present invention;
FIG. 7 is a diagram illustrating an aggregate metric segment in accordance with an embodiment of the present invention;
FIG. 8 is a diagram illustrating a global metric segment according to an embodiment of the present invention;
FIG. 9 is a diagram of a composite attribute segment in an embodiment of the present invention;
FIG. 10 is a schematic representation of a composite metrology section in an embodiment of the present invention;
FIG. 11 is a flow chart of a retrieval process in an embodiment of the present invention;
FIG. 12 is a diagram illustrating a retrieval process according to an embodiment of the present invention;
FIG. 13 is a diagram illustrating a prior art retrieval process in accordance with an embodiment of the present invention;
FIG. 14 is a flowchart illustrating backtracking of a path according to an embodiment of the present invention;
FIG. 15 is a schematic structural diagram of an apparatus for sub-graph search according to an embodiment of the present invention;
fig. 16 is a schematic structural diagram of an electronic device in an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In accordance with an embodiment of the present invention, there is provided a method embodiment of sub-graph retrieval, it being noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
In this embodiment, a sub-graph retrieval method is provided, which may be used in a scene where sub-graph retrieval is performed on object-oriented graph data, as shown in fig. 1, the sub-graph retrieval method includes the following steps:
step S1: and acquiring the retrieval requirement of the user.
Step S2: and converting the retrieval requirement into a sub-graph template and a value constraint rule according to a preset conversion rule. Specifically, the rule representation for performing subgraph retrieval on the object graph data generally consists of two parts, namely a "subgraph template" and a "value constraint rule": the subgraph template is a template for representing paths and structures in a retrieval target subgraph, is usually a tree structure or a directed acyclic graph structure with branches from some type of root nodes and is used for searching subgraphs matched with the root node in object-oriented graph data; the value constraint rule represents the constraint condition and logic rule that the value, character string value and the like should satisfy for each subgraph matched with the subgraph template.
Step S3: and establishing a rule chain based on the subgraph template and the value constraint rule. Specifically, a "subgraph template" and a "value constraint rule" separated by the existing method are uniformly represented as a node set mapping rule, and the interior of the node set mapping rule is formed by connecting a plurality of rule segments in series and in parallel. By the rule mapping mode, corresponding subgraphs can be quickly matched, and the retrieval efficiency is effectively improved.
Step S4: and inputting the regular chain into a preset knowledge graph for retrieval to obtain a subgraph conforming to the regular chain. Specifically, in the execution process, two steps of 'subgraph matching' and 'value constraint rule' separated by the existing method are combined into the same path searching step, and all subgraph results are obtained through one round-trip path searching.
Through the steps S1 to S4, the subgraph retrieval method provided by the embodiment of the invention directly screens subgraphs matched with the rule chain from the knowledge graph spectrum by establishing the rule chain, so that the data processing amount is reduced, a large amount of computing resources are saved, the computing speed is higher, and the retrieval efficiency is effectively improved.
In addition, the object-oriented graph data is a general term of a common data representation and storage method, and the data is composed of nodes and edges with types, and commonly includes RDF semantic web data, industrial data such as STEP and IFC, and data of a graph database such as Neo4 j. The method provided by the embodiment can obviously improve the computational efficiency of sub-graph retrieval, and is applicable to data such as RDF, STEP, IFC and the like. In the embodiment of the present invention, IFC data is taken as an example for description.
Specifically, in an embodiment, as shown in fig. 2, the step S3 includes the following steps:
step S31: and establishing a plurality of rule segments based on the node sets and the value constraint rules in the subgraph template, wherein the rule segments comprise an attribute segment, a measurement segment and a composite segment.
Step S32: and connecting the regular sections in sequence according to the element attributes of the node sets in each measurement section to obtain a regular chain.
Specifically, the node set mapping rule is formed by connecting a plurality of rule segments in series and in parallel, and each rule segment represents a calculation method for mapping from one node set to the next node set. By the rule mapping mode, corresponding subgraphs can be quickly matched, and compared with the prior art, the process of screening inappropriate subgraphs is omitted, and the retrieval efficiency is effectively improved.
Specifically, in an embodiment, the attribute segment in step S31 is obtained by, as shown in fig. 3, the following steps:
step S311: and acquiring the attribute of each node set in the sub-graph template.
Step S312: and establishing a mapping relation between the node sets based on the attributes of the node sets to obtain attribute segments.
Specifically, the attribute segment represents a method of mapping from one node set to the next node set through one attribute edge. The attribute segment mapping instructions are represented in the regular representation using arrows "→" plus the attribute name. As shown in FIG. 4, in data filtering execution, the attribute segment computation results in a mapping between two node sets.
Specifically, in an embodiment, the metric segment in the step S31 is obtained by, as shown in fig. 5, the following steps:
step S313: and obtaining a metric value of each node set, wherein the metric value comprises the type and the number of the nodes.
Step S314: and screening the node set based on the metric value and the value constraint rule.
Step S315: and establishing a mapping relation among all nodes in the node set according to the screening result to obtain a measurement section.
Specifically, the metric segment represents a method of filtering a node set according to a rule, and represents a mapping of a node set to itself. In the regular expression, a metric type is added using a square bracket "[ ]", and then a numerical value or a boolean value is connected using a comparison symbol (═, + >, etc.). According to different measurement types, the method is divided into three types of 'single measurement section', 'collective measurement section' and 'global measurement section'.
The single metric segment is determined according to each element in the set, and the nodes in the input set are filtered according to the single metric segment, as shown in fig. 6. The method comprises the following steps:
[ Value ]: screening the numerical value of each node;
[ Type ]: the type of each node is filtered.
The set metric segment needs to be used in conjunction with the previous attribute segment, and is determined according to the mapping target set of each element in the previous attribute segment and represented as a filter of the input set of the previous attribute segment, as shown in fig. 7. The method comprises the following steps:
[ Size ]: screening the number of elements of each target set;
[ Exists ]: each target set is screened for being empty.
The global metric segment needs to be used in conjunction with the previous attribute segment, and is determined from the previous attribute segment map as a whole and represented as a full pass or full cutoff filter on the input set of the previous attribute segment, as shown in fig. 8. The method comprises the following steps:
[ Unique ]: and judging whether the mapping target is globally unique.
Specifically, in an embodiment, the composite segment in step S31 is obtained by the following steps:
and combining one or more regular segments to obtain a composite segment.
Specifically, the composite segment includes a coincidence attribute segment and a coincidence metric segment.
The composite property segment encapsulates the internal rule segment with brackets so that it behaves equivalently to a single property segment, as shown in FIG. 9. The composite attribute segment may contain one OR more rule segments connected in series, OR "may be used to indicate that a plurality of branching chains are connected in parallel to indicate a plurality of rule segments, wherein each branching chain should end with an attribute segment.
The composite metric segment encapsulates the internal rule segment with brackets so that it behaves equivalently to a single metric segment, as shown in fig. 10. The composite measurement segment may only contain one OR more rule segments connected in series, OR "AND", "OR", "NOT" may be used to indicate the intersection, union, AND complement of the mapping results of multiple branched chains, where each branch should end with the measurement segment.
Specifically, there may be only one branch in a composite attribute segment or a composite metric segment, or there may be multiple branches connected in parallel, where a branch is composed of multiple rule segments connected in series, and the relationship between multiple branches is parallel, and there is a logical connector (and, or, not) in between. Distinguishing a composite attribute segment from a composite metric segment by whether the end of each branch analyzed is an attribute segment or a metric segment; each branch is at the end of the attribute segment, and the encapsulated composite segment is also equivalent to the attribute segment; each branch is metric segment-ended, and its encapsulated composite segment is also equivalent to a metric segment.
Specifically, in an embodiment, as shown in fig. 11, the step S4 includes the following steps:
step S41: and comparing the knowledge graph with the regular chain to obtain a plurality of paths which can pass through the regular chain.
Step S42: and backtracking the paths to obtain a plurality of subgraphs which accord with the regular chain.
Specifically, the starting point of the whole regular chain is a "root node set" which represents a set of one type of data objects; the regular chain is composed of several regular segments connected in series, where there may be a composite attribute segment or a composite metrology segment may contain internal branches, each branch ending with a metrology segment. Each regular chain has a corresponding string representation. The rule chain and the character string are in a corresponding relation, each prefix also has a corresponding relation with the prefix of the character string, the rule chain can be used for rule transmission and cache acceleration, and subsequent retrieval tasks can be effectively accelerated through the corresponding relation.
When the route search is performed, a sub-graph search is performed in a round trip according to a regular chain, as shown in fig. 12. Firstly, forward searching is carried out, and a path which can pass through all node mapping rules is searched; and then backtracking each path, reserving nodes in the path and removing other nodes so as to obtain all subgraphs which accord with the rules. The round-trip path search of each branch is performed in the same manner inside the composite metric segment. Compared with the existing method shown in fig. 13, the method provided in the embodiment can obtain all sub-graph results through one round-trip path search, and can significantly improve the calculation speed.
Specifically, in an embodiment, as shown in fig. 14, the step S42 includes the following steps:
step S421: and backtracking along the path from the last node of the current subgraph, and judging whether each node on the paths is connected with a branch node except the nodes on the paths.
Step S422: and if the nodes on the paths are connected with branch nodes except the nodes on the paths, deleting the branch nodes to obtain a plurality of sub-images conforming to the regular chain.
Specifically, firstly, forward search is carried out to find a path which can pass through all the rules; and then backtracking each path, reserving nodes in the path and removing other nodes so as to obtain all subgraphs which accord with the rules. The round-trip path search of each branch is performed in the same way inside the composite metric segment. Compared with the prior art, the method in the embodiment does not check the subgraphs one by one, but obtains all subgraph results through one-time round-trip path search, avoids the subgraph screening process, and has higher running speed and higher efficiency.
In this embodiment, a device for sub-map retrieval is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, which have already been described and are not described again. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware or a combination of software and hardware is also possible and contemplated.
The present embodiment provides a device for sub-map retrieval, as shown in fig. 15, including:
the obtaining module 101 is configured to obtain a retrieval requirement of a user, and details of the retrieving requirement refer to the related description of step S1 in the foregoing method embodiment, which is not described herein again.
The conversion module 102 is configured to convert the search requirement into a sub-graph template and a value constraint rule according to a preset conversion rule, for details, refer to the related description of step S2 in the foregoing method embodiment, and no further description is provided here.
The establishing module 103 is configured to establish a rule chain based on the sub-graph template and the value constraint rule, for details, refer to the related description of step S3 in the foregoing method embodiment, and are not described herein again.
The retrieving module 104 is configured to input the rule chain into a preset knowledge graph to retrieve to obtain a sub-graph that conforms to the rule chain, for details, refer to the related description of step S4 in the foregoing method embodiment, and are not described herein again.
The means for sub-graph retrieval in this embodiment is presented in the form of functional units, where a unit refers to an ASIC circuit, a processor and memory executing one or more software or fixed programs, and/or other devices that can provide the above-described functionality.
Further functional descriptions of the modules are the same as those of the corresponding embodiments, and are not repeated herein.
There is also provided an electronic device according to an embodiment of the present invention, as shown in fig. 16, the electronic device may include a processor 901 and a memory 902, where the processor 901 and the memory 902 may be connected by a bus or by other means, and fig. 16 takes the example of connection by a bus as an example.
Processor 901 may be a Central Processing Unit (CPU). The Processor 901 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 902, which is a non-transitory computer readable storage medium, may be used for storing non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the methods in the method embodiments of the present invention. The processor 901 executes various functional applications and data processing of the processor by executing non-transitory software programs, instructions and modules stored in the memory 902, that is, implements the methods in the above-described method embodiments.
The memory 902 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor 901, and the like. Further, the memory 902 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 902 may optionally include memory located remotely from the processor 901, which may be connected to the processor 901 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in the memory 902, which when executed by the processor 901 performs the methods in the above-described method embodiments.
The specific details of the electronic device may be understood by referring to the corresponding related descriptions and effects in the above method embodiments, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, and the program can be stored in a computer readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. A method of sub-map retrieval, comprising:
acquiring retrieval requirements of a user;
converting the retrieval requirement into a sub-graph template and a value constraint rule according to a preset conversion rule;
establishing a rule chain based on the subgraph template and a value constraint rule;
and inputting the regular chain into a preset knowledge graph for retrieval to obtain a subgraph conforming to the regular chain.
2. The method for sub-graph retrieval according to claim 1, wherein the step of inputting the regular chain into the knowledge graph for retrieval to obtain the sub-graph conforming to the regular chain comprises:
comparing the knowledge graph with the regular chain to obtain a plurality of paths which can pass through the regular chain;
and backtracking the paths to obtain a plurality of subgraphs which accord with the regular chain.
3. The method for sub-graph retrieval according to claim 2, wherein said backtracking the plurality of paths to obtain a plurality of sub-graphs that conform to a regular chain comprises:
backtracking along the path from the last node of the current subgraph, and judging whether each node on the paths is connected with a branch node except the nodes on the paths;
and if the nodes on the paths are connected with branch nodes except the nodes on the paths, deleting the branch nodes to obtain a plurality of sub-images conforming to the regular chain.
4. The method of sub-graph retrieval as claimed in claim 1, wherein the building a rule chain based on the sub-graph template and value constraint rules comprises:
establishing a plurality of rule segments based on a node set and a value constraint rule in the subgraph template, wherein the rule segments comprise an attribute segment, a measurement segment and a composite segment;
and connecting the plurality of rule segments in sequence according to the element attributes of the node sets in each measurement segment to obtain a rule chain.
5. The method of sub-graph retrieval according to claim 4, wherein the property segment is obtained by:
acquiring the attribute of each node set in the sub-graph template;
and establishing a mapping relation between the node sets based on the attributes of the node sets to obtain attribute segments.
6. The method of sub-graph retrieval of claim 4, wherein the metric segment is obtained by:
obtaining a metric value of each node set, wherein the metric value comprises the type and the number of nodes;
screening the node set based on the metric values and the value constraint rules;
and establishing a mapping relation among all nodes in the node set according to the screening result to obtain a measurement section.
7. The method of sub-graph retrieval according to claim 4, wherein the composite segment is obtained by:
and combining one or more regular segments to obtain a composite segment.
8. An apparatus for sub-map retrieval, comprising:
the acquisition module is used for acquiring the retrieval requirement of a user;
the conversion module is used for converting the retrieval requirements into a sub-graph template and a value constraint rule according to a preset conversion rule;
the establishing module is used for establishing a rule chain based on the sub-graph template and a value constraint rule;
and the retrieval module is used for inputting the regular chain into a preset knowledge graph for retrieval to obtain a subgraph conforming to the regular chain.
9. An electronic device, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the sub-graph retrieval method of any of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a computer to perform the method of sub-graph retrieval of any of claims 1-7.
CN202210469593.0A 2022-04-28 2022-04-28 Sub-graph retrieval method and device and electronic equipment Pending CN114817647A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210469593.0A CN114817647A (en) 2022-04-28 2022-04-28 Sub-graph retrieval method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210469593.0A CN114817647A (en) 2022-04-28 2022-04-28 Sub-graph retrieval method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN114817647A true CN114817647A (en) 2022-07-29

Family

ID=82509246

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210469593.0A Pending CN114817647A (en) 2022-04-28 2022-04-28 Sub-graph retrieval method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114817647A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201313157D0 (en) * 2013-07-23 2013-09-04 Canon Kk Method, device and computer program for encapsulating partitioned timed media data using sub-track feature
CN103957268A (en) * 2014-05-08 2014-07-30 中国人民解放军总参谋部气象水文空间天气总站 Rule-driven data transmission method
US20180276278A1 (en) * 2017-03-20 2018-09-27 Carnegie Mellon University Searching of data structures in pre-processing data for a machine learning classifier
CN113360675A (en) * 2021-06-25 2021-09-07 中关村智慧城市产业技术创新战略联盟 Knowledge graph specific relation completion method based on Internet open world
CN113609166A (en) * 2021-08-16 2021-11-05 优默网络科技(深圳)有限公司 Search method, search device, computer equipment and computer-readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201313157D0 (en) * 2013-07-23 2013-09-04 Canon Kk Method, device and computer program for encapsulating partitioned timed media data using sub-track feature
CN103957268A (en) * 2014-05-08 2014-07-30 中国人民解放军总参谋部气象水文空间天气总站 Rule-driven data transmission method
US20180276278A1 (en) * 2017-03-20 2018-09-27 Carnegie Mellon University Searching of data structures in pre-processing data for a machine learning classifier
CN113360675A (en) * 2021-06-25 2021-09-07 中关村智慧城市产业技术创新战略联盟 Knowledge graph specific relation completion method based on Internet open world
CN113609166A (en) * 2021-08-16 2021-11-05 优默网络科技(深圳)有限公司 Search method, search device, computer equipment and computer-readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LIU H等: "MVDLite: a Fast Validation Algorithm for Model View Definition Rules", 《HTTPS://ARXIV.ORG/ABS/1909.06997》 *
崔阳等: "超图在数据挖掘领域中的几个应用", 《计算机科学》 *

Similar Documents

Publication Publication Date Title
Zhang et al. Fast algorithms for Dyck-CFL-reachability with applications to alias analysis
CN110019876B (en) Data query method, electronic device and storage medium
CN107689628B (en) Power grid loop detection method
CN109189758B (en) Operation and maintenance flow design method, device and equipment, operation method, device and host
CN104320312A (en) Network application safety test tool and fuzz test case generation method and system
CN113312175A (en) Operator determining and operating method and device
CN109561163B (en) Method and device for generating uniform resource locator rewriting rule
CN107679107B (en) Graph database-based power grid equipment reachability query method and system
CN112650819A (en) Method, device and equipment for constructing metadata cube and storage medium
CN109412149B (en) Power grid subgraph construction method based on regional division, topology analysis method and device
CN114817647A (en) Sub-graph retrieval method and device and electronic equipment
CN115495248B (en) Memory allocation method and device of reasoning card, electronic equipment and storage medium
CN116382658A (en) Compiling method and device of AI model, computer equipment and storage medium
CN109101595B (en) Information query method, device, equipment and computer readable storage medium
CN113965515A (en) Virtualized network link visualization method, system, computer and storage medium
CN112306876A (en) Method and device for generating automatic flow chart, computer equipment and storage medium
CN112765433B (en) Text keyword scanning method, device, equipment and computer readable storage medium
CN104504660B (en) The data processing method and device released for grid model hole
CN117149663B (en) Multi-target detection algorithm deployment method and device, electronic equipment and medium
CN114281830B (en) Rule mapping table construction method, rule matching method and device for multi-attribute conditions
CN111476663B (en) Data processing method and device, node equipment and storage medium
CN117331962A (en) Hierarchical structure searching method, hierarchical structure searching device, computer equipment and storage medium
CN109885733B (en) Graph data compression method and device for target spanning tree query
CN117742900A (en) Method, device, equipment and storage medium for constructing service call graph
CN117369816A (en) Page partitioning method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20220729