A service method and system for implementing the management of neo4j graph database instances

Through the neo4j graph database instance management service method, the graph database instance is managed using the uuid identification code and CQL/JDBC interface, the problem of engineers efficient access to multi-tenant scenarios is solved, and efficient graph database operation and project development assistance is realized.

CN115774729BActive Publication Date: 2025-07-18FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111038536.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-06
Publication Date
2025-07-18
Estimated Expiration
2041-09-06

AI Technical Summary

Technical Problem

When using the graph database, there are multi-tenant scenarios where engineering personnel have high learning costs and cannot quickly and conveniently access to componentized products, resulting in inefficient project development.

Method used

A service method for realizing the management of neo4j graph database instances is provided. Through the collaborative operation of NDR components and graph database administrators, including steps S1 to S10, it realizes efficient access to componentized products, uses uuid universal unique identification code to manage the life cycle of graph database instances, and manages nodes and relationships through CQL query language and JDBC interface.

Benefits of technology

It significantly reduces the time cost of engineering personnel learning and accessing graph databases, solves the pain points of multi-tenant management, helps the DevOps process, and reduces the company's project development costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115774729B_ABST
    Figure CN115774729B_ABST
Patent Text Reader

Abstract

The present invention provides a service method for implementing the management of neo4j graph database instances. The method includes the following steps: Step S1, the NDR component requests to establish a new graph database to store resources; Step S2, the graph database administrator requests the interface for adding a new graph database, and the server will add a new graph database instance locally and record the uuid (universally unique identifier); Step S3, the graph database administrator passes in the uuid, and provides the uuid to the NDR component; Step S4, the NDR component passes in the node label and the uuid and requests the interface for adding a new node to add a new node; Step S5, the NDR component passes in the name of the newly added node and the uuid and requests the interface for adding a new node relationship to add the relationship between the nodes; Step S6, in the process of establishing the node relationship, a complete graph database is constructed. The present invention can achieve the efficient promotion of componentized products to access the graph database by endowing general database operation capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of graph databases, and particularly to a service method and system for implementing the management of neo4j graph database instances. Background Art

[0002] The graph database instance management service (system) helps engineering personnel quickly access and efficiently develop various graph database-based applications by integrating the capabilities of open-source tools and self-developed service capabilities suitable for the componentized product tenant isolation scenario. Through this graph database instance management service, engineering personnel can conveniently implement the isolation management of multi-tenant graph database instances and all regular operations of the graph database, thereby efficiently and gracefully promoting the progress of projects and helping to realize scenario applications such as the establishment and correlation analysis of data relationships.

[0003] Currently, there is a certain time cost for engineering personnel to use and learn graph databases, and it is not convenient and fast to access the multi-tenant scenarios of componentized products. Summary of the Invention

[0004] To overcome the above problems, the object of the present invention is to provide a method that can achieve efficient promotion of the access of componentized products to graph databases by endowing general database operation capabilities.

[0005] The present invention is implemented as follows: A service method for implementing the management of neo4j graph database instances, the method comprising the following steps:

[0006] Step S1, the NDR component requests to establish a new graph database to store resources;

[0007] Step S2, the graph database administrator requests the new graph database interface, and the server allocates multiple unused ports to the instances of the new graph database interface. The server will create a new graph database instance locally and record the uuid (Universally Unique Identifier);

[0008] Step S3, the graph database administrator passes in the uuid and requests to start the graph database interface, and provides the uuid to the NDR component;

[0009] Step S4, the NDR component passes in the node label and uuid and requests the new node interface to create a new node;

[0010] Step S5, the NDR component passes in the new node name and uuid and requests the new node relationship interface to create the relationship between new nodes;

[0011] Step S6: Repeat steps S3 to S5, the process of establishing node relationships, to build a complete graph database, thereby achieving the purpose of promoting componentized products to access the graph database.

[0012] Further, after step S6, the following steps are also included: Step S7: The NDR component passes in node labels and attributes, and the uuid (Universally Unique Identifier) requests a new index interface, adding an index to the attributes of the node; Step S8: The NDR component passes in the node label name and the uuid and requests a node query interface, searches for the corresponding node, and passes in the uuid to use other general capabilities; Step S9: When the NDR component needs to be updated, stop using the graph database. The graph database administrator passes in the uuid to the terminate graph database interface to stop the graph data instance process; Step S10: The graph database administrator passes in the uuid to the delete graph data interface and deletes the graph database instance file on the server local.

[0013] Further, step S2 is further specifically as follows: In the server local folder, store an original neo4j graph database compressed package. When adding a new graph database, the server allocates four unused ports as the BOLT port, HTTP port, HTTPS port, and SHELL port of the graph database instance. Create a new folder locally on the server, named by concatenating the BOLT port, HTTP port, HTTPS port, and SHELL port of the graph database instance; Unzip the original neo4j graph database compressed package to the new folder, modify the configuration file neo4j.conf in the / bin directory, write the BOLT port, HTTP port, HTTPS port, and SHELL port of the new graph database instance into the conf configuration. The server generates a unique uuid, and writes the uuid and the graph database instance folder name into the MySQL tenant database, completing the addition of the graph database instance.

[0014] Further, step S3 is further specifically as follows: The user passes in the uuid. The server uses the uuid to query the folder name of the graph database instance in the MySQL tenant database; The server uses the method Runtime.getRuntime().exec() of the JAVA development tool to run the startneo4j.bat console program in the / bin directory under the instance folder, thus starting the corresponding graph database; Use the Kernel32 class and WinNT.HANDLE class of the JAVA development tool to obtain the process ID of the graph database instance and store it in the MySQL tenant database.

[0015] Further, the step S5 is further specifically as follows: The graph database provides the ability to add neo4j nodes by encapsulating the corresponding JDBC application interface, open-source client, and CQL query language, and uses the MERGE command of the CQL language to implement: Determine whether the node exists. If it does, keep it unchanged. If not, add it.

[0016] Further, the step S6 is further specifically as follows: The graph database provides the ability to add relationships between nodes by encapsulating the corresponding JDBC application interface, open-source client, and CQL query language, and uses the MATCH and MERGE commands of the CQL language to implement: Determine whether the relationship exists. If it does, do not add it. If not, add it.

[0017] The present invention also provides a service system for implementing the management of neo4j graph database instances, including a creation module, a request module, a startup module, a new node module, a node relationship module, and a construction completion module; The creation module, that is, the NDR component proposes to create a new graph database to store resources; The request module, that is, the graph database administrator requests the new graph database interface, and the server allocates multiple unused ports to the instances of the new graph database interface. The server will create a new graph database instance locally and record the uuid (Universally Unique Identifier); The startup module, that is, the graph database administrator passes in the uuid and requests to start the graph database interface, and provides the uuid to the NDR component; The new node module, that is, the NDR component passes in the node label and uuid and requests the new node interface to add a new node; The node relationship module, that is, the NDR component passes in the new node name and uuid and requests the new node relationship interface to add the relationship between the new nodes; The construction completion module, that is, repeat the startup module, the new node module, and the node relationship module to establish the process of node relationships and construct a complete graph database, so as to achieve the purpose of promoting the access of componentized products to the graph database.

[0018] Further, it also includes a new index module, a search module, a termination module, and a deletion module. The new index module, that is, the NDR component passes in the node label and attributes, and the uuid (Universally Unique Identifier) requests the new index interface to add an index to the node attributes. The search module, that is, the NDR component passes in the node label name and the uuid and requests the query node interface to search for the corresponding node, and then passes in the uuid to use other general capabilities. The termination module, that is, when the NDR component needs to be updated and the graph database stops being used, the graph database administrator passes in the uuid to the terminate graph database interface to stop the graph data instance process. The deletion module, that is, the graph database administrator passes in the uuid to the delete graph data interface and deletes the graph database instance file on the server local.

[0019] Further, the request module is further specifically as follows: In the server local folder, there is an original compressed package of the neo4j graph database. When adding a new graph database, the server allocates four unused ports as the BOLT port, HTTP port, HTTPS port, and SHELL port of the graph database instance. A new folder is created locally on the server, named by concatenating the BOLT port, HTTP port, HTTPS port, and SHELL port of the graph database instance. The original neo4j graph database compressed package is decompressed into the new folder, and the configuration file neo4j.conf in the / bin directory is modified to write the BOLT port, HTTP port, HTTPS port, and SHELL port of the new graph database instance into the conf configuration. The server generates a unique uuid, and writes the uuid and the graph database instance folder name into the MySQL tenant database to complete the addition of the graph database instance.

[0020] Further, the start module is further specifically as follows: The user passes in the uuid. The server uses the uuid to query the folder name of the graph database instance in the MySQL tenant database. The server uses the method Runtime.getRuntime().exec() of the JAVA development tool to run the start neo4j.bat console program in the / bin directory under the instance folder, and then the corresponding graph database can be started. The Kernel32 class and WinNT.HANDLE class of the JAVA development tool are used to obtain the process ID of the graph database instance and store it in the MySQL tenant database.

[0021] Further, the node relationship module is further specifically as follows: The graph database provides the ability to add neo4j nodes by encapsulating the corresponding JDBC application interface, open-source client, and CQL query language, and uses the MERGE command of the CQL language to implement: Determine whether the node exists. If it does, keep it unchanged; if not, add it.

[0022] Further, the construction completion module is further specifically as follows: The graph database provides the ability to add relationships between nodes by encapsulating the corresponding JDBC application interface, open-source client, and CQL query language, and uses the MATCH and MERGE commands of the CQL language to implement: Determine whether the relationship exists. If it does, do not add it; if not, add it.

[0023] The beneficial effects of the present invention are as follows: Through the present invention, the time cost for engineering personnel to learn and access the graph database can be greatly reduced; it solves the pain points that the conventional graph database Client and other methods cannot meet the tenant management requirements, helps DevOps, and reduces costs for the company's project development. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a schematic flowchart of the method of the present invention.

[0025] Figure 2 It is a schematic block diagram of the system principle of the present invention.

[0026] Figure 3 It is a schematic block diagram of the instance lifecycle management module.

[0027] Figure 4 It is a schematic block diagram of the authentication module.

[0028] Figure 5 It is a schematic block diagram of the general capabilities module of the graph database. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0029] The present invention will be further described below with reference to the accompanying drawings.

[0030] Please refer to Figure 1 As shown, a service method for implementing neo4j graph database instance management of the present invention includes the following steps:

[0031] Step S1, the NDR component proposes to establish a new graph database to store resources;

[0032] Step S2, the graph database administrator requests to add a graph database interface, and the server allocates multiple unused ports to the instance of the added graph database interface. The server will add a graph database instance locally and record the uuid (universally unique identifier);

[0033] Step S3: The graph database administrator passes in the uuid (Universally Unique Identifier), requests to start the graph database interface, and provides the uuid to the NDR component;

[0034] Step S4: The NDR component passes in the node label and the uuid, requests the new node interface, and adds a new node;

[0035] Step S5: The NDR component passes in the name of the newly added node and the uuid, requests the new node relationship interface, and adds the relationship between the nodes;

[0036] Step S6: Repeat Steps S3 to S5 to establish the process of node relationships, construct a complete graph database, thereby achieving the purpose of promoting componentized products to access the graph database.

[0037] The present invention will be further described below through a specific embodiment:

[0038] The NDR component puts forward a requirement to establish a new graph database to store courseware and teacher information resources. The implementation steps are as follows:

[0039] 1. The graph database administrator requests the new graph database interface. The service allocation server assigns 4 unused ports to the new instance. The service will add a new graph database instance locally on the server and generate a new tenant record in the tenant database, recording the uuid and the 4 port numbers, and return the uuid of the tenant;

[0040] 2. The graph database administrator passes in the uuid and requests to start the graph database interface. After waiting for a few minutes for the graph database instance to start, provide the uuid to the NDR component personnel;

[0041] 3. The NDR component personnel pass in the node label "courseware" and its attributes (such as courseware name: "Returning to Nature", courseware content: "Planting beans under the southern mountain...") and the uuid, and request the new node interface to add a "courseware" node;

[0042] 4. The NDR component personnel pass in the node label "teacher" and its attributes (such as teacher name: "Little A", teaching grade: "Grade 8 in junior high school") and the uuid, and request the new node interface to add a "teacher" node;

[0043] 5. The NDR component personnel pass in the courseware name ("Returning to Nature") and the teacher name ("Little A"), as well as the relationship name between the courseware and the teacher (such as "produced"), and the uuid, and request the new relationship interface to add the relationship between the nodes;

[0044] 6. The NDR component personnel repeat the process of establishing nodes and relationships similar to Steps 3, 4, and 5 to construct the complete content of the graph database;

[0045] 7. The NDR component personnel pass in the node label name "teacher" and the attribute "teacher name", and the uuid to request the new index interface, and add an index to the "teacher name" attribute of the "teacher" node;

[0046] 8. The NDR component personnel pass in "teacher name: Xiao A" and the uuid to request the query node interface, and search for the corresponding node;

[0047] 9. The NDR component personnel pass in the uuid to use other general capabilities of this service;

[0048] 10. The NDR component requirement is updated, and the graph database is stopped from being used;

[0049] 11. The graph database administrator passes in the uuid to the terminate graph database interface to stop the graph data instance process;

[0050] 12. The graph database administrator passes in the uuid to the delete graph database interface, and the service deletes the tenant records on the MySQL tenant database and deletes the graph database instance files on the server local.

[0051] It is mainly divided into two major modules:

[0052] 1. Management module: mainly through Java code to operate on the file system, process management, and MySQL database, providing management of graph database instances and tenant information;

[0053] 2. General capability module: mainly through encapsulating the CQL graph database query language, providing services for users to perform general operations on the graph database.

[0054] I. Graph database management module

[0055] The graph database management module provides capabilities such as managing database instances, implementing tenant separation, and integrating general database operations, etc.

[0056] 1.1 Instance lifecycle management module (please refer to Figure 3 as shown)

[0057] The service provides capabilities such as adding, moving, modifying, deleting graph database files on the server local, and starting and terminating system processes, including adding, deleting, starting, and terminating graph database instances, which fully improves the scalability of the service.

[0058] Add a new graph database instance: Place an original neo4j compressed package in the local server folder (e.g., D: / / neo4j / ). When adding a new graph database, the service allocates four unused ports as the BOLT, HTTP, HTTPS, and SHELL ports of the graph database instance. Create a new folder locally on the server, named by concatenating the 4 ports of the instance (such as 7687-7476-7471-7339). Unzip the original compressed package into the new folder, modify the configuration file neo4j.conf in the / bin directory, and write the BOLT, HTTP, HTTPS, and SHELL ports of the new instance into the conf configuration. The service generates a unique uuid and writes the uuid and the instance folder name (7687-7476-7471-7339) into the MySQL tenant database to complete the addition of the instance. Each tenant has a graph database instance, and a graph database instance occupies 4 ports on the server. The service can operate the corresponding instance by establishing a connection with the port, such as jdbc:neo4j:bolt: / / {graph database server IP}:{BOLT port number}, or jdbc:neo4j:http: / / {graph database server IP}:{HTTP port number}.

[0059] The UUID of the tenant and the four occupied ports are recorded in the MySQL tenant database. After the user passes in the uuid, the service uses this uuid to search in the MySQL database to obtain the port numbers of the corresponding instance and concatenates them into a url to establish a connection with the graph database belonging to the tenant for graph database operations with tenant isolation.

[0060] Start the graph database instance: The user passes in the uuid, and the service uses the uuid to query the instance folder name (such as 7687-7476-7471-7339) in the MySQL tenant database. The service uses the JAVA method Runtime.getRuntime().exec() to run start neo4j.bat console in the / bin directory under the instance folder to start the corresponding graph database. Use the JAVA Kernel32 and WinNT.HANDLE classes to obtain the process ID (pid) of the graph database instance and store it in the MySQL tenant database.

[0061] Terminate the graph database instance: The user passes in the uuid, and the service queries the process ID (pid) of the instance in the MySQL tenant database through the uuid. The service uses the JAVA Runtime.getRuntime().exec() to run the kill command to directly kill the pid process. To achieve the purpose of terminating the instance.

[0062] Deleting a Graph Database Instance: After terminating the instance, the user can delete the instance by passing in the uuid. The service uses the uuid to query the folder name of the instance in the MySQL tenant database (such as 7687-7476-7471-7339), and directly uses JAVA code to perform a physical deletion on this folder. Then, it deletes the tenant record in the MySQL tenant database through the uuid.

[0063] 1.2 Authentication Module (please refer to Figure 4 shown)

[0064] The service conducts tenant management by differentiating the BOLT, HTTP, HTTPS, and SHELL ports of each graph database, allowing the user to pass in the tenant uuid during the request. The server will determine the graph data ports belonging to the tenant based on the uuid, thereby providing the ability to distinguish graph database tenant authentication.

[0065] Each tenant has a graph database instance, and a graph database instance uses four ports: BOLT, HTTP, HTTPS, and SHELL. By establishing connections with the corresponding ports, the service can operate the corresponding instance. For example, jdbc:neo4j:bolt: / / {graph database server IP}:{BOLT port number}, or jdbc:neo4j:http: / / {graph database server IP}:{HTTP port number}.

[0066] The UUID of the tenant and the four ports are all recorded in the MySQL tenant database. After the user passes in the uuid, the service uses this uuid to search in the MySQL tenant database to obtain the port numbers of the corresponding instance and splices them into a url to establish a connection with the graph database belonging to the tenant for graph database cql operations.

[0067] 1.3 Graph Database General Capability Communication Module

[0068] Based on the premise that the service controls the lifecycle of the graph database instance, by integrating the management capabilities of the graph database with the general capabilities mentioned below, it meets the operational requirements of the graph database in a multi-tenant scenario.

[0069] II. Graph Database General Capability Module (please refer to Figure 5 shown)

[0070] The general ability module of the graph database provides the general abilities of modules such as basic configuration management, node management, relationship management, attribute management, and query management by encapsulating the corresponding JDBC, open-source client, and CQL query language, combined with the ability of tenant isolation; the JDBC is Java Database Connectivity, which is an application programming interface in the Java language to standardize how client programs access databases, and provides methods such as querying and updating data in the database.

[0071] 2.1 Basic Configuration Management

[0072] The encapsulation provides the ability to clear all data, which is implemented using the MATCH, OPTIONAL MATCH, and DELETE commands of the CQL language;

[0073] The encapsulation provides the ability to manage constraints, which is implemented using the CONSTRAINT command of the CQL language: adding or deleting a unique constraint on an attribute of nodes under a certain type of label; this constraint is a unique constraint, which can ensure that nodes with specific labels and attribute values in the database are unique. Implement adding and deleting using the CQL language;

[0074] The encapsulation provides the ability to manage indexes, which is implemented using the INDEX command of the CQL language: adding or deleting an index on an attribute of nodes under a certain type of label.

[0075] 2.2 Node Management

[0076] The encapsulation provides the ability to add neo4j nodes, which is implemented using the MERGE command of the CQL language: first judge whether the node exists, if not, add it, and if it exists, keep it unchanged;

[0077] The encapsulation provides the ability to delete neo4j nodes, which is implemented using the MATCH and DELETE commands of the CQL language: deleting the node itself and all its associated relationships;

[0078] The encapsulation provides the ability to modify node attributes, which is implemented using the MATCH and SET commands of the CQL language: modifying or adding the attribute name and attribute value of the corresponding node;

[0079] The encapsulation provides the ability to query neo4j nodes and all their attributes, which is implemented using the MATCH command of the CQL language.

[0080] 2.3 Relationship Management

[0081] The encapsulation provides the ability to add new relationships between nodes, which is implemented using the MATCH and MERGE commands in CQL language: first, it determines whether the relationship exists. If it doesn't exist, it adds the relationship; if it exists, it doesn't add it again.

[0082] The encapsulation provides the ability to delete relationships between nodes, which is implemented using the MATCH and DELETE commands in CQL language: it deletes the specified relationships between nodes.

[0083] The encapsulation provides the ability to modify relationship attributes, which is implemented using the MATCH and SET commands in CQL language: it modifies or adds the attribute names and values of the relationships between nodes.

[0084] The encapsulation provides the ability to query relationships between nodes, which is implemented using the MATCH command in CQL language: by passing in the labels and attributes of two nodes, it returns a list of relationships between the nodes.

[0085] 2.4 Query Management

[0086] According to the project requirements, it provides customized graph database query capabilities.

[0087] The encapsulation provides the ability to obtain all nodes under a label by the label, which is implemented using the MATCH command in CQL language: by passing in the node label, it returns a list of all nodes belonging to that label.

[0088] The encapsulation provides the ability to query associated nodes by a node, which is implemented using the MATCH command in CQL language: by passing in the node label and node attributes, it returns a list of nodes that have an associated relationship with that node.

[0089] The encapsulation provides the ability to query the number of associated nodes by a node, which is implemented using the MATCH command and the count() function in CQL language: by passing in the node label and node attributes, it returns the number of nodes that have an associated relationship with that node.

[0090] The encapsulation provides the ability to query second-level associated nodes by a node, which is implemented using the MATCH command in CQL language: by passing in the node label and node attributes, it returns a list of nodes that have a second-level associated relationship with that node.

[0091] The encapsulation provides the ability to customize CQL queries, where the user passes in custom CQL to query the graph database.

[0092] In summary, by isolating multiple database instances for tenants and then endowing them with simple and clear general graph database operation capabilities, it achieves the goal of efficiently promoting the access of componentized products to the graph database, and on the basis of meeting the basic needs of engineers to operate the graph database, it is assisted by various modular secondary encapsulations to facilitate the DevOps process.

[0093] Please refer toFigure 2 As shown in the figure, the present invention also provides a service system for realizing the management of neo4j graph database instances, including a establishment module, a request module, a start module, a new addition module, a node relationship module and a construction completion module; the establishment module, that is, the NDR component proposes to establish a new graph database to store resources; the request module, that is, the graph database administrator requests a new graph database interface, and the server allocates multiple unused ports to the instances of the new graph database interface. The server will add a new graph database instance locally and record the uuid (universally unique identifier); the start module, that is, the graph database administrator inputs the uuid and requests to start the graph database interface, and provides the uuid to the NDR component; the new addition module, that is, the NDR component inputs the node label and the uuid and requests a new node interface to add a new node; the node relationship module, that is, the NDR component inputs the name of the newly added node and the uuid and requests a new node relationship interface to add the relationship between the new nodes; the construction completion module, that is, repeat the start module, the new addition module and the node relationship module to establish the process of node relationship and construct a complete graph database, so as to achieve the purpose of promoting the access of componentized products to the graph database.

[0094] It also includes a new index module, a search module, a termination module and a deletion module. The new index module, that is, the NDR component inputs the node label and attributes, and the uuid and requests a new index interface to add an index to the attributes of the node; the search module, that is, the NDR component inputs the node label name and the uuid and requests a query node interface to search for the corresponding node, and inputs the uuid to use other general capabilities; the termination module, that is, when the NDR component needs to be updated and stops using the graph database, the graph database administrator inputs the uuid to the termination graph database interface to stop the graph data instance process; the deletion module, that is, the graph database administrator inputs the uuid to the delete graph data interface and deletes the graph database instance file on the server local.

[0095] The request module is further specifically as follows: In the local folder of the server, store an original compressed Neo4j graph database package. When adding a new graph database, the server allocates four unused ports as the BOLT port, HTTP port, HTTPS port, and SHELL port of the graph database instance. A new folder is created locally on the server and named by concatenating the BOLT port, HTTP port, HTTPS port, and SHELL port of the graph database instance. Unzip the original Neo4j graph database compressed package to the new folder, modify the configuration file neo4j.conf in the / bin directory, write the BOLT port, HTTP port, HTTPS port, and SHELL port of the new graph database instance into the conf configuration. The server generates a unique UUID (Universally Unique Identifier), and writes the UUID and the graph database instance folder name into the MySQL tenant database to complete the addition of the graph database instance.

[0096] The start module is further specifically as follows: The user passes in the UUID. The server uses the UUID to query the folder name of the graph database instance in the MySQL tenant database. The server uses the method Runtime.getRuntime().exec() of the JAVA development tool to run the startneo4j.bat console program in the / bin directory under the instance folder, thus starting the corresponding graph database. Use the Kernel32 class and WinNT.HANDLE class of the JAVA development tool to obtain the process ID of the graph database instance and store it in the MySQL tenant database.

[0097] The node relationship module is further specifically as follows: The graph database provides the ability to add Neo4j nodes by encapsulating the corresponding JDBC application interface, open-source client, and CQL query language. It is implemented using the MERGE command in the CQL language: Determine whether the node exists. If it does, keep it unchanged; if not, add it.

[0098] The construction completion module is further specifically as follows: The graph database provides the ability to add relationships between nodes by encapsulating the corresponding JDBC application interface, open-source client, and CQL query language. It is implemented using the MATCH and MERGE commands in the CQL language: Determine whether the relationship exists. If it does, do not add it; if not, add it.

[0099] The above are only the preferred embodiments of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention shall fall within the scope covered by the present invention.

Claims

1. A service method for implementing the management of neo4j graph database instances, characterized in that, The method includes the following steps: Step S1: The NDR component proposes to establish a new graph database to store resources; Step S2: The graph database administrator requests to add a graph database interface. The server allocates multiple unused ports to the instances of the newly added graph database interface. The server will add a graph database instance locally and record the uuid (Universally Unique Identifier); Step S3: The graph database administrator passes in the uuid and requests to start the graph database interface, and provides the uuid to the NDR component; Step S4: The NDR component passes in the node label and uuid and requests to add a node interface to add a node; Step S5: The NDR component passes in the name of the newly added node and uuid and requests to add a node relationship interface to add the relationship between nodes; Step S6: Repeat Step S3 to Step S5 in the process of establishing node relationships to build a complete graph database, so as to achieve the purpose of promoting componentized products to access the graph database; The specific content of Step S3 is further as follows: The user passes in the uuid. The server uses the uuid to query the folder name of the graph database instance in the MySQL tenant database; The server uses the method Runtime.getRuntime().exec() of the JAVA development tool to run the startneo4j.bat console program in the / bin directory under the instance folder, and then the corresponding graph database can be started; Use the Kernel32 class and WinNT.HANDLE class of the JAVA development tool to obtain the process ID of the graph database instance and store it in the MySQL tenant database; The specific content of Step S5 is further as follows: The graph database provides the ability to add neo4j nodes by encapsulating the corresponding JDBC application interface, open-source client, and CQL query language. The MERGE command of the CQL language is used to achieve: judge whether the node exists. If it exists, it remains unchanged. If not, it is newly added.

2. The service method for implementing the management of neo4j graph database instances according to claim 1, characterized in that: After Step S6, the following steps are further included: Step S7: The NDR component passes in the node label and attributes, and uuid and requests to add an index interface to add an index to the attributes of the node; Step S8: The NDR component passes in the node label name and uuid and requests to query the node interface, searches for the corresponding node, and passes in the uuid to use other general capabilities; Step S9: When the NDR component needs to be updated and stops using the graph database, the graph database administrator passes in the uuid to the termination graph database interface to stop the graph data instance process; Step S10: The graph database administrator passes in the uuid to the delete graph data interface and deletes the graph database instance file on the server local.

3. The service method for implementing the management of a neo4j graph database instance according to claim 1, characterized in that: The step S2 is further specifically as follows: In the local folder of the server, store an original compressed Neo4j graph database package. When adding a new graph database, the server allocates four unused ports as the BOLT port, HTTP port, HTTPS port, and SHELL port of the graph database instance. A new folder is created locally on the server, named by concatenating the BOLT port, HTTP port, HTTPS port, and SHELL port of the graph database instance. Unzip the original Neo4j graph database compressed package to the new folder, modify the configuration file neo4j.conf in the / bin directory, write the BOLT port, HTTP port, HTTPS port, and SHELL port of the new graph database instance into the conf configuration. The server generates a unique UUID (Universally Unique Identifier), and writes the UUID and the graph database instance folder name into the MySQL tenant database to complete the addition of the graph database instance.

4. A service method for implementing the management of neo4j graph database instances according to claim 1, characterized in that: The step S6 is further specifically as follows: The graph database provides the ability to add relationships between new nodes by encapsulating the corresponding JDBC application interface, open-source client, and CQL query language, and uses the MATCH and MERGE commands of the CQL language to implement: Determine whether the relationship exists. If it does, do not add; if not, add.

5. A service system for implementing the management of neo4j graph database instances, characterized in that: It includes a creation module, a request module, a startup module, an addition module, a node relationship module, and a construction completion module; The creation module, that is, the NDR component proposes to create a new graph database to store resources; The request module, that is, the graph database administrator requests the new graph database interface, and the server allocates multiple unused ports to the instance of the new graph database interface. The server will add a new graph database instance locally and record the UUID; The startup module, that is, the graph database administrator passes in the UUID and requests to start the graph database interface, and provides the UUID to the NDR component; The addition module, that is, the NDR component passes in the node label and UUID and requests the new node interface to add a node; The node relationship module, that is, the NDR component passes in the new node name and UUID and requests the new node relationship interface to add the relationship between nodes; The construction completion module, that is, repeats the startup module, the addition module, and the node relationship module to establish the process of node relationships and construct a complete graph database, so as to achieve the purpose of promoting componentized products to access the graph database. The startup module is further specifically as follows: The user inputs a UUID (Universally Unique Identifier), and the server uses the UUID to query the folder name of the graph database instance in the MySQL tenant database; the server uses the method Runtime.getRuntime().exec() of the JAVA development tool to run the startneo4j.bat console program in the / bin directory under the instance folder, thereby starting the corresponding graph database; the server uses the Kernel32 class and WinNT.HANDLE class of the JAVA development tool to obtain the process ID of the graph database instance and stores it in the MySQL tenant database. The node relationship module is further specifically as follows: The graph database provides the ability to add neo4j nodes by encapsulating the corresponding JDBC application interface, open-source client, and CQL query language. The MERGE command of the CQL language is used to achieve: judge whether the node exists, if it does, keep it unchanged, if not, add it.

6. The service system for implementing the management of neo4j graph database instances according to claim 5, characterized in that: It further includes an index adding module, a search module, a termination module, and a deletion module. For the index adding module, that is, the NDR component inputs the node label and attributes, and the UUID to request the index adding interface, and adds an index to the attributes of the node; for the search module, that is, the NDR component inputs the node label name and the UUID to request the node query interface, searches for the corresponding node, and inputs the UUID to use other general capabilities; for the termination module, that is, when the NDR component needs to be updated and stops using the graph database, the graph database administrator inputs the UUID into the graph database termination interface to stop the graph data instance process; for the deletion module, that is, the graph database administrator inputs the UUID into the graph data deletion interface and deletes the graph database instance file on the server local.

7. The service system for implementing the management of neo4j graph database instances according to claim 5, characterized in that: The request module is further specifically as follows: In the server local folder, there is an original compressed package of the neo4j graph database. When adding a new graph database, the server allocates four unused ports as the BOLT port, HTTP port, HTTPS port, and SHELL port of the graph database instance. A new folder is created locally on the server, named by concatenating the BOLT port, HTTP port, HTTPS port, and SHELL port of the graph database instance; the original compressed package of the neo4j graph database is decompressed to the new folder, and the configuration file neo4j.conf in the / bin directory is modified to write the BOLT port, HTTP port, HTTPS port, and SHELL port of the new graph database instance into the conf configuration. The server generates a unique UUID, and writes the UUID and the graph database instance folder name into the MySQL tenant database to complete the addition of the graph database instance.

8. The service system for implementing the management of neo4j graph database instances according to claim 5, wherein: The constructed complete module is further specifically as follows: The graph database provides the ability to add relationships between new nodes by encapsulating the corresponding JDBC application interface, open-source client, and CQL query language, and implements it using the MATCH and MERGE commands of the CQL language: Determine whether the relationship exists. If it does, do not add it. If not, add it.

Citation Information

Patent Citations

  • A knowledge map organization query method based on hybrid database

    CN109241078A

  • Data-graph information retrieval using automata

    EP3570183A1