CN109726305A - A kind of complex_relation data storage and search method based on graph structure - Google Patents

A kind of complex_relation data storage and search method based on graph structure Download PDF

Info

Publication number
CN109726305A
CN109726305A CN201811643795.2A CN201811643795A CN109726305A CN 109726305 A CN109726305 A CN 109726305A CN 201811643795 A CN201811643795 A CN 201811643795A CN 109726305 A CN109726305 A CN 109726305A
Authority
CN
China
Prior art keywords
node
relationship
pointer
complex
attribute
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
CN201811643795.2A
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.)
CETC Information Science Research Institute
Original Assignee
CETC Information Science Research Institute
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 CETC Information Science Research Institute filed Critical CETC Information Science Research Institute
Priority to CN201811643795.2A priority Critical patent/CN109726305A/en
Publication of CN109726305A publication Critical patent/CN109726305A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A kind of complex_relation data storage and search method based on graph structure, including constructing complex_relation data storage model, there are multiple nodes in the model, have side to be connected with each other between different nodes, wherein the node table shows entity object, relationship between the side presentation-entity, each node have the multiple attributes of itself, and the mode that the relationship and the attribute are all made of doubly linked list is stored.The present invention combines the storage method of the node structure based on entity relationship, the date storage method of side structure based on graph structure, and combine the building hybrid index structure of node structure and side structure, support the quick indexing of large-scale graph data, and scalability is supported well, using a pair of of relationship of relational database memory node and side, the disadvantage for overcoming chart database committed memory excessive realizes the quick search of complex_relation data.

Description

A kind of complex_relation data storage and search method based on graph structure
Technical field
The application belongs to database technology and diagram data management domain, is suitable for specifically, being related to one kind based on graph structure Complex_relation data storage and search method.
Background technique
Complex_relation data is a kind of important kind of big data, such as social network data, scientific and technological information data.Very much Typical case aiming at complex_relation data analysis and excavation, such as community discovery, scientific research relationship inquiry.It is closed for complexity The storage and retrieval of coefficient evidence is the basis for realizing above-mentioned function.Therefore, research complex_relation data method for quickly retrieving has Important meaning.
There are two types of forms for complex_relation data storage, the first is stored based on relational database, and another kind is diagram data Library storage.Complex relationship relationship sheet form is converted to based on relational database storage to be stored in entity relationship scheme;Based on figure Database purchase indicates and stores complex_relation data according to the structure and attribute of figure.Relational database technology comparative maturity, But being to look for complex relationship needs multilist JOIN to operate, inefficient;Although chart database technology, which searches complex relationship, compares appearance Easily, but insertion speed is slow, expends memory, causes data directory convergence slow.
It in the prior art, will in patent document 1 " a kind of diagram data storage method and subgraph query method based on external memory " Complex_relation data is abstracted into figure, is made of different type side and point, to pressing in figure when carrying out classification storage and to every class B+-Tree index is established according to lexcographical order, and point index of the picture and terminal bitmap are set up according to the starting point on side, terminal label information Index.This method can also be applicable in small-scale data volume, but can not be suitable for big index of the picture.Because with a B+-Tree Support one big figure infeasible in reality, and the situation that bitmap index is less suitble to element very big.Patent document 2 is " a kind of Graph data query method and device ", by figure vertex subregion and layering, the search efficiency of Lai Tigao diagram data.It is this Method can not be in face of the quick variation of complex_relation data and the sparse characteristic of big figure, i.e. some nodes and the performance of frontier juncture system complexity Very dense, many nodes and side are very sparse without especially more relationship performances.
Therefore, the shortcomings that high cost JOIN is operated when how to overcome relational database query complex relationship, and overcome The excessive disadvantage of chart database committed memory, realizes the quick search of complex_relation data, becomes prior art urgent need to resolve Technical problem.
Summary of the invention
It is an object of the invention to propose that a kind of graph structure that is based on is suitable for complex_relation data storage and search method, lead to The complex relationship for crossing graph structure storing data, supports the quick indexing of large-scale graph data, and supports scalability well.
To achieve this purpose, the present invention adopts the following technical scheme:
A kind of complex_relation data storage and search method based on graph structure, it is characterised in that:
Including constructing complex_relation data storage model, the storage model is graph structure, is had in the model multiple Node has side to be connected with each other between different nodes, wherein the node table shows entity object, the side presentation-entity Between relationship, each node has itself multiple attributes, wherein the relationship and the attribute are all made of the mode of chained list It is saved.
Optionally, the mode that the relationship and the attribute are all made of doubly linked list is stored.
Optionally, in store the 1st relationship for belonging to the entity object of the node and the 1st attribute.It should by inquiry Relationship, so that it may all relationships for belonging to the entity object are found along the chained list of relationship.Likewise, passing through the 1st category of inquiry Property, so that it may along the chained list of attribute, find all properties for belonging to the entity object.
Optionally, the side start node and terminal node composition, and start node includes the preposition relationship of the node Pointer (Prev) and postposition relationship pointer (Next), terminal node include the preposition relationship pointer of the node (Prev) and postposition relationship Pointer (Next), preposition pointer are directed toward the upper relationship with starting point, and postposition pointer is directed toward the latter relation of the same starting point.
Optionally, all relationships of start node form a doubly linked list, and all relationships of terminal node form one Doubly linked list.
Optionally, establish and hybrid index structure formed by node structure storage and relational structure, according to relationship type for Node is grouped, and entity object node is ranked up with certain sequence, forms the index structure based on attribute of a relation.
Optionally, when being retrieved, query node first inquires corresponding first relationship of the node;Then, root According to the relationship inquired, search relationship storage organization finds the beginning and end of node, along starting point preposition pointer or after The corresponding relation of node can be found by setting pointer.
Optionally, the graph structure of the complex_relation data storage model is stored in relational database, is connected by table Operation is connect, the relationship of figure interior joint and node is found.
Therefore, the present invention has the advantage that combining the storage method of the node structure based on entity relationship, based on figure The date storage method of the side structure of structure, and the building hybrid index structure of node structure and side structure is combined, support big rule The quick indexing of mould diagram data, and support scalability well, using a pair of of relationship of relational database memory node and side, gram The excessive disadvantage of chart database committed memory is taken, realizes the quick search of complex_relation data.
Detailed description of the invention
Fig. 1 is the storage model of the complex_relation data based on graph structure of specific embodiment according to the present invention;
Fig. 2 is the storage method of relationship and attribute in the node of specific embodiment according to the present invention;
Fig. 3 is the storage organization of the relationship of specific embodiment according to the present invention;
Fig. 4 is the data query example of the complex relationship based on graph structure of specific embodiment according to the present invention.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
The present invention establishes the storage method of the node structure based on entity relationship, and multiple nodes are connected by entity relationship It is connected together, establishes the date storage method of the side structure based on graph structure, and combine the building of node structure and side structure mixed Index structure is closed, to provide complex_relation data querying method.
Referring to figures 1-3, respectively illustrate the storage model of the complex_relation data based on graph structure, in node relationship with The storage method of attribute and the storage organization of relationship.
Specifically, a kind of complex_relation data storage and search method based on graph structure, including building complex relationship number According to storage model, the storage model is graph structure, has multiple nodes in the model, has Bian Yijin between different nodes Row is connected with each other, wherein the node table shows that entity object, the relationship between the side presentation-entity, each node have itself Attribute, wherein the mode that the relationship and the attribute are all made of chained list is saved.Therefore, it is by complicated Relationship Change One graph structure.
Further, the mode that the relationship and the attribute are all made of doubly linked list is stored.That is two nodes All relationships form a doubly linked list.
Specifically, referring to fig. 2, in store the 1st relationship for belonging to the entity object of the node and the 1st attribute.It is logical It crosses and inquires the relationship, so that it may find all relationships for belonging to the entity object along the chained list of relationship.Likewise, passing through inquiry 1st attribute, so that it may along the chained list of attribute, find all properties for belonging to the entity object.
Referring to Fig. 3, the side start node and terminal node composition, and start node includes the preposition relationship of the node Pointer (Prev) and postposition relationship pointer (Next), terminal node include the preposition relationship pointer of the node (Prev) and postposition relationship Pointer (Next), preposition pointer are directed toward the upper relationship with starting point, and postposition pointer is directed toward the latter relation of the same starting point.
All relationships of start node form a doubly linked list, and all relationships of terminal node form a Two-way Chain Table.
Further, storage of the invention and search method, which are also set up, forms mixing by node structure storage and relational structure Index structure is grouped node according to relationship type, and entity object node is ranked up with certain sequence, this Sample just forms the index structure based on attribute of a relation.
It establishes the index of entity object node respectively according to different relationships, includes with this relationship under each index The entity node list of attribute, the list of entities are arranged according to certain sequence, in an alternative embodiment, suitable according to letter Sequence sequence.
Querying method of the invention is: query node first, inquires corresponding first relationship of the node;Then, According to the relationship inquired, search relationship storage organization finds the beginning and end of node, along starting point preposition pointer or Postposition pointer can find the corresponding relation of node.
Illustratively, referring to fig. 4, all relationships that there is the big treasured of father node king of set membership to have for inquiry are shown For attribute.
There is following index according to different relationships in the figure:
Set membership (father): node A, node E
Set membership (son): node B, node C
Peer Relationships: node D, node E
Conjugal relation (husband): node A, node E
Conjugal relation (wife): node D, node C
Query process is as follows:
(1) index structure based on attribute is inquired according to set membership, inquires some entity node, is here node A.
(2) storage organization of the entity node is read, as shown in Fig. 2, inquiring first relationship R1 of the entity node With first attribute P1 (herein are as follows: name attribute).
(3) storage organization for reading relationship R1, as shown in figure 3, the preposition pointer Prev and postposition along the starting point of R1 refer to Needle Next traverses relationship doubly linked list, reads all relationships for belonging to start node.In this example, developing the preposition pointer of R1 is The postposition pointer that the postposition relationship of postposition pointer points relationship R3, R3 of NULL, R1 are directed toward R7, R7 is directed toward NULL, obtains entity All relationships of Object node A are R1, R3, R7.
(4) similar, the storage organization of reading attributes P1 develops the preposition pointer Prev and postposition pointer Next of P1, time Go through the doubly linked list of attribute.
Read all properties for belonging to start node.So far, inquiry is completed.The preposition pointer Prev of P1 is directed toward NULL, P1 Postposition pointer be directed toward attribute gender, read gender attribute: male;The Next pointer of attribute gender is directed toward the attribute age, reads year Age attribute: 32;The Next pointer at attribute age is directed toward NULL, and so far obtaining all properties name of entity object node A, (king is big It is precious), gender (male), age (32).
Further, the present invention also has following improvement, can store the graph structure of complex_relation data storage model In relational database, by table attended operation, the relationship of figure interior joint and node is found.
Therefore, the present invention has the advantage that combining the storage method of the node structure based on entity relationship, based on figure The date storage method of the side structure of structure, and the building hybrid index structure of node structure and side structure is combined, support big rule The quick indexing of mould diagram data, and support scalability well, using a pair of of relationship of relational database memory node and side, gram The excessive disadvantage of chart database committed memory is taken, realizes the quick search of complex_relation data.
The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be said that A specific embodiment of the invention is only limitted to this, for those of ordinary skill in the art to which the present invention belongs, is not taking off Under the premise of from present inventive concept, several simple deduction or replace can also be made, all shall be regarded as belonging to the present invention by institute Claims of submission determine protection scope.

Claims (8)

1. a kind of complex_relation data storage and search method based on graph structure, it is characterised in that:
Including constructing complex_relation data storage model, the storage model is graph structure, has multiple nodes in the model, Have side to be connected with each other between different nodes, wherein the node table shows entity object, between the side presentation-entity Relationship, each node has itself multiple attributes, wherein the mode that the relationship and the attribute are all made of chained list carries out It saves.
2. storage according to claim 1 and search method, it is characterised in that:
The mode that the relationship and the attribute are all made of doubly linked list is stored.
3. storage according to claim 1 and search method, it is characterised in that:
In store the 1st relationship for belonging to the entity object of the node and the 1st attribute.By inquiring the relationship, so that it may All relationships for belonging to the entity object are found along the chained list of relationship.Likewise, passing through the 1st attribute of inquiry, so that it may edge The chained list of attribute, find all properties for belonging to the entity object.
4. storage according to claim 1 and search method, it is characterised in that:
The side start node and terminal node composition, and start node include the preposition relationship pointer of the node (Prev) and Postposition relationship pointer (Next), terminal node include the preposition relationship pointer of the node (Prev) and postposition relationship pointer (Next), Preposition pointer is directed toward the upper relationship with starting point, and postposition pointer is directed toward the latter relation of the same starting point.
5. storage according to claim 4 and search method, it is characterised in that:
All relationships of start node form a doubly linked list, and all relationships of terminal node form a doubly linked list.
6. storage according to claim 1 and search method, it is characterised in that:
It establishes and hybrid index structure is formed by node structure storage and relational structure, node is divided according to relationship type Group, and entity object node is ranked up with certain sequence, form the index structure based on attribute of a relation.
7. storage according to claim 1 and search method, it is characterised in that:
When being retrieved, query node first inquires corresponding first relationship of the node;Then, according to inquiring Relationship, search relationship storage organization find the beginning and end of node, along the preposition pointer or postposition pointer of starting point Find the corresponding relation of node.
8. storage according to claim 1 and search method, it is characterised in that:
The graph structure of the complex_relation data storage model is stored in relational database, by table attended operation, is searched To the relationship of figure interior joint and node.
CN201811643795.2A 2018-12-30 2018-12-30 A kind of complex_relation data storage and search method based on graph structure Pending CN109726305A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811643795.2A CN109726305A (en) 2018-12-30 2018-12-30 A kind of complex_relation data storage and search method based on graph structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811643795.2A CN109726305A (en) 2018-12-30 2018-12-30 A kind of complex_relation data storage and search method based on graph structure

Publications (1)

Publication Number Publication Date
CN109726305A true CN109726305A (en) 2019-05-07

Family

ID=66299530

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811643795.2A Pending CN109726305A (en) 2018-12-30 2018-12-30 A kind of complex_relation data storage and search method based on graph structure

Country Status (1)

Country Link
CN (1) CN109726305A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125265A (en) * 2019-12-13 2020-05-08 四川蜀天梦图数据科技有限公司 Method and device for generating mapping data based on relational database data
CN111523000A (en) * 2020-04-23 2020-08-11 北京百度网讯科技有限公司 Method, device, equipment and storage medium for importing data
CN112116951A (en) * 2020-08-14 2020-12-22 中国科学院计算技术研究所 Proteome data management method, medium and equipment based on graph database
CN112348934A (en) * 2020-10-20 2021-02-09 珠海金山网络游戏科技有限公司 Game map display method, device and medium based on large linked list
WO2021083239A1 (en) * 2019-10-28 2021-05-06 北京大学 Graph data query method and apparatus, and device and storage medium
CN112765418A (en) * 2021-04-08 2021-05-07 中译语通科技股份有限公司 Alias merging and storing method, system, terminal and medium based on graph structure
CN112836063A (en) * 2021-01-27 2021-05-25 四川新网银行股份有限公司 Method for realizing feature tracing
CN113448964A (en) * 2021-06-29 2021-09-28 四川蜀天梦图数据科技有限公司 Hybrid storage method and device based on graph-KV
CN113961754A (en) * 2021-09-08 2022-01-21 南湖实验室 Graph database system based on persistent memory
CN114996297A (en) * 2022-04-14 2022-09-02 建信金融科技有限责任公司 Data processing method, device, equipment, medium and product
CN115658329A (en) * 2022-12-22 2023-01-31 杭州欧若数网科技有限公司 Method, system and medium for optimizing memory of graph data structure
WO2023160137A1 (en) * 2022-02-25 2023-08-31 苏州浪潮智能科技有限公司 Graph data storage method and system, and computer device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6665863B1 (en) * 2000-05-31 2003-12-16 Microsoft Corporation Data referencing within a database graph
CN105608232A (en) * 2016-02-17 2016-05-25 扬州大学 Bug knowledge modeling method based on graphic database
CN106383879A (en) * 2016-09-13 2017-02-08 深圳市华傲数据技术有限公司 Method and system for handling government administration data
CN108549731A (en) * 2018-07-11 2018-09-18 中国电子科技集团公司第二十八研究所 A kind of knowledge mapping construction method based on ontology model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6665863B1 (en) * 2000-05-31 2003-12-16 Microsoft Corporation Data referencing within a database graph
CN105608232A (en) * 2016-02-17 2016-05-25 扬州大学 Bug knowledge modeling method based on graphic database
CN106383879A (en) * 2016-09-13 2017-02-08 深圳市华傲数据技术有限公司 Method and system for handling government administration data
CN108549731A (en) * 2018-07-11 2018-09-18 中国电子科技集团公司第二十八研究所 A kind of knowledge mapping construction method based on ontology model

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
BONELEE: "Neo4j图数据库简介和底层原理", 《HTTPS://WWW.CNBLOGS.COM/BONELEE/P/6211290.HTML》 *
JEWEL_JIA: "图数据存储初见", 《HTTPS://WWW.CNBLOGS.COM/JEWELL/P/5789270.HTML》 *
WEB8: "neo4j中索引的使用", 《HTTPS://WWW.CNBLOGS.COM/WEB100/P/NEO4J.HTML》 *
王莉: "《情报研究前沿聚焦》", 31 December 2017 *
范仁义: "Neo4j图数据库简介和底层原理", 《HTTPS://WWW.CNBLOGS.COM/RENYI-FAN/P/7833274.HTML》 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021083239A1 (en) * 2019-10-28 2021-05-06 北京大学 Graph data query method and apparatus, and device and storage medium
CN111125265B (en) * 2019-12-13 2020-10-02 四川蜀天梦图数据科技有限公司 Method and device for generating mapping data based on relational database data
CN111125265A (en) * 2019-12-13 2020-05-08 四川蜀天梦图数据科技有限公司 Method and device for generating mapping data based on relational database data
CN111523000A (en) * 2020-04-23 2020-08-11 北京百度网讯科技有限公司 Method, device, equipment and storage medium for importing data
CN112116951A (en) * 2020-08-14 2020-12-22 中国科学院计算技术研究所 Proteome data management method, medium and equipment based on graph database
CN112116951B (en) * 2020-08-14 2023-04-07 中国科学院计算技术研究所 Proteome data management method, medium and equipment based on graph database
CN112348934A (en) * 2020-10-20 2021-02-09 珠海金山网络游戏科技有限公司 Game map display method, device and medium based on large linked list
CN112836063A (en) * 2021-01-27 2021-05-25 四川新网银行股份有限公司 Method for realizing feature tracing
CN112765418B (en) * 2021-04-08 2022-04-01 中译语通科技股份有限公司 Alias merging and storing method, system, terminal and medium based on graph structure
CN112765418A (en) * 2021-04-08 2021-05-07 中译语通科技股份有限公司 Alias merging and storing method, system, terminal and medium based on graph structure
CN113448964A (en) * 2021-06-29 2021-09-28 四川蜀天梦图数据科技有限公司 Hybrid storage method and device based on graph-KV
CN113448964B (en) * 2021-06-29 2022-10-21 四川蜀天梦图数据科技有限公司 Hybrid storage method and device based on graph-KV
CN113961754A (en) * 2021-09-08 2022-01-21 南湖实验室 Graph database system based on persistent memory
WO2023160137A1 (en) * 2022-02-25 2023-08-31 苏州浪潮智能科技有限公司 Graph data storage method and system, and computer device
CN114996297A (en) * 2022-04-14 2022-09-02 建信金融科技有限责任公司 Data processing method, device, equipment, medium and product
CN114996297B (en) * 2022-04-14 2023-09-26 建信金融科技有限责任公司 Data processing method, device, equipment and medium
CN115658329A (en) * 2022-12-22 2023-01-31 杭州欧若数网科技有限公司 Method, system and medium for optimizing memory of graph data structure

Similar Documents

Publication Publication Date Title
CN109726305A (en) A kind of complex_relation data storage and search method based on graph structure
CN106227800B (en) Storage method and management system for highly-associated big data
CN103345521B (en) A kind of method and apparatus processing key assignments in Hash table database
CN111190904B (en) Method and device for hybrid storage of graph-relational database
CN106933833B (en) Method for quickly querying position information based on spatial index technology
CN103561133B (en) A kind of IP address attribution information index method and method for quickly querying
CN102662974B (en) A network graph index method based on adjacent node trees
CN111309868B (en) Knowledge graph construction and retrieval method and device
CN108829880B (en) Method for configuration management of optical network terminal equipment
CN103064908B (en) A kind of method by the quick duplicate removal list of internal memory
EP3767486B1 (en) Multi-record index structure for key-value stores
CN104731945A (en) Full-text searching method and device based on HBase
CN110888930A (en) Financial knowledge inquiry service interface design and implementation method based on knowledge map
CN104615734B (en) A kind of community management service big data processing system and its processing method
WO2015058500A1 (en) Data storage method and device
CN102571752A (en) Service-associative-index-map-based quality of service (QoS) perception Top-k service combination system
CN101963993B (en) Method for fast searching database sheet table record
CN102779186A (en) Whole process modeling method of unstructured data management
CN114860727A (en) Zipper watch updating method and device
CN103365960A (en) Off-line searching method of structured data of electric power multistage dispatching management
CN116150436B (en) Data display method and system based on node tree
CN112540987A (en) Big data management system of distribution and utilization electricity based on data mart
CN106933844B (en) Construction method of reachability query index facing large-scale RDF data
CN109271350B (en) Database and information point table automatic comparison and synchronization method based on telecontrol communication
CN110263108A (en) A kind of keyword Skyline fuzzy query method and system based on road network

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190507