A chart automatic generation system

By designing a chart automatic generation system, including a database search module, a form serialization module and a chart presentation module, the problem of inability to handle natural language queries and custom charts in the existing technology is solved, and user-defined data visualization and rapid rendering are realized.

CN116186125BActive Publication Date: 2025-06-17BEIJING BAIYANG CHENGCHUANG PHARM INVESTMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310047514.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-31
Publication Date
2025-06-17
Estimated Expiration
2043-01-31

AI Technical Summary

Technical Problem

The prior art is difficult to generate custom charts based on user-defined search conditions, especially the inability to directly process search conditions in natural language forms, resulting in users being unable to freely select data and graph display forms.

Method used

A chart automatic generation system is designed, including a database search module, a form serialization module and a chart presentation module. The system can receive natural language queries, construct database query statements, generate form data, and generate target charts based on the rendering parameters selected by the user.

Benefits of technology

It realizes that users can freely choose the data in the NLP query content and rich chart presentation forms, reduces data loading and chart rendering time, and provides a more intuitive and customized data visualization experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116186125B_ABST
    Figure CN116186125B_ABST
Patent Text Reader

Abstract

A chart automatic generation system provided by the present invention includes a database retrieval module, which is used to receive an NLP query for a database, construct a query statement according to the NLP query, and automatically generate form data of a query result; a form serialization module, which is used to obtain the form data, determine the type of the form data, and generate a serialized form based on the type of the form data; a chart rendering module, which is used to receive rendering parameters associated with the serialized form, and in a chart creation interface, determine a set of data elements to be presented based on multiple rendering parameters, and render a target chart by using a specific chart style. Through the solution of the present invention, users can freely select data in the NLP query content, independently select a rich chart display form, realize real-time visualization display of the selected data, and implement chart content according to the data selected by the users, reducing the time spent on data loading and chart rendering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data visualization, and particularly to a chart automatic generation system. Background Art

[0002] Chart presentation is one of the most intuitive ways to present data stored in a database. Most of the time, the presentation form of a chart has a fixed theme and a fixed form type. Users cannot view data forms according to their own retrieval conditions and then generate charts automatically by selecting data forms. In particular, they cannot determine which data forms to display according to the retrieval conditions in the form of natural language input. If one wants to achieve self-demand-based, fixed-theme-free, customizable, and diversified presentation, a large amount of cumbersome development work is required, which is not conducive to user operation. Summary of the Invention

[0003] To solve the problems existing in the prior art, the present invention provides a chart automatic generation system, including a database retrieval module, a form serialization module, and a chart presentation module, characterized in that:

[0004] The database retrieval module is configured to receive an NLP natural language query for the database, construct a database query statement according to the NLP query, store the query result of the database query statement, and automatically generate corresponding form data;

[0005] The form serialization module is configured to obtain the labels and key values of multiple data columns and multiple data rows in the form data, determine the type of the form data, and generate a serialized form including the labels and the key values based on the type of the form data;

[0006] The chart presentation module is configured to receive rendering parameters associated with the serialized form, and in a chart creation interface, based on the received multiple rendering parameters, according to user selection and a set of data elements to be presented, render and generate a target chart using a specific chart style.

[0007] Preferably, the database retrieval module is further configured to:

[0008] Parse the NLP query to determine multiple entities of the NLP query;

[0009] Use a context knowledge base to identify the multiple entities, wherein the multiple entities are compared with the context knowledge base by entity type;

[0010] Determine the dependency relationship between the identified multiple entities based on the parsed NLP query;

[0011] Then, construct a database query statement based on the identified multiple entities and the dependencies.

[0012] Preferably, the database retrieval module is further configured to:

[0013] Before parsing the NLP query, once an NLP query is received from the user, convert the NLP query into an intermediate query language;

[0014] By parsing the converted intermediate query language, identify the database query format based on the types of multiple data sources;

[0015] Use the field semantics of the data source to determine whether the database query result can be formalized;

[0016] If the database query result can be formalized, use the field semantics of the data source to translate the data query to be executed.

[0017] Preferably, if the database query result cannot be formalized, prompt the user to input additional information or correct the input NLP query information through the field semantics and the context information of the natural language from the user, repeat the above judgment until it is determined that the database query result can be formalized, and generate a database query statement.

[0018] Preferably, the form serialization module is further configured to:

[0019] Associate each column in the multiple data columns and each row in the multiple data rows with a specific data type;

[0020] Based on the data type associated with each column and the data type associated with each row, determine whether the form data is a column-oriented form or a row-oriented form.

[0021] Preferably, the form serialization module is further configured to:

[0022] When it is determined that the form data is a column-oriented form, make the horizontal axis of the generated serialized form correspond to the labels and key values in the multiple data rows;

[0023] When the form data is determined to be a row-oriented form, make the horizontal axis of the generated serialized form correspond to the labels and key values in the multiple data columns.

[0024] Preferably, the form serialization module is further configured to:

[0025] Associate the row label data associated with the horizontal axis of the serialized form with the vertical axis, and associate the column label data associated with the vertical axis of the serialized form with the horizontal axis;

[0026] Generate a transposed form, where the row label data is associated with the vertical axis of the transposed form, and the column label data is associated with the horizontal axis of the transposed form.

[0027] Preferably, the chart creation interface includes a data element display sub-interface, a data element conversion sub-interface, and an attribute selection sub-interface;

[0028] The data element display sub-interface is used to display controls for data elements; the data element conversion sub-interface is used to send the selected data elements to the chart creation engine; the attribute selection sub-interface is used to select attributes of the data elements to be displayed in the data element display sub-interface.

[0029] Preferably, the chart rendering module is further configured to:

[0030] Display controls for the data element set in the data element display sub-interface of the chart creation interface, where the controls include graphical representations of the data element set;

[0031] Receive a candidate group of data elements selected by the user;

[0032] Receive an operation by the user to place the candidate group of data elements in the data element conversion sub-interface of the chart creation interface;

[0033] Send the candidate group to the chart creation engine to create the target chart;

[0034] Identify unused attributes of the candidate group of data elements that are not used when creating the target chart, where the unused attributes are based on the candidate group of data elements, the chart style of the target chart, and the user's selection result of the unused attributes through the chart creation interface;

[0035] Remove the unused attributes from the candidate group of data elements to create data to be rendered for the target chart;

[0036] Automatically send the data to be rendered to the chart creation engine;

[0037] Automatically create the target chart in the chart creation engine based on the received data to be rendered.

[0038] Preferably, the chart style is one or more of a bar chart, a line chart, a scatter plot, a tree map, a pie chart, a column chart, a bubble chart, a funnel chart, a radar chart, a Gantt chart, a stacked chart, an area chart, a scatter plot, a doughnut chart, and a coordinate chart

[0039] Compared with the prior art, the beneficial effects of the present invention are:

[0040] The present invention provides a chart automatic generation system, including a database retrieval module for receiving an NLP query for a database, constructing a query statement according to the NLP query, and automatically generating form data of a query result; a form serialization module for obtaining the form data, determining the type of the form data, and generating a serialized form based on the type of the form data; and a chart rendering module for receiving rendering parameters associated with the serialized form, determining a set of data elements to be presented based on multiple rendering parameters in a chart creation interface, and rendering a target chart by using a specific chart style. The chart automatic generation system of the present invention can allow a user to freely select data in the NLP query content, independently select a rich chart display form, realize real-time visualization display of the selected data, and then implement chart content according to the data selected by the user, greatly reducing the time spent on data loading and chart rendering. Brief Description of the Drawings

[0041] Figure 1 It is a block diagram of the chart automatic generation system according to an embodiment of the present invention. Detailed Embodiment

[0042] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention belong to the scope of protection of the present invention.

[0043] The chart automatic generation system of the present invention aims to bring a better experience to users with rich chart styles and freely selectable data. It is applied and embedded into other visualization applications in the form of components, thereby simplifying the development of chart controls. At the same time, the serialization configuration method in the system background also provides an adaptive solution for the free display of charts.

[0044] To better understand the present invention, the content of the present invention will be further described below in conjunction with the accompanying drawings of the specification and examples.

[0045] The present invention provides a chart automatic generation system, as Figure 1As shown in the figure, the chart automatic generation system involved in the present application mainly includes: a database retrieval module 101, a form serialization module 102, and a chart presentation module 103. The database retrieval module 101 is used to receive an NLP natural language query for the database, parse the NLP query to determine the entities of the NLP query and the dependency relationships between the entities, construct a database query statement based on the entities and the dependency relationships, store the query results of the database query statement, and automatically generate corresponding form data. The form serialization module 102 is used to obtain the labels and key values of multiple data columns and multiple data rows in the form data, determine the type of the form data, and generate a serialized form including the labels and the key values based on the type of the form data. The chart presentation module 103 is used to receive rendering parameters associated with the serialized form, and in the chart creation interface, based on the multiple rendering parameters, according to the user's selection and the set of data elements to be presented, render and generate a target chart using a specific chart style.

[0046] Specifically, the database retrieval module 101 is used to receive an NLP natural language query for the database, parse the NLP query to determine multiple entities of the NLP query; use a context knowledge base to identify the multiple entities, where the multiple entities can be compared with the context knowledge base through entity types to determine the dependency relationships between the identified multiple entities based on the parsed NLP query. Then, construct a database query statement based on the identified multiple entities and the dependency relationships, store the query results of the database query statement, and automatically generate corresponding form data. In an optional embodiment, before parsing the NLP query, once an NLP query is received from the user, the NLP query can be converted into an intermediate query language. By parsing the converted intermediate query language, identify the database query format based on the types of multiple data sources, and use the field semantics of the data sources to determine whether the database query results can be formalized. The formalization of data can refer to describing data using entities and relationships. If so, use the field semantics of the data sources to translate the data query to be executed. If the database query results cannot be formalized, further prompt the user to input additional information or correct the entered NLP query information through the field semantics and the context information of the natural language from the user, and repeat the above judgment until it is determined that the database query results can be formalized and a database query statement is generated.

[0047] The form serialization module 102 is used to obtain the form data, where the form data includes tags and key values organized into multiple data columns and multiple data rows. Each column in the multiple data columns and each row in the multiple data rows are associated with a specific data type. Based on the data type associated with each column and the data type associated with each row, it is determined whether the form data is a column-oriented form or a row-oriented form. Among them, the column-oriented form can represent a form in which the primary key is in the same row, while the row-oriented form can represent a form in which the primary key is in the same column. Based on the determination that the form data is a column-oriented form or a row-oriented form, a predefined optimization model is applied to the data type associated with each column and the data type associated with each row respectively to automatically select a candidate form type from multiple form types. Then, using the automatically selected form type, a serialized form including the tags and the key values is generated. Among them, when it is determined that the form data is a column-oriented form, the horizontal axis of the generated serialized form corresponds to the tags and key values in the multiple data rows, and when the form data is determined to be a row-oriented form, the horizontal axis of the generated serialized form corresponds to the tags and key values in the multiple data columns.

[0048] After generating the serialized form, the form data can be stored in association with a document including the serialized form, and in response to receiving a modification request for the form data through the form serialization module 102, in the form serialization module 102, a form of the selected form type is automatically regenerated, and the form describes the graphical representation of the tags and the modified key values.

[0049] As an optional embodiment, after adding the serialized form to a document generated by the form serialization module 102, a transpose function can be further provided, and the transpose function associates the row label data associated with the horizontal axis of the serialized form with the vertical axis, and associates the column label data associated with the vertical axis of the serialized form with the horizontal axis. Then a transposed form is generated, where the row label data is associated with the vertical axis of the transposed form, and the column label data is associated with the horizontal axis of the transposed form.

[0050] The chart presentation module 103 is configured to receive a plurality of rendering parameters, where the plurality of rendering parameters are associated with a plurality of data elements of the serialized form and are associated with a plurality of attributes of each data element, generate a chart creation interface including controls for the data elements, where the controls for the data elements are linked to each other and are linked to attributes pre-specified as being associated with each data element, and the chart creation interface includes a data element display sub-interface, a data element conversion sub-interface, and an attribute selection sub-interface. The data element display sub-interface is configured to display the controls for the data elements; the data element conversion sub-interface is configured to send the selected data elements to a chart creation engine. And the attribute selection sub-interface is configured to select the attributes of the data elements to be displayed in the data element display sub-interface. Based on the plurality of rendering parameters, through the attribute selection sub-interface of the chart creation interface, a set of data elements is determined according to the user's selection, where the user's selection is based on a target chart selected from a plurality of chart styles that the user desires to create. When determining the set of data elements according to the user's selection, the set of data elements is displayed to the user as a sequence of selectable objects in the interface, and the user can be received to add a plurality of data elements to the set or remove a plurality of data elements from the set.

[0051] Display the controls for the set of data elements in the data element display sub-interface of the chart creation interface, where the controls include a graphical representation of the set of data elements. Receive a candidate group of the data elements selected by the user; at the same time, receive the user's operation to place the candidate group of the data elements in the data element conversion sub-interface of the chart creation interface to send the candidate group to the chart creation engine to create the target chart; identify the unused attributes of the candidate group of the data elements that are not used when creating the target chart, where the unused attributes are based on the candidate group of the data elements, the chart style of the target chart, and the user's selection result of the unused attributes through the chart creation interface. Remove the unused attributes from the candidate group of the data elements to create data to be rendered for the target chart; automatically send the data to be rendered to the chart creation engine. In the chart creation engine, the target chart is automatically created based on the received data to be rendered.

[0052] The chart style may be one or more of a bar chart, a line chart, a scatter chart, a tree map, a pie chart, a column chart, a bubble chart, a funnel chart, a radar chart, a Gantt chart, a stacked chart, an area chart, a scatter plot, a doughnut chart, and a coordinate chart. At the same time, the chart automatic generation system of the present invention can also set label display, X-axis tilt angle, decimal retention, etc. to meet the user's multi-angle analysis.

[0053] When automatically creating the target chart based on the received data to be rendered, the chart presentation module 103 may create different charts based on different subsets of the data to be rendered. For example, based on each subset of the data to be rendered, the first chart G1 and the second chart G2 are created, and when a user instruction to modify the first chart G1 is received, it is determined whether the first chart G1 has attributes compatible with the second chart G2. If so, the corresponding modification is synchronously performed on the second chart G2. For example, when the user expands or compresses the coordinate axis of the first chart G1, and when it is determined that the attributes of the first chart G1 and the second chart G2 are compatible with each other, the coordinate axis of the second chart G2 can be expanded or compressed synchronously.

[0054] Optionally, the chart presentation module 103 may also merge the first chart G1 and the second chart G2 when the first chart G1 has attributes compatible with the second chart G2. In one embodiment, after determining the data sets D1 and D2 corresponding to the first chart G1 and the second chart G2 respectively, in response to a user's chart merge request, a comparison of the metadata of the data set D1 and the metadata of the data set D2 is first performed to identify the metadata attributes that can be used as keywords from the data set D1 and the data set D2. The metadata attributes include data format and data type. The first chart G1 includes a first attribute set and a first metadata attribute, while the second chart G2 includes a second attribute set and a first metadata attribute. After modifying the data format and the data type in the data sets D1 and D2 based on the keyword, the data set D1 and the data set D2 are merged to form a combined data set D3. The combined data set is used to generate a combined chart G3, which can present the data from the data set D1 in the first chart format and present the data from the data set D2 in a second chart format with a visual effect different from the first chart format.

[0055] The first metadata attribute includes a first data type of the data assigned to the data set D1, and the second metadata attribute includes a second data type of the data assigned to the data set D2, and the second data type is different from the first data type. After generating the combined chart G3, a chart type for the combined chart G3 is selected, and the chart type presents the first data type and the second data type in the first chart format and the second chart format respectively.

[0056] To implement the processing of user-defined query terms in the NLP natural language query and to analyze the predefined range of data sets in the database, the database retrieval module 101 pre-stores predefined data sets. The range of the predefined data sets may include multiple attributes for performing data parsing and stores information describing each intention of the NLP query, where each intention corresponds to a rule for identifying natural language queries with the intention and a command for processing the data in the data set according to the intention. In a preferred embodiment, the rule may include multiple query templates, and each query template specifies natural language keywords, multiple attributes of the data set, and the sorting of the keywords and the multiple attributes.

[0057] The database retrieval module 101 may receive information describing a user-defined query term, which associates the NLP phrase identifying the user-defined query term with an expression that maps the user-defined query term to individual data columns in the data set and is used to enumerate a subset of the named entities manually selected by the user in each data column. After receiving an NLP query, the NLP phrase identifying the user-defined query term used in each NLP query is determined. A database query statement is generated only when the NLP query satisfies the rule associated with the identified intention to retrieve the data in the data set requested by the NLP query. And wherein, the database query statement uses the expression of the user-defined query term to select records associated with the subset of the user-selected named entities enumerated in the expression.

[0058] After performing the database query, multiple form documents obtained by the query can be stored, each form document corresponding to an NLP query result. At the same time, the correspondence between the form document and each NLP query can be stored, and this correspondence is used to identify the user-defined query term. When the user needs to add or remove named entities, or edit the expression of the user-defined query term, the corresponding form document can also be updated based on the correspondence stored in each form document, for example, including re-parsing multiple NLP queries based on the edit of the user-defined query term. In a further aspect, determining the expression of the user-defined query term further includes obtaining a filtering condition for the data in the data set, so that the database query determines a filter for filtering the data set based on the filtering condition.

[0059] Wherein the expression can further apply a format conversion operation to the user-defined query term, the format conversion operation can be used to determine column data to be converted from an original format to a target format, and during the process of processing the NLP query, convert the column data retrieved from the original format to target column data in the target format, the target column data is not stored in the dataset, and each key value in the original column corresponds to a converted key value in the target column, and enable the query result in the stored form document to include the target column data.

[0060] To achieve the visualization of hierarchical data, the chart automatic generation system of the present invention further realizes the support for hierarchical chart display. Specifically, the chart presentation module 103 first generates a summary chart template, the summary chart template includes a first-level folding control, and the first-level folding control includes a link to the basic detail chart. After instantiating the summary chart according to the summary chart template, generate a basic detail chart template and instantiate it into a basic detail chart. When receiving an action of the user on the first-level folding control in the summary chart, present the basic detail chart to the user and display the URL corresponding to the link of the basic detail chart.

[0061] Furthermore, the basic detail chart template includes a generated lower-level folding control, the lower-level folding control includes a link to a secondary detail chart, and the secondary detail chart is used to provide additional information associated with the lower-level folding control. When receiving an action of the user on the lower-level folding control in the basic detail chart, present the basic detail chart to the user and display the URL corresponding to the link of the basic detail chart. When the user sets the screen focus above the first-level folding control, a floating layer can be presented to the user, and the floating layer can include the URLs corresponding to the multiple links associated with the first-level folding control.

[0062] For the form serialization module 102, its serialization process can essentially be a process of converting the object state into a format that can be maintained or transmitted. Opposite to serialization is deserialization, which converts a stream into an object. These two processes combined can facilitate the storage and transmission of data. By referring to the XML serializer, the Serialize method of the system can be directly called to convert the object of the class into XML, and conversely, the XML file can be deserialized into an object through the Deserialize method.

[0063] During the serialization process, the property names of the defined serialization classes (chart classes) must be the same as the XML file node names. In the XML file of each chart type, the values of the XML nodes correspond one by one to the properties of the chart class. When the XML file is serialized, the values of its nodes will be initialized to the corresponding property values of the chart object, and different charts will be generated according to different chart objects. The XML file contains all the information of the graph. For example, in the XML file of a pie chart, the value of the Viewtype node is "Pie", and in the XML file of a line chart, the value of the Viewtype node is "Line"; when the user selects "line chart" in the chart type dropdown box, the parameter received by the interface is the "line chart.XML" file, and the content of the file is read. The value "Line" of Viewtype in the "line chart.XML" file is serialized into the value of Viewtype of the chart class ChartControl. The encapsulated chart plugin ChartControl can determine the type of graph to be displayed according to the value of Viewtype, so the interface is displayed as a pie chart.

[0064] The following embodiments provide a method for converting a database query form into an XML file:

[0065] Step A1, generating an entity relationship model from the relational paradigm of the database.

[0066] Step A2, applying a schema conversion process to the entity relationship model to map the relational paradigm to the DTD of the XML schema.

[0067] Step A3, generating a DOM from the DTD, where the DOM represents the data semantics of the relational paradigm, and the data semantics of the relational paradigm are saved as the data semantics in the XML file.

[0068] Step A4, converting the relational data from the database query form into an XML file using the relational paradigm and XML schema from the DTD and DOM.

[0069] Then, optionally, the DOM is used to integrate the XML file to form a serialized database corresponding to the queried database. Wherein, the root element and sub-elements in the XML file can be pre-positioned before mapping the relational paradigm to the DTD. During the process of mapping the relational paradigm to the DTD of the XML schema, the relational paradigm with associated relational paradigm constraints is mapped into the DTD together, and the relevant entities in the database are mapped to the corresponding root element and sub-elements in the XML file.

[0070] In a specific field, traditional methods for automatically generating charts often fail to accurately obtain users' retrieval requirements and have low processing efficiency for heterogeneous databases. Therefore, in a further embodiment, taking a medical expert Q&A system as an example, the chart automatic generation system of the present invention presents data resources that users may be interested in to medical users in the form of charts in a reliable manner. Before the data collection and reading stage of the database retrieval module 101 for retrieval, first, according to the size of the predefined data set read in, a binary matrix with an initial value set to 0 is constructed, and a corresponding interest training data set TRS and an interest test data set TES are generated according to the database query results. The content in the interest test data set TES represents the set of items that medical users are interested in. Then, the values of this matrix are randomly modified to 1, and the remaining values remain 0. By performing a bitwise AND operation between this binary matrix and the corresponding data set, the corresponding interest training data set TRS is calculated, and by performing a bitwise NOT operation on the binary matrix of the interest training data set TRS, the interest test data set TES is thus calculated. The generated interest training data set TRS and interest test data set TES are sent to the database retrieval module 101 for query execution. The database retrieval module 101 calculates the scores of the data items with a value of 1 in the binary matrix corresponding to the interest test data set TES based on the interest training data set TRS.

[0071] When the database retrieval module 101 returns data, it is presented to the medical user together with the algorithm configuration parameters for the user to provide feedback and modify the parameters. After the medical user provides feedback information on the query results, the query results are reordered according to the scores of the query results and the proximity of the current query results feedback by the medical user. For each query result γ i Calculate the weight vector, which is composed of the weights represented by the IDF word frequencies of the corresponding words in the query results. The following formula is used to calculate the correlation Correlation between the query result γ i and the query statement Ω.

[0072]

[0073]

[0074]

[0075] In the formula, Ψ(t, γ i ) is the weight of the word t in the query result γ i . is the weight of the word t in the query statement Ω. len(γ i ) is the number of records in the query result γ i . cnt(t, γ i ) is the word t in the query result γi The IDF term frequency that appears in

[0076] According to the order of the correlation degree Correlation calculated by the above algorithm from high to low, the initial query results of the medical Q&A system are re-sorted, and a predefined number of query results are sent to the form serialization module 102 for further processing.

[0077] Through the chart automatic generation system provided by the present invention, the user is allowed to freely select the data in the NLP query content, independently select a rich chart display form, realize the real-time visual display of the selected data, and then realize the chart content according to the data selected by the user, greatly reducing the time spent on data loading and chart rendering.

[0078] Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0079] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on a plurality of computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0080] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data mining devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable data mining devices generate a device for realizing the functions specified in Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0081] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data mining device to work in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 specified in one block or multiple blocks.

[0082] These computer program instructions can also be loaded onto a computer or other programmable data mining device, such that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, thereby providing steps for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 specified in one block or multiple blocks.

[0083] The above are only embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included within the scope of the claims of the present invention pending approval of the application.

Claims

1. An automatic chart generation system, comprising a database retrieval module, a form serialization module, and a chart presentation module, characterized in that: The database retrieval module is used to receive NLP natural language queries for the database, construct database query statements according to the NLP queries, store the query results of the database query statements, and automatically generate corresponding form data; The form serialization module is used to obtain the labels and key values of multiple data columns and multiple data rows in the form data, determine the type of the form data, and generate a serialized form including the labels and the key values based on the type of the form data; The chart rendering module is used to receive the serialized form and rendering parameters associated with the serialized form, and in the chart creation interface, based on the multiple rendering parameters, according to the user's selection and the set of data elements to be presented, render and generate a target chart using a specific chart style; The form serialization module is further configured as: Associate each column of the multiple data columns and each row of the multiple data rows with a specific data type; based on the data type associated with each column and the data type associated with each row, determine whether the form data is a column-oriented form or a row-oriented form; The form serialization module is further configured as: When it is determined that the form data is a column-oriented form, make the horizontal axis of the generated serialized form correspond to the labels and key values in the multiple data rows, and when the form data is determined to be a row-oriented form, make the vertical axis of the generated serialized form correspond to the labels and key values in the multiple data columns; The form serialization module is further configured as: Associate the row label data associated with the horizontal axis of the serialized form with the vertical axis, and associate the column label data associated with the vertical axis of the serialized form with the horizontal axis; Generate a transposed form, where the row label data is associated with the vertical axis of the transposed form, and the column label data is associated with the horizontal axis of the transposed form.

2. The automatic chart generation system according to claim 1, characterized in that, The database retrieval module is further configured as: Parse the NLP query to determine multiple entities of the NLP query; use a context knowledge base to identify the multiple entities, where the multiple entities are compared with the context knowledge base through entity types to determine the dependency relationship between the identified multiple entities based on the parsed NLP query; Construct a database query statement based on the identified multiple entities and the dependency relationship.

3. The automatic chart generation system according to claim 1, characterized in that, The database retrieval module is further configured as: Before parsing the NLP query, once an NLP query is received from the user, convert the NLP query into an intermediate query language; By parsing the converted intermediate query language, identify the database query format based on the types of multiple data sources, and use the field semantics of the data sources to determine whether the database query results can be formalized; If the database query results can be formalized, use the field semantics of the data sources to translate the data query to be executed.

4. The automatic chart generation system according to claim 3, characterized in that, If the database query result cannot be formalized, the user is prompted to input additional information or correct the input NLP query information based on the field semantics and the context information of the natural language from the user, and the above judgment is repeated until it is determined that the database query result can be formalized and a database query statement is generated.

5. The automatic chart generation system according to claim 1, characterized in that, The chart creation interface includes a data element display sub-interface, a data element conversion sub-interface, and an attribute selection sub-interface; the data element display sub-interface is used to display controls for data elements; the data element conversion sub-interface is used to send the selected data elements to the chart creation engine; the attribute selection sub-interface is used to select the attributes of the data elements to be displayed in the data element display sub-interface.

6. The automatic chart generation system according to claim 5, characterized in that, The chart rendering module is further configured to: display, in the data element display sub-interface of the chart creation interface, controls for the data element set, where the controls include graphical representations of the data element set; receive a candidate group of the data elements selected by the user; and at the same time, receive an operation by the user to place the candidate group of the data elements in the data element conversion sub-interface of the chart creation interface to send the candidate group to the chart creation engine to create the target chart; identify unused attributes of a candidate group of data elements that are not used when creating the target chart, where the unused attributes are based on the candidate group of the data elements, the chart style of the target chart, and the selection result of the user on the unused attributes through the chart creation interface; remove the unused attributes from the candidate group of the data elements to create data to be rendered for the target chart; automatically send the data to be rendered to the chart creation engine; automatically create the target chart in the chart creation engine based on the received data to be rendered.

7. The automatic chart generation system according to claim 1, characterized in that, The chart style is one or more of a bar chart, a line chart, a scatter chart, a tree chart, a pie chart, a column chart, a bubble chart, a funnel chart, a radar chart, a Gantt chart, a stacked chart, an area chart, a scatter plot, a doughnut chart, and a coordinate chart.

Citation Information

Patent Citations

  • Method and device for displaying visual chart in real time, computer equipment and storage medium

    CN111666328A

  • Data query method, data query device and electronic device

    CN112989010A