Database visualization method and device, medium and electronic equipment
By obtaining and rendering node data and association relationships in the database, visual editing functions are provided, which solves the problem of high database operation threshold and realizes efficient data table management and analysis.
Patent Information
- Application Number
- CN202310791326.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2024-12-31
AI Technical Summary
Existing database operations have high thresholds and high costs, making it difficult to achieve clear display and editing of data table relationships, and lacks visual modeling and efficient data management.
By obtaining the node data and edge data of the associated relationships of each data table in the database, visual page rendering is performed, editing and updating functions are provided, layout style switching, node dragging and field management are supported, and visual display and editing of data tables are realized.
It lowers the threshold and cost of database operations, improves the efficiency of visual management of data tables, supports efficient data analysis and editing, and simplifies the database operation process.
Smart Images

Figure CN119226256A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a database visualization, device, computer-readable medium and electronic device. Background Art
[0002] Database is a professional software system, which usually contains complicated data tables. The analysis and operation of database need professional personnel to complete. Therefore, the use of database currently requires high ability of relevant personnel, and the operation is cumbersome, which leads to high threshold and cost of using database.
[0003] Therefore, there is an urgent need for a technical solution that can lower the threshold for using databases. Summary of the invention
[0004] The embodiments of the present application provide a database visualization method, device, computer-readable medium and electronic device, which can reduce the threshold and cost of using the database to at least a certain extent and improve work efficiency.
[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0006] According to one aspect of an embodiment of the present application, a database visualization method is provided, the method comprising: obtaining node data corresponding to each data table in the database and edge data used to characterize the association relationship between different data tables, the node data being obtained by performing data conversion on the original data of the corresponding data table; rendering each of the node data as a node component corresponding to the corresponding data table in a visualization page, and rendering each of the edge data as an edge between different node components, the node component being used to display at least one field in the corresponding data table; displaying a target editing page according to an editing instruction for a target node component in the visualization page, and collecting editing data through the target editing page, the target editing page being used to visually edit a target data table corresponding to the target node component; updating the target data table based on the editing data, and re-rendering the target node component in the visualization page according to the updated target data table.
[0007] According to one aspect of an embodiment of the present application, a database visualization device is provided, the device comprising: an acquisition unit, for acquiring node data corresponding to each data table in the database and edge data for characterizing the association relationship between different data tables, the node data being obtained by performing data conversion on the original data of the corresponding data table; a rendering unit, for rendering each of the node data as a node component corresponding to the corresponding data table in a visualization page, and rendering each of the edge data as an edge between different node components, the node component being used to display at least one field in the data table; an editing unit, for displaying a target editing page according to an editing instruction for a target node component in the visualization page, and collecting editing data through the target editing page, the target editing page being used to perform visual editing on a target data table corresponding to the target node component; an updating and rendering unit, for updating the target data table based on the editing data, and re-rendering the target node component in the visualization page according to the updated target data table.
[0008] In some embodiments of the present application, based on the aforementioned scheme, the device also includes a new unit. After rendering each of the edge data as an edge between different node components, the new unit is used to: when a new instruction is received through the visualization page, display the new page, and the new page is used to create a data table in a visual manner; collect new data table data through the new page, and the new data table data includes multiple fields, and the multiple fields include user-submitted fields and preset common fields, and the common fields are fields that need to be set by default in the data table; create a new data table in the database based on the new data table data, and render the node component corresponding to the new data table in the visualization page.
[0009] In some embodiments of the present application, based on the aforementioned scheme, the device also includes a selection unit, and before the editing instruction of the target node component in the visualization page, the selection unit is used to: when receiving the selection instruction of the target node component in the visualization page, switch the appearance style of the target node component from the first node appearance style to the second node appearance style that is different from the first node appearance style, and switch the edge connected to the target node component from the first edge appearance style to the second edge appearance style that is different from the first edge appearance style.
[0010] In some embodiments of the present application, based on the aforementioned scheme, the rendering unit is configured to: render each of the node data as a node component corresponding to the corresponding data table, and display the node component corresponding to each of the node data in the visualization page with a first layout style; when a layout style switching instruction is received, display the node component corresponding to each of the node data in the visualization page with a second layout style indicated by the layout style switching instruction, and the first layout style and the second layout style are used to characterize different layout methods of node components.
[0011] In some embodiments of the present application, based on the aforementioned scheme, the visualization page includes a data table grouping area and a rendering area, the data table grouping area is used to display a tree structure, the tree structure includes multiple data table groups and data table identifiers under each data table group, and the rendering area is used to display node components corresponding to each data table identifier under the same data table group, and the data table groups to which the data table identifiers of different data tables belong are divided according to the functional modules corresponding to the data tables.
[0012] In some embodiments of the present application, based on the aforementioned scheme, the device also includes a push-and-drag unit. After rendering each edge data as an edge between different node components, the push-and-drag unit is used to: when receiving a drag instruction for a specified node component, move the position of the specified node component according to the drag instruction, and while moving the specified node component, synchronously follow the movement of the edge connected to the specified node component.
[0013] In some embodiments of the present application, based on the aforementioned scheme, the rendering unit is configured to: display a field expansion button and a predetermined number of fields in the corresponding data table in each node component; when a trigger instruction for the field expansion button in the target node component is received, all fields in the target data table are displayed in the target node component, and the field expansion button is switched to a field collapse button; when a trigger instruction for the field collapse button is received, a predetermined number of fields in the target data table are displayed again in the target node component, and the field collapse button is restored to a field expansion button.
[0014] In some embodiments of the present application, based on the aforementioned solution, different association relationships between data tables in the visualization page are represented by edges of different styles.
[0015] In some embodiments of the present application, based on the aforementioned scheme, the acquisition unit is configured to: obtain the intermediate format data and table relationship data generated by the backend according to the original data of each data table by calling the interface; generate node data corresponding to each data table in the database according to the intermediate format data, and obtain edge data used to characterize the association relationship between different data tables according to the table relationship data.
[0016] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for visualizing a database as described in the above embodiment is implemented.
[0017] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the database visualization method as described in the above embodiments.
[0018] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes computer instructions, wherein the computer instructions are stored in a computer-readable storage medium, a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the database visualization method as described in the above embodiments.
[0019] In the technical solution provided by some embodiments of the present application, by first obtaining the node data corresponding to each data table in the database and the edge data used to characterize the association relationship between different data tables, each node data is rendered as a node component in the visualization page, and the edge data is rendered as the edge between different node components; when the editing instruction of the target node component in the visualization page is received, the target editing page will be displayed, so that the target editing page is used to collect editing data from the user, and finally the target data table corresponding to the target node component is automatically updated according to the editing data, and the target node component is automatically re-rendered based on the updated target data table. Therefore, the embodiment of the present application can display the association relationship between each data table and different data tables in the database in a visual way, so that relevant personnel can efficiently analyze the data table in the database. At the same time, since the embodiment of the present application can also edit the data table in the database in a visual way, the embodiment of the present application also significantly improves the convenience of database operation. In general, the embodiment of the present application realizes the data table, the association relationship between the data tables and the data table editing in a visual way, so that the operation and analysis of the database no longer rely on professional personnel, greatly reducing the threshold and cost of using the database, improving the efficiency of using the database, and thus improving user experience and work efficiency.
[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0022] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0023] Figure 2 A flowchart of a database visualization method according to an embodiment of the present application is shown;
[0024] Figure 3 A schematic diagram of an overall process according to an embodiment of the present application is shown;
[0025] Figure 4 An embodiment according to the present application is shown. Figure 2 A flowchart of the details of step 210 in an embodiment;
[0026] Figure 5 A schematic diagram of a visualization page according to an embodiment of the present application is shown;
[0027] Figure 6 An embodiment according to the present application is shown. Figure 2 A flowchart of the details of step 220 in an embodiment;
[0028] Figure 7 A flowchart of rendering each node data into a node component corresponding to a corresponding data table in a visualization page according to an embodiment of the present application is shown;
[0029] Figure 8 A schematic diagram showing a visualization page after receiving a trigger instruction for a field expansion button according to an embodiment of the present application is shown;
[0030] Fig. 9 An embodiment according to the present application is shown. Figure 2 A flowchart of the steps before the editing instruction of the target node component in the visualization page in the embodiment;
[0031] Fig.10 A schematic diagram showing a visualization page after receiving a selection instruction for a node component according to an embodiment of the present application is shown;
[0032] Fig.11 An embodiment according to the present application is shown. Figure 2A flowchart of the steps after rendering each edge data as edges between different node components in an embodiment;
[0033] Fig.12 A flowchart showing steps after rendering each edge data as edges between different node components according to one embodiment of the present application is shown;
[0034] Fig.13 A schematic diagram showing a newly added page according to an embodiment of the present application is shown;
[0035] Fig.14 A schematic diagram showing the direction of data flow according to an embodiment of the present application;
[0036] Fig.15 A block diagram of a database visualization device according to an embodiment of the present application is shown;
[0037] Fig.16 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0038] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0039] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0040] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0041] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0042] In the related technologies, there are almost no solutions for visualizing databases. Even if there are, it is impossible to select the layout algorithm for display. After selecting a table, the tables and relationship lines associated with it cannot be highlighted, making it difficult to sort out the relationship. At the same time, it is impossible to visualize modeling. Model fields need to be filled in one field at a time. For repeated fields, multiple inputs are required, which makes the process cumbersome and inefficient.
[0043] In summary, the solutions of the related art have at least the following problems:
[0044] 1. When viewing the data table relationship diagram, you can only use the system default layout. The system default layout is not beautiful, and the tables are prone to stacking, which affects usage.
[0045] 2. The lines between data tables cannot represent the corresponding relationship, and it is unclear whether it is a one-to-one or one-to-many relationship. In addition, the data tables and lines cannot be highlighted. When there are many lines, it is easy to be confused.
[0046] 3. Creating a data table and modeling are more troublesome. You need to fill in each field one by one, and fill in the type of each field one by one. Repeated fields need to be entered repeatedly, which increases the workload.
[0047] 4. Table fields cannot be deleted or modified visually.
[0048] 5. Data tables cannot be grouped. Dozens or even hundreds of tables are mixed together. Tables that have no relationship are still on the same canvas, which is messy and affects the viewing of relationship diagrams.
[0049] To this end, the present application first provides a database visualization method. The database visualization method provided by the embodiments of the present application can overcome the above-mentioned defects and at least achieve the following technical effects:
[0050] 1. Visually display the table structure and corresponding relationship, and choose to switch different layout styles to meet different usage scenarios.
[0051] 2. Clearly mark the relationship between each table, whether it is one-to-one, one-to-many, or many-to-many. And when a table is selected, its associated tables and connections can be highlighted for easy viewing.
[0052] 3. Create tables visually, create data models through page forms, automatically fill in repeated attributes in each table, visually select field types, let the program help people do repetitive work and improve work efficiency.
[0053] 4. Visually modify table fields, visualize table fields as forms, and provide online modification capabilities. At the same time, it provides online deletion and confirmation deletion functions to prevent accidental deletion.
[0054] 5. Group the data tables according to functional modules and put strongly related tables together to facilitate viewing of relationships.
[0055] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied is shown. Figure 1 As shown, the system architecture 100 may include a user terminal 110, a backend server 120, and a database 130. Communication connections are established between the user terminal 110 and the backend server 120, and between the backend server 120 and the database 130. The user terminal 110 includes a browser; the backend server 120 is provided with a database visualization server, which is embedded with a data processing program; the database 130 includes multiple data tables. The user terminal 110 is the execution subject of the embodiment of the present application. When a database visualization method provided by the present application is applied to Figure 1 In the system architecture shown in FIG. 1 , a process may be as follows: first, the back-end server 120 accesses the database 130 through the database address and the user name and password of the user logging into the database, thereby obtaining the original data of each data table in the database 130; then, the data processing program in the back-end server 120 generates table relationship data and intermediate format data in JSON format according to the original data of each data table; then, when the user opens the database visualization system through the browser on the user terminal 110 and requests to view the data table structure and relationship, the back-end server 120 returns the table relationship data and the intermediate format data to the user terminal 110, and the browser renders the node data into the corresponding The node components corresponding to the data table are rendered, and the edge data are rendered as edges between different node components, so as to visually display the data table structure and relationship in the visualization page displayed by the browser; finally, when the user submits the editing instruction for a certain node component through the visualization page displayed by the browser, the browser will display the editing page, which is used to collect the user's editing data for the corresponding data table; when the user submits the editing data through the editing page, the back-end server 120 will receive the editing data from the user terminal 110 and update the corresponding data table in the database 130. As the data table is updated, the updated data will be fed back to the database visualization system again, and the visualization page viewed by the user through the browser will change adaptively.
[0056] In some embodiments of the present application, a user can select, drag, and perform other operations on a node component in a visualization page, and the selected node component will be highlighted, for example, in a highlighted color or a special shape; the edges connected to the selected node component will also be highlighted.
[0057] In some embodiments of the present application, all node components are displayed in groups on the visualization page, and only one node component corresponding to a group can be displayed on the visualization page at a time.
[0058] In some embodiments of the present application, the highlight color displayed when a node is selected and the highlight color displayed for the edge connected to the selected node component can be configured by the user.
[0059] In some embodiments of the present application, the database 130 is a relational database.
[0060] It should be understood that Figure 1 The number of user terminals, backend servers and databases in the embodiment is only illustrative. According to the implementation requirements, there can be any number of user terminals, backend servers and databases, that is, there can be multiple user terminals, backend servers and databases, for example, the backend server can be a server cluster composed of multiple servers.
[0061] It should be noted that Figure 1 The embodiment shown is only one embodiment of the present application. Figure 1 In the embodiment, the user terminal is a laptop computer, but in other embodiments of the present application, the user terminal and the execution subject may also be various types of terminal devices such as a smart phone, a desktop computer, a tablet computer, a vehicle-mounted terminal, a portable wearable device, a workstation, etc.; Figure 1 In the solution of the embodiment, the database is set outside the back-end server 120 in the form of a server, but in other embodiments of the present application, the database can also be set locally on the back-end server 120, that is, the back-end server can obtain the original data of the data table locally. Figure 1 Only one user is shown in the scheme of the embodiment. Of course, in other embodiments of the present application, multiple users may be allowed to access the database visualization system at the same time, and all users may be allowed to view the node components of all data tables and the associations between the node components on the visualization page. It is also possible to perform permission verification when users access the database visualization system. For each data table, only users with permission to the data table can view the corresponding node components and the associations between these node components on the visualization page. The embodiments of the present application do not make any limitation on this, and the protection scope of the present application should not be limited in any way.
[0062] It is easy to understand that the database visualization method provided in the embodiment of the present application is generally executed by the terminal device, and accordingly, the database visualization device is generally set in the terminal device. However, in other embodiments of the present application, the server can also have similar functions as the terminal device, so as to execute the database visualization solution provided in the embodiment of the present application.
[0063] Therefore, the embodiments of the present application can be applied to a terminal or a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.
[0064] The solution of the embodiment of the present application can be applied to the field of cloud computing. Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". The resources in the "cloud" are infinitely expandable in the eyes of users, and can be obtained at any time, used on demand, expanded at any time, and paid for by use.
[0065] As a cloud computing basic capability provider, a cloud computing resource pool (referred to as a cloud platform, generally referred to as IaaS (Infrastructure as a Service)) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0066] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0067] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0068] Figure 2 The flowchart of a database visualization method according to an embodiment of the present application is shown. The database visualization method can be executed by various devices capable of computing and processing, such as user terminals or cloud servers. User terminals include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, smart watches, etc. Please refer to Figure 2 As shown, the database visualization method includes at least the following steps:
[0069] In step 210, node data corresponding to each data table in the database and edge data used to characterize the association relationship between different data tables are obtained, and the node data is obtained by performing data conversion on the original data of the corresponding data table.
[0070] The database may be any type of database, for example, a relational database such as MySQL.
[0071] The database may include multiple data tables, each data table includes multiple fields, and the fields in the database may be the table headers corresponding to each column in the database. Each data table in the database may belong to each scenario, such as a private cloud scenario or other scenarios.
[0072] Next, we will introduce how to obtain node data and edge data.
[0073] Figure 3 Schematic diagram of the overall process according to an embodiment of the present application is shown. Figure 3 As shown, the overall process is divided into three stages, namely the data processing stage, the visualization engine stage and the visualization operation stage. Among them, the node data and edge data are obtained through the data processing stage and the visualization engine stage.
[0074] Figure 4 An embodiment according to the present application is shown. Figure 2 Flow chart of details of step 210 in the embodiment. Figure 4 As shown, obtaining node data corresponding to each data table in the database and edge data used to characterize the association relationship between different data tables may specifically include the following steps:
[0075] In step 211, the intermediate format data and table relationship data generated by the backend according to the original data of each data table are obtained by calling the interface.
[0076] Below, we will introduce the details Figure 3The various stages shown, combined with Figure 3 The various steps in the embodiments of the present application are described in detail below.
[0077] Phase 1: Data processing
[0078] In this stage, the data processing module in the backend needs to read the database and process the data. The backend here can be a data processing device such as a server. The specific steps included in this stage are as follows:
[0079] First, configure the database address that needs to be read and the username and password for logging into the database for the data processing module in the backend. The data processing module can connect to the database based on the database address, username and password, and read the original data of each data table from the database.
[0080] Then, the data processing module will mark the relationship between the tables according to the original data of each data table to obtain the table relationship data, that is, Figure 3 The data processing module also converts the original data of each data table into intermediate format data, that is, Figure 3 The formatted data shown is as follows:
[0081]
[0082]
[0083] It can be seen that the converted data is data in JSON format, which is the intermediate format data generated according to the original data of the data table. In the embodiment of the present application, each data table is represented as a model, and the outermost layer of the intermediate format data is models, which represents all models (i.e., all data tables in the database). For ease of understanding, the following will be explained with models instead of data tables. Models is an array, and each model (data table) is an object element under models, which contains five main fields: name, description, group, fields, and version. These five main fields are all required, where name is the model name, description is the model description, group is the group where the model is located, fields is the specific field array contained in the model, and version is the version number of the model. Fields is an array containing a list of fields corresponding to all fields of the current model, and the list of fields corresponding to each field includes multiple attribute fields. The field list corresponding to all fields includes the attribute field of field type, and the number of attribute fields in the field list corresponding to different field types can be different. All possible attribute fields may include autoIncrement, primaryKey, name, type, size, and description, where autoIncrement means whether it is auto-incremented, primaryKey means whether it is the primary key, name means the field name, type means the field type, size means the size of the field, and description means the field description. The four attribute fields of name, type, size, and description must be included in the field list corresponding to each field, and other attribute fields are optional in the field list; the field corresponding to the field list is indicated by the attribute field "name". For example, if a field list contains ""name":"UserName"", then the field corresponding to the field list is UserName. The model is divided into different groups according to the group field of the model, and each group is displayed independently without affecting each other, that is, Figure 3 The data table grouping is shown.
[0084] The front-end program sends an axios request to the back-end by calling the API interface, and obtains the table relationship data and intermediate format data in JSON format returned by the back-end.
[0085] Please continue to see Figure 4 In step 212, node data corresponding to each data table in the database is generated according to the intermediate format data, and edge data for representing the association relationship between different data tables is obtained according to the table relationship data.
[0086] This step involves Figure 3 The visualization engine stages shown are as follows:
[0087] Phase 2: Visualization Engine Phase
[0088] After the front-end program obtains the table relationship data and the intermediate format data in JSON format sent by the back-end by calling the API interface, a data conversion is performed in the front-end program to convert the intermediate format data in JSON format into node data that can be recognized, parsed and rendered into node components by the visualization engine in the front-end program, and to convert the table relationship data into edge data that can be recognized, parsed and rendered into edges by the visualization engine. The node component here is a custom component, that is, Figure 3 Custom nodes involved in the visualization engine stage shown.
[0089] In the visualization engine stage, data in the following format will be obtained:
[0090]
[0091] Among them, nodes is the collection of node data, and edges is the collection of edge data.
[0092] Specifically, for a collection of node data, the visualization engine will loop through the aforementioned models array through a program, convert the format of each model in the models array, and convert it into node data in the following format:
[0093]
[0094]
[0095] It can be seen that the node data includes the expansion result of all fields in the model using the expansion operator "..." provided by javascript and the following four additional attribute fields: id, label, type, fields, where id is the node identifier, and its value is the model name; label is the node label, and its value is also the model name; type is a fixed "er-table", which specifies the type of the node. Only when type is specified as "er-table" can the node data be rendered; fields and the type therein are used to render the fields in the model. Although the values of the node identifier and the node label in the embodiment of the present application both use the model name, in other embodiments of the present application, the node identifier and the node label may also use other values.
[0096] The associations between different data tables can be of various kinds, for example, they can include "one-to-one" and "one-to-many" associations. For example, the association between the student table and the student score table can be a "one-to-one" relationship, that is, one student can only correspond to a set of student scores, the student table can contain a student's name, age, gender and other information, and the student score table can contain the scores of each subject corresponding to the student; and the student table and the teacher table can be a "one-to-many" relationship, the teacher table can contain a teacher's name, age, gender, responsible subjects and other information, and the student table can contain information such as the names of multiple students taught by the teacher.
[0097] Table relationship data can be the determined field type corresponding to the data table. The relationship between different data tables can be determined as edge data using the following formula:
[0098]
[0099] The meaning of this formula is that if the field type (type) in the table relationship data is model, then the relationship between the data tables is "one-to-one"; if the field type (type) in the table relationship data is model_array, then the relationship between the data tables is "one-to-many". It is easy to understand that the edge data can also include the table name of the data table associated with the current data table.
[0100] The visualization engine will also configure the node appearance style of the nodes that can be rendered, the edge appearance style of the edges, and the edge style, where the node appearance style of the node is the color displayed by the node component when it is unselected and selected, the edge appearance style of the edge is the color displayed by the edges connected to the node component when the node component is unselected and selected, and the edge style is the type of edge corresponding to each association relationship. The color displayed by the node component when it is unselected can be blue, and the color displayed by the node component when it is selected can be red, and its color code can be #FF0000. Of course, the color displayed by the node component in different situations can also be configured to other colors, which is not limited here.
[0101] The edge style can be selected from the following 9 styles: line, polyline, arc, quadratic, cubic, cubic-vertical, cubic-horizontal, and loop.
[0102] For a "one-to-one" relationship, you can choose the line style; for a "one-to-many" relationship, you can choose the arc style, which can be expressed as:
[0103]
[0104] In other words, the type of the field field.type can be set to represent the association relationship, and the type of the association relationship can be determined based on the value of field.type; if the value of field.type is model, it means that the association relationship corresponding to the edge is "one-to-one", and the type of the edge is determined to be a straight line; if the value of field.type is model_array, it means that the association relationship corresponding to the edge is "one-to-many", and the type of the edge is determined to be an arc.
[0105] Of course, the edge style can also be set to other styles, which are not limited here.
[0106] When a node component is not selected, the edge connected to the node component may be displayed in gray, and its color code may be #f2f2f2; when a node component is selected, the edge connected to the node component may be displayed in blue, and its color code may be #2196f3, which can be expressed as follows:
[0107]
[0108] It can be seen that the color of the edge connected to a node component in the formula is determined according to the status of the node component; when the status of the node component is normal, it means that the node component is not selected, and the color of the edge connected to the node component is gray; when the status of the node component is selected, it means that the node component is selected, and the color of the edge connected to the node component is blue.
[0109] Of course, the color displayed on the edge connected to the node component in different situations can also be configured to other colors, which is not limited here.
[0110] In step 220, each node data is rendered as a node component corresponding to the corresponding data table in the visualization page, and each edge data is rendered as an edge between different node components, and the node component is used to display at least one field in the data table.
[0111] Edges are the connections between different node components. When the node components and edges are rendered in the visualization page, the node components and edges will be displayed in the visualization page, so that the data tables in the database and the relationships between different data tables can be visualized.
[0112] In one embodiment of the present application, a visualization page includes a data table grouping area and a rendering area. The data table grouping area is used to display a tree structure. The tree structure includes multiple data table groups and data table identifiers under each data table group. The rendering area is used to display node components corresponding to each data table identifier under the same data table group. The data table groups to which data table identifiers of different data tables belong are divided according to the functional modules corresponding to the data tables.
[0113] Figure 5 A schematic diagram of a visualization page according to an embodiment of the present application is shown.
[0114] See also Figure 5 As shown, the visualization page 500 includes a data table grouping area 510 and a rendering area 520. The data table grouping area 510 includes a tree structure 511. The tree structure 511 specifically includes several data table groups, and application is one of the data table groups. The rendering area 520 can be drawn in a Canvas canvas manner.
[0115] In one embodiment of the present application, different association relationships between data tables in a visualization page are represented by edges of different styles.
[0116] Each data table group contains several data table identifiers ( Figure 5 (not shown), the rendering area 520 includes multiple node components and edges between different node components, for example, it may include a first node component 521, a second node component 522 associated with the node component, and an edge 523 between the first node component 521 and the second node component 522.
[0117] When a selection instruction for the data table grouping application is received through the data table grouping area 510, the data table grouping application is selected and filled with color to highlight it, and the rendering area 520 will display the node components corresponding to each data table identifier under the data table group and the edges between different node components. Different edge styles are used to represent different associations between data tables. For example, the style of edge 523 is a straight line, which is used to indicate that the association relationship between the data tables corresponding to the first node component 521 and the second node component 522 is one-to-one, and the style of edge 525 is an arc line, which is used to indicate that the association relationship between the data tables corresponding to the first node component 521 and the third node component 524 is one-to-many.
[0118] Each time the user selects a data table group in the data table grouping area 510, the rendering area 520 will display the node components corresponding to the data table identifiers under the data table group. Figure 5 It can also be seen that when rendering each edge, the rendering area 520 will mark text information on the edge. The text information represents the association relationship between the data tables. For example, when the text information is "1:1", it indicates that the association relationship between the corresponding data tables is one-to-one. When the text information is "1:N", it indicates that the association relationship between the corresponding data tables is one-to-many.
[0119] A functional module is a subsystem with independent functions in a software system. Therefore, the tables involved in a functional module are strongly correlated. In the embodiment of the present application, by grouping the data tables according to the corresponding functional modules, that is, dividing the data tables with strong correlation into a group, it is convenient for users to view the association relationship.
[0120] Figure 6 An embodiment according to the present application is shown. Figure 2 Flow chart of details of step 220 in the embodiment. Figure 6 As shown, rendering each node data into a node component corresponding to the corresponding data table in the visualization page may specifically include the following steps:
[0121] In step 221, each node data is rendered as a node component corresponding to the corresponding data table, and the node component corresponding to each node data is displayed in the visualization page in the first layout style.
[0122] The first layout style is a layout method, for example, it can be Figure 5 The layout of each node component is shown in the rendering area.
[0123] In step 222, when a layout style switching instruction is received, the node components corresponding to each node data are displayed in the visualization page in the second layout style indicated by the layout style switching instruction. The first layout style and the second layout style are used to represent different layout methods of the node components.
[0124] Please continue to see Figure 3 As shown, the visualization engine stage also provides a function for selecting a display layout.
[0125] Can be Figure 5A layout style switching button is set on the visualization page 500 shown. When the user clicks the button, a layout style switching instruction is received, and the second layout style can be switched according to the instruction of the layout style switching instruction. The second layout style is another layout method, for example, each node component can be arranged neatly, or formed into a radial arrangement from the center to the outside. When the user clicks the layout style switching button again, it can be switched back to the first layout style.
[0126] Although the user can only switch between two layout styles by clicking the layout style switch button in the embodiment of the present application, in other embodiments of the present application, multiple layout styles can be switched, and the switching method can also be set as needed. Figure 5 A drop-down menu is provided on the visualization page 500 shown, and the drop-down menu includes multiple layout style options, wherein the layout style option corresponding to the current layout style is not clickable. When the user clicks on a clickable layout style option, the visualization page 500 will switch to the corresponding layout style.
[0127] In the embodiment of the present application, switching of layout styles is implemented to meet different usage scenarios.
[0128] Figure 7 A flowchart of rendering each node data into a node component corresponding to a corresponding data table in a visualization page according to an embodiment of the present application is shown. Figure 7 As shown, rendering each node data into a node component corresponding to the corresponding data table in the visualization page may specifically include the following steps:
[0129] In step 710, a field expansion button and a predetermined number of fields in the corresponding data table are displayed in each node component.
[0130] In addition to displaying the field expansion button and fields in the data table, the field type corresponding to the field and the corresponding data table identifier can be further displayed. The data table identifier here is the model name. The predetermined number can be set as needed, for example, it can be set to 3. The predetermined number of fields in the corresponding data table displayed in the node component can be selected from the corresponding data table according to various methods. For example, it can be a predetermined number of fields randomly selected from the corresponding data table, or it can be selected from the corresponding data table according to certain rules. For example, the fields can be sorted from small to large according to the generation time of the fields or sorted in alphabetical order, and the predetermined number of fields sorted first are displayed in the node component.
[0131] Figure 8FIG. 1 is a schematic diagram showing a visualization page after receiving a trigger instruction for a field expansion button according to an embodiment of the present application. Figure 8 As shown, the second node component 522 displays the data table identifier "AuroraEnvTenantRel", and also displays the three fields "AuroraUUID", "AuroraEnv", and "TenantUUID" and the field type corresponding to each field. For example, the field type corresponding to the field "AuroraUUID" can be "string". In addition, the second node component 522 displays the field expansion button "Click to expand +". It is easy to understand that when the number of all fields in a data table does not exceed three, all fields will be displayed in the corresponding node component, and the field expansion button will not be displayed.
[0132] By displaying only a predetermined number of fields in a node component, the page can be made more beautiful and easier to layout.
[0133] In step 720, when a trigger instruction for a field expansion button in a target node component is received, all fields in the target data table are displayed in the target node component, and the field expansion button is switched to a field collapse button.
[0134] Please continue to see Figure 8 As shown, when the user Figure 5 After the field expansion button "Click to expand +" in the first node component 521 is triggered, the first node component 521 will display all the fields in the corresponding data table, which are displayed from top to bottom in a list, and then display the field collapse button "Click to collapse -". In addition, the three fields displayed before the field expansion button "Click to expand +" is triggered are exactly the top three fields in the field list displayed after the field expansion button "Click to expand +" is triggered.
[0135] In step 730, when a trigger instruction for the field collapse button is received, a predetermined number of fields in the target data table are displayed again in the target node component, and the field collapse button is restored to a field expansion button.
[0136] When the user Figure 8 After the "click to collapse -" field collapse button in the first node component 521 is triggered, the first node component 521 will be restored to Figure 5 As shown, the field collapse button "Click to collapse -" will be switched to the field expansion button "Click to expand +", and only three fields will be displayed in the node component.
[0137] Fig. 9 An embodiment according to the present application is shown. Figure 2 Flowchart of the steps before the editing instruction of the target node component in the visualization page in the embodiment. Fig. 9 As shown, the following steps may be included:
[0138] In step 230, when a selection instruction for a target node component in a visualization page is received, the appearance style of the target node component is switched from a first node appearance style to a second node appearance style that is different from the first node appearance style, and the edge connected to the target node component is switched from a first edge appearance style to a second edge appearance style that is different from the first edge appearance style.
[0139] Fig.10 FIG. 1 is a schematic diagram showing a visualization page after receiving a selection instruction for a node component according to an embodiment of the present application. Fig.10 As shown, the fourth node component 1010 corresponds to the data table identifier Workflow in the data table group operations; when the fourth node component 1010 is selected, the area at the top of the fourth node component 1010 responsible for displaying the data table identifier will switch from blue to red, and the color of the edge connected to the fourth node component 1010 will switch from gray to blue. It is easy to understand that a node component can be selected in a variety of ways. For example, when the user selects the data table identifier Workflow from the data table grouping area, a selection instruction for the corresponding node component can be received; when the user triggers a certain area of the fourth node component 1010 in the rendering area, a selection instruction for the node component can also be received. In actual application, the user may be allowed to select the node component in only one of the two ways.
[0140] Easy to understand, though Figure 8 In the embodiment, the first node component 521 is in a selected state, but it is easy to understand that whether the field expansion button and the field collapse button are allowed to be triggered has no necessary connection with whether the node component containing these buttons is selected. The field expansion button or the field collapse button may be allowed to be triggered only when the node component is selected, or the field expansion button or the field collapse button may be allowed to be triggered when the node component is selected or unselected.
[0141] Fig.11 An embodiment according to the present application is shown. Figure 2 Flowchart of the steps after rendering each edge data as edges between different node components in the embodiment. Fig.11 As shown, after rendering each edge data as an edge between different node components, the method may further include the following steps:
[0142] In step 240, when a drag command for a designated node component is received, the position of the designated node component is moved according to the drag command, and while the designated node component is moved, the edge connected to the designated node component is synchronously followed and moved.
[0143] The user can long-press and drag a node component to change the display position of the node component in the rendering area. The user can freely adjust the display position of each node component; while dragging the node component, the connected edges will also move synchronously to keep the edges connected to the node component at all times.
[0144] Fig.12 FIG. 1 is a flowchart showing steps after rendering each edge data as edges between different node components according to an embodiment of the present application. Fig.12 As shown, after rendering each edge data as an edge between different node components, the following steps may also be included:
[0145] In step 1210, when a new adding instruction is received through the visualization page, the new adding page is displayed, and the new adding page is used to create a data table in a visual manner.
[0146] See also Fig.10 As shown, a "Add Model" button is set in the upper right corner of the rendering area. When the user clicks the "Add Model" button, the new instruction sent by the user will be received and the new page will be displayed.
[0147] Fig.13 FIG. 1 is a schematic diagram showing a newly added page according to an embodiment of the present application. Fig.13 As shown in the figure, the new page is a drawer component that pops up from the right side of the page, which displays the model form.
[0148] In step 1220, newly added data table data is collected through a newly added page. The newly added data table data includes multiple fields. The multiple fields include fields submitted by the user and preset public fields. The public fields are fields that need to be set by default in the data table.
[0149] See also Fig.13As shown, the following new data table data can be collected through the model form in the new page: Name (model name), Group (model group), Description, model field, where the model field is a field list, and each field in the field list includes the following attribute fields: Name (name), Type (type), Size (size), Description (description), primary key (whether it is the primary key). Among them, Name and Group are set with *, which means that their corresponding input boxes are required. When their corresponding forms are empty, the form validation will be triggered, and the input box will turn red, indicating that this item is required. At this time, the data cannot be submitted. When the correct content is filled in the corresponding input box, the error prompt disappears, and the data can be submitted at this time; the input box corresponding to the description is optional. The user can enter an explanation of the current model here to facilitate others to understand. Since the model field is a list and many attribute fields need to be entered, it is designed in the form of an editable table. Although Fig.13 It is not shown, but it is easy to understand. A data adding button can be set in the new page. When the user clicks the data adding button, a row of data can be added to the editable table. The Name column is an input box, and the user can enter the content freely; the Type column is a drop-down selection box. Because the value range of the type is fixed, it needs to be selected within the provided range. Its value range is as follows: Type = {integer, string, Boolean value, floating point number, timestamp, UUID, JSON, Decimal}; Size is a number input box, only numbers are allowed to be entered, and Description is the description of the field, which is also an input box and can be entered freely. There are only two values for the primary key: yes or no, indicating whether the field is the primary key. It can be seen that the last column of the editable table is the operation column, including the edit button and the delete button. Through the edit button, the user can modify the corresponding row of data; through the delete button, the corresponding row of data can be deleted; therefore, the model formula can be expressed as: Model = Name + Group + Description + Field * n, where Field is a field in the field list.
[0150] Please continue to see Figure 3 As shown, the visualization engine also provides a function for automatically processing repeated fields.
[0151] Common fields are repeated fields that need to be set for each data table, such as creation time, update time, etc. In the embodiment of the present application, by automatically filling in common fields when creating a new data table, the program can help people do repetitive work, reduce duplication of labor, and improve work efficiency.
[0152] In actual application, public fields can be dynamically configured by users. For example, a public field list can be maintained in the system. Duplicate fields in each table will be automatically added to this public field list. Users can also edit the public field list to further improve convenience.
[0153] In step 1230, a new data table is created in the database based on the new data table data, and a node component corresponding to the new data table is rendered in the visualization page.
[0154] Although Fig.13 Not shown, but easy to understand, a submit button can also be set in the newly added page. When the user clicks the submit button, the data filled in by the user will be collected in the form of a form, and the collected raw data will be converted into the format required by the API interface. Then, an Http request will be sent on the front-end page through Axios to submit the newly added data table data to the database and create a new data table. When a new data table is created in the database, if the data table group corresponding to the new data table is selected, the corresponding node component will be drawn synchronously in the visualization page.
[0155] Please continue to see Figure 2 As shown, in step 250, according to the editing instruction of the target node component in the visualization page, the target editing page is displayed, and the editing data is collected through the target editing page, and the target editing page is used to visually edit the target data table corresponding to the target node component.
[0156] The user's editing instructions for the target node component can be received in a variety of ways. For example, in the visualization page, the user right-clicks on the target node component to directly trigger the editing instruction; for another example, the user right-clicks on the target node component to display multiple menu options. When the user triggers the menu option indicating editing, the editing instruction can be triggered. For another example, the editing instruction for the target node component can only be generated after the user selects the target node component. For example, see Fig.10 As shown, after the fourth node component 1010 is selected by the user, the data table identifier "Workflow" of the currently selected node component will be displayed at the top of the rendering area, and an "Edit button" will be further displayed. When the user triggers the "Edit button", an editing instruction for the currently selected node component will be generated, that is, the editing instruction for the target node component can only be generated when the target node component is selected.
[0157] The field content of the target edit page is consistent with that of the new page. Users can edit Name (model name), Group (model grouping), Description, and model fields through the target edit page. Since the model field is an array, it is displayed in a table. The last column in the table is the operation column, which has two buttons, Edit and Delete. Click the Edit button, and the current row of data will become editable. You can modify the attribute fields corresponding to the Name, Type, Size, Description, and primary key fields. If you want to delete a field, click the Delete button of the corresponding row. When the user clicks the Delete button, a secondary confirmation pop-up window can be displayed. The deletion operation will only be performed after the user clicks the Confirm button in the secondary confirmation pop-up window to avoid accidental deletion. If the user wants to add a new field, click the Data Add button in the target edit page to add a new row of data.
[0158] Please continue to see Figure 3 As shown, the visualization engine stage also provides the function of adding, modifying and deleting fields visually. After the visualization engine stage, it enters stage 4: the user operation visualization stage. The functions provided by the visualization engine stage will be completed by the user's operation on the user operation interface in the user operation visualization stage. The visualization page, the new page and the target editing page all belong to the user operation interface.
[0159] In the embodiment of the present application, by setting up a new page and a target editing page, visual operations on the database and data table are implemented in the form of a form, providing users with the ability to modify data table fields online. The type of field can also be selected in a visual manner, greatly improving the convenience of operation.
[0160] In step 260, the target data table is updated based on the edited data, and the target node component is re-rendered in the visualization page according to the updated target data table.
[0161] After the user finishes editing, click the Submit button. The form will collect the data filled in by the user, convert the collected raw data into the format required by the API interface, and then use Axios to send an Http request on the front-end page to submit the data to the database. The visualization page will also re-render the target node component based on the submitted data.
[0162] Fig.14 A schematic diagram showing the data flow direction according to an embodiment of the present application is shown. Fig.14As shown, the direction of data flow is: first, from the data in the database to the custom component, thereby changing the corresponding data state in the custom component; then, when the user operates to change a certain data state, the data in the database will be changed first, and then the custom component will be further changed. In other words, in the embodiment of the present application, the direction of data flow is unidirectional, and the custom component can only be rendered according to the current data, and the state of the data cannot be changed within the component. It is invalid to maintain the state within the component itself.
[0163] In summary, according to the database visualization method provided in the embodiment of the present application, a database visualization solution is provided, which can be applied to various scenarios including private cloud scenarios, and the abstract database content is visualized in front of the user through custom layout, custom nodes, and Canvas canvas. And it can automatically connect according to the relationship between the data tables, and display the type of relationship as one-to-one or one-to-many. When a certain node is selected, the connection between the nodes associated with it can be highlighted, which improves the efficiency of developers in understanding system design and reduces communication and development costs. At the same time, it also provides the ability to visually edit, create, and delete data tables and fields, so that developers do not have to write cumbersome yaml files by hand. Duplicate fields can be added automatically, which reduces the repetitive work of developers, allowing developers to pay more attention to the business itself and improve development efficiency.
[0164] The following describes an apparatus embodiment of the present application, which can be used to execute the database visualization method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned embodiment of the database visualization method of the present application.
[0165] Fig.15 A block diagram of a database visualization device according to an embodiment of the present application is shown.
[0166] Reference Fig.15As shown, according to an embodiment of the present application, a database visualization device 1500 includes: an acquisition unit 1510, a rendering unit 1520, an editing unit 1530, and an updating and rendering unit 1540. The acquisition unit 1510 is used to acquire node data corresponding to each data table in the database and edge data used to characterize the association relationship between different data tables, and the node data is obtained by performing data conversion on the original data of the corresponding data table; the rendering unit 1520 is used to render each of the node data as a node component corresponding to the corresponding data table in the visualization page, and render each of the edge data as an edge between different node components, and the node component is used to display at least one field in the data table; the editing unit 1530 is used to display a target editing page according to an editing instruction for the target node component in the visualization page, and collect editing data through the target editing page, and the target editing page is used to perform visual editing on the target data table corresponding to the target node component; the updating and rendering unit 1540 is used to update the target data table based on the editing data, and re-render the target node component in the visualization page according to the updated target data table.
[0167] In some embodiments of the present application, based on the aforementioned scheme, the device also includes a new unit. After rendering each of the edge data as an edge between different node components, the new unit is used to: when a new instruction is received through the visualization page, display the new page, and the new page is used to create a data table in a visual manner; collect new data table data through the new page, and the new data table data includes multiple fields, and the multiple fields include user-submitted fields and preset common fields, and the common fields are fields that need to be set by default in the data table; create a new data table in the database based on the new data table data, and render the node component corresponding to the new data table in the visualization page.
[0168] In some embodiments of the present application, based on the aforementioned scheme, the device also includes a selection unit, and before the editing instruction of the target node component in the visualization page, the selection unit is used to: when receiving the selection instruction of the target node component in the visualization page, switch the appearance style of the target node component from the first node appearance style to the second node appearance style that is different from the first node appearance style, and switch the edge connected to the target node component from the first edge appearance style to the second edge appearance style that is different from the first edge appearance style.
[0169] In some embodiments of the present application, based on the aforementioned scheme, the rendering unit 1520 is configured to: render each of the node data as a node component corresponding to the corresponding data table, and display the node component corresponding to each of the node data in the visualization page with a first layout style; when a layout style switching instruction is received, display the node component corresponding to each of the node data in the visualization page with a second layout style indicated by the layout style switching instruction, and the first layout style and the second layout style are used to represent different layout methods of node components.
[0170] In some embodiments of the present application, based on the aforementioned scheme, the visualization page includes a data table grouping area and a rendering area, the data table grouping area is used to display a tree structure, the tree structure includes multiple data table groups and data table identifiers under each data table group, and the rendering area is used to display node components corresponding to each data table identifier under the same data table group, and the data table groups to which the data table identifiers of different data tables belong are divided according to the functional modules corresponding to the data tables.
[0171] In some embodiments of the present application, based on the aforementioned scheme, the device also includes a push-and-drag unit. After rendering each edge data as an edge between different node components, the push-and-drag unit is used to: when receiving a drag instruction for a specified node component, move the position of the specified node component according to the drag instruction, and while moving the specified node component, synchronously follow the movement of the edge connected to the specified node component.
[0172] In some embodiments of the present application, based on the aforementioned scheme, the rendering unit 1520 is configured to: display a field expansion button and a predetermined number of fields in the corresponding data table in each node component; when a trigger instruction for the field expansion button in the target node component is received, all fields in the target data table are displayed in the target node component, and the field expansion button is switched to a field collapse button; when a trigger instruction for the field collapse button is received, a predetermined number of fields in the target data table are displayed again in the target node component, and the field collapse button is restored to a field expansion button.
[0173] In some embodiments of the present application, based on the aforementioned solution, different association relationships between data tables in the visualization page are represented by edges of different styles.
[0174] In some embodiments of the present application, based on the aforementioned scheme, the acquisition unit 1510 is configured to: obtain the intermediate format data and table relationship data generated by the backend according to the original data of each data table by calling the interface; generate node data corresponding to each data table in the database according to the intermediate format data, and obtain edge data used to characterize the association relationship between different data tables according to the table relationship data.
[0175] Fig.16 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0176] It should be noted that Fig.16 The computer system 1600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0177] like Fig.16 As shown, the computer system 1600 includes a central processing unit (CPU) 1601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1602 or the program loaded from the storage part 1608 to the random access memory (RAM) 1603, such as executing the method described in the above embodiment. In RAM 1603, various programs and data required for system operation are also stored. CPU 1601, ROM 1602 and RAM 1603 are connected to each other through bus 1604. Input / output (I / O) interface 1605 is also connected to bus 1604.
[0178] The following components are connected to the I / O interface 1605: an input section 1606 including a keyboard, a mouse, etc.; an output section 1607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1608 including a hard disk, etc.; and a communication section 1609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1609 performs communication processing via a network such as the Internet. A drive 1610 is also connected to the I / O interface 1605 as needed. A removable medium 1611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1610 as needed so that a computer program read therefrom is installed into the storage section 1608 as needed.
[0179] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1609, and / or installed from a removable medium 1611. When the computer program is executed by a central processing unit (CPU) 1601, various functions defined in the system of the present application are executed.
[0180] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0181] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0182] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0183] As one aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0184] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0185] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0186] It is understandable that in the specific implementation of this application, data related to the database is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0187] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0188] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A database visualization method, characterized in that: The method comprises: Obtaining node data corresponding to each data table in the database and edge data used to characterize the association relationship between different data tables, wherein the node data is obtained by performing data conversion on the original data of the corresponding data table; Rendering each of the node data as a node component corresponding to the corresponding data table in the visualization page, and rendering each of the edge data as an edge between different node components, wherein the node component is used to display at least one field in the data table; According to the editing instruction of the target node component in the visualization page, a target editing page is displayed, and editing data is collected through the target editing page, wherein the target editing page is used to perform visual editing on the target data table corresponding to the target node component; The target data table is updated based on the edited data, and the target node component is re-rendered in the visualization page according to the updated target data table.
2. The database visualization method according to claim 1, characterized in that: After rendering each of the edge data as an edge between different node components, the method further includes: When a new addition instruction is received through the visualization page, a new addition page is displayed, wherein the new addition page is used to create a data table in a visualization manner; Collecting new data table data through the new page, the new data table data includes multiple fields, the multiple fields include fields submitted by the user and preset common fields, the common fields are fields in the data table that need to be set by default; A new data table is created in the database based on the new data table data, and a node component corresponding to the new data table is rendered in the visualization page.
3. The database visualization method according to claim 1, characterized in that: Before the editing instruction for the target node component in the visualization page is executed, the method further comprises: When a selection instruction for a target node component in the visualization page is received, the appearance style of the target node component is switched from a first node appearance style to a second node appearance style that is different from the first node appearance style, and the edge connected to the target node component is switched from a first edge appearance style to a second edge appearance style that is different from the first edge appearance style.
4. The database visualization method according to claim 1, characterized in that: The rendering of each of the node data into a node component corresponding to the corresponding data table in the visualization page includes: Rendering each of the node data into a node component corresponding to the corresponding data table, and displaying the node component corresponding to each of the node data in the visualization page in a first layout style; When a layout style switching instruction is received, the node components corresponding to each node data are displayed in the visualization page in a second layout style indicated by the layout style switching instruction, and the first layout style and the second layout style are used to represent different layout methods of the node components.
5. The database visualization method according to claim 1, characterized in that: The visualization page includes a data table grouping area and a rendering area. The data table grouping area is used to display a tree structure. The tree structure includes multiple data table groups and data table identifiers under each data table group. The rendering area is used to display node components corresponding to each data table identifier under the same data table group. The data table groups to which data table identifiers of different data tables belong are divided according to the functional modules corresponding to the data tables.
6. The database visualization method according to claim 1, characterized in that: After rendering each of the edge data as an edge between different node components, the method further includes: When a drag command for a designated node component is received, the position of the designated node component is moved according to the drag command, and while moving the designated node component, the edge connected to the designated node component is synchronously followed and moved.
7. The database visualization method according to claim 1, characterized in that: The rendering of each of the node data into a node component corresponding to the corresponding data table in the visualization page includes: Displaying a field expansion button and a predetermined number of fields in a corresponding data table in each node component; When a trigger instruction for a field expansion button in the target node component is received, all fields in the target data table are displayed in the target node component, and the field expansion button is switched to a field collapse button; When a trigger instruction for the field collapse button is received, a predetermined number of fields in the target data table are displayed again in the target node component, and the field collapse button is restored to a field expansion button.
8. The database visualization method according to any one of claims 1 to 7, characterized in that: Different association relationships between data tables in the visualization page are represented by edges of different styles.
9. The database visualization method according to any one of claims 1 to 7, characterized in that: The step of obtaining node data corresponding to each data table in the database and edge data used to characterize the association relationship between different data tables includes: Obtain the intermediate format data and table relationship data generated by the backend based on the original data of each data table by calling the interface; Node data corresponding to each data table in the database is generated according to the intermediate format data, and edge data for representing the association relationship between different data tables is acquired according to the table relationship data.
10. A database visualization device, characterized in that: The device comprises: An acquisition unit, used to acquire node data corresponding to each data table in the database and edge data used to characterize the association relationship between different data tables, wherein the node data is obtained by performing data conversion on the original data of the corresponding data table; A rendering unit, used to render each of the node data as a node component corresponding to the corresponding data table in a visualization page, and render each of the edge data as an edge between different node components, wherein the node component is used to display at least one field in the data table; An editing unit, configured to display a target editing page according to an editing instruction for a target node component in the visualization page, and collect editing data through the target editing page, wherein the target editing page is used to perform visual editing on a target data table corresponding to the target node component; An updating and rendering unit is used to update the target data table based on the edited data, and re-render the target node component in the visualization page according to the updated target data table.
11. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for visualizing a database according to any one of claims 1 to 9 is implemented.
12. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the database visualization method as described in any one of claims 1 to 9.
13. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the database visualization method according to any one of claims 1 to 9.
Citation Information
Cited By
Content editing method and device, electronic equipment and storage medium
CN120296276A