Method and device for drawing structured data statistical graphs through natural language question and answer

The user's structured data statistics drawing operation is obtained through natural language questions and answers, and preprocessed and drawn charts are performed according to preset models. This solves the problem of manual drawing of professional drawing personnel increasing costs, and realizes efficient and low-cost structured data statistics drawing.

CN118485740BActive Publication Date: 2025-03-14JIERUAN TECH (GRP) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410673096.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2025-03-14
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

When drawing a large number of structured data statistics, manual drawing by professional drawing personnel will greatly increase cost investment.

Method used

Obtain the user's structured data statistics graph drawing operation through natural language questions and answers, perform preprocessing to obtain the data set, and draw the structured data statistics graph according to the preset drawing model and display it to the user.

Benefits of technology

Reduce dependence on professional drawing personnel, save drawing time and cost, while improving drawing efficiency and user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118485740B_ABST
    Figure CN118485740B_ABST
Patent Text Reader

Abstract

A method and device for drawing structured data statistical graphs through natural language question and answer, relating to the field of computer technology. The method comprises: obtaining a first mapping text in response to a user's structured data statistical graph drawing operation; performing a preprocessing operation on the first mapping text, the preprocessing operation being used to obtain a first data set in the first mapping text; drawing a first structured data statistical graph corresponding to the first mapping text through the first data set according to a preset drawing model; and displaying the first structured data statistical graph to the user. The technical solution of the present application solves the problem that when drawing a large number of structured data statistical graphs, manually drawing structured data statistical graphs by professional draftsmen will greatly increase the cost investment of drawing graphs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for drawing structured data statistical graphs through natural language question and answer. Background Art

[0002] Structured data graphs are a graphical representation method for visualizing and representing data structures. They are often used in the fields of computer science and information technology to show the relationships and organization of data. Structured data graphs can display various data structures, such as trees, graphs, stacks, queues, etc. Through these graphical representations, people can more intuitively understand the relationships and organizational structures of data, making it easier to analyze and process data. In the fields of software development, database design, algorithm analysis, etc., structured data graphs are very common and useful tools.

[0003] Nowadays, structured data statistical graphs are mostly drawn manually by relevant professional draftsmen. However, when drawing structured data statistical graphs, professional draftsmen need to collect a large amount of structured data personally, so it takes a lot of time to draw. At this time, due to the high time and skill costs of professional draftsmen, when drawing a large number of structured data statistical graphs, the cost investment of drawing the charts is greatly increased.

[0004] Therefore, there is an urgent need for a method and device for drawing structured data statistical graphs through natural language question answering. Summary of the invention

[0005] The present application provides a method and device for drawing structured data statistical graphs through natural language question and answer, which solves the problem that when drawing a large number of structured data statistical graphs, manual drawing of structured data statistical graphs by professional draftsmen will greatly increase the cost investment of drawing the graphs.

[0006] In a first aspect of the present application, a method for drawing a structured data statistical graph through natural language question and answer is provided, the method comprising: in response to a user's structured data statistical graph drawing operation, obtaining a first mapping text; performing a preprocessing operation on the first mapping text, the preprocessing operation being used to obtain a first data set in the first mapping text; according to a preset drawing model, drawing a first structured data statistical graph corresponding to the first mapping text through the first data set; and displaying the first structured data statistical graph to the user.

[0007] By adopting the above technical solution, when a user performs a structured data statistical graph drawing operation, a first mapping text is obtained, and a preprocessing operation is performed on the first mapping text, so as to obtain a first data set in the first mapping text, and according to a preset drawing model, a first structured data statistical graph corresponding to the first mapping text is drawn through the first data set, and the drawn first structured data statistical graph is displayed to the user. Drawing a structured data statistical graph through the preset drawing model helps users save a lot of drawing time, and reduces the increased cost investment of professional draftsmen to manually draw structured data statistical graphs when drawing a large number of structured data statistical graphs.

[0008] Optionally, a preprocessing operation is performed on the first cartographic text, specifically including: obtaining index items in the first cartographic text through natural language processing; obtaining an SQL search statement corresponding to the first cartographic text according to the index items; and using the SQL search statement as the first data set.

[0009] By adopting the above technical solution, through natural language processing, the index items in the first mapping text are obtained, and based on the index items, the SQL search statement corresponding to the first mapping text is obtained, so that the SQL search statement is used as the first data set to complete the preprocessing operation.

[0010] Optionally, the first data set includes a mapping style requirement data set and a structured data set, the mapping style requirement data set includes an icon type data set, a color style data set and a title style data set, and the structured data set includes a numerical data set, a time series data set and a relational data set.

[0011] By adopting the above technical solution, by obtaining the mapping style requirement data set and the structured data set in the first data set, it is possible to automatically draw a first structured data statistical chart that meets the user's expectations based on the user's requirements for the chart style and presentation method, and the given structured data set, thereby improving the drawing efficiency.

[0012] Optionally, a first structured data statistical graph is drawn through the first data set, specifically including: obtaining a target style template corresponding to a mapping style requirement data set in a statistical graph style database, the statistical graph style database being used to store the correspondence between the mapping style requirement data set and the target style template; and drawing the first structured data statistical graph through the first data set according to the target style template.

[0013] By adopting the above technical solution, a target style template corresponding to a mapping style requirement data set is obtained in a statistical chart style database, and a first structured data statistical chart is drawn using a first data set according to the target style template, so as to automatically draw a first structured data statistical chart that meets the user's expectations according to the user's mapping style requirements and a preset style template, thereby improving user satisfaction.

[0014] Optionally, before obtaining the target style template corresponding to the cartographic style requirement data set in the statistical chart style database, constructing the statistical chart style database, specifically including: obtaining historical cartographic style requirement data; performing classification operations on the historical cartographic style data to obtain multiple preset cartographic style requirement data sets, the multiple preset cartographic style requirement data sets include the cartographic style requirement data set; obtaining multiple preset style templates, the multiple preset style templates include the target style template; constructing a correspondence between multiple preset cartographic style requirement data sets and multiple preset style templates, one preset cartographic style requirement data set corresponds to one preset style template; and storing the correspondence between multiple preset cartographic style requirement data sets and multiple preset style templates in the statistical chart style database.

[0015] By adopting the above-mentioned technical scheme, historical cartographic style requirement data is obtained, and the historical cartographic style data is classified to obtain multiple preset cartographic style requirement data sets, which include a cartographic style requirement data set, and multiple preset style templates are obtained, which include a target style template. Thus, by constructing a correspondence between multiple preset cartographic style requirement data sets and multiple preset style templates, when the cartographic style requirement data set in the first data set is obtained, the corresponding target style template can be easily obtained according to the correspondence in the statistical chart style database.

[0016] Optionally, before drawing the first structured data statistical chart corresponding to the first cartographic text according to the preset drawing model through the first data set, construct the preset drawing model: obtain the historical data set, the historical data set includes the historical cartographic style requirement data set and the historical structured data set; and construct the preset drawing model according to the historical data set.

[0017] By adopting the above technical solution, a preset drawing model is constructed according to the historical data set, so that the structured data statistical graph required by the user can be generated through the constructed preset drawing model.

[0018] Optionally, after displaying the first structured data statistical chart to the user, the method also includes: obtaining the user's feedback evaluation score, the feedback evaluation score including an understanding degree evaluation score, a readability evaluation score and an ease of use evaluation score; determining whether the feedback evaluation score is less than a preset evaluation score; if the feedback evaluation score is less than the preset evaluation score, obtaining a second mapping text input by the user; performing a preprocessing operation on the second mapping text, the preprocessing operation being used to obtain a second data set in the second mapping text; according to a preset drawing model, performing an improvement operation on the first structured data statistical chart through the second data set to obtain a second structured data statistical chart, the improvement operation including an operation of adding new structured data, an operation of adjusting the icon style and an operation of adjusting the layout; and sending the second structured data statistical chart to the user.

[0019] By adopting the above technical solution, after the first structured data statistical chart is displayed to the user, the user can continue to perform question and answer operations through the question and answer page, and ask the user for the feedback evaluation score for the first structured data statistical chart, and analyze the feedback evaluation score. When it is judged that the feedback evaluation score is less than the preset evaluation score, the second mapping text is obtained and the second mapping text is preprocessed to obtain the second data set in the second mapping text, so that according to the preset drawing model, the first structured data statistical chart is improved through the second data set to obtain the second structured data statistical chart, and then the first structured data statistical chart is continuously drawn and improved through multiple question and answer operations to meet the needs of users and increase user satisfaction.

[0020] Optionally, after displaying the first structured data statistical graph to the user, the method further includes: displaying an interactive page on the first structured data statistical graph and the second structured data statistical graph, the interactive page including multiple interactive functions, including a zoom function, a scroll function and a data filtering function.

[0021] By adopting the above technical solution, users can interact with structured data statistical charts through an interactive page. The interactive page includes multiple interactive functions, including but not limited to: zooming, scrolling, data filtering and other operations. Through the above operations, users can conduct more direct observation and analysis, thereby meeting their needs for data visualization.

[0022] In a second aspect of the present application, a device for drawing a structured data statistical graph through natural language question and answer is provided, the device comprising an acquisition module and a processing module, wherein:

[0023] The acquisition module is used to acquire a first mapping text in response to a user's structured data statistical graph drawing operation; and perform a preprocessing operation on the first mapping text, wherein the preprocessing operation is used to acquire a first data set in the first mapping text.

[0024] The processing module is used to draw a first structured data statistical graph corresponding to the first mapping text according to a preset drawing model and through a first data set; and display the first structured data statistical graph to a user.

[0025] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any one of the methods described above.

[0026] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to perform any of the above methods.

[0027] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0028] 1. When the user performs a structured data statistical chart drawing operation, the first mapping text is obtained, and the first mapping text is preprocessed to obtain the first data set in the first mapping text. According to the preset drawing model, the first structured data statistical chart corresponding to the first mapping text is drawn through the first data set, and the drawn first structured data statistical chart is displayed to the user. Drawing the structured data statistical chart through the preset drawing model helps users save a lot of drawing time and reduces the increased cost investment of professional draftsmen to manually draw structured data statistical charts when drawing a large number of structured data statistical charts.

[0029] 2. After the first structured data statistical chart is displayed to the user, the user can continue to perform question and answer operations through the question and answer page, and ask the user for feedback evaluation scores for the first structured data statistical chart, and analyze the feedback evaluation scores. When it is judged that the feedback evaluation score is less than the preset evaluation score, the second mapping text is obtained and the second mapping text is preprocessed to obtain the second data set in the second mapping text, so as to improve the first structured data statistical chart according to the preset drawing model and the second data set to obtain the second structured data statistical chart, and then continuously improve the drawing of the first structured data statistical chart through multiple question and answer operations to meet the needs of users and increase user satisfaction.

[0030] 3. Users can interact with structured data statistics charts through the interactive page. The interactive page includes multiple interactive functions, including but not limited to: zooming, scrolling, data filtering and other operations. Through the above operations, users can conduct more direct observation and analysis, thereby meeting their needs for data visualization. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a flowchart of a method for drawing a structured data statistical graph through natural language question and answer provided in an embodiment of the present application;

[0032] Figure 2 It is a module schematic diagram of a device for drawing a structured data statistical graph through natural language question and answer provided in an embodiment of the present application;

[0033] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0034] Explanation of the reference numerals: 21, acquisition module; 22, processing module; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION

[0035] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0036] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.

[0037] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0038] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.

[0039] Structured data graphs are a graphical representation method for visualizing and representing data structures. They are often used in the fields of computer science and information technology to show the relationships and organization of data. Structured data graphs can display various data structures, such as trees, graphs, stacks, queues, etc. Through these graphical representations, people can more intuitively understand the relationships and organizational structures of data, making it easier to analyze and process data. In the fields of software development, database design, algorithm analysis, etc., structured data graphs are very common and useful tools.

[0040] Nowadays, structured data statistical graphs are mostly drawn manually by relevant professional draftsmen. However, when drawing structured data statistical graphs, professional draftsmen need to collect a large amount of structured data personally, so it takes a lot of time to draw. At this time, due to the high time and skill costs of professional draftsmen, when drawing a large number of structured data statistical graphs, the cost investment of drawing the charts is greatly increased.

[0041] Therefore, there is an urgent need for a method and device for drawing structured data statistical graphs through natural language question answering.

[0042] Please refer to Figure 1 , which shows a flow chart of a method for drawing a structured data statistical graph through natural language question and answer provided in an embodiment of the present application. The method is applied to a server, and the flow chart mainly includes the following steps: S101 to S104.

[0043] Step S101, in response to a user's structured data statistical graph drawing operation, obtaining a first drawing text.

[0044] Specifically, the user can perform a question-and-answer operation through the question-and-answer page. At this time, the user sends the first mapping text through the question-and-answer page. The user's input device includes but is not limited to a mobile phone, a tablet, a PC, etc., and the user's input method includes but is not limited to: voice input, text input, image input, etc. The user can perform multiple question-and-answer operations through the question-and-answer page. Each time the question-and-answer operation is performed, the server will improve the generated structured data statistical chart until a final result that satisfies the user is generated. When the user performs the first question-and-answer operation, the server will generate multiple input prompts to remind the user to input the information required to generate the structured data statistical chart, that is, the first mapping text. The prompts include: prompts for determining the design style of generating the structured data statistical chart, prompts for determining the display method of the structured data statistical chart, prompts for determining the entity content in the structured data statistical chart, etc. The user can determine the initial question-and-answer content, that is, the content of the first mapping text, according to the above prompts.

[0045] Step S102: performing a preprocessing operation on the first cartographic text, where the preprocessing operation is used to obtain a first data set in the first cartographic text.

[0046] Specifically, a preprocessing operation is performed on the first cartographic text, that is, data cleaning is performed on the first cartographic text to obtain a relevant data set used to generate a structured data statistical chart, that is, a first data set. The first data set includes a cartographic style requirement data set and a structured data set. The cartographic style requirement data set includes an icon type data set, a color style data set, and a title style data set. The structured data set includes a numerical data set, a time series data set, and a relational data set.

[0047] In a possible implementation, step S102 further includes: obtaining index items in the first cartographic text through natural language processing; obtaining an SQL search statement corresponding to the first cartographic text according to the index items; and using the SQL search statement as the first data set.

[0048] Specifically, through natural language processing technology, multiple indicator items in the first mapping text are obtained, and the indicator items are necessary indicators required to generate a structured data graph. Afterwards, the server generates a corresponding SQL search statement for each indicator item based on the indicator items, and uses the SQL search statement as the data in the first data set. The server can use the SQL search statement to perform query operations to obtain a data set that meets the conditions.

[0049] In a possible implementation, step S102 also includes: obtaining a target style template corresponding to a mapping style requirement data set in a statistical chart style database, the statistical chart style database being used to store the correspondence between the mapping style requirement data set and the target style template; and drawing a first structured data statistical chart using the first data set according to the target style template.

[0050] Specifically, the statistical chart style database is a pre-built database, which is used to store the correspondence between the mapping style requirement data set and the target style template. According to the correspondence in the statistical chart style database, when the above-mentioned mapping style requirement data set exists in the first data set, the corresponding target style template is obtained, and according to the target style template, the first structured data statistical chart is drawn through the first data set.

[0051] In a possible implementation, step S102 also includes: obtaining historical cartographic style requirement data; performing classification operations on the historical cartographic style data to obtain multiple preset cartographic style requirement data sets, the multiple preset cartographic style requirement data sets include a cartographic style requirement data set; obtaining multiple preset style templates, the multiple preset style templates include a target style template; constructing a correspondence between multiple preset cartographic style requirement data sets and multiple preset style templates, one preset cartographic style requirement data set corresponds to one preset style template; storing the correspondence between multiple preset cartographic style requirement data sets and multiple preset style templates in a statistical chart style database.

[0052] Specifically, the specific steps of constructing a statistical chart style database are as follows: the server collects the mapping style demand data used by users in the past, that is, the historical mapping style demand data, which includes the mapping style demand, preferences and parameter settings used by users in the past. Data sorting: sorting and cleaning the collected historical data to ensure the accuracy and consistency of the data, including removing duplicate data, processing missing values, unifying data formats and other operations. Historical data classification: classifying the historical data, dividing the historical data into different categories or groups according to different mapping style requirements and parameter settings, that is, dividing them into multiple preset mapping style demand data sets, each of which represents a common user mapping style demand mode. Obtaining preset style templates: the server obtains multiple preset style templates, which include preset chart styles, color schemes, layouts, etc., to meet the different mapping style requirements of users. Correspondence construction: establishing a correspondence between each preset mapping style demand data set and the corresponding preset style template. A preset mapping style demand data set corresponds to a preset style template to ensure that the generated chart can meet the specific style requirements of the user. Storing the established correspondence: storing the established correspondence between multiple preset mapping style requirement data sets and preset style templates in the statistical chart style database for use in subsequent chart generation processes.

[0053] It should be noted that when the server obtains the mapping style requirement data set in the first data set, it is necessary to calculate the similarity between the mapping style requirement data set and multiple preset mapping style requirement data sets in the statistical chart style database, so as to obtain multiple similarity values. At this time, the server sorts the multiple similarity values, and determines the preset mapping style requirement data set corresponding to the maximum similarity as the data set corresponding to the mapping style requirement data set in the first data set, and obtains the preset style template corresponding to the preset mapping style requirement data set as the target style template corresponding to the mapping style requirement data set in the first data set. In addition, the statistical chart style database also supports real-time updates, and users can add mapping style requirement data. At this time, users can customize the preset style template corresponding to the newly added mapping style requirement data according to the newly added mapping style requirement data, and update the correspondence between the newly added mapping style requirement data and the newly added preset style template to the statistical chart style database.

[0054] Step S103, drawing a first structured data statistical graph corresponding to the first cartographic text using the first data set according to a preset drawing model.

[0055] Specifically, the server obtains a preset drawing model, and uses the target style template in the above step S102 to draw a first structured data statistical graph corresponding to the first cartographic text by inputting the structured data set in the first data set into the target style template. When drawing the first structured data statistical graph, the server will draw in different ways according to different types of structured data sets. For example, the structured data sets in step S102 include numerical data sets, time series data sets, and relational data sets. When there are numerical data sets in the structured data sets, the distribution, trend, and correlation of different numerical values ​​are displayed through bar charts, line charts, scatter charts, etc. to draw the first structured data statistical graph, and according to the settings of the target style template, appropriate colors, styles, labels and other elements are selected to present the chart of the numerical data set to ensure that the first structured data statistical graph meets the user's style preferences; when the structured data sets When there is a time series data set in the data set, the trend of data changes over time is displayed through line graphs, area graphs, etc. to draw a first structured data statistical graph, and according to the setting of the target style template, the time axis label, color, line style and other elements of the graph are adjusted to ensure that the first structured data statistical graph is consistent with the style specified by the user; when there is a relational data set in the structured data set, the relationship and connection between the data are displayed through network diagrams, tree diagrams, etc., and according to the setting of the target style template, the node color, connection style, layout and other elements of the graph are adjusted to ensure that the first structured data statistical graph meets the style requirements expected by the user.

[0056] In a possible implementation, step S103 further includes: acquiring a historical data set, the historical data set including a historical mapping style requirement data set and a historical structured data set; and constructing a preset drawing model according to the historical data set.

[0057] Specifically, the preset drawing model is a learning model built in advance, and its construction method is as follows: a large number of historical cartographic style requirement data sets and a large number of historical structured data sets are obtained. The historical cartographic style requirement data sets can be directly obtained from the above-mentioned statistical chart style database. A large number of preset chart style requirement data sets are used as a large number of historical cartographic style requirement data sets for model training. A large number of historical structured data sets include but are not limited to: a large number of historical numerical data sets, a large number of historical time series data sets, a large number of historical relational data sets, etc. After that, a large number of historical cartographic style requirement data sets and historical structured data sets are used for model training to train the model to understand the user's mapping needs and learn how to generate structured data statistical charts that meet the user's needs based on the given structured data sets. The methods that can be used in the training process include but are not limited to: machine learning algorithms, deep learning technologies, etc. The trained preset drawing model is verified to ensure the accuracy and effectiveness of the preset drawing model in generating structured data statistical charts. The test data set can be used for model evaluation and performance verification. According to the verification results, the preset drawing model is tuned and improved to improve the performance and adaptability of the preset drawing model. The adjustment method is not limited to: adjusting model parameters, optimizing algorithms, adding training data, etc. The trained preset drawing model is saved and integrated into the drawing system. When the user requests to draw a structured data statistical graph, the system can directly use this preset drawing model to generate a statistical graph that meets the user's needs.

[0058] Step S104: display the first structured data statistical graph to the user.

[0059] Specifically, the generated first structured data statistical graph is displayed to the user in the above-mentioned question and answer page to facilitate the user to view and filter the data. At the same time, the user can continue to perform question and answer operations through the question and answer page, so that the server can improve the first structured data statistical graph through subsequent question and answer operations.

[0060] In a possible implementation, step S104 also includes: obtaining the user's feedback evaluation score, the feedback evaluation score includes an understanding degree evaluation score, a readability evaluation score and an ease of use evaluation score; determining whether the feedback evaluation score is less than a preset evaluation score; if the feedback evaluation score is less than the preset evaluation score, obtaining a second mapping text input by the user; performing a preprocessing operation on the second mapping text, the preprocessing operation being used to obtain a second data set in the second mapping text; according to a preset drawing model, performing an improvement operation on the first structured data statistical chart through the second data set to obtain a second structured data statistical chart, the improvement operation including a new structured data operation, an icon style adjustment operation and a layout adjustment operation; and sending the second structured data statistical chart to the user.

[0061] Specifically, after the first structured data statistical graph is displayed to the user, the user can continue to perform the question and answer operation through the question and answer page, and the server asks the user for the feedback evaluation score for the first structured data statistical graph through the question and answer page, and analyzes the feedback evaluation score. When the analysis result is "satisfactory", the question and answer operation is terminated. At this time, the first structured data statistical graph is the final generated structured data graph. The feedback evaluation score includes but is not limited to: understanding degree evaluation score, readability evaluation score, usability evaluation score, etc. When the user gives corresponding evaluation scores for the understanding degree, readability, usability, etc. of the first structured data statistical graph, and the above evaluation scores are all greater than their respective corresponding preset evaluation scores, or when the user does not give any evaluation score within the preset time period, the server regards the analysis result as "satisfactory" and terminates the question and answer operation, wherein the preset evaluation score and the preset time period can be set according to actual conditions. In this embodiment There is no limitation on the setting of preset evaluation and preset time period; when the user gives corresponding evaluation scores for the understanding degree, readability, ease of use and other aspects of the first structured data statistical graph, and any evaluation score is less than the corresponding preset evaluation score, the server regards the analysis result as "unsatisfactory", then the server obtains the second mapping text input by the user, the second mapping text is the corresponding feedback given by the user for the unsatisfactory part, the server performs the same preprocessing on the feedback, thereby obtaining the second data set in the feedback, the second data is improved data, the improved data includes but is not limited to: improved data for mapping style, improved data for erroneous structured data, newly added formatted data, data graph pattern adjustment data, data graph adjustment data, etc., the server improves the first structured data statistical graph through the above improved data, and obtains the second structured data statistical graph, and sends the second structured data statistical graph to the user. In theory, as long as the analysis result of the user's feedback evaluation score is "unsatisfactory", the user can continue the question-and-answer operation until the user obtains a satisfactory structured data statistical graph.

[0062] In a possible implementation, step S104 further includes: displaying an interactive page on the first structured data statistical graph and the second structured data statistical graph, the interactive page including multiple interactive functions, the multiple interactive functions including a zoom function, a scroll function, and a data filtering function.

[0063] Specifically, each time the server gives a structured data statistical chart, the user can interact with the structured data statistical chart through an interactive page. The interactive page includes multiple interactive functions, including but not limited to: zooming, scrolling, data filtering and other operations. Through the above operations, users can conduct more direct observation and analysis, thereby meeting their needs for data visualization.

[0064] The present application adopts the above-mentioned method. When the user performs a structured data statistical graph drawing operation, the first mapping text is obtained, and the first mapping text is preprocessed, so as to obtain the first data set in the first mapping text. According to the preset drawing model, the first structured data statistical graph corresponding to the first mapping text is drawn through the first data set, and the drawn first structured data statistical graph is displayed to the user. Drawing the structured data statistical graph through the preset drawing model helps the user save a lot of drawing time, and reduces the increased cost investment caused by professional draftsmen manually drawing structured data statistical graphs when drawing a large number of structured data statistical graphs.

[0065] Please refer to Figure 2 , which shows a module schematic diagram of a device for drawing a structured data statistical graph through natural language question and answer provided in an embodiment of the present application, the device is a server, and the server includes an acquisition module 21 and a processing module 22, wherein,

[0066] The acquisition module 21 is used to acquire a first mapping text in response to a user's structured data statistical graph drawing operation; and perform a preprocessing operation on the first mapping text, where the preprocessing operation is used to acquire a first data set in the first mapping text.

[0067] The processing module 22 is used to draw a first structured data statistical graph corresponding to the first cartographic text according to a preset drawing model and using a first data set; and display the first structured data statistical graph to a user.

[0068] In a possible implementation, the first data set includes a mapping style requirement data set and a structured data set, the mapping style requirement data set includes an icon type data set, a color style data set, and a title style data set, and the structured data set includes a numerical data set, a time series data set, and a relational data set.

[0069] In a possible implementation, the processing module 22 is used to perform preprocessing operations on the first cartographic text, specifically including: obtaining index items in the first cartographic text through natural language processing; obtaining the SQL search statement corresponding to the first cartographic text according to the index items; and using the SQL search statement as the first data set.

[0070] In a possible implementation, the processing module 22 is used to draw a first structured data statistical graph through a first data set, specifically including: obtaining a target style template corresponding to a mapping style requirement data set in a statistical graph style database, the statistical graph style database being used to store the correspondence between the mapping style requirement data set and the target style template; and drawing a first structured data statistical graph through the first data set according to the target style template.

[0071] In a possible implementation, the processing module 22 is used to construct a statistical chart style database before obtaining a target style template corresponding to a cartographic style requirement data set in the statistical chart style database, specifically including: obtaining historical cartographic style requirement data; performing classification operations on the historical cartographic style data to obtain multiple preset cartographic style requirement data sets, and the multiple preset cartographic style requirement data sets include a cartographic style requirement data set; obtaining multiple preset style templates, and the multiple preset style templates include a target style template; constructing a correspondence between multiple preset cartographic style requirement data sets and multiple preset style templates, and one preset cartographic style requirement data set corresponds to one preset style template; and storing the correspondence between multiple preset cartographic style requirement data sets and multiple preset style templates in the statistical chart style database.

[0072] In a possible implementation, the processing module 22 is used to construct a preset drawing model before drawing a first structured data statistical chart corresponding to a first cartographic text according to the preset drawing model through a first data set: obtaining a historical data set, the historical data set including a historical cartographic style requirement data set and a historical structured data set; and constructing a preset drawing model according to the historical data set.

[0073] In one possible implementation, the processing module 22 is used to display the first structured data statistical chart to the user, and the method also includes: obtaining the user's feedback evaluation score, the feedback evaluation score includes an understanding evaluation score, a readability evaluation score and an ease of use evaluation score; determining whether the feedback evaluation score is less than a preset evaluation score; if the feedback evaluation score is less than the preset evaluation score, obtaining a second mapping text input by the user; performing a preprocessing operation on the second mapping text, the preprocessing operation is used to obtain a second data set in the second mapping text; according to a preset drawing model, using the second data set, performing an improvement operation on the first structured data statistical chart to obtain a second structured data statistical chart, the improvement operation including a new structured data operation, an icon style adjustment operation and a layout adjustment operation; and sending the second structured data statistical chart to the user.

[0074] In a possible implementation, the processing module 22 is used to display the first structured data statistical graph to the user, and the method also includes: displaying an interactive page on the first structured data statistical graph and the second structured data statistical graph, the interactive page including multiple interactive functions, and the multiple interactive functions include a zoom function, a scrolling function, and a data filtering function.

[0075] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0076] The present application also provides an electronic device. Figure 3 , Figure 3 30 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include: at least one processor 301, at least one communication bus 302, a user interface 303, at least one network interface 304, and a memory 305.

[0077] The communication bus 302 is used to realize the connection and communication between these components.

[0078] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.

[0079] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0080] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.

[0081] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may optionally also be at least one storage device located away from the aforementioned processor 301. Refer to Figure 3 , the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application for drawing structured data statistical graphs through natural language question and answer.

[0082] exist Figure 3In the electronic device shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user. The user interface includes a microphone, which is used to receive the voice input sent by the user; and the processor 301 can be used to call the application program stored in the memory 305 for drawing structured data statistical graphs through natural language questions and answers. When executed by one or more processors 301, the electronic device executes one or more of the methods described in the above embodiments. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.

[0083] The present application also provides a computer-readable storage medium, which stores instructions. When executed by one or more processors, the electronic device executes one or more of the methods described in the above embodiments.

[0084] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0085] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0086] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0087] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0088] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: various media that can store program codes, such as USB flash drives, mobile hard drives, magnetic disks or optical disks.

[0089] The above are only exemplary embodiments disclosed in this application, and the scope of the disclosure of this application cannot be limited by this. That is, any equivalent changes and modifications made according to the teachings disclosed in this application are still within the scope of the disclosure of this application. After considering the disclosure of the specification and the truth of practice, those skilled in the art will easily think of other implementation schemes disclosed in this application.

[0090] This application is intended to cover any modifications, uses or adaptive changes disclosed in this application, which follow the general principles disclosed in this application and include common knowledge or customary technical means in the technical field not recorded in this application.

Claims

1. A method for drawing a structured data statistical graph through natural language question answering, characterized in that: The method comprises: In response to a user's structured data statistical graph drawing operation, obtaining a first mapping text; A preprocessing operation is performed on the first cartographic text, wherein the preprocessing operation is used to obtain a first data set in the first cartographic text; the first data set includes a cartographic style requirement data set and a structured data set, wherein the cartographic style requirement data set includes an icon type data set, a color style data set and a title style data set, and the structured data set includes a numerical data set, a time series data set and a relational data set; according to a preset drawing model, a first structured data statistical graph corresponding to the first cartographic text is drawn through the first data set; the drawing of the first structured data statistical graph through the first data set specifically includes: obtaining a target style template corresponding to the cartographic style requirement data set in a statistical graph style database, wherein the statistical graph style database is used to store the correspondence between the cartographic style requirement data set and the target style template; according to the target style template, Through the first data set, a first structured data statistical graph is drawn; before obtaining the target style template corresponding to the mapping style requirement data set in the statistical graph style database, the statistical graph style database is constructed, which specifically includes: obtaining historical mapping style requirement data; classifying the historical mapping style requirement data to obtain multiple preset mapping style requirement data sets, and the multiple preset mapping style requirement data sets include the mapping style requirement data set; obtaining multiple preset style templates, and the multiple preset style templates include the target style template; constructing a correspondence between multiple preset mapping style requirement data sets and multiple preset style templates, and one preset mapping style requirement data set corresponds to one preset style template; storing the correspondence between multiple preset mapping style requirement data sets and multiple preset style templates in the statistical graph style database; The first structured data statistical chart is displayed to the user; after the first structured data statistical chart is displayed to the user, the method further includes: obtaining the user's feedback evaluation score, the feedback evaluation score includes an understanding degree evaluation score, a readability evaluation score and an ease of use evaluation score; judging whether the feedback evaluation score is less than a preset evaluation score; if the feedback evaluation score is less than the preset evaluation score, obtaining a second mapping text input by the user; performing a preprocessing operation on the second mapping text, the preprocessing operation is used to obtain a second data set in the second mapping text; according to a preset drawing model, the first structured data statistical chart is improved through the second data set to obtain a second structured data statistical chart, the improvement operation includes a new structured data operation, an icon style adjustment operation and a layout adjustment operation; sending the second structured data statistical chart to the user; after the first structured data statistical chart is displayed to the user, the method further includes: displaying an interactive page on the first structured data statistical chart and the second structured data statistical chart, the interactive page including multiple interactive functions, and the multiple interactive functions include a zoom function, a scroll function and a data filtering function.

2. The method according to claim 1, characterized in that The preprocessing operation on the first mapping text specifically includes: Obtaining indicator items in the first mapping text through natural language processing; According to the indicator item, obtaining the SQL search statement corresponding to the first mapping text; The SQL search statement is used as the first data set.

3. The method according to claim 1, characterized in that Before drawing the first structured data statistical graph corresponding to the first cartographic text according to the preset drawing model and using the first data set, the preset drawing model is constructed: Acquire a historical data set, wherein the historical data set includes a historical mapping style requirement data set and a historical structured data set; The preset drawing model is constructed according to the historical data set.

4. A device for drawing structured data statistical graphs through natural language question and answer, characterized in that: The device comprises an acquisition module (21) and a processing module (22), wherein: The acquisition module (21) is used to acquire a first mapping text in response to a user's structured data statistical graph drawing operation; perform a preprocessing operation on the first mapping text, wherein the preprocessing operation is used to acquire a first data set in the first mapping text; the first data set includes a mapping style requirement data set and a structured data set, the mapping style requirement data set includes an icon type data set, a color style data set, and a title style data set, and the structured data set includes a numerical data set, a time series data set, and a relational data set; The processing module (22) is used to draw a first structured data statistical graph corresponding to the first cartographic text through the first data set according to a preset drawing model; the drawing of the first structured data statistical graph through the first data set specifically includes: obtaining a target style template corresponding to the cartographic style requirement data set in a statistical graph style database, the statistical graph style database is used to store the correspondence between the cartographic style requirement data set and the target style template; according to the target style template, drawing the first structured data statistical graph through the first data set; in the obtaining of the target style template corresponding to the cartographic style requirement data set in the statistical graph style database Before obtaining the target style template, constructing the statistical map style database specifically includes: obtaining historical mapping style requirement data; classifying the historical mapping style requirement data to obtain multiple preset mapping style requirement data sets, multiple preset mapping style requirement data sets including the mapping style requirement data set; obtaining multiple preset style templates, multiple preset style templates including the target style template; constructing a correspondence between multiple preset mapping style requirement data sets and multiple preset style templates, one preset mapping style requirement data set corresponds to one preset style template; and comparing multiple preset mapping style requirement data sets with multiple preset style templates. The correspondence of the preset style templates is stored in the statistical chart style database; the first structured data statistical chart is displayed to the user; after the first structured data statistical chart is displayed to the user, it also includes: obtaining the user's feedback evaluation score, the feedback evaluation score includes an understanding degree evaluation score, a readability evaluation score and an ease of use evaluation score; judging whether the feedback evaluation score is less than the preset evaluation score; if the feedback evaluation score is less than the preset evaluation score, obtaining the second mapping text input by the user; performing a preprocessing operation on the second mapping text, the preprocessing operation is used to obtain a second data set in the second mapping text; according to the preset drawing model, through the second data set, performing an improvement operation on the first structured data statistical chart to obtain a second structured data statistical chart, the improvement operation includes a new structured data operation, an icon style adjustment operation and a layout adjustment operation; sending the second structured data statistical chart to the user; after the first structured data statistical chart is displayed to the user, it also includes: displaying an interactive page on the first structured data statistical chart and the second structured data statistical chart, the interactive page includes multiple interactive functions, and the multiple interactive functions include a zoom function, a scroll function and a data filtering function.

5. An electronic device, characterized in that: The electronic device comprises a processor (301), a communication bus (302), a user interface (303), a network interface (304) and a memory (305), wherein the memory (305) is used to store instructions, the user interface (303) and the network interface (304) are used to communicate with other devices, the processor (301) is used to execute the instructions stored in the memory (305) so that the electronic device executes the method according to any one of claims 1 to 3, and the user interface (303) comprises a microphone.

Citation Information

Patent Citations

  • Intelligent query and visualization method based on natural language processing

    CN117931852A