Method and system for automatically generating chart by using large model

By using the method of automatically generating charts with large models, the problems of low degree of automation in the chart generation, intricate data format inspection and incomplete chart quality evaluation in the prior art are solved, efficient and accurate chart generation and optimization are achieved, reducing user operation complexity, and improving the quality and user experience of charts.

CN119887996AActive Publication Date: 2025-04-25GUANGZHOU HONGSUAN INFORMATION TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411701149.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-04-25
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

In the prior art, the chart generation process is low in degree, and users need to manually design and adjust the charts. The operation is complex and time-consuming, and there is a lack of effective data format checking and preprocessing mechanisms, resulting in poor graph generation results, and incomplete chart optimization and quality evaluation mechanisms, which cannot ensure that the generated graphs achieve the optimal results in clarity, layout rationality and data expression accuracy.

Method used

The method of automatically generating charts by large models is adopted. By obtaining the data information input by users, inputting them into a pre-trained neural network model, the initial structure and basic element layout of the chart are generated, optimized, and the coordinates and dimensions of the chart elements are calculated, the chart elements are drawn, and the generated charts are evaluated to ensure clarity, layout rationality and data expression accuracy.

Benefits of technology

It improves the efficiency and accuracy of chart generation, reduces the workload of users in chart design and adjustment, reduces their dependence on professional skills, and allows non-professionals to easily realize the visual expression of data, ensures high-quality output of charts, and optimizes the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887996A_ABST
    Figure CN119887996A_ABST
Patent Text Reader

Abstract

The invention provides a method and system for automatically generating a chart by using a large model, and the method comprises the steps: obtaining user data information, such as data types, quantities and features, and target chart types, and inputting the user data information into a pre-trained neural network model; and the model generates an initial structure and layout of a chart, element coordinates and sizes are calculated after optimization, and chart elements are drawn. The generated chart is subjected to quality evaluation including definition, layout rationality and data accuracy, and is regenerated if the quality does not reach the standard. And finally outputting a chart. The efficiency and accuracy of chart generation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data visualization, and more specifically, to a method and system for automatically generating charts using a large model. Background Art

[0002] With the advent of the big data era, data visualization technology plays an increasingly important role in various fields. Data visualization technology helps users understand and analyze data more quickly and accurately by intuitively displaying complex data in the form of graphics, charts, etc. In the traditional data visualization process, professional data analysts or designers are usually required to manually design and adjust charts, which is not only time-consuming and labor-intensive, but also has a high threshold for non-professionals. In addition, with the continuous growth of data volume, the difficulty of manual processing and analysis of data is also increasing. Therefore, how to improve the degree of automation of the data visualization process, reduce the difficulty of user operation, and improve the efficiency and accuracy of chart generation has become a problem that needs to be solved in the current field of data visualization technology.

[0003] In the process of implementing the embodiments of the present invention, the inventors found that there are at least the following problems or defects in the prior art: the degree of automation of the chart generation process in the prior art is low, and users are required to manually design and adjust the charts, which is complicated and time-consuming; there is a lack of effective data format checking and preprocessing mechanisms, resulting in poor chart generation effects when data input errors or inconsistent formats occur; the chart optimization and quality assessment mechanisms are imperfect, and it is impossible to ensure that the generated charts achieve the best effects in terms of clarity, layout rationality and data expression accuracy. Summary of the invention

[0004] The present invention provides a method and system for automatically generating charts using a large model.

[0005] In a first aspect of the present invention, a method for automatically generating a graph using a large model is provided, comprising:

[0006] Step 1: Obtain data information input by the user, wherein the data information includes data type, data volume, data content characteristics, and target chart type;

[0007] Step 2: Input the acquired user input data information into a large model, where the large model is a pre-trained neural network model capable of processing chart generation tasks;

[0008] Step 3: The large model generates the initial structure and basic element layout of the chart based on the input data information, specifically:

[0009] The large model determines the basic structure of the chart according to the data type and target chart type, and determines the basic element layout according to the data volume and data content characteristics;

[0010] Step 4: Optimize the initial structure and basic element layout of the generated chart according to the data content characteristics;

[0011] Step 5: Calculate the coordinates and sizes of the chart elements based on the optimized architecture and layout. When calculating the coordinates, set the chart width to W and the relative position ratio of the elements in the horizontal direction to p. x , then the x-coordinate of the element, let the height of the chart be H, and the relative position ratio of the element in the vertical direction be p y , then the element y coordinate, let the total layout width be TW, and the element horizontal space ratio be s w , then the width of the element, let the total layout height be TH, and the vertical space ratio of the element be s h , then the element height;

[0012] Step 6: Draw the chart elements according to the calculated coordinates and sizes;

[0013] Step 7: Evaluate the quality of the generated chart from three aspects: chart clarity C, element layout rationality LR, and data expression accuracy DA. If the quality score is high, return to step 3 to regenerate; T is the preset threshold;

[0014] Step 8: Output the final chart.

[0015] The above-mentioned embodiments of the present invention have at least the following beneficial effects: the present invention can improve the efficiency and accuracy of chart generation by using a method for automatically generating charts using a large model. The user only needs to provide the required data information and the target chart type, and the large model can automatically process the data, generate the initial structure and basic element layout of the chart, and optimize it, and finally output a high-quality chart. This process can not only reduce the user's workload in chart design and adjustment, but also reduce the dependence on professional skills, so that non-professionals can easily achieve data visualization.

[0016] In addition, this method introduces a quality assessment mechanism in the chart generation process, which can ensure that the generated charts meet high standards in terms of clarity, element layout rationality, and data expression accuracy. By calculating the coordinates and sizes of chart elements, optimizing the coordinate axis scales, and performing quality assessment on charts, this method can effectively improve the visual effects of charts and the accuracy of information transmission. At the same time, through compression processing, the size of chart files can be reduced, and the loading speed and transmission efficiency of charts can be improved, thereby optimizing the user experience while ensuring the quality of the charts. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:

[0018] Figure 1 A schematic diagram of a flow chart of a method for automatically generating a chart using a large model provided by an embodiment of the present invention;

[0019] Figure 2 A schematic diagram of the structure of a system for automatically generating charts using a large model provided by an embodiment of the present invention;

[0020] Figure 3 The schematic diagram schematically shows the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.

[0022] Those skilled in the art know that the embodiments of the present invention can be implemented as a system, device, apparatus, method or computer program product. Therefore, the present invention can be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0023] It should be noted that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction and does not have any limiting meaning.

[0024] Reference below Figure 1 , Figure 1 The following is a flow chart of a method for automatically generating a chart using a large model provided by an embodiment of the present invention. Figure 1 As shown, a method 100 for automatically generating a chart using a large model includes:

[0025] Step 1: Obtain data information input by the user, wherein the data information includes data type, data volume, data content characteristics, and target chart type;

[0026] Step 2: Input the acquired user input data information into a large model, where the large model is a pre-trained neural network model capable of processing chart generation tasks;

[0027] Step 3: The large model generates the initial structure of the chart and the layout of basic elements based on the input data information, specifically as follows:

[0028] The large model determines the basic architecture of the chart according to the data type and the target chart type, and determines the layout of basic elements according to the data volume and the characteristics of the data content;

[0029] Step 4: Optimize the generated initial chart structure and the layout of basic elements according to the characteristics of the data content;

[0030] Step 5: Calculate the coordinates and sizes of the chart elements according to the optimized architecture and layout. When calculating the coordinates, assume the width of the chart is W and the relative position ratio of the element in the horizontal direction is p x , then the x coordinate of the element x = W × p x , assume the height of the chart is H and the relative position ratio of the element in the vertical direction is p y , then the y coordinate of the element y = H × p y , assume the total layout width is TW and the space occupancy ratio of the element in the horizontal direction is s w , then the width of the element w = TW × s w , assume the total layout height is TH and the space occupancy ratio of the element in the vertical direction is s h , then the height of the element h = TH × s h ;

[0031] Step 6: Draw the chart elements according to the calculated coordinates and sizes;

[0032] Step 7: Evaluate the quality of the generated chart. Evaluate from three aspects: the clarity C of the chart, the rationality LR of the element layout, and the accuracy DA of the data expression. The quality score S = 0.3 × C + 0.4 × LR + 0.3 × DA. If S < T (T is a preset threshold), then return to Step 3 to regenerate;

[0033] Step 8: Output the final chart.

[0034] It should be noted that this method first involves obtaining the data information input by the user, which includes the data type, data volume, characteristics of the data content, and the target chart type that the user hopes to generate. The data type can be time series data, categorical data, etc. The data volume refers to the number of records in the data set. The characteristics of the data content may include the distribution of the data, extreme values, etc. The target chart type is the chart form that the user hopes to obtain, such as a line chart, a bar chart, etc. The large model refers to a pre-trained neural network model that can handle the chart generation task, that is, generate a chart according to the input data information.

[0035] Specifically, the data type parameter can be time series or categorical data, and the target chart type parameter can be a line chart or a bar chart. The data volume and data content characteristics can be used to determine the basic architecture and element layout of the chart. For example, if the data type is time series and the target chart type is a line chart, the basic architecture will include a time axis and a data value axis. The data volume and data content characteristics can be used to determine the spatial proportion of each element in the chart, such as the width of each bar in a bar chart. In addition, the number of different data categories in the data content characteristics and the amount of data in each category can be used to calculate the spatial proportion of the element layout of each category.

[0036] Preferably, for a large range of data values, the readability of the chart can be improved by optimizing the coordinate axis scale. Specifically, the minimum and maximum values ​​of the data value and the number of scales can be set to calculate the scale interval. For example, if the minimum value of the data value is 10, the maximum value is 100, and the number of scales is 5, the scale interval can be set to (100-10) / 5=18.

[0037] Furthermore, for the drawing of chart elements, different drawing sub-functions can be called according to the element type. For example, if the element is a line, the start point coordinates and the end point coordinates can be used to draw the line; if the element is a rectangle, the upper left corner coordinates, width and height can be used to draw the rectangle. The specific settings of these parameters can be determined according to the actual data and chart requirements.

[0038] In some embodiments, in the step of obtaining the data information input by the user in step 1, the data input by the user is format checked and preprocessed. If the data format does not meet the requirements, it is converted according to the preset format conversion rules. The original format parameters of the data are F1, F2, ..., F n , the preset format parameters are P1, P2, ..., P n , if F i ≠P i (i=1,2,…,n), then F i Convert to P i .

[0039] It should be noted that when this method obtains the data information input by the user, it will perform format checking and preprocessing on the data provided by the user. This is to ensure that the data information meets the requirements of large model processing. If the data format does not meet the requirements, it needs to be converted according to the preset format conversion rules. The data format here refers to the organization and structure of the data, such as CSV, JSON, etc., and the preset format conversion rules are a set of predefined rules used to convert data formats that do not meet the requirements into a format acceptable to the model.

[0040] Specifically, when checking the data format, the system will identify the original format parameters of the data, such as the field separator and record separator of the data, and compare them with the preset format parameters. If a mismatch is found, such as the original format uses commas to separate fields, and the preset format uses tabs, the system will adjust the data format according to the preset conversion rules, such as replacing commas with tabs. This process may involve cleaning, converting, and standardizing data to ensure data consistency and accuracy.

[0041] Preferably, during the data format conversion process, multiple strategies can be used to handle different types of format problems. For example, if the data contains extra spaces or special characters, regular expressions can be used to clean them up. For missing values ​​or outliers, filling, deleting, or replacing methods can be used to handle them.

[0042] Furthermore, different data encoding methods can be selected according to the characteristics and requirements of the data, such as encoding categorical data into numerical data to facilitate model processing. These conversion steps can be adjusted according to the actual data characteristics and model requirements to achieve the best data preprocessing effect.

[0043] In some embodiments, in the step of generating the initial structure and basic element layout of the chart according to the input data information in the large model in step 3, if the data type is time series data and the target chart type is a line chart, the basic structure includes a time axis and a data value axis; if the data type is categorical data and the target chart type is a bar chart, the basic structure includes a category axis and a value axis. Let the data type parameter be D t , the target chart type parameter is T t , when D t is a time series and T t When it is a line chart, the structure parameter A=1 (representing a structure with time axis and data value axis). t For categorical data and T t When it is a bar chart, the structure parameter A=2 (representing a structure with a category axis and a value axis).

[0044] It should be noted that when generating the initial structure and basic element layout of a chart, this method will determine the basic architecture of the chart based on the data type and the target chart type. The data type here refers to the nature of the data, such as time series data or classification data, and the target chart type is the form of the chart that the user wants to generate, such as a line chart or a bar chart. The basic architecture refers to the skeleton of the chart, including the layout and design of elements such as axes, legends, and titles.

[0045] Specifically, when determining the basic architecture of a chart, if the data type is time series data and the user wants to generate a line chart, the basic architecture will include a time axis and a data value axis. The time axis is used to represent the passage of time, while the data value axis is used to represent the change in data. For categorical data and bar charts, the basic architecture will include a category axis and a value axis. The category axis is used to display different categories, while the value axis is used to display the data value of each category. The architecture parameters are used to define these axes. For example, the architecture parameters can be 1 or 2, representing an architecture with a time axis and a data value axis, or an architecture with a category axis and a value axis.

[0046] Preferably, after determining the basic architecture, the element layout can be further refined according to the amount of data and the data content characteristics. For example, if the amount of data is large, you can consider increasing the size of the chart or using a scroll bar to display all the data. If the data content characteristics contain multiple data categories, you can assign different colors or patterns to each category to facilitate user differentiation.

[0047] Furthermore, the scale of the coordinate axis can be adjusted according to the distribution of the data to make the chart clearer and easier to read. These detailed steps can be adjusted according to the actual data characteristics and user needs to achieve the best chart display effect.

[0048] In some embodiments, in the step of determining the basic element layout according to the data volume and data content characteristics in step 3, the number of different data categories in the data content characteristics is n, the data volume is V, and the data volume of the i-th data category is V. i , then the layout space proportion of the i-th data category element is

[0049] It should be noted that this method considers the number of different data categories and the amount of data in each category in the data content features when determining the basic element layout of the chart. The data content features here refer to specific attributes in the data set, such as the distribution, extreme values, categories, etc. of the data, while the data categories refer to the different groupings or classifications in the data set. The basic element layout refers to the position and size of each component in the chart, such as each column in a bar chart, each line in a line chart, etc.

[0050] Specifically, when determining the basic element layout, the data volume and data content characteristics can be used to calculate the space proportion of each data category element layout. For example, if the data set contains three categories, and the data volume of each category is 100, 200, and 300, then the total data volume is 600. According to the formula, the space proportion of the first category is 100 / 600, the second category is 200 / 600, and the third category is 300 / 600. These proportions can be used to determine the relative size and position of each category in the chart.

[0051] More specifically, you can also adjust the layout based on the distribution of the data. For example, if the amount of data in a certain category is much larger than that of other categories, you can appropriately increase its proportion in the chart to better show the distribution of the data.

[0052] Preferably, when determining the basic element layout, the aesthetics and readability of the chart can also be considered. For example, different colors or patterns can be assigned to different data categories to facilitate user differentiation. In addition, the scale of the coordinate axis can be adjusted according to the distribution of the data to make the chart clearer and easier to read.

[0053] Furthermore, in actual operation, the layout of elements can be adjusted according to the display area of ​​the chart and the user's visual habits, for example, the most important data category can be placed in the center or the most prominent position of the chart. These detailed steps can be adjusted according to the actual data characteristics and user needs to achieve the best chart display effect.

[0054] In some embodiments, in the step of optimizing the initial structure and basic element layout of the generated chart according to the data content characteristics in step 4, if the data content characteristics include a large data value range, the coordinate axis scale is optimized, and the minimum data value is min, the maximum data value is max, and the number of scales is m, then the scale interval is

[0055] It should be noted that after generating the initial structure and basic element layout of the chart, this method will optimize the chart according to the data content characteristics. The data content characteristics here refer to specific attributes in the data set, such as the distribution, extreme values, categories, etc. of the data, while optimization refers to adjusting certain parameters of the chart to improve the readability of the chart and the accuracy of the data expression. Optimizing the axis scale is a key step, which involves adjusting the scale interval on the axis to better show the range and variation of the data.

[0056] Specifically, when optimizing the axis scale, you need to consider the minimum and maximum values ​​of the data value, as well as the number of scales that the user wants to display on the axis. For example, if the minimum value of the data value is 10 and the maximum value is 100, and the user wants 5 scales, then the scale interval can be set to (100-10) / 5=18. This setting can ensure that the scales on the axis are evenly distributed, making the chart reading more intuitive. In addition, you can also choose the appropriate number of scales based on the distribution of the data to avoid the scales being too dense or sparse, affecting the readability of the chart.

[0057] Preferably, when optimizing the coordinate axis scale, an adaptive scale setting method can be used. For example, if the range of data values ​​is very large, a logarithmic scale can be used to display the data, which can better show the relative changes in the data. In addition, if there are abnormal values ​​or outliers in the data, consider adding additional marks or annotations on the coordinate axis to remind users to pay attention to these special data points.

[0058] Furthermore, the labels and formats of the scales can be adjusted according to the purpose and target audience of the chart to make it more in line with the user's reading habits. These optimization steps can be adjusted according to the actual data characteristics and user needs to achieve the best chart display effect.

[0059] In some embodiments, in the step of drawing the chart element according to the calculated coordinates and size in step 6, the drawing function calls different drawing sub-functions according to the element type. If the element is a line, the starting coordinates of the line are set to (x1, y1) and the ending coordinates are set to (x2, y2). Then the formula for drawing the line is:

[0060]

[0061] If the element is a rectangle, let the coordinates of the upper left corner be (x, y), the width be w, and the height be h. The formula for drawing the rectangle is x≤X≤x+w and y≤Y≤y+h ((X, Y) are the coordinates of the point inside the rectangle).

[0062] It should be noted that when this method draws chart elements according to the calculated coordinates and sizes, it will call different drawing sub-functions according to the type of element. The drawing sub-function here refers to the function used to draw specific types of chart elements, such as lines, rectangles, etc. These functions can accurately draw the corresponding elements in the chart according to the provided coordinate and size parameters. The type of element determines the drawing method and the required parameters, for example, a line requires the starting and ending coordinates, while a rectangle requires the upper left corner coordinates, width and height.

[0063] Specifically, when drawing a line, you need to set the starting point coordinates and the end point coordinates of the line. These two coordinates define the position and direction of the line in the chart. The formula for drawing a line can be calculated based on the starting point coordinates (x1, y1) and the end point coordinates (x2, y2) to ensure that the line can accurately extend from one point to another.

[0064] More specifically, for drawing a rectangle, in addition to the coordinates of the upper left corner (x, y), the width and height of the rectangle also need to be determined. These parameters together determine the size and position of the rectangle in the chart. The formula for drawing a rectangle can ensure that each point (x', y') of the rectangle satisfies the conditions of (x≤x'≤x+width) and (y≤y'≤y+height).

[0065] Preferably, when drawing chart elements, the drawing process can be further refined, such as by setting the thickness, color or style of the line to enhance the visual effect. For rectangles, in addition to basic drawing, borders, shadows or fill colors can be added to improve the readability and aesthetics of the chart.

[0066] Furthermore, the order of drawing elements can be adjusted according to the purpose and target audience of the chart to ensure that important elements are highlighted. In some cases, animation or interactive elements can be used to enhance the dynamic effect of the chart, allowing users to understand and analyze data more intuitively. These refinement steps can be adjusted according to the actual data characteristics and user needs to achieve the best chart display effect.

[0067] In some embodiments, in the step of evaluating the quality of the generated chart in step 7, the clarity C is measured by calculating the sharpness E of the edge of the element in the chart, assuming that the edge pixel change rate is r, then E=∑r, and the element layout rationality LR is measured by calculating the average distance D between the elements and the preset reasonable distance range [d min ,d max ] is measured by the degree of compliance. If d min ≤D≤d max , then the LR score is high. The data expression accuracy DA is measured by calculating the error rate e between the data value and the chart display value. Suppose the true data value is v and the chart display value is v ′ ,but

[0068] It should be noted that after generating the chart, this method will conduct a quality assessment to ensure the clarity of the chart, the rationality of the element layout, and the accuracy of the data expression. The quality assessment here refers to the process of comprehensively evaluating the three key aspects of generating the chart. Clarity refers to the sharpness of the edges of the elements in the chart, the rationality of the element layout involves the spatial distribution between the elements in the chart, and the accuracy of data expression refers to the consistency between the data displayed in the chart and the actual data. Through this evaluation, it can be ensured that the final output chart is both beautiful and accurate.

[0069] Specifically, when conducting quality assessment, clarity can be measured by calculating the sharpness of the edges of elements in the chart, which involves calculating the pixel change rate. The rationality of element layout is measured by calculating the degree of conformity between the average distance between elements and the preset reasonable distance range. If the average distance falls within the preset reasonable range, the layout rationality score is high. The accuracy of data expression is measured by calculating the error rate between the data value and the chart display value. The lower the error rate, the higher the accuracy of the data expression. The settings of these evaluation parameters can be adjusted according to the specific type of chart and user needs to ensure the accuracy and applicability of the evaluation results.

[0070] Preferably, during the quality assessment process, more sophisticated algorithms can be used to calculate the clarity of the chart, such as using edge detection algorithms to identify and enhance the edges of elements in the chart. For the rationality of element layout, machine learning models can be introduced to predict and adjust the optimal distance between elements to achieve better visual effects. In terms of data expression accuracy, more complex statistical methods can be used to analyze the relationship between data values ​​and chart display values ​​to ensure accurate communication of data.

[0071] Furthermore, a user feedback mechanism can be introduced to allow users to participate in the quality assessment process and further optimize the chart generation process based on user feedback. These refinement steps can be adjusted according to actual data characteristics and user needs to achieve the best chart display effect.

[0072] In some embodiments, before step eight, the chart is compressed. Assume that the original data size of the chart is S1, the compressed data size is S2, and the compression rate is A compression algorithm is used to make Z meet the preset range.

[0073] It should be noted that this method will compress the chart before outputting the final chart. Compression here refers to the use of a specific algorithm to reduce the size of the chart file for easy storage and transmission. The compression ratio is an important parameter to measure the compression effect, which represents the ratio of the compressed file size to the original file size. Through compression, the size of the chart file can be reduced without significantly reducing the quality of the chart, and the loading speed and transmission efficiency of the chart can be improved.

[0074] Specifically, when compressing charts, you can choose from a variety of compression algorithms, such as JPEG, PNG, GIF, etc. These algorithms remove redundant information in files in different ways to achieve the purpose of compression. For example, the JPEG algorithm is suitable for compressing continuous-tone images, while the PNG algorithm is more suitable for compressing images containing a lot of text and lines. When setting compression parameters, you need to balance the compression rate and chart quality to ensure that the compressed chart is still clear and readable. The compression rate setting can be determined according to the purpose of the chart and the transmission environment. For example, for web page charts that need to load quickly, you can set a higher compression rate; for printed charts that require high precision, you can set a lower compression rate to maintain the details of the chart.

[0075] Preferably, when compressing chart files, adaptive compression technology can be used to automatically select the most appropriate compression algorithm and parameters according to the content and characteristics of the chart. For example, for charts containing a large amount of text and symbols, PNG format can be selected to maintain the clarity of the text; while for charts mainly containing images and gradient colors, JPEG format can be selected to obtain a higher compression rate.

[0076] Furthermore, lossless compression and lossy compression techniques can be combined to perform differential compression on different parts of the chart to achieve the best compression effect. In practical applications, different compression options can be provided according to user needs and preferences, allowing users to choose compression rates and compression algorithms to meet different usage scenarios. These optimization measures can ensure that while ensuring the quality of the chart, the file size is minimized, and the practicality and convenience of the chart are improved.

[0077] In some embodiments, in step 7, if the quality score S does not meet the requirement, the system returns to step 3 for regeneration, and records the number of regenerations N each time. If N>N max (N max is the preset maximum number of regenerations), the user is prompted to check the input data.

[0078] It should be noted that in the quality assessment stage of this method, if the quality score of the generated chart does not meet the preset threshold, that is, the clarity of the chart, the rationality of the element layout and the accuracy of the data expression do not meet the expected standards, the system will record the number of regenerations each time and prompt the user to check the input data after reaching the preset maximum number of regenerations. The quality score here is a comprehensive score that reflects the overall quality of the chart, while the preset threshold and the preset maximum number of regenerations are pre-set parameters in the system to control the quality and efficiency of the chart generation process.

[0079] Specifically, the calculation of the quality score involves scoring three aspects: clarity of the chart, rationality of element layout, and accuracy of data expression. Clarity can be measured by calculating the sharpness of the edges of elements in the chart, rationality of element layout can be measured by calculating the degree of conformity between the average distance between elements and the preset reasonable distance range, and accuracy of data expression can be measured by calculating the error rate between the data value and the chart display value.

[0080] More specifically, the preset threshold can be a value between 0 and 1, such as 0.8, which means that the quality score of the chart must reach 80% or more to be qualified. The preset maximum number of regenerations is an integer, such as 5, which means that the system will try to regenerate the chart up to 5 times. If the preset threshold is not reached after 5 attempts, the user will be prompted to check the input data.

[0081] Preferably, in the process of regenerating a chart, the system can adopt different strategies to improve the quality score of the chart. For example, the layout parameters of the chart, such as the spacing between elements, the size of the chart, etc., can be adjusted to improve the rationality of the element layout. The visual effects of the chart can also be optimized, such as adjusting the color contrast, adding legends and labels, etc., to improve the clarity of the chart. For the accuracy of data expression, the steps of data processing and conversion can be rechecked to ensure the accuracy and completeness of the data.

[0082] Furthermore, the system can also introduce a user feedback mechanism to allow users to participate in the process of chart quality evaluation, and further optimize the chart generation process based on user feedback. These strategies can be adjusted according to the actual data characteristics and user needs to achieve the best chart display effect. If the expected quality cannot be achieved after multiple attempts, the system can prompt the user to check the accuracy of the input data, or provide professional data cleaning and preprocessing services to help users improve data quality.

[0083] The above-mentioned embodiments of the present invention have the following beneficial effects: the method for automatically generating charts using a large model described in the present invention can improve the degree of automation of chart generation, reduce manual intervention, and thus improve the efficiency of generating charts. The user only needs to provide data information and the target chart type, and the large model can automatically process the data, generate the initial structure and basic element layout of the chart, which can not only save the user's time, but also reduce the dependence on professional skills, so that non-professionals can easily achieve data visualization. By implementing the various steps described in this method, the coordinate axis scale can be optimized to ensure the accurate drawing of chart elements, and the chart can be comprehensively evaluated through a quality assessment mechanism to ensure the quality of the chart. In addition, compression processing can reduce the size of the chart file, improve the loading speed and transmission efficiency of the chart, and optimize the user experience. The processing of these details makes the entire chart generation process more accurate and efficient, and can meet the high requirements of different users for chart quality.

[0084] like Figure 2 As shown, a system 200 for automatically generating a chart using a large model in some embodiments includes:

[0085] A data acquisition module 201, configured to execute step 1 in claim 1;

[0086] A large model processing module 202, used to execute step 3 and step 4 in claim 1;

[0087] A chart calculation module 203, used to execute step 5 in claim 1;

[0088] A chart drawing module 204, configured to execute step 6 of claim 1;

[0089] A quality assessment module 205, configured to execute step 7 in claim 1;

[0090] The output module 206 is used to execute step eight in claim 1.

[0091] It is understood that the modules and references described in the system 200 for automatically generating charts using a large model are Figure 1 Therefore, the operations, features and beneficial effects described above for the method for automatically generating charts using a large model are also applicable to the system 200 for automatically generating charts using a large model and the modules contained therein, and will not be repeated here.

[0092] Reference below Figure 3 , which shows a schematic diagram of a structure 300 of an electronic device suitable for implementing some embodiments of the present invention. The electronic devices in some embodiments of the present invention may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0093] like Figure 3 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0094] Typically, the following devices may be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication devices 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 3 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0095] Furthermore, the storage medium of the embodiment of the present application stores program instructions that can implement all the above methods, wherein the program instructions can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.

[0096] The above descriptions are only some preferred embodiments of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present invention is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present invention to form a technical solution.

Claims

1. A method for automatically generating a chart using a large model, characterized in that: It includes the following steps: Step 1: Obtain the data information input by the user, where the data information includes data type, data volume, data content characteristics, and target chart type; Step 2: Input the obtained user input data information into a large model, where the large model is a pre-trained neural network model capable of handling chart generation tasks; Step 3: The large model generates the initial structure and basic element layout of the chart based on the input data information, specifically: The large model determines the basic architecture of the chart according to the data type and target chart type, and determines the basic element layout according to the data volume and data content characteristics; Step 4: Optimize the generated initial chart structure and basic element layout according to the data content characteristics; Step 5: Calculate the coordinates and sizes of the chart elements based on the optimized architecture and layout. When calculating the coordinates, set the chart width to W and the relative position ratio of the elements in the horizontal direction to p. x , then the x-coordinate of the element, let the height of the chart be H, and the relative position ratio of the element in the vertical direction be p y , then the element y coordinate, let the total layout width be TW, and the element horizontal space ratio be s w , then the width of the element, let the total layout height be TH, and the vertical space ratio of the element be s h , then the element height; Step 6: Draw chart elements according to the calculated coordinates and sizes; Step 7: Perform quality evaluation on the generated chart, evaluating from three aspects: clarity C, rationality of element layout LR, and accuracy of data expression DA of the chart. If the quality score S < T, then return to Step 3 to regenerate; where T is a preset threshold; Step 8: Output the final chart.

2. The method for automatically generating a chart using a large model according to claim 1, characterized in that: In the step of obtaining the data information input by the user in step 1, the format of the data input by the user is checked and preprocessed. If the data format does not meet the requirements, it is converted according to the preset format conversion rules. The original format parameters of the data are set as F1, F2, ..., F n , the preset format parameters are P1, P2, ..., P n , if F i ≠P i , where i=1,2,…,n, then F i Convert to P i .

3. The method for automatically generating a chart using a large model according to claim 1, characterized in that: In the step of generating the initial structure and basic element layout of the chart based on the input data information in the large model in step 3, if the data type is time series data and the target chart type is a line chart, the basic structure includes a time axis and a data value axis; if the data type is categorical data and the target chart type is a bar chart, the basic structure includes a category axis and a value axis. Let the data type parameter be D t , the target chart type parameter is T t , when D t is a time series and T t When it is a line chart, the structure parameter A=1, which means there is a time axis and a data value axis structure. t For categorical data and T t When it is a bar chart, the structure parameter A=2, which means there is a category axis and a value axis structure.

4. The method for automatically generating a chart using a large model according to claim 1, characterized in that: In the step of determining the basic element layout according to the data volume and data content characteristics in step 3, assume that the number of different data categories in the data content characteristics is n, the data volume is V, and the data volume of the i-th data category is V i , then the layout space proportion of the i-th data category element.

5. The method for automatically generating a chart using a large model according to claim 1, characterized in that: In the step of optimizing the generated initial chart structure and basic element layout according to the data content characteristics in Step 4, if the data content characteristics include a large data value range, then optimize the axis scale. Let the minimum data value be min, the maximum value be max, and the number of scales be m, then the scale interval.

6. The method for automatically generating a chart using a large model according to claim 1, characterized in that: In the step of drawing chart elements according to the calculated coordinates and sizes in Step 6, the drawing function calls different drawing sub-functions according to the element type. If the element is a line, let the starting coordinate of the line be (x1, y1) and the ending coordinate be (x2, y2).

7. The method for automatically generating a chart using a large model according to claim 1, characterized in that: In the step of evaluating the quality of the generated chart in step 7, the clarity C is measured by calculating the sharpness E of the edge of the element in the chart, assuming that the edge pixel change rate is r, and the element layout rationality LR is calculated by calculating the average distance D between the elements and the preset reasonable distance range [d min ,d max ] is measured by the degree of compliance. If d min ≤D≤d max , then the LR score is high. The data expression accuracy DA is measured by calculating the error rate e between the data value and the chart display value. Suppose the true data value is v and the chart display value is v ′ .

8. The method for automatically generating a chart using a large model according to claim 1, characterized in that: Before Step 8, perform compression processing on the chart. Let the original data size of the chart be S1 and the compressed data size be S2, and use a compression algorithm to make Z satisfy a preset range.

9. The method for automatically generating a chart using a large model according to claim 1, characterized in that: In step 7, if the quality score S does not meet the requirements, return to step 3 and regenerate, record the number of times N is regenerated each time, if N>N max , the user is prompted to check the input data; where N max The preset maximum number of regenerations.

10. A system for automatically generating charts using a large model according to claim 9, characterized in that: The data acquisition module transmits the data information input by the user to the large model processing module for generating the initial structure and layout of the chart; after the large model processing module optimizes the generated initial structure and layout, it transmits them to the chart calculation module for calculating the coordinates and sizes of chart elements; after the chart calculation module completes the calculation of the coordinates and sizes of the elements, it transmits the results to the chart drawing module for drawing chart elements; after the chart drawing module generates a preliminary chart, it hands it over to the quality evaluation module to evaluate the clarity, layout rationality, and data expression accuracy of the chart; the quality evaluation module determines whether to output the final chart according to the evaluation results, and transmits the chart passing the evaluation to the output module for display; if it fails, it feeds back to the large model processing module to regenerate.

Citation Information

Patent Citations

  • Chart layout mode generation method and device and electronic equipment

    CN114625941A

  • Chart display method and device, equipment and medium

    CN115730113A

  • ECharts-based data visualization chart customizing method

    CN116501316A

  • Report generation method and device, electronic equipment and medium

    CN117033540A

  • Multi-dimensional statistical graph drawing system under statistical scene based on NPL semantic analysis

    CN118296033A