Method, device and electronic device for generating experimental environment based on graph database
By converting the topology results of the graph database into JSON format and saving it in a relational database, the data redundancy problem when generating multiple experimental environments is solved, and efficient experimental environment generation and independent management are achieved.
Patent Information
- Application Number
- CN202211118335.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-09
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-09-09
AI Technical Summary
Existing graph databases need to create multiple copies when generating multiple experimental environments, resulting in data redundancy and high maintenance costs, affecting user construction efficiency.
By retrieving entities from the graph database, performing topology display, and converting the topology results into JSON format and saving them in a relational database, the generation of multiple experimental environments can be achieved.
It reduces data redundancy, improves the efficiency of generating experimental environments, and generates multiple independent experimental environments through a graph database, reducing operating costs.
Smart Images

Figure CN115470277B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and more particularly to a method, device, and electronic device for generating an experimental environment based on a graph database. Background Art
[0002] Graph databases generally have the ability to generate experimental environments, such as scenarios for red-blue adversarial attack drills or network topology diagrams. However, in most cases, graph databases generate experimental environments directly from their graph data. This makes it difficult to generate additional experimental environments from the same database if its graph data is already occupied. Therefore, when generating multiple experimental environments, it is generally necessary to create a copy of the graph database in advance and then generate additional experimental environments based on the copy. This is equivalent to maintaining multiple graph databases to generate multiple experimental environments, which is very cumbersome. Summary of the Invention
[0003] In view of this, an embodiment of the present invention provides a method, device and electronic device for generating an experimental environment based on a graph database, which facilitates the generation of multiple experimental environments through a graph database.
[0004] To achieve the above objectives, the embodiments of the present invention adopt the following technical solutions:
[0005] In a first aspect, an embodiment of the present invention provides a method for generating an experimental environment based on a graph database, comprising: in response to a first retrieval request for performing a first entity retrieval on a graph database, retrieving the first entity from the graph database and displaying the first entity; in response to a first topology request for performing a topology display on the first entity, displaying a first topology result with the first entity as a vertex; wherein the first topology result is a first experimental environment, presenting a mesh topology structure with edges connecting the vertices; and saving the first topology result in a first relational database.
[0006] According to a specific implementation of the embodiment of the present invention, the step of saving the first topology result to the first relational database includes: converting the data format of the first topology result into a format consistent with the first relational database.
[0007] A data format compatible with a relational database is provided; and the first topology result after the data format conversion is saved in the first relational database.
[0008] According to a specific implementation of the embodiment of the present invention, converting the data format of the first topology result into a data format compatible with the first relational database includes: converting the data format of the first topology result into a JSON format.
[0009] According to a specific implementation method of an embodiment of the present invention, converting the data format of the first topology result into a data format compatible with the first relational database includes: responding to a drag request to drag the first topology result into the canvas of the first relational database; moving the first topology result into the canvas, and converting the data format of the first topology result into a data format compatible with the first relational database.
[0010] According to a specific implementation method of an embodiment of the present invention, after displaying the first topology result with the first entity as the vertex, the method further includes: in response to a request to hide the specified entity in the first topology result, hiding the specified entity and the connection line connected to the specified entity; wherein, saving the first topology result to the first relational database includes: saving the first topology result after hiding the specified entity and the connection line connected to the specified entity to the first relational database.
[0011] According to a specific implementation method of an embodiment of the present invention, after saving the first topology result in a first relational database, the method further includes: displaying the first topology result in a canvas; in response to an editing request for the first topology result displayed in the canvas, performing an editing operation on the first topology result to obtain the edited first topology result; and saving the edited first topology result in the first relational database.
[0012] According to a specific implementation of an embodiment of the present invention, after saving the first topology result in a first relational database, the method further includes: responding to a second retrieval request for a second entity retrieval on a graph database; retrieving the second entity from the graph database and displaying the second entity; responding to a second topology request for topology display of the second entity, displaying a second topology result with the second entity as a vertex; wherein the second topology result is a second experimental environment, presenting a mesh topology structure with edges connecting the vertices; saving the second topology result in a second relational database; wherein the second relational database and the first relational database are the same relational database, or are different relational databases.
[0013] According to a specific implementation method of an embodiment of the present invention, saving the second topology result in a second relational database includes: converting the data format of the second topology result into a data format compatible with the second relational database; and saving the second topology result after data format conversion into the second relational database.
[0014] According to a specific implementation of the embodiment of the present invention, converting the data format of the second topology result into a data format compatible with the second relational database includes: converting the data format of the second topology result into JSON format.
[0015] According to a specific implementation method of an embodiment of the present invention, converting the data format of the second topology result into a data format compatible with the second relational database includes: responding to a drag request to drag the second topology result into the canvas of the second relational database; moving the second topology result into the canvas, and converting the data format of the second topology result into a data format compatible with the second relational database.
[0016] According to a specific implementation method of an embodiment of the present invention, after displaying the second topology result with the second entity as the vertex, the method further includes: in response to a request to hide the specified entity in the second topology result, hiding the specified entity and the connection line connected to the specified entity; wherein, saving the second topology result to the second relational database includes: saving the second topology result after hiding the specified entity and the connection line connected to the specified entity to the second relational database.
[0017] According to a specific implementation method of an embodiment of the present invention, after saving the second topology result in a second relational database, the method further includes: displaying the second topology result in a canvas; in response to an editing request for the second topology result displayed in the canvas, performing an editing operation on the second topology result to obtain an edited second topology result; and saving the edited second topology result in the second relational database.
[0018] In a second aspect, an embodiment of the present invention provides a device for generating an experimental environment based on a graph database, comprising: a first retrieval and display module for responding to a first retrieval request for performing a first entity retrieval on a graph database, retrieving the first entity from the graph database, and displaying the first entity; a first generation module for responding to a first topology request for performing a topology display on the first entity, displaying a first topology result with the first entity as a vertex, presenting a mesh topology structure with edges connecting the vertices; wherein the first topology result is a first experimental environment; and a first saving module for saving the first topology result in a first relational database.
[0019] According to a specific implementation method of an embodiment of the present invention, the first saving module includes: a first data conversion sub-module, used to convert the data format of the first topology result into a data format compatible with the first relational database; a first saving sub-module, used to save the first topology result after data format conversion into the first relational database.
[0020] According to a specific implementation of the embodiment of the present invention, the first data conversion submodule is specifically used to: convert the data format of the first topology result into JSON format.
[0021] According to a specific implementation method of an embodiment of the present invention, the first data conversion submodule is specifically used to: respond to a drag request to drag the first extrude result into the canvas of the first relational database; move the first extrude result into the canvas, and convert the data format of the first extrude result into a data format compatible with the first relational database.
[0022] According to a specific implementation method of an embodiment of the present invention, it also includes: a first entity hiding module, which is used to hide the specified entity and the connection line connected to the specified entity in response to a hiding request for the specified entity in the first topology result; the first saving module is specifically used to save the first topology result after hiding the specified entity and the connection line connected to the specified entity into a first relational database.
[0023] According to a specific implementation method of an embodiment of the present invention, it also includes: a first display module, used to display the first topology result in a canvas; a first editing module, used to respond to an editing request for the first topology result displayed in the canvas, execute an editing operation on the first topology result, and obtain an edited first topology result; a first editing and saving module, used to save the edited first topology result to the first relational database.
[0024] According to a specific implementation method of an embodiment of the present invention, it also includes: a second retrieval and display module, which is used to respond to a second retrieval request for performing a second entity retrieval on the graph database, retrieve the second entity from the graph database, and display the second entity; a second generation module, which is used to respond to a second topology request for performing a topology display on the second entity, and display a second topology result with the second entity as a vertex; wherein the second topology result is a second experimental environment, which is a mesh topology structure with edges connecting the vertices; a second saving module, which is used to save the second topology result in a second relational database; wherein the second relational database and the first relational database are the same relational database, or different relational databases.
[0025] According to a specific implementation method of an embodiment of the present invention, the second saving module includes: a second data conversion sub-module, used to convert the data format of the second topology result into a data format compatible with the second relational database; a second saving sub-module, used to save the second topology result after data format conversion into the second relational database.
[0026] According to a specific implementation of the embodiment of the present invention, the second data conversion submodule is specifically used to: convert the data format of the second topology result into JSON format.
[0027] According to a specific implementation method of an embodiment of the present invention, the second data conversion sub-module is specifically used to: respond to a drag request to drag the second topology result into the canvas of the second relational database; move the second topology result to the canvas, and convert the data format of the second topology result into a data format compatible with the second relational database.
[0028] According to a specific implementation method of an embodiment of the present invention, it also includes: a second entity hiding module, which is used to hide the specified entity and the connection line connected to the specified entity in response to a hiding request for the specified entity in the second topology result; the second saving module is specifically used to save the second topology result after hiding the specified entity and the connection line connected to the specified entity into a second relational database.
[0029] According to a specific implementation method of an embodiment of the present invention, it also includes: a second display module, used to display the second topology result in a canvas; a second editing module, used to respond to an editing request for the second topology result displayed in the canvas, execute an editing operation on the second topology result, and obtain an edited second topology result; a second editing and saving module, used to save the edited second topology result in the second relational database.
[0030] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, and is used to execute any method of generating an experimental environment based on a graph database as described in the first aspect above.
[0031] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method of generating an experimental environment based on a graph database as described in any of the first aspects above.
[0032] The method, apparatus, and electronic device for generating an experimental environment based on a graph database provided by embodiments of the present invention can retrieve and display a first entity from a graph database, perform topology on the first entity, display a first experimental environment, and store the first experimental environment in a first relational database. This allows the first experimental environment generated by the graph database to be stored in the first relational database, facilitating the generation of new experimental environments using the graph database. This facilitates the generation of multiple experimental environments from a single graph database. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1 A flowchart of a method for generating an experimental environment based on a graph database according to an embodiment of the present invention;
[0035] Figure 2 This is a module schematic diagram of a device for generating an experimental environment based on a graph database according to an embodiment of the present invention;
[0036] Figure 3 The figure is a schematic diagram of a module of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0038] It should be understood that the embodiments described are only a portion of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0039] Example 1
[0040] See Figure 1 As shown, an embodiment of the present invention provides a method for generating an experimental environment based on a graph database, including:
[0041] S110 , in response to a first search request for performing a first entity search on a graph database, retrieve the first entity from the graph database and display the first entity.
[0042] A graph database is a data management system based on graph-based storage units. For example, the graph database can be HugeGraph. Furthermore, the graph database can be an already constructed graph database, or a graph database obtained by building a graph model based on actual needs and collecting and storing graph data. A graph is a set of vertices and edges. Vertices represent entities, entities are generally sets of certain types of things, and edges represent relationships between entities. The first entity can be any entity or any multiple entities in the graph database. For example, when the first search request is a precise search request, the first entity can be any entity in the graph database. When the first search request is a fuzzy search request, the first entity can be any multiple entities in the graph database. When displaying the first entity, the first entity can be displayed visually in the graph display interface of the graph database.
[0043] S111. In response to a first topology request for displaying the first entity, display a first topology result with the first entity as a vertex; wherein the first topology result is a first experimental environment, presenting a mesh topology structure with edges connecting vertices.
[0044] The topology display can be performed by obtaining a set of entities that have relationships with a first entity, as well as the relationships between the first entity and the entity set, and visually displaying the first entity, the entity set, and the relationships between the first entity and the entity set as a first topology result in a graph display interface of a graph database. This can also be said to be the acquisition of more entities and relationships for generating an experimental environment. For example, the first topology result for the topology display of a port includes ip1 (vertex), ip2 (vertex), the port (vertex), the switch (vertex), and the connections (edges) between the port and ip1, ip2, and the switch, respectively.
[0045] Furthermore, the first topology result can also contain attributes. An attribute is a specific object or relationship, and both vertices and edges have attributes. Using the above example, ip1 can be 192.168.10.10 (attribute), ip2 can be 192.168.10.11, the port can be GigabitEthernet0 / 0 / 10, and the switch can be S5720S-52P-LI.
[0046] S112: Save the first topology result in a first relational database.
[0047] A relational database refers to a data management system that uses tables as the basic storage unit. For example, the first relational database may be PostgreSQL. A table includes a series of rows and columns.
[0048] The method for generating an experimental environment based on a graph database provided by an embodiment of the present invention can retrieve and display a first entity from the graph database, perform topology on the first entity, display a first experimental environment, and save the first experimental environment in a first relational database. This allows the first experimental environment generated by the graph database to be saved in the first relational database, thereby facilitating the generation of new experimental environments using the graph database. This facilitates the generation of multiple experimental environments from a single graph database.
[0049] The data format of the graph database differs from the data format of the first relational database. In order to adapt the data format of the first topology result obtained through the graph database to the first relational database, in one embodiment, saving the first topology result in the first relational database includes: converting the data format of the first topology result into a data format compatible with the first relational database; and saving the converted first topology result in the first relational database. Thus, by converting the data format of the first topology result, the first topology result can be saved in the first relational database and displayed normally in the display interface of the first relational database.
[0050] Specifically, in one embodiment, converting the data format of the first topology result into a data format compatible with the first relational database includes: converting the data format of the first topology result into JSON format. Among them, data in JSON format can be stored in the first relational database in a large text field format, such as text. In addition, the data format of the first topology result can also be converted into XML format, CSV format, XLS format or XLSX format. It can be understood that converting the data format of the first topology result into JSON format, XML format, XLS format or XLSX format helps to display the first topology result in a visual manner on the front end.
[0051] In one embodiment, converting the data format of the first topology result into a data format compatible with the first relational database includes: responding to a drag request to drag the first topology result into the canvas of the first relational database; moving the first topology result into the canvas, and converting the data format of the first topology result into a data format compatible with the first relational database.
[0052] The canvas may be a display interface of the first relational database, and the drag request may be to drag the first topology result from the graph display interface of the graph database to the canvas. In this way, by dragging the first topology result from the graph display interface of the graph database to the canvas, the first topology result and the data format compatible with the first relational database can be saved in the first relational database. Specifically, in response to the drag request to drag the first topology result into the canvas of the first relational database, after executing the operation of moving the first topology result from the graph display interface of the graph database to the canvas, the data format of the first topology result is converted into a data format compatible with the first relational database in the first relational database, and the first topology result is displayed in the canvas.
[0053] In addition, after executing the operation of moving the first topology result from the graph display interface of the graph database to the canvas, a third-party interface is called to convert the data format of the first topology result into a data format compatible with the first relational database, and then store it in the first relational database, and display the first topology result in the canvas.
[0054] In one example, the first topology result can be moved from the graph database to the canvas of the first relational database by submitting a form.
[0055] Current graph database schemas are typically defined explicitly or implicitly, and all graph structures must be fixed and cannot be modified. To address the dynamic needs of enterprise users to build multiple experimental environments, a multi-replica graph database solution is often used when only one copy of the graph data is available. However, this approach requires maintaining multiple databases, resulting in high data redundancy and maintenance costs. Furthermore, when users build multiple experimental environments simultaneously, the need to create graph database replicas consumes significant space and time, significantly impacting user build efficiency.
[0056] To solve the above problem, in one embodiment, after saving the first topology result in the first relational database, the method further includes: responding to a second retrieval request for a second entity retrieval on the graph database; retrieving the second entity from the graph database and displaying the second entity; responding to the second topology request for topology display of the second entity, displaying a second topology result with the second entity as a vertex; wherein the second topology result is a second experimental environment, presenting a mesh topology structure with edges connecting the vertices; saving the second topology result in a second relational database; wherein the second relational database and the first relational database are the same relational database, or different relational databases.
[0057] As mentioned above, the first topology result is the first experimental environment, and the second topology result is the second experimental environment. After saving the first experimental environment to the first relational database, the second experimental environment can be generated from the same database. This means that multiple experimental environments can be generated from a single graph database. Because there's no need to provide a copy of the graph database for the second experimental environment, data redundancy is reduced, and there's no need to maintain redundant graph databases.
[0058] When the second relational database and the first relational database are the same relational database, the first and second experimental environments are independently stored in the database. That is, the data between the first and second experimental environments is isolated. In this way, modifications to the first experimental environment will not affect the second experimental environment, meeting the need for dynamic creation of experimental environments. It will be understood that when the second relational database and the first relational database are different relational databases, the data between the first and second experimental environments is also isolated.
[0059] It is understandable that the saved first experimental environment and second experimental environment can be conveniently queried from the database.
[0060] In another embodiment, after displaying the first topology result with the first entity as the vertex, the method further includes: in response to a request to hide a specified entity in the first topology result, hiding the specified entity and the connection line connected to the specified entity; wherein, saving the first topology result to the first relational database includes: saving the first topology result after hiding the specified entity and the connection line connected to the specified entity to the first relational database.
[0061] The operation of specifying the entity can be performed by clicking or boxing the entity that is not related to the target experimental environment in the first topology result. A hiding request for the specified entity can be sent by clicking the hide button. In this way, by hiding the specified entity, only the necessary entities can be generated into the experimental environment, thereby making the experimental environment more in line with actual needs, and also by reducing the data volume for building the experimental environment, thereby improving the efficiency of building the experimental environment. Of course, in other embodiments of the present invention, in order to avoid errors, for example, by performing a hiding operation on the specified entity, when hiding the specified entity and the lines connected to the specified entity, some lines are omitted or unspecified entities are hidden together, it is necessary to select the entities and / or relationships that are not related to the target experimental environment in the first topology result by clicking, boxing or quick selection to hide, wherein quick selection refers to, after selecting at least two vertices, automatically selecting the edge between the at least two vertices in response to the quick selection request. These operations are completed directly at the front end without interacting with the back end. For example, in one embodiment of the present invention, the first topology result of the port topology display includes ip1 (vertex), ip2 (vertex), ip3 (vertex), port (vertex), switch (vertex), and the connections (edges) between the port and ip1, ip2, ip3 and the switch respectively. By clicking ip3 (vertex) and the connection (edge) between the port and ip3 to specify the entity and relationship, and sending a hide request, the first topology result after hiding is obtained, including ip1 (vertex), ip2 (vertex), port (vertex), switch (vertex), and the connections (edges) between the port and ip1, ip2 and the switch respectively.
[0062] In order to support real-time adjustment, editing and deletion of the experimental environment, in one embodiment, after saving the first topology result in the first relational database, the method further includes: displaying the first topology result in a canvas; in response to an editing request for the first topology result displayed in the canvas, performing an editing operation on the first topology result to obtain the edited first topology result; and saving the edited first topology result in the first relational database.
[0063] Saving the edited first topology result in the first relational database is in response to a user's save operation, for example, in response to the user clicking a save button, saving the edited first topology result in the first relational database.
[0064] It is understandable that the first topology result displayed in the canvas is a mesh topology structure with edges connecting vertices. Therefore, for ease of description, the first topology result in the canvas is still described in the form of a graph.
[0065] The edit request for the first topology result may be to add one or more new vertices and / or edges to the first topology result, following the above example, add ip4 (vertex) and the connection (edge) between ip4 (vertex) and port (vertex) to the first topology result, and save the edited first topology result to the first relational database, or delete one or more vertices and / or edges on the first topology result, following the above example, delete ip4 (vertex) and the connection (edge) between ip4 (vertex) and port (vertex) on the first topology result, and save the edited first topology result to the first relational database, or edit the attributes of one or more vertices and / or edges on the first topology result, following the above example, modify the attributes of ip1 (vertex) to 192.168.10.12, and save the edited first topology result to the first relational database.
[0066] The editing operation on the first topology result may be to modify the JSON string corresponding to the first topology result in the first relational database using a JSON parsing function.
[0067] In order to reduce operating costs, modifications to the canvas will not be synchronized to the first relational database in real time. Instead, a save request needs to be sent to the canvas, such as clicking a save button in the canvas to save the edited first topology result to the first relational database.
[0068] The method for generating an experimental environment based on a graph database provided by an embodiment of the present invention reduces data redundancy and improves the efficiency of building an experimental environment by only obtaining entities and relationships used to generate the experimental environment from the graph database; by storing the generated experimental environment in a relational database, multiple experimental environments can be generated through one graph database, and each experimental environment can be independently stored in the relational database, thereby ensuring data isolation between the experimental environments and being able to dynamically generate multiple experimental environments.
[0069] In one embodiment, the step of saving the second topology result in the second relational database includes: converting the data format of the second topology result into a data format compatible with the second relational database; and saving the second topology result after data format conversion in the second relational database.
[0070] In one embodiment, converting the data format of the second topology result into a data format compatible with the second relational database includes: converting the data format of the second topology result into a JSON format.
[0071] In one embodiment, converting the data format of the second topology result into a data format compatible with the second relational database includes: responding to a drag request to drag the second topology result into the canvas of the second relational database; moving the second topology result into the canvas, and converting the data format of the second topology result into a data format compatible with the second relational database.
[0072] In one embodiment, after displaying the second topology result with the second entity as the vertex, the method further includes: in response to a request to hide a specified entity in the second topology result, hiding the specified entity and the connection line connected to the specified entity; wherein, saving the second topology result to the second relational database includes: saving the second topology result after hiding the specified entity and the connection line connected to the specified entity to the second relational database.
[0073] In one embodiment, after saving the second topology result in the second relational database, the method further includes: displaying the second topology result in a canvas; in response to an edit request for the second topology result displayed in the canvas, performing an editing operation on the second topology result to obtain an edited second topology result; and saving the edited second topology result in the second relational database.
[0074] As for the embodiment of generating the second experimental environment through a graph database, since it is basically similar to the embodiment of generating the first experimental environment through a graph database, the description is relatively simple. For relevant matters, please refer to the description of the embodiment of generating the first experimental environment through a graph database.
[0075] Example 2
[0076] See Figure 2 An embodiment of the present invention provides a device for generating an experimental environment based on a graph database, including: a first retrieval and display module 201, for responding to a first retrieval request for performing a first entity retrieval on a graph database, retrieving the first entity from the graph database, and displaying the first entity; a first generation module 202, for responding to a first topology request for performing a topology display on the first entity, displaying a first topology result with the first entity as a vertex, presenting a mesh topology structure with edges connecting the vertices; wherein the first topology result is a first experimental environment; and a first saving module 203, for saving the first topology result in a first relational database.
[0077] The apparatus for generating an experimental environment based on a graph database provided by an embodiment of the present invention can retrieve and display a first entity from the graph database, perform topology on the first entity, display a first experimental environment, and store the first experimental environment in a first relational database. This facilitates the generation of new experimental environments from the graph database by storing the first experimental environment generated from the graph database in the first relational database, i.e., facilitates the generation of multiple experimental environments from a single graph database.
[0078] In one embodiment, the first saving module 203 includes: a first data conversion submodule, used to convert the data format of the first topology result into a data format compatible with the first relational database; a first saving submodule, used to save the first topology result after data format conversion into the first relational database.
[0079] In one embodiment, the first data conversion submodule is specifically configured to convert the data format of the first topology result into a JSON format.
[0080] In one embodiment, the first data conversion submodule is specifically used to: respond to a drag request to drag the first topology result into the canvas of the first relational database; move the first topology result into the canvas, and convert the data format of the first topology result into a data format compatible with the first relational database.
[0081] In one embodiment, the aforementioned device also includes: a first entity hiding module, which is used to hide the specified entity and the connection connected to the specified entity in response to a hiding request for the specified entity in the first topology result; the first saving module 203 is specifically used to save the first topology result after hiding the specified entity and the connection connected to the specified entity into a first relational database.
[0082] In one embodiment, the aforementioned device also includes: a first display module, used to display the first topology result in a canvas; a first editing module, used to respond to an editing request for the first topology result displayed in the canvas, execute an editing operation on the first topology result, and obtain an edited first topology result; a first editing and saving module, used to save the edited first topology result to the first relational database.
[0083] In one embodiment, it also includes: a second retrieval and display module, which is used to respond to a second retrieval request for performing a second entity retrieval on the graph database, retrieve the second entity from the graph database, and display the second entity; a second generation module, which is used to respond to a second topology request for performing a topology display on the second entity, and display a second topology result with the second entity as a vertex; wherein the second topology result is a second experimental environment; and a second saving module, which is used to save the second topology result in a second relational database, presenting a mesh topology structure with edges connecting the vertices.
[0084] In one embodiment, the second saving module includes: a second data conversion submodule for converting the data format of the second topology result into a data format compatible with the second relational database; and a second saving submodule for saving the second topology result after data format conversion into the second relational database.
[0085] In one embodiment, the second data conversion submodule is specifically configured to convert the data format of the second topology result into a JSON format.
[0086] In one embodiment, the second data conversion submodule is specifically used to: respond to a drag request to drag the second topology result into the canvas of the second relational database; move the second topology result into the canvas, and convert the data format of the second topology result into a data format compatible with the second relational database.
[0087] In one embodiment, the aforementioned device also includes: a second entity hiding module, which is used to hide the specified entity and the connection connected to the specified entity in response to a hiding request for the specified entity in the second topology result; the second saving module is specifically used to save the second topology result after hiding the specified entity and the connection connected to the specified entity into a second relational database.
[0088] In one embodiment, the aforementioned device also includes: a second display module, used to display the second topology result in a canvas; a second editing module, used to respond to an editing request for the second topology result displayed in the canvas, execute an editing operation on the second topology result, and obtain an edited second topology result; a second editing and saving module, used to save the edited second topology result into the second relational database.
[0089] Example 3
[0090] See Figure 3An embodiment of the present invention provides an electronic device, comprising: a housing 301, a processor 302, a memory 303, a circuit board 304, and a power supply circuit 305, wherein the circuit board 304 is placed inside the space enclosed by the housing 301, and the processor 302 and the memory 303 are arranged on the circuit board 304; the power supply circuit 305 is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory 303 is used to store executable program code; the processor 302 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 303, so as to execute the method for displaying the system screen saver wallpaper described in any of the above-mentioned embodiments.
[0091] The specific execution process of the above steps by the processor 302 and the steps further executed by the processor 302 by running the executable program code can be found in the description of the above embodiment and will not be repeated here.
[0092] The aforementioned electronic devices exist in various forms, including but not limited to:
[0093] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and are primarily designed to provide voice and data communications. These terminals include smartphones (e.g., iPhones), multimedia phones, feature phones, and low-end phones.
[0094] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access. These terminals include PDAs, MIDs, and UMPCs, such as the iPad.
[0095] (3) Portable entertainment devices: These devices can display and play multimedia content. These devices include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0096] (4) Server: A device that provides computing services. The server consists of a processor 302, a hard disk, memory, a system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0097] (5) Other electronic devices with data interaction functions.
[0098] Example 4
[0099] An embodiment of the present invention provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the method for displaying the system screen saver wallpaper described in any of the above-mentioned embodiments, thereby also achieving the corresponding technical effects. This has been described in detail above and will not be repeated here.
[0100] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0101] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0102] In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0103] For the convenience of description, the above device is described as being divided into various units / modules based on their functions. Of course, when implementing the present invention, the functions of each unit / module can be implemented in the same or multiple software and / or hardware.
[0104] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0105] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for generating an experimental environment based on a graph database, characterized in that: include: In response to a first search request for searching a graph database for a first entity, retrieving the first entity from the graph database and displaying the first entity; In response to a first topology request for displaying the first entity, a first topology result with the first entity as a vertex is displayed; wherein the first topology result is a first experimental environment, which is a mesh topology structure with edges connecting the vertices; Saving the first topology result in a first relational database; The step of saving the first topology result in a first relational database includes: Converting the data format of the first topology result into a data format compatible with the first relational database; Saving the first topology result after data format conversion into the first relational database; The converting the data format of the first topology result into a data format compatible with the first relational database includes: responding to a drag request to drag the first rendering result into a canvas of the first relational database; Moving the first rubbing result to the canvas, and converting the data format of the first rubbing result into a data format compatible with the first relational database; After saving the first topology result in the first relational database, the method further includes: Responding to a second search request for performing a second entity search on the graph database; Retrieving the second entity from the graph database and displaying the second entity; In response to a second topology request for displaying the second entity, display a second topology result with the second entity as a vertex; wherein the second topology result is a second experimental environment, presenting a mesh topology structure with edges connecting the vertices; The second topology result is saved in a second relational database; wherein the second relational database and the first relational database are the same relational database or different relational databases.
2. The method according to claim 1, characterized in that The converting the data format of the first topology result into a data format compatible with the first relational database includes: The data format of the first topology result is converted into JSON format.
3. The method according to claim 1, characterized in that After displaying a first topology result with the first entity as a vertex, the method further includes: In response to a request to hide a designated entity in the first topology result, hiding the designated entity and a line connected to the designated entity; The step of saving the first topology result in a first relational database includes: A first topology result after hiding the designated entity and the connection line connected to the designated entity is saved in a first relational database.
4. The method according to claim 1, wherein After saving the first topology result in the first relational database, the method further includes: Displaying the first topology result on the canvas; In response to an edit request for the first rubbing result displayed on the canvas, performing an edit operation on the first rubbing result to obtain an edited first rubbing result; The edited first topology result is saved in the first relational database.
5. A device for generating an experimental environment based on a graph database, characterized in that: include: a first retrieval and display module, configured to, in response to a first retrieval request for performing a first entity retrieval on a graph database, retrieve the first entity from the graph database and display the first entity; A first generating module is configured to respond to a first topology request for displaying the first entity and display a first topology result with the first entity as a vertex; wherein the first topology result is a first experimental environment, presenting a mesh topology structure with edges connecting vertices; A first saving module, configured to save the first topology result in a first relational database; Wherein, the first saving module includes: A first data conversion submodule, configured to convert the data format of the first topology result into a data format compatible with the first relational database; A first saving submodule, configured to save the first topology result after data format conversion into a first relational database; The first data conversion submodule is specifically configured to: responding to a drag request to drag the first rendering result into a canvas of the first relational database; Moving the first rubbing result to the canvas, and converting the data format of the first rubbing result into a data format compatible with the first relational database; The device further comprises: A second retrieval and display module, configured to, in response to a second retrieval request for performing a second entity retrieval on the graph database, retrieve the second entity from the graph database and display the second entity; A second generating module is configured to, in response to a second topology request for displaying the second entity, display a second topology result with the second entity as a vertex; wherein the second topology result is a second experimental environment, presenting a mesh topology structure with edges connecting the vertices; The second saving module is configured to save the second topology result into a second relational database; wherein the second relational database and the first relational database are the same relational database or different relational databases.
6. The device according to claim 5, characterized in that The first data conversion submodule is specifically configured to: The data format of the first topology result is converted into JSON format.
7. The device according to claim 5, characterized in that Also includes: A first entity hiding module, configured to hide a specified entity and a line connected to the specified entity in response to a hiding request for the specified entity in the first topology result; The first saving module is specifically used for: A first topology result after hiding the designated entity and the connection line connected to the designated entity is saved in a first relational database.
8. The device according to claim 5, characterized in that Also includes: A first display module, configured to display the first topology result on a canvas; a first editing module configured to, in response to an editing request for the first rubbing result displayed on the canvas, perform an editing operation on the first rubbing result to obtain an edited first rubbing result; The first editing and saving module is used to save the edited first topology result into the first relational database.
9. An electronic device, characterized in that: The electronic device includes: a shell, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the shell, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, and is used to execute the method for generating an experimental environment based on a graph database as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for generating an experimental environment based on a graph database as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Network link analysis method based on graph data structure
CN112328711A
Graph calculation based personnel relation construction and analysis method
CN112749237A