CN110717056B - Update maintenance method and device for Noe j graph database and computer readable storage medium - Google Patents
Update maintenance method and device for Noe j graph database and computer readable storage medium Download PDFInfo
- Publication number
- CN110717056B CN110717056B CN201910830884.6A CN201910830884A CN110717056B CN 110717056 B CN110717056 B CN 110717056B CN 201910830884 A CN201910830884 A CN 201910830884A CN 110717056 B CN110717056 B CN 110717056B
- Authority
- CN
- China
- Prior art keywords
- document
- nodes
- node
- graph database
- noe
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/51—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/53—Querying
- G06F16/532—Query formulation, e.g. graphical querying
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to a big data technology, and discloses an updating and maintaining method of a Noe4j graph database, which comprises the following steps: acquiring a relation document of a Noe j graph database, inquiring nodes of graph data in the relation document, calculating an aggregation coefficient of the nodes, and generating an inquiry document of the Noe4j graph database according to the aggregation coefficient; calculating the average path length of any two nodes in the query document, supplementing the nodes to the query document according to the average path length, and generating a supplementary document; correcting nodes in the supplementary document to generate a corrected document; and analyzing the corrected document to generate a linked list relation document, and uploading the linked list relation document to the Noe j graph database to finish updating and maintaining the Noe j graph database. The invention also provides an updating and maintaining device of the Noe4j graph database and a computer readable storage medium. The invention realizes the efficient updating and maintenance of the Noe4j graph database.
Description
Technical Field
The invention relates to the technical field of big data, in particular to a method and a device for updating and maintaining a Noe4j graph database and a computer readable storage medium.
Background
The updating and maintenance of the Neo4j graph database are generally carried out by technicians according to data sources (including domain core concepts and the description of the relationship between the core concepts) provided by service personnel through data cleaning and arrangement, and finally, the data loading mode provided by Neo4j is used for completing the updating and maintenance, which cannot be directly recorded by the service personnel, is often limited by the professional level of the service personnel due to single mode and one-sided observation, and cannot accurately and efficiently complete the updating task.
Disclosure of Invention
The invention provides a method, a device and a computer readable storage medium for updating and maintaining a Noe4j graph database, which mainly aim to present accurate updating and maintaining results to a user when the user updates and maintains the Noe4j graph database.
In order to achieve the above object, the present invention provides a method for updating and maintaining a Noe j graph database, which includes:
acquiring a relation document of a Noe j graph database, inquiring nodes of graph data in the relation document, calculating an aggregation coefficient of the nodes, and generating an inquiry document of the Noe4j graph database according to the aggregation coefficient;
calculating the average path length of any two nodes in the query document, and supplementing the nodes to the query document in a random increasing mode to generate a supplement document if the number of the average path lengths exceeds the upper limit of the total path number of the query document;
correcting nodes in the supplementary document to generate a corrected document;
and analyzing the corrected document to generate a linked list relation document, and uploading the linked list relation document to the Noe j graph database to finish updating and maintaining the Noe j graph database.
Optionally, the method for calculating the aggregation coefficient of the node includes:
wherein C is i Representing node v i Aggregation coefficient, k i Representing node v i Number of adjacent nodes, e i Representing the number, k, of directed edges actually present between adjacent nodes i (k i -1) an upper limit on the number of edges present between adjacent nodes.
Optionally, the method for calculating the average path length of any two nodes in the query document includes:
wherein l ij Represents the average path of any two nodes in the query document, N represents the node number of the query document, and d ij Representing the shortest path length between any two nodes in the query document.
Optionally, the correcting the node in the supplementary document includes:
calculating any two nodes v in the supplementary document i "sum v j "intermediate number C with respect to node k B (k);
When said C B (k) When the threshold value is smaller than the preset threshold value, the node k and the node v are connected through a connection command i "or v j And combining to finish the correction operation of the node k.
Optionally, the calculation of any two nodes v in the supplementary document i "sum v j "intermediate number C with respect to node k B (k) The method of (1) comprises:
wherein V represents a set of all nodes in the supplemental document; delta ij Representing the node v i "sum v j The number of shortest paths between "s; delta ij (k) Representing the node v i "sum v j "number of shortest paths between nodes k.
In addition, in order to achieve the above object, the present invention further provides an update maintenance device for a Noe4j graph database, which includes a memory and a processor, wherein the memory stores an update maintenance program for the Noe4j graph database that can be executed on the processor, and the update maintenance program for the Noe4j graph database when executed by the processor implements the following steps:
acquiring a relation document of a Noe j graph database, inquiring nodes of graph data in the relation document, calculating an aggregation coefficient of the nodes, and generating an inquiry document of the Noe4j graph database according to the aggregation coefficient;
calculating the average path length of any two nodes in the query document, and supplementing the nodes to the query document in a random increasing mode to generate a supplement document if the number of the average path lengths exceeds the upper limit of the total path number of the query document;
correcting nodes in the supplementary document to generate a corrected document;
and analyzing the corrected document to generate a linked list relation document, and uploading the linked list relation document to the Noe j graph database to finish updating and maintaining the Noe j graph database.
Optionally, the method for calculating the aggregation coefficient of the node includes:
wherein C is i Representing node v i Aggregation coefficient, k i Representing node v i Number of adjacent nodes, e i Representing the number, k, of directed edges actually present between adjacent nodes i (k i -1) an upper limit on the number of edges present between adjacent nodes.
Optionally, the method for calculating the average path length of any two nodes in the query document includes:
wherein l ij Represents the average path of any two nodes in the query document, N represents the node number of the query document, and d ij Representing the shortest path length between any two nodes in the query document.
Optionally, the correcting the node in the supplementary document includes:
calculating any two nodes v in the supplementary document i "sum v j "intermediate number C with respect to node k B (k);
When said C B (k) When the threshold value is smaller than the preset threshold value, the node k and the node v are connected through a connection command i "or v j And combining to finish the correction operation of the node k.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium having stored thereon an update maintenance program of the Noe j graph database, the update maintenance program of the Noe4j graph database being executable by one or more processors to implement the steps of the update maintenance method of the Noe j graph database as described above.
According to the update maintenance method, the update maintenance device and the computer readable storage medium for the Noe4j graph database, when a user performs update maintenance on the Noe4j graph database, the obtained relationship document of the Noe4j graph database is supplemented, corrected and analyzed to generate the linked list relationship document, and the linked list relationship document is uploaded to the Noe4j graph database to complete update maintenance of the Noe4j graph database, so that an accurate update maintenance result can be presented to the user.
Drawings
Fig. 1 is a flowchart illustrating a method for updating and maintaining a Noe j database according to an embodiment of the invention;
fig. 2 is a schematic diagram of an internal structure of a device for updating and maintaining a database of Noe j diagram according to an embodiment of the present invention;
fig. 3 is a schematic block diagram of an update maintenance procedure of the Noe j-map database in the update maintenance apparatus of the Noe j-map database according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides an updating and maintaining method of a Noe4j graph database. Referring to fig. 1, a flowchart of a method for updating and maintaining a Noe j graph database according to an embodiment of the invention is shown. The method may be performed by an apparatus, which may be implemented in software and/or hardware.
In this embodiment, the update maintenance method of the Noe j graph database includes:
s1, acquiring a relation document of a Noe j graph database, inquiring nodes of graph data in the relation document, calculating an aggregation coefficient of the nodes, and generating an inquiry document of the Noe j graph database according to the aggregation coefficient.
In the preferred embodiment of the present invention, the Noe j graph database refers to: a database consisting of a set of nodes, which refers to a collection of nodes in the Neo4j graph database representing various objects, and a connection node, which refers to a description of the relationship between the nodes. Further, the invention downloads the target relationship document in the Neo4j graphic database based on the extraction command. The target relation document refers to a document which needs to be updated and maintained again in the Neo4j graphic database because of the change of the node itself or the relation among the nodes. Further, the invention stores the downloaded target relation document in a local server in a CSV format to generate the Neo4j library relation document.
Preferably, the extraction command may be an export command: neo4j-admin dump-database = graph.db-to=/home/robot/neoj_data/graph.db.
Further, the invention utilizes the declared query language cyto to acquire each node of the graph data in the relational document in the Neo4j library, and stores the connection logic between each node in the local server in a preliminary relational linked list mode.
In a preferred embodiment of the present invention, the calculation formula of the aggregation coefficient of the node is:
wherein C is i Representing node v i Aggregation coefficient, k i Representing node v i Number of adjacent nodes, e i Representing the number, k, of directed edges actually present between adjacent nodes i (k i -1) an upper limit on the number of edges present between adjacent nodes.
When the aggregation coefficient C i When the node v is larger than a preset first threshold value, the node v is described i High degree of tightness with adjacent nodes, the node v is reserved i When the aggregation coefficient is smaller than a preset first threshold value, the node v is described i The node v is deleted if the degree of tightness between the node v and the adjacent node is low i And generating query documents of the Neo4j graph database after deleting the corresponding nodes, and generating a relation linked list after synchronously updating the preliminary relation linked list. Preferably, the preset first threshold value is 0.5.
S2, calculating the average path length of any two nodes in the query document, and supplementing the nodes to the query document in a random increasing mode to generate a supplementing document if the number of the average path lengths exceeds the upper limit of the total path number of the query document.
The preferred embodiment of the invention traverses the nodes in the query document according to the relation among the nodes in the relation linked list to obtain the node number of the query document, and presets v i ' and v j ' is any two nodes in the query document, then the v i ' and v j The' average path calculation formula is:
wherein l ij Representing the v i ' and v j ' average path, N represents the node number of the query document, d ij Representing node v i ' and v j ' shortest path length between.
Further, in the preferred embodiment of the present invention, the total path number of the query document is preset to be 20%, wherein when the number of average path lengths exceeds the total path number of the query document by the upper limit, the present invention preferably uses a random increasing method, that is, at the node v i ' and v j ' random increase| (2-l) ij ) X 2| nodes, the random increase pattern refers to: at the node v i ' and v j ' add on existing path| (2-l) ij ) X 2| nodes, or at the node v i ' and v j ' additionally add between | (2-l) ij ) X 2| nodes, and at node v i ' and v j ' connect into a new path. And obtaining the supplementary nodes of the query document according to the random increasing mode, generating the supplementary document, synchronously updating the relation linked list and generating a supplementary relation linked list.
S3, correcting the nodes in the supplementary document to generate a corrected document.
The preferred embodiment of the invention traverses the nodes in the supplementary document according to the relation among the nodes in the supplementary relation linked list to obtain the node number in the supplementary document, and calculates any two nodes v in the supplementary document i "sum v j "intermediate number C with respect to node k B (k) A. The invention relates to a method for producing a fibre-reinforced plastic composite Wherein the C B (k) The calculation formula of (2) is as follows:
wherein V represents a set of all nodes in the supplemental document; delta ij Representing the node v i "sum v j The number of shortest paths between "s; delta ij (k) Representing the node v i "sum v j "number of shortest paths between nodes k.
Further, when said C B (k) When the threshold value is smaller than a preset second threshold value, the node k and the node v are connected through a connection command i "or v j And merging to finish the correction operation of the node k, generating the correction document after the correction operation is performed on all nodes in the supplementary document, and synchronously updating the supplementary relation linked list to generate a correction relation linked list. Preferably, in the present invention, the preset second threshold value is 0.25.
S4, analyzing the corrected document to generate a linked list relation document, and uploading the linked list relation document to the Noe4j graph database to complete updating and maintenance of the Noe4j graph database.
The preferred embodiment of the invention analyzes the corrected document through a skip list (skip list) algorithm, and preferentially, the invention initializes the skip list algorithm by calling a skip entry port, wherein the skip list algorithm refers to: and applying extra pointers in the process of analyzing the linked list, and skipping some non-key nodes to analyze the acted linked list. Further, the invention analyzes the logic relations of all nodes, paths and attributes in the corrected relation linked list through the skip list algorithm, stores each analysis result in a key-value pair mode, and gathers all analysis results to generate the linked list relation document.
Further, the method uploads the linked list relation document to the Noe4j graph database, and automatically generates updated Neo4j graph database contents according to the analysis result in the linked list relation document, so that the Noe4j graph database is updated and maintained.
The invention also provides a Noe4j graph database updating and maintaining device. Referring to fig. 2, an internal structure diagram of a device for updating and maintaining a Noe j database according to an embodiment of the invention is shown.
In this embodiment, the update maintenance device 1 of the Noe j graph database may be a PC (Personal Computer ), or a terminal device such as a smart phone, a tablet computer, or a portable computer, or may be a server. The Noe j map database update and maintenance device 1 includes at least a memory 11, a processor 12, a communication bus 13, and a network interface 14.
The memory 11 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the update maintenance device 1 of the Noe j graph database, for example a hard disk of the update maintenance device 1 of the Noe j graph database. The memory 11 may also be an external storage device of the update maintenance apparatus 1 of the Noe j graph database, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like provided on the update maintenance apparatus 1 of the Noe j graph database in other embodiments. Further, the memory 11 may include both the internal storage unit and the external storage device of the update maintenance apparatus 1 of the Noe j map database. The memory 11 can be used not only for storing application software of the update maintenance apparatus 1 installed in the Noe j graph database and various types of data, for example, a code of the update maintenance program 01 of the Noe j graph database, or the like, but also for temporarily storing data that has been output or is to be output.
The communication bus 13 is used to enable connection communication between these components.
The network interface 14 may optionally comprise a standard wired interface, a wireless interface (e.g. WI-FI interface), typically used to establish a communication connection between the apparatus 1 and other electronic devices.
Optionally, the device 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or a display unit, as appropriate, for displaying information processed in the update maintenance device 1 of the Noe j map database and for displaying a visual user interface.
Fig. 2 shows only the update maintenance device 1 of the Noe j map database with the update maintenance program 01 of the assemblies 11-14 and Noe4j map database, it will be understood by those skilled in the art that the structure shown in fig. 1 does not constitute a limitation of the update maintenance device 1 of the Noe4j map database, and may include fewer or more components than shown, or may combine certain components, or may be arranged in different components.
In the embodiment of the apparatus 1 shown in fig. 2, the memory 11 stores therein an update maintenance program 01 of the Noe4j map database; the processor 12 executes the update maintenance program 01 of the Noe j map database stored in the memory 11, and performs the following steps:
step one, acquiring a relation document of a Noe j graph database, inquiring nodes of graph data in the relation document, calculating an aggregation coefficient of the nodes, and generating an inquired document of the Noe j graph database according to the aggregation coefficient.
In the preferred embodiment of the present invention, the Noe j graph database refers to: a database consisting of a set of nodes, which refers to a collection of nodes in the Neo4j graph database representing various objects, and a connection node, which refers to a description of the relationship between the nodes. Further, the invention downloads the target relationship document in the Neo4j graphic database based on the extraction command. The target relation document refers to a document which needs to be updated and maintained again in the Neo4j graphic database because of the change of the node itself or the relation among the nodes. Further, the invention stores the downloaded target relation document in a local server in a CSV format to generate the Neo4j library relation document.
Preferably, the extraction command may be an export command: neo4j-admin dump-database = graph.db-to=/home/robot/neoj_data/graph.db.
Further, the invention utilizes the declared query language cyto to acquire each node of the graph data in the relational document in the Neo4j library, and stores the connection logic between each node in the local server in a preliminary relational linked list mode.
In a preferred embodiment of the present invention, the calculation formula of the aggregation coefficient of the node is:
wherein C is i Representing node v i Aggregation coefficient, k i Representing node v i Number of adjacent nodes, e i Representing the number, k, of directed edges actually present between adjacent nodes i (k i -1) an upper limit on the number of edges present between adjacent nodes.
When the aggregation coefficient C i When the node v is larger than a preset first threshold value, the node v is described i High degree of tightness with adjacent nodes, the node v is reserved i When the aggregation coefficient is smaller than a preset first threshold value, the node v is described i The node v is deleted if the degree of tightness between the node v and the adjacent node is low i And generating query documents of the Neo4j graph database after deleting the corresponding nodes, and generating a relation linked list after synchronously updating the preliminary relation linked list. Preferably, the preset first threshold value is 0.5.
Calculating the average path length of any two nodes in the query document, and supplementing the nodes to the query document in a random increasing mode to generate a supplementing document if the number of the average path lengths exceeds the upper limit of the total path number of the query document.
The preferred embodiment of the invention traverses the nodes in the query document according to the relation among the nodes in the relation linked list to obtain the node number of the query document, and presets v i ' and v j ' is any two nodes in the query document, then the v i ' and v j The' average path calculation formula is:
wherein l ij Representing the v i ' and v j The average path of the' average path,n represents the node number of the query document, d ij Representing node v i ' and v i ' shortest path length between.
Further, in the preferred embodiment of the present invention, the total path number of the query document is preset to be 20%, wherein when the number of average path lengths exceeds the total path number of the query document by the upper limit, the present invention preferably uses a random increasing method, that is, at the node v i ' and v j ' random increase| (2-l) ij ) X 2| nodes, the random increase pattern refers to: at the node v i ' and v j ' add on existing path| (2-l) ij ) X 2| nodes, or at the node v i ' and v j ' additionally add between | (2-l) ij ) X 2| nodes, and at node v i ' and v j ' connect into a new path. And obtaining the supplementary nodes of the query document according to the random increasing mode, generating the supplementary document, synchronously updating the relation linked list and generating a supplementary relation linked list.
And thirdly, correcting nodes in the supplementary document to generate a corrected document.
The preferred embodiment of the invention traverses the nodes in the supplementary document according to the relation among the nodes in the supplementary relation linked list to obtain the node number in the supplementary document, and calculates any two nodes v in the supplementary document i "sum v j "intermediate number C with respect to node k B (k) A. The invention relates to a method for producing a fibre-reinforced plastic composite Wherein the C B (k) The calculation formula of (2) is as follows:
wherein V represents a set of all nodes in the supplemental document; delta ij Representing the node v i "sum v j The number of shortest paths between "s; delta ij (k) Representing the node v i "sum v j "shortest Path strip between nodes kA number.
Further, when said C B (k) When the threshold value is smaller than a preset second threshold value, the node k and the node v are connected through a connection command i "or v j And merging to finish the correction operation of the node k, generating the correction document after the correction operation is performed on all nodes in the supplementary document, and synchronously updating the supplementary relation linked list to generate a correction relation linked list. Preferably, in the present invention, the preset second threshold value is 0.25.
And fourthly, analyzing the corrected document to generate a linked list relation document, and uploading the linked list relation document to the Noe4j graph database to finish updating and maintaining the Noe4j graph database.
The preferred embodiment of the invention analyzes the corrected document through a skip list (skip list) algorithm, and preferentially, the invention initializes the skip list algorithm by calling a skip entry port, wherein the skip list algorithm refers to: and applying extra pointers in the process of analyzing the linked list, and skipping some non-key nodes to analyze the acted linked list. Further, the invention analyzes the logic relations of all nodes, paths and attributes in the corrected relation linked list through the skip list algorithm, stores each analysis result in a key-value pair mode, and gathers all analysis results to generate the linked list relation document.
Further, the method uploads the linked list relation document to the Noe4j graph database, and automatically generates updated Neo4j graph database contents according to the analysis result in the linked list relation document, so that the Noe4j graph database is updated and maintained.
Optionally, in other embodiments, the update maintenance program of the Noe j graph database may be further divided into one or more modules, where one or more modules are stored in the memory 11 and executed by one or more processors (the processor 12 in this embodiment) to complete the present invention, and the modules referred to herein refer to a series of instruction segments of a computer program capable of performing a specific function, for describing the execution of the update maintenance program of the Noe j graph database in the update maintenance apparatus of the Noe4j graph database.
For example, referring to fig. 3, a schematic program module of an update maintenance program of the Noe j graph database in an embodiment of the update maintenance apparatus for Noe j graph database of the present invention is shown, where the update maintenance program of the Noe j graph database may be divided into a query document generation module 10, a supplementary document generation module 20, a correction document generation module 30, and a linked list document generation module 40, by way of example:
the queried document generation module 10 is for: acquiring a relation document of the Noe j graph database, querying nodes of graph data in the relation document, calculating an aggregation coefficient of the nodes, and generating a query document of the Noe4j graph database according to the aggregation coefficient.
The supplementary document generating module 20 is configured to: and calculating the average path length of any two nodes in the query document, and supplementing the nodes to the query document in a random increasing mode to generate a supplementing document if the number of the average path lengths exceeds the upper limit of the total path number of the query document.
The corrected document generation module 30 is configured to: and correcting the nodes in the supplementary document to generate a corrected document.
The linked list relation document generating module 40 is configured to: and analyzing the corrected document to generate a linked list relation document, and uploading the linked list relation document to the Noe j graph database to finish updating and maintaining the Noe j graph database.
The functions or operation steps implemented when the program modules such as the above-described query document generation module 10, supplementary document generation module 20, corrected document generation module 30, and linked list relationship document generation module 40 are executed are substantially the same as those of the above-described embodiments, and will not be described in detail herein.
In addition, an embodiment of the present invention further proposes a computer readable storage medium, where an update maintenance program of the Noe j graph database is stored on the computer readable storage medium, where the update maintenance program of the Noe4j graph database may be executed by one or more processors to implement the following operations:
acquiring a relation document of a Noe j graph database, inquiring nodes of graph data in the relation document, calculating an aggregation coefficient of the nodes, and generating an inquiry document of the Noe4i graph database according to the aggregation coefficient;
calculating the average path length of any two nodes in the query document, and supplementing the nodes to the query document in a random increasing mode to generate a supplement document if the number of the average path lengths exceeds the upper limit of the total path number of the query document;
correcting nodes in the supplementary document to generate a corrected document;
and analyzing the corrected document to generate a linked list relation document, and uploading the linked list relation document to the Noe j graph database to finish updating and maintaining the Noe j graph database.
The embodiment of the computer readable storage medium of the present invention is substantially the same as the above-described embodiments of the apparatus and method for updating and maintaining the Noe j graph database, and will not be described in detail herein.
It should be noted that, the foregoing reference numerals of the embodiments of the present invention are merely for describing the embodiments, and do not represent the advantages and disadvantages of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, apparatus, article, or method that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
Claims (4)
1. A method for updating and maintaining a Noe j graph database, the method comprising:
acquiring a relation document of a Noe j graph database, inquiring nodes of graph data in the relation document, calculating an aggregation coefficient of the nodes, and generating an inquiry document of the Noe4j graph database according to the aggregation coefficient;
calculating the average path length of any two nodes in the query document, and supplementing the nodes to the query document in a random increasing mode to generate a supplement document if the number of the average path lengths exceeds the upper limit of the total path number of the query document;
correcting nodes in the supplementary document to generate a corrected document;
analyzing the corrected document to generate a linked list relation document, and uploading the linked list relation document to the Noe j graph database to finish updating and maintaining the Noe j graph database;
the method for calculating the aggregation coefficient of the node comprises the following steps:
wherein C is i Representing node v i Aggregation coefficient, k i Representing node v i Number of adjacent nodes, e i Representing the number, k, of directed edges actually present between adjacent nodes i (k i -1) an upper limit on the number of edges present between adjacent nodes;
the method for calculating the average path length of any two nodes in the query document comprises the following steps:
wherein l ij Represents the average path of any two nodes in the query document, N represents the node number of the query document, and d ij Representing the shortest path length between any two nodes in the query document; the correcting the nodes in the supplementary document comprises the following steps:
calculating any two nodes v in the supplementary document i "sum v j "intermediate number C with respect to node k B (k);
When said C B (k) When the threshold value is smaller than the preset threshold value, the node k and the node v are connected through a connection command i "or v j And combining to finish the correction operation of the node k.
2. The method for updating and maintaining Noe j-graph database according to claim 1, wherein any two nodes v in said supplementary document are calculated i "sum v j "intermediate number C with respect to node k B (k) The method of (1) comprises:
wherein V represents a set of all nodes in the supplemental document; delta ij Representing the node v i "sum v j The number of shortest paths between "s; delta ij (k) Representing the node v i "sum v j "number of shortest paths between nodes k.
3. An update and maintenance device for a Noe j graph database, comprising a memory and a processor, wherein the memory stores an update and maintenance program for the Noe j graph database that can be executed on the processor, and the update and maintenance program for the Noe4j graph database when executed by the processor implements the steps of:
acquiring a relation document of a Noe j graph database, inquiring nodes of graph data in the relation document, calculating an aggregation coefficient of the nodes, and generating an inquiry document of the Noe4j graph database according to the aggregation coefficient;
calculating the average path length of any two nodes in the query document, and supplementing the nodes to the query document in a random increasing mode to generate a supplement document if the number of the average path lengths exceeds the upper limit of the total path number of the query document;
correcting nodes in the supplementary document to generate a corrected document;
analyzing the corrected document to generate a linked list relation document, and uploading the linked list relation document to the Noe j graph database to finish updating and maintaining the Noe j graph database;
the method for calculating the aggregation coefficient of the node comprises the following steps:
wherein C is i Representing node v i Aggregation coefficient, k i Representing node v i Number of adjacent nodes, e i Representing the number, k, of directed edges actually present between adjacent nodes i (k i -1) an upper limit on the number of edges present between adjacent nodes;
the method for calculating the average path length of any two nodes in the query document comprises the following steps:
wherein l ij Represents the average path of any two nodes in the query document, N represents the node number of the query document, and d ij Representing the shortest path length between any two nodes in the query document;
the correcting the nodes in the supplementary document comprises the following steps:
calculating any two nodes v in the supplementary document i "sum v j "intermediate number C with respect to node k B (k);
When said C B (k) When the threshold value is smaller than the preset threshold value, the node k and the node v are connected through a connection command i "or v j And combining to finish the correction operation of the node k.
4. A computer readable storage medium having stored thereon an update maintenance program for a Noe j graph database, the update maintenance program for the Noe j graph database being executable by one or more processors to implement the steps of the update maintenance method for the Noe j graph database of any one of claims 1 to 2.
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910830884.6A CN110717056B (en) | 2019-09-03 | 2019-09-03 | Update maintenance method and device for Noe j graph database and computer readable storage medium |
| PCT/CN2019/117288 WO2021042528A1 (en) | 2019-09-03 | 2019-11-12 | Method and apparatus for updating and maintaining noe4j graph database, and computer readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910830884.6A CN110717056B (en) | 2019-09-03 | 2019-09-03 | Update maintenance method and device for Noe j graph database and computer readable storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110717056A CN110717056A (en) | 2020-01-21 |
| CN110717056B true CN110717056B (en) | 2023-05-23 |
Family
ID=69210212
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910830884.6A Active CN110717056B (en) | 2019-09-03 | 2019-09-03 | Update maintenance method and device for Noe j graph database and computer readable storage medium |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110717056B (en) |
| WO (1) | WO2021042528A1 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112015819A (en) * | 2020-08-31 | 2020-12-01 | 杭州欧若数网科技有限公司 | Data updating method, device, equipment and medium for distributed graph database |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120096043A1 (en) * | 2010-10-19 | 2012-04-19 | 7 Degrees, Inc. | Data graph cloud system and method |
| US10083236B2 (en) * | 2015-05-29 | 2018-09-25 | Salesforce.Com, Inc. | Database searching using a graph of nodes and edges formed using log node pairs |
| US10671588B2 (en) * | 2016-07-08 | 2020-06-02 | Ebay Inc. | Multiple database updates using paths |
| CN110110154B (en) * | 2018-02-01 | 2023-07-11 | 腾讯科技(深圳)有限公司 | Image file processing method, device and storage medium |
| CN109670089A (en) * | 2018-12-29 | 2019-04-23 | 颖投信息科技(上海)有限公司 | Knowledge mapping system and its figure server |
| CN110011830A (en) * | 2019-03-03 | 2019-07-12 | 北京立思辰安科技术有限公司 | Communication topology information modeling method based on data on flows |
-
2019
- 2019-09-03 CN CN201910830884.6A patent/CN110717056B/en active Active
- 2019-11-12 WO PCT/CN2019/117288 patent/WO2021042528A1/en not_active Ceased
Also Published As
| Publication number | Publication date |
|---|---|
| CN110717056A (en) | 2020-01-21 |
| WO2021042528A1 (en) | 2021-03-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111414353A (en) | Intelligent missing data filling method and device and computer readable storage medium | |
| CN110363303B (en) | Intelligent allocation model training memory method, device and computer-readable storage medium | |
| CN110389896A (en) | Automatic code analysis and testing method, device and computer-readable storage medium | |
| WO2019227716A1 (en) | Method for generating influenza prediction model, apparatus, and computer readable storage medium | |
| US8732655B2 (en) | Systems and methods for metamodel transformation | |
| WO2019056793A1 (en) | Device, method, and computer readable storage medium for identifying resume | |
| CN111860641A (en) | Power grid image recognition method, electronic device and storage medium | |
| CN112925552B (en) | Code processing method, device, equipment and storage medium | |
| CN108491326A (en) | Behavioral test recombination method, device and storage medium | |
| CN104598570A (en) | Resource fetching method and device | |
| CN105718468A (en) | Method and device for building ODS layer of data warehouse | |
| CN111241066B (en) | Platform database automation operation and maintenance method, device and computer readable storage medium | |
| WO2019227711A1 (en) | Method and apparatus for generating influenza prediction model, and computer-readable storage medium | |
| CN110717056B (en) | Update maintenance method and device for Noe j graph database and computer readable storage medium | |
| CN114741085B (en) | Data processing method, device, equipment and storage medium | |
| HK40020152B (en) | Method and device for updating and maintaining noe4j graph database and computer readable storage medium | |
| CN116956032B (en) | Service data processing method and device based on service model | |
| CN110598995A (en) | Intelligent customer rating method and device and computer readable storage medium | |
| WO2021147251A1 (en) | Internet of things device connection test method and apparatus, computer device and storage medium | |
| CN114580943B (en) | Project risk tracking methods, devices, computer equipment, media and program products | |
| HK40020152A (en) | Method and device for updating and maintaining noe4j graph database and computer readable storage medium | |
| CN105608097A (en) | Method and device for adaptively adjusting database structure | |
| CN111160336B (en) | Target detection method, device and computer readable storage medium | |
| CN115526731A (en) | Task batch processing method and device, computer equipment and storage medium | |
| CN114896265A (en) | Method, device and equipment for constructing full link and computer readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40020152 Country of ref document: HK |
|
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |















