Chart generation method and system and electronic equipment
By converting the question information and initial data information before the big model generates a chart, and performing reverse conversion after the big model generates a chart, the risk of data leakage during the big model is solved, and data security and the accuracy of the chart data are achieved.
Patent Information
- Application Number
- CN202510233217.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-23
AI Technical Summary
In the process of generating charts based on questions and data in the big model, there is a risk of data leakage and security risks.
Before inputting the question information and initial data information into the big model, the converted target question and target data information are generated, and the converted target data information is input to the big model. After generating the first chart, the second chart matching the initial data information is obtained, thereby avoiding the risk of data leakage.
It effectively avoids the risk of data leakage, ensures data security, and ensures the accuracy of generated chart data.
Smart Images

Figure CN120032013A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a chart generation method, system and electronic device. Background Art
[0002] As the technology of big models becomes more mature, the application of big models is becoming more and more extensive. For example, users input questions and data related to the questions into the big model, so that the big model can generate charts based on the questions and data.
[0003] However, in the process of large models generating charts based on questions and data, there may be a risk of data leakage and security risks. Summary of the invention
[0004] In view of this, the present application provides a chart generation method, system and electronic device, and the specific scheme thereof is as follows:
[0005] A method for generating a chart, comprising:
[0006] Obtain question information and initial data information input by the user;
[0007] If the question information represents generating a chart from the initial data information using the large model, the question information and the initial data information are converted according to the target rule to obtain the converted target question and target data information;
[0008] Inputting the target question and the target data information into the macro model to obtain a first chart generated by the macro model based on the target question and the target data information;
[0009] The first chart is reversely converted according to the target rule to obtain a second chart, so that data corresponding to the second chart matches the initial data information.
[0010] Furthermore, converting the question information and the initial data information according to the target rule to obtain the converted target question and target data information includes:
[0011] Identify the question information and the initial data information, and determine different data field types in the question information and the initial data information;
[0012] Determine a conversion rule in the target rule corresponding to each data field type in the different data field types;
[0013] Each data field type in different data field types in the question information and the initial data information is converted according to corresponding conversion rules to obtain converted target question and target data information.
[0014] Furthermore, the step of converting each data field type in different data field types in the question information and the initial data information according to corresponding conversion rules to obtain converted target question and target data information includes:
[0015] Determine the digital data in the question information and the initial data information, perform digital operations on the digital data according to the conversion rules corresponding to the digital data in the target rules, and obtain converted data;
[0016] The converted data is used to replace the digital data in the question information and the initial data information to obtain the target question and target data information.
[0017] Furthermore, the step of replacing the digital data in the question information and the initial data information with the converted data to obtain the target question and the target data information includes:
[0018] Determine the information of the character string type in the question information and the initial data information, and perform character string conversion on the information of the character string type according to the conversion rule corresponding to the information of the character string type in the target rule to obtain converted information;
[0019] The converted data and the converted information are combined according to the positions of the converted data and the converted information in the question information and the initial data information before the conversion, so as to obtain the converted target question and target data information.
[0020] Furthermore, if the question information representation generates a chart from the initial data information using the large model, the question information and the initial data information are converted according to the target rule to obtain the converted target question and target data information, including:
[0021] If the question information represents the use of the big model to generate a chart from the initial data information, determine the type of the chart to be generated so that the type of the chart to be generated, the target question and the target data information are input into the big model to obtain a first chart output by the big model that conforms to the type of the chart to be generated.
[0022] Furthermore, if the question information represents generating a chart from the initial data information using the large model, determining the type of the chart to be generated includes:
[0023] If it is determined that the question information represents the use of the large model to generate a first type of chart from the initial data information, determining that the type of the chart to be generated is the first type;
[0024] If it is determined that the question information represents the use of the large model to generate a graph from the initial data information, the type of the graph to be generated is determined based on the attributes of the initial data information.
[0025] Further, the determining the type of the chart to be generated based on the attribute of the initial data information includes:
[0026] Determine the amount of string type information and the change range of digital type data in the initial data information;
[0027] The type of the chart to be generated is determined based on the amount of string-type information in the initial data information and the variation interval of the digital-type data.
[0028] Furthermore, it also includes:
[0029] In response to the question information and initial data information input by the user, the second chart is displayed.
[0030] A chart generation system, comprising:
[0031] An obtaining unit, used to obtain question information and initial data information input by the user;
[0032] A first conversion unit is used to convert the question information and the initial data information according to a target rule to obtain a converted target question and target data information when determining that the question information represents the use of the large model to generate a chart from the initial data information;
[0033] An input unit, used for inputting the target question and the target data information into the large model, and obtaining a first chart generated by the large model based on the target question and the target data information;
[0034] The second conversion unit is used to reversely convert the first chart according to the target rule to obtain a second chart, so that the data corresponding to the second chart matches the initial data information.
[0035] An electronic device, comprising:
[0036] A processor is used to obtain question information and initial data information input by a user; if the question information represents generating a chart from the initial data information using the large model, the question information and the initial data information are converted according to the target rule to obtain a converted target question and target data information; the target question and target data information are input into the large model to obtain a first icon generated by the large model based on the target question and target data information; the first icon is reversely converted according to the target rule to obtain a second chart, so that the data corresponding to the second chart matches the initial data information;
[0037] The memory is used to store the program required by the processor to execute the above processing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A flowchart of a chart generation method disclosed in an embodiment of the present application;
[0040] Figure 2 A complete schematic diagram of a chart generation method disclosed in an embodiment of the present application;
[0041] Figure 3 A flowchart of a chart generation method disclosed in an embodiment of the present application;
[0042] Figure 4 A flowchart of a chart generation method disclosed in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of the structure of a chart generation system disclosed in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0046] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0047] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0048] The present application discloses a method for generating a chart, and its flow chart is as follows: Figure 1 As shown, including:
[0049] Step S11, obtaining question information and initial data information input by the user;
[0050] Step S12: if the question information represents the use of a large model to generate a chart from the initial data information, the question information and the initial data information are converted according to the target rule to obtain the converted target question and target data information;
[0051] Step S13, inputting the target question and the target data information into the large model, and obtaining a first chart generated by the large model based on the target question and the target data information;
[0052] Step S14: reversely transform the first chart according to the target rule to obtain a second chart, so that the data corresponding to the second chart matches the initial data information.
[0053] As the technology of big models becomes more mature, the application of big models is becoming more and more extensive. For example, users input questions and data related to the questions into the big model, so that the big model can generate charts based on the questions and data.
[0054] However, in the process of large models generating charts based on questions and data, there may be a risk of data leakage and security risks.
[0055] Based on this, after obtaining the question information and initial data information input by the user, if it is determined that the question information representation needs to use the large model to generate a chart from the initial data information, then before inputting the question information and the initial data information into the large model, the question information and the initial data information are first converted, and the converted target question and target data information are input into the large model, so that the large model obtains the converted question and data information, and generates a first chart based on the converted question and data information, and then reversely converts the first chart to obtain the second chart. On the basis of ensuring that the final chart matches the initial data information, the risk of information leakage that may be caused by directly inputting the initial data information into the large model is avoided, thereby ensuring data security.
[0056] Specifically, when the user needs to use the big model to generate a chart, the user needs to input the question information and the initial data information corresponding to the chart to be generated into the big model. The big model can then generate the corresponding chart based on the initial data information. In this embodiment, before the question information and the initial data information are input into the big model, the question information and the initial data information are intercepted by an interception tool in order to convert them.
[0057] Among them, the interception tool is a tool that carries the system corresponding to the chart generation method disclosed in this embodiment. The interception tool is a tool independent of the large model and can be set at the input and output ends of the large model. All information reaching the input end of the large model is intercepted by the interception tool, and the information output from the large model will also be intercepted by the interception tool.
[0058] After obtaining the question information and initial data information input by the user, the interception tool judges the question information to determine whether the question information indicates that a chart needs to be generated using the big model. If the question information is not for generating a chart using the big model, but for performing other operations using the big model, such as analyzing the initial data information, the interception tool can directly output the obtained question information and initial data information, so that the big model directly receives the user's question information and initial data information;
[0059] If the question information representation is to generate a chart using a large model, the interception tool needs to convert the question information and the initial data information to change the question information and the initial data information, and obtain the converted target question and target data information. The target question is different from the question information, and the target data information is different from the initial data information.
[0060] The conversion from question information to target question and from initial data information to target data information is carried out according to target rules. That is, the conversion of question information and initial data information has certain rules and needs to be carried out according to certain rules rather than random conversion. The target rules should be recorded to facilitate subsequent reverse conversion.
[0061] The target rule may be pre-set, and one conversion rule may be pre-set as the target rule, or a combination of multiple conversion rules may be pre-set as the target rule.
[0062] When the target rule includes only one conversion rule, as long as there is a question information that needs to generate a chart from the initial data information using the large model, the question information and the initial data information are converted according to the target rule, regardless of what the question information is and what the initial data information includes;
[0063] When the target rule includes multiple conversion rules, different types of question information and initial data information correspond to different types of target rules. When determining the question information representation to generate a chart from the initial data information using a large model, it is necessary to further determine the types corresponding to the question information and the initial data information, and select a matching conversion rule from the target rule based on the determined type, and use the selected matching conversion rule to convert the question information and the initial data information to obtain the target question and target data information.
[0064] After using the conversion rules to convert the question information into the target question and the initial data information into the target data information, the interception tool inputs the target question and the target data information into the big model so that the big model can use the target question to generate the first chart according to the target data information, and the big model outputs the first chart.
[0065] After the large model outputs the first chart, since an interception tool is provided at the output end of the large model, the interception tool can obtain the first chart output by the large model. At this time, the recorded target rules can be used to reversely transform the first chart according to the target rules to obtain the second chart, and the data in the second chart is data that matches the initial data information.
[0066] The reverse conversion corresponds to the conversion, and both the reverse conversion and the conversion are performed according to the target rules. Since the conversion performed according to the target rules is to convert the initial data information into the target data information in order to generate the first chart, then the corresponding data in the first chart is the target data information. In order to ensure that the final generated chart corresponds to the initial data information, it is necessary to convert the target data information in the first chart according to the target rules, so that the data in the second chart obtained after the conversion corresponds to the initial data information, thereby ensuring the accuracy of the data in the final second chart.
[0067] For example: converting according to the target rule is to convert a into b, then, reverse conversion according to the target rule is to convert b into a, then, reverse conversion of the first chart according to the target rule is actually to reversely convert the data corresponding to the target data information in the first chart to obtain data corresponding to the initial data information, and use the data corresponding to the initial data information to replace the data corresponding to the target data information in the first chart, so as to obtain the second chart.
[0068] In the chart generation method disclosed in the present embodiment, what is input into the big model is the target question and target data information, and there is no risk of leakage of the initial data information input by the user, thereby ensuring the security of the data. At the same time, what is input into the big model is the target question and target data information converted by the question information and the initial data information, and for the first chart output by the big model, the second chart is obtained after the reverse conversion, so that the final second chart is generated according to the question information and the initial data information input by the user, thereby ensuring the accuracy of the generated chart.
[0069] The chart generation method disclosed in the present embodiment obtains question information and initial data information input by a user. If the question information represents the generation of a chart from the initial data information using a large model, the question information and the initial data information are converted according to a target rule to obtain a converted target question and target data information; the target question and target data information are input into the large model to obtain a first chart generated by the large model based on the target question and target data information; the first chart is reversely converted according to the target rule to obtain a second chart, so that the data corresponding to the second chart matches the initial data information. When obtaining the question information and initial data information input by the user, this solution first determines whether the question information represents the need to use the big model to generate a chart from the initial data information. If so, the question information and the initial data information must first be converted according to the target rules, and the converted target question and target data information must be input into the big model. After the big model outputs the first chart, it is converted into the second chart according to the target rules. This ensures that what is input into the big model are the converted questions and data, and what the big model receives is not the question information and the initial data information, which effectively avoids the risk of data leakage and ensures data security. At the same time, after the big model generates the first chart, it can perform a reverse conversion to ensure that the final result is a second chart that matches the initial data information, thereby ensuring the accuracy of the data in the generated chart.
[0070] Furthermore, the chart generation method disclosed in this embodiment may also include:
[0071] In response to the question information and the initial data information input by the user, a second chart is displayed.
[0072] Before inputting the question information and initial data information into the big model, they are converted according to the target rules, and the target question and target data information obtained after the conversion are input into the big model to obtain the first chart generated by the big model. Afterwards, the first chart is reversely converted according to the target rules to obtain the second chart. After obtaining the second chart, the second chart needs to be displayed and output to complete the response to the question information and initial data information input by the user.
[0073] Specifically, the complete flowchart can be shown as follows: Figure 2 As shown, including:
[0074] Step S21, the user uploads question information and initial data information;
[0075] Step S22: the interception tool intercepts the question information and the initial data information;
[0076] Step S23, the interception tool converts the intercepted data into target questions and target data information;
[0077] Step S24, the interception tool uploads the target question and target data information to the big model;
[0078] Step S25, the large model generates a first chart;
[0079] Step S26, reversely converting the data corresponding to the first chart to obtain a second chart;
[0080] Step S27: display the second chart.
[0081] The chart generation method disclosed in this embodiment does not upload the real initial data information and question information uploaded by the user to the big model, but stores them locally. Therefore, there is no risk of information leakage due to uploading data to the big model. In this process, there is no need to deploy the big model, the cost is low, and the scalability is strong.
[0082] This embodiment discloses a method for generating a chart, and its flow chart is as follows: Figure 3 As shown, including:
[0083] Step S31, obtaining question information and initial data information input by the user;
[0084] Step S32: if the question information represents generating a chart from the initial data information using a large model, identifying the question information and the initial data information, and determining different data field types in the question information and the initial data information;
[0085] Step S33, determining the conversion rule corresponding to each data field type in the target rule;
[0086] Step S34, converting each data field type in different data field types in the question information and the initial data information according to corresponding conversion rules to obtain converted target question and target data information;
[0087] Step S35: input the target question and the target data information into the large model to obtain a first chart generated by the large model based on the target question and the target data information;
[0088] Step S36: reversely transform the first chart according to the target rule to obtain a second chart, so that the data corresponding to the second chart matches the initial data information.
[0089] When the user has question information and initial data information that need to be input into the big model, it is necessary to first determine whether the question information represents the need to generate a chart using the big model. If the big model does not need to be used to generate a chart, the question information and initial data information can be directly input into the big model; if the big model needs to be used to generate a chart, the question information and initial data information need to be further identified to determine how to convert the question information and initial data information.
[0090] Specifically, the question information and the initial data information are identified to determine different data field types in the question information and the initial data information. The question information and the initial data information may include one data field type or may include multiple different data field types.
[0091] Among them, the data field type can be: time, dimension, measurement, etc. Time is data in time format, such as: 2025, 13:00 to 15:00, December, etc., to determine whether the question information and the initial data information include data in time format. If included, the data field type corresponding to these data is determined as time; dimension is a noun or name, that is, the noun or name in the question information and the initial data information, which can be a string, that is, the dimension can be a string type, such as: computer, mobile phone, etc., to determine whether the question information and the initial data information include string type data. If included, the data field type corresponding to these data is determined as dimension; measurement is a numerical value, that is, the numerical value in the question information and the initial data information. Measurement can be a digital type, such as: 23, 375, etc., that is, to determine whether the question information and the initial data information include digital type data. If included, the data field type corresponding to these data is determined as measurement.
[0092] The preset target rules may include multiple conversion rules, and different data field types may correspond to different conversion rules.
[0093] After obtaining the question information and the initial data information, the question information and the initial data information are analyzed to determine whether the data field type in the question information and the initial data information is time, dimension, or measurement, or both time and dimension, or both time, dimension, and measurement, etc. Then, a conversion rule corresponding to the data field type included in the question information and the initial data information is determined from the target rule, and data corresponding to the corresponding data field type in the question information and the initial data information is converted according to the conversion rule.
[0094] If the question information and the initial data information only include one data field type, then only one conversion rule corresponding to the data field type is determined from the target rules, and the data corresponding to the data field type in the question information is converted according to the determined conversion rule, and the data corresponding to the data field type in the initial data information is converted according to the determined conversion rule, so as to obtain the converted target question and target data information;
[0095] If the question information and the initial data information include multiple data field types, such as a first data field type and a second data field type, then a first conversion rule corresponding to the first data field type and a second conversion rule corresponding to the second data field type are determined from the target rules, and the data of the first data field type in the question information and the initial data information are converted according to the first conversion rule, and the data of the second data field type in the question information and the initial data information are converted according to the second conversion rule, so as to obtain the converted target question and target data information.
[0096] Specifically, if the digital type data in the question information and the initial data information is determined, digital operations are performed on the digital type data according to the conversion rules corresponding to the digital type data in the target rules to obtain converted data; the digital type data in the question information and the initial data information is replaced with the converted data to obtain the target question and target data information.
[0097] If the question information and the initial data information include digital data, that is, metrics, then determine the conversion rule corresponding to the digital type in the target rule, and convert the digital data in the question information and the initial data information according to the conversion rule corresponding to the digital type. For example, if the conversion rule corresponding to the digital type in the target rule is "×7", then all digital data in the question information and the initial data information need to be ×7, and the obtained values are used to replace the original values in the question information and the initial data information. For example, the first position of the initial data information includes digital data 32, the second position includes digital data 67, and the third position includes digital data 78. Then, according to the above conversion rule "×7", the digital data in the initial data information are converted to obtain 32×7=224, 67×7=469, and 78×7=546. Then, 32 at the first position of the initial data information is changed to 224, 67 at the second position of the initial data information is changed to 469, and 78 at the third position of the initial data information is changed to 546, thereby obtaining the target data information;
[0098] Alternatively, the question information and the initial data information include data of different measures, that is, the question information and the initial data information include digital data, but the digital data included are data of different dimensions. Then, these data can be confirmed as data of different measures, and different conversion rules can be used for data of different measures, such as: for the data of measure 1, the corresponding conversion rule is "×7", for the data of measure 2, the corresponding conversion rule is "+3", etc. For example: the initial data information includes data of two measures, namely, the sales volume and growth rate of a certain product in each month within a year, then for the data corresponding to the sales volume, the corresponding conversion rule is "+3", and for the data corresponding to the growth rate, the corresponding conversion rule is "×7", then all the data related to the sales volume in the initial data information are "+3", and all the data related to the growth rate in the initial data information are "×7", thereby obtaining the converted target data information.
[0099] Correspondingly, when the question information and the initial data information include digital type data, when the conversion rule is "×7", the data in the first chart is reversely converted according to the conversion rule, the corresponding data in the first chart is "÷7" so that the data corresponding to the second chart obtained after the conversion of the first chart can be the same as the data in the initial data information; when the conversion rule is "+3", the corresponding reverse conversion is to convert the corresponding data to "-3", etc.
[0100] In addition, if the string type information in the question information and the initial data information is determined, the string type information is converted into a string according to the conversion rule corresponding to the string type information in the target rule to obtain the converted information; the converted data and the converted information are combined according to the positions of the converted data and the converted information in the question information and the initial data information before the conversion to obtain the converted target question and target data information.
[0101] If the question information and the initial data information include string type information, i.e., dimension, then the conversion rule corresponding to the string type is determined from the target rule, and the string type information in the question information and the initial data information is converted according to the conversion rule, such as: the conversion rule corresponding to the string type in the target rule is to convert the first string into the second string, then all the first strings in the question information and the initial data information are replaced by the second string, and the converted target question and target data information can be obtained. For example: the question information and the initial data information include string A, where string A is a certain specific model of computer, then according to the conversion rule, all the strings A included in the question information and the initial data information can be directly replaced with string B, where string B is a certain specific brand of cola.
[0102] Alternatively, if the question information and the initial data information include information of different dimensions, that is, multiple information of the string type, the conversion rules corresponding to the information of each dimension are determined, and the conversions are performed separately. For example, for the string of dimension 1, the corresponding conversion rule is to convert it to string 1, and for the string of dimension 2, the corresponding conversion rule is to convert it to string 2. For example, the question information and the initial data information include string A and string B, where string A is a computer of the first model and string B is a computer of the second model. Conversion rule 1 corresponding to string A and conversion rule 2 corresponding to string B are determined, and all string A in the question information and the initial data information are converted to string 1 according to conversion rule 1, and all string B in the question information and the initial data information are converted to string 2 according to conversion rule 2, to obtain the converted target question and target data information.
[0103] Correspondingly, after determining conversion rule 1 corresponding to string A and conversion rule 2 corresponding to string B, the information in the first chart is reverse converted according to conversion rule 1, that is, all character strings 1 in the first chart are reverse converted to obtain string A, and all character strings 2 in the first chart are reverse converted to obtain string B, so as to obtain a second chart, so that the information in the second chart is consistent with the information in the question information and the initial data information.
[0104] Furthermore, when performing dimension conversion, the key dimensions and non-key dimensions in the multiple character strings analyzed from the question information and the initial data information can be determined. When performing dimension conversion, only the key dimensions are converted, while the non-key dimensions can be converted or not converted. When converting the non-key dimensions, different standards can be used for conversion from the key dimensions, such as: for the key dimensions, they can be directly converted into a clear character string, while for the non-key dimensions, they can be converted into a virtual character string or an identifier. For example: converting the key dimension into "XX Cola" and converting the non-key dimension into "Brand A", "Brand B", etc., does not require a specific brand logo, but can be represented by a logo.
[0105] In addition, if the time format information in the question information and the initial data information is determined, the time format information can be converted according to the conversion rule corresponding to the time format in the target rule, such as: December is converted to March, etc.
[0106] For example, obtain the question information "What percentage of all computer sales in December is accounted for by the XX model computer, expressed in a chart", and obtain the initial data information at the same time, such as: the data of the corresponding computer sales in December. After obtaining the question information and the initial data information, analyze the data field types included therein, and determine that they include: information in the time format "December", information of the string type "XX model computer" and digital type data related to sales. Different conversions can be performed according to different data field types, such as: converting "XX model computer" to "XX cola", and performing corresponding operations on the digital type data related to sales to obtain the converted data. "December" can be replaced or retained without conversion. Among them, the target question obtained after converting the question information can be: "What percentage of all computer sales is accounted for by XX cola in December, expressed in a chart", thereby avoiding the question information. In addition, the data is also converted, which will not affect the results of the large model analysis and chart generation, ensuring the accuracy of the large model chart generation.
[0107] In addition, it should be noted that the large model analyzes and answers the input data and questions to output the corresponding charts. It cannot determine whether the logic of the question is correct, that is, even if the input question is "What percentage of all computer sales in December is XX cola, represented by a chart", it will not affect the accuracy of the chart generated by the large model based on the question and data. Of course, when converting string type information, "computer" can also be converted to "cola" to ensure the logic of the target question obtained by the large model.
[0108] The method disclosed in this embodiment is not a simple encryption and decryption, but distinguishes different dimensions, measurements, time and other information according to the different question information and initial data information input by the user each time, and then performs a reversible conversion, while ensuring the accuracy of chart generation.
[0109] The chart generating method disclosed in the present embodiment, after obtaining the question information and the initial data information, if it is determined that the question information represents the use of the big model to generate a chart from the initial data information, then the question information and the initial data information need to be identified to determine the different data field types in the question information and the initial data information, and the corresponding conversion rules are determined from the target rules according to each data field type, and each data field type in the question information and the initial data information is converted according to the corresponding conversion rules to obtain the target question and the target data information, so that the big model outputs the first chart corresponding to the target question and the target data information, thereby ensuring the security of the question information and the initial data information input by the user, and the conversion is performed according to the data field type in the question information and the initial data information to ensure the regularity of the conversion, thereby ensuring that the reverse conversion can be accurately performed according to the data field type.
[0110] This embodiment discloses a method for generating a chart, and its flow chart is as follows: Figure 4 As shown, including:
[0111] Step S41, obtaining question information and initial data information input by the user;
[0112] Step S42: if the question information indicates that the initial data information is generated into a chart using a large model, determine the type of the chart to be generated;
[0113] Step S43, converting the question information and the initial data information according to the target rule to obtain the converted target question and target data information;
[0114] Step S44, inputting the type of the chart to be generated, the target question and the target data information into the macro model, and obtaining a first chart that meets the type of the chart to be generated and is generated by the macro model based on the target question and the target data information;
[0115] Step S45: reversely transform the first chart according to the target rule to obtain a second chart, so that the data corresponding to the second chart matches the initial data information.
[0116] After obtaining the question information and initial data information input by the user, if it is determined that the question information represents using a large model to generate a chart from the initial data information, the question information and initial data information need to be converted according to the target rules to obtain the target question and target data information, and the target question and target data information are input into the large model so that the large model can generate a first chart based on the target question and target data information. After the large model outputs the first chart, the data in the first chart is reversely converted according to the target rules to obtain a second chart that matches the initial data information.
[0117] When determining that the question information represents using a large model to generate a chart from the initial data information, it is also necessary to analyze the question information to determine what type of chart needs to be generated from the initial data information using the large model, that is, to determine the type of the chart to be generated.
[0118] The step of determining the type of the chart to be generated can be carried out synchronously with the step of converting the question information and initial data information, or can be executed sequentially.
[0119] After determining the type of the chart to be generated, and obtaining the target question and target data information, the type of the chart to be generated, the target question and the target data information are jointly input into the large model so that the large model can generate a chart of the corresponding type according to the target question from the target data information.
[0120] For example: if the type of the chart to be generated is a pie chart, then after determining that the type of the chart to be generated is a pie chart, the information that the type of the chart to be generated is a pie chart is input into the large model, and the large model uses the obtained target question and target data information to generate a first chart, and the first chart is in the form of a pie chart.
[0121] Among them, determining the type of the chart to be generated can be: if it is determined that the question information represents using a large model to generate a chart of the first type from the initial data information, then directly determine that the type of the chart to be generated is the first type.
[0122] That is, the type of the chart to be generated is directly specified in the question information. At this time, the type specified in the question information can be directly determined as the type of the chart to be generated. For example: the question information is: "The percentage of XX model computers in all computer sales in December, shown in a pie chart", analyzing this question information, it can be determined that the pie chart is directly specified as the type of the chart to be generated in the question information, so the pie chart is directly input into the large model as the type of the chart to be generated, and the large model directly generates a chart of the pie chart type.
[0123] Or, determining the type of the chart to be generated can also be: if it is determined that the question information represents using a large model to generate a chart from the initial data information, determine the type of the chart to be generated based on the attributes of the initial data information.
[0124] That is, when the question information does not clearly state what type of chart to generate, the initial data information needs to be analyzed in order to determine the type of chart to be generated based on the attributes of the initial data information. For example, if the question information is: "Use a chart to show the percentage of XX model computers in all computer sales in December", by analyzing the question information, it can be determined that the question information only indicates that a chart needs to be generated, but does not specify what type of chart needs to be generated. Therefore, it is necessary to further analyze the obtained initial data information to determine which type of chart the current initial data information matches, and then determine that type as the type of chart to be generated.
[0125] Specifically, the type of chart to be generated is determined based on the attributes of the initial data information, including: determining the amount of string type information in the initial data information, and the variation range of the numeric type data; determining the type of chart to be generated based on the amount of string type information in the initial data information, and the variation range of the numeric type data.
[0126] That is, the string type information and the digital type data included in the initial data information are analyzed to determine the type of chart to be generated. Different amounts of string type information and different change intervals of digital type data correspond to different types of charts.
[0127] For example: the user inputs question information and initial data information, analyzes the question information, and determines that the question information does not clearly indicate the type of chart to be generated. Then, the initial data information is continued to be analyzed to determine the number of string type information (i.e., the number of dimensions) and the change area of the numeric type data (i.e., the change interval of the measurement). If the initial data information includes one dimension and the change area of the measurement is within a first specific range, then based on this, it can be determined that the type of chart to be generated is a line chart; if the initial data information includes multiple dimensions and one measurement, that is, there is only one type of data in the initial data information, then it can be determined that the type of chart to be generated is a pie chart, etc.
[0128] Alternatively, when it is determined that the question information does not directly indicate the type of the chart to be generated, the question information may be analyzed to determine the type of the chart to be generated based on information included in the question information.
[0129] For example: the question information is: "Use a chart to show the percentage of XX model computers in all computer sales in December". The question information does not specify which type of chart to use, so the initial data information corresponding to the question information is analyzed. The initial data information only includes the sales of different models of computers in December. If the chart to be used is to show the percentage of a specific model of computer in all computer sales, a pie chart can be used, that is, the type of chart to be generated is determined to be a pie chart.
[0130] Alternatively, when it is determined that the question information does not directly indicate the type of the chart to be generated, the properties of the question information and the initial data information may be analyzed to determine the type of the chart to be generated based on the information included in the question information and the properties of the initial data information.
[0131] In addition, it should be noted that the step of determining the type of chart to be generated may not be performed by the interception tool corresponding to the chart generation method disclosed in this embodiment, but the large model directly analyzes the target question to determine the type of chart to be generated, and when generating the first chart, generates the corresponding type of chart directly based on its own analysis.
[0132] The chart generation method disclosed in the present embodiment, after obtaining the question information and initial data information input by the user, if the question information represents the use of a large model to generate a chart from the initial data information, it is necessary to first determine the type of the chart to be generated, and at the same time, convert the question information and the initial data information according to the target rule to obtain the target question and target data information, and then input the type of the chart to be generated, the target question and the target data information into the large model together, so that the large model can generate a first chart that conforms to the type of the chart to be generated, and after reverse conversion of the data in the first chart, obtain a second chart that conforms to the question information and the initial data information, thereby effectively avoiding the risk of data leakage and ensuring data security.
[0133] This embodiment discloses a chart generation system, and its structural diagram is as follows: Figure 5 As shown, including:
[0134] An obtaining unit 51 , a first converting unit 52 , an inputting unit 53 and a second converting unit 54 .
[0135] The obtaining unit 51 is used to obtain the question information and initial data information input by the user;
[0136] The first conversion unit 52 is used to convert the question information and the initial data information according to the target rule to obtain the converted target question and target data information when determining the question information representation to generate a chart using the large model from the initial data information;
[0137] The input unit 53 is used to input the target question and the target data information into the large model to obtain a first chart generated by the large model based on the target question and the target data information;
[0138] The second conversion unit 54 is used to perform reverse conversion on the first chart according to the target rule to obtain the second chart, so that the data corresponding to the second chart matches the initial data information.
[0139] Furthermore, the first conversion unit may also be used for:
[0140] Identify the question information and the initial data information, determine the different data field types in the question information and the initial data information; determine the conversion rule corresponding to each data field type in the different data field types in the target rule; convert each data field type in the different data field types in the question information and the initial data information according to the corresponding conversion rule to obtain the converted target question and target data information.
[0141] Furthermore, the first conversion unit may also be used for:
[0142] Determine the digital type data in the question information and the initial data information, perform digital operations on the digital type data according to the conversion rules corresponding to the digital type data in the target rules, and obtain converted data; use the converted data to replace the digital type data in the question information and the initial data information to obtain the target question and target data information.
[0143] Furthermore, the first conversion unit may also be used for:
[0144] Determine the string type information in the question information and the initial data information, perform string conversion on the string type information according to the conversion rule corresponding to the string type information in the target rule, and obtain the converted information; combine the converted data and the converted information according to the positions of the converted data and the converted information in the question information and the initial data information before conversion, so as to obtain the converted target question and target data information.
[0145] Furthermore, the first conversion unit may also be used for:
[0146] If the question information represents the use of a large model to generate a chart from the initial data information, determine the type of the chart to be generated so that the type of the chart to be generated, the target question and the target data information are input into the large model to obtain a first chart output by the large model that meets the type of the chart to be generated.
[0147] Furthermore, the first conversion unit may also be used for:
[0148] If it is determined that the question information represents the use of a large model to generate a first type of chart from the initial data information, the type of the chart to be generated is determined to be the first type; if it is determined that the question information represents the use of a large model to generate a chart from the initial data information, the type of the chart to be generated is determined based on the attributes of the initial data information.
[0149] Furthermore, the first conversion unit may also be used for:
[0150] Determine the amount of string type information and the variation interval of digital type data in the initial data information; determine the type of chart to be generated based on the amount of string type information and the variation interval of digital type data in the initial data information.
[0151] Furthermore, the chart generation system disclosed in this embodiment may also include:
[0152] The display unit is used to display a second chart in response to the question information and initial data information input by the user.
[0153] The chart generation system disclosed in this embodiment is implemented based on the chart generation method disclosed in the above embodiment, which will not be described in detail here.
[0154] The chart generation system disclosed in the present embodiment obtains question information and initial data information input by a user. If the question information represents the generation of a chart from the initial data information using a large model, the question information and the initial data information are converted according to a target rule to obtain a converted target question and target data information; the target question and target data information are input into the large model to obtain a first chart generated by the large model based on the target question and target data information; the first chart is reversely converted according to the target rule to obtain a second chart, so that the data corresponding to the second chart matches the initial data information. When obtaining the question information and initial data information input by the user, this solution first determines whether the question information represents the need to use the big model to generate a chart from the initial data information. If so, the question information and the initial data information must first be converted according to the target rules, and the converted target question and target data information must be input into the big model. After the big model outputs the first chart, it is converted into the second chart according to the target rules. This ensures that what is input into the big model are the converted questions and data, and what the big model receives is not the question information and the initial data information, which effectively avoids the risk of data leakage and ensures data security. At the same time, after the big model generates the first chart, it can perform a reverse conversion to ensure that the final result is a second chart that matches the initial data information, thereby ensuring the accuracy of the data in the generated chart.
[0155] This embodiment discloses an electronic device, and its structural diagram is as follows: Figure 6 As shown, including:
[0156] Processor 61 and memory 62.
[0157] The processor 61 is used to obtain the question information and initial data information input by the user; if the question information represents the use of the large model to generate a chart from the initial data information, the question information and the initial data information are converted according to the target rule to obtain the converted target question and target data information; the target question and the target data information are input into the large model to obtain a first icon generated by the large model based on the target question and the target data information; the first icon is reversely converted according to the target rule to obtain a second chart, so that the data corresponding to the second chart matches the initial data information;
[0158] The memory 62 is used to store the programs required by the processor to execute the above processing procedures.
[0159] The electronic device disclosed in this embodiment is implemented based on the chart generating method disclosed in the above embodiment, which will not be described in detail here.
[0160] The electronic device disclosed in the present embodiment obtains question information and initial data information input by a user, and if the question information represents generating a chart from the initial data information using a large model, the question information and the initial data information are converted according to a target rule to obtain a converted target question and target data information; the target question and target data information are input into the large model to obtain a first chart generated by the large model based on the target question and target data information, and the first chart is reversely converted according to the target rule to obtain a second chart, so that the data corresponding to the second chart matches the initial data information. When obtaining the question information and initial data information input by the user, this solution first determines whether the question information represents the need to use the big model to generate a chart from the initial data information. If so, the question information and the initial data information must first be converted according to the target rules, and the converted target question and target data information must be input into the big model. After the big model outputs the first chart, it is converted into the second chart according to the target rules. This ensures that what is input into the big model are the converted questions and data, and what the big model receives is not the question information and the initial data information, which effectively avoids the risk of data leakage and ensures data security. At the same time, after the big model generates the first chart, it can perform a reverse conversion to ensure that the final result is a second chart that matches the initial data information, thereby ensuring the accuracy of the data in the generated chart.
[0161] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0162] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0163] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0164] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A method for generating a chart, comprising: Obtain question information and initial data information input by the user; If the question information represents generating a chart from the initial data information using the large model, the question information and the initial data information are converted according to the target rule to obtain the converted target question and target data information; Inputting the target question and the target data information into the macro model to obtain a first chart generated by the macro model based on the target question and the target data information; The first chart is reversely converted according to the target rule to obtain a second chart, so that data corresponding to the second chart matches the initial data information.
2. According to the method of claim 1, the step of converting the question information and the initial data information according to the target rule to obtain the converted target question and target data information comprises: Identify the question information and the initial data information, and determine different data field types in the question information and the initial data information; Determine a conversion rule in the target rule corresponding to each data field type in the different data field types; Each data field type in different data field types in the question information and the initial data information is converted according to corresponding conversion rules to obtain converted target question and target data information.
3. The method according to claim 2, wherein each data field type in different data field types in the question information and the initial data information is converted according to corresponding conversion rules to obtain converted target question and target data information, comprising: Determine the digital data in the question information and the initial data information, perform digital operations on the digital data according to the conversion rules corresponding to the digital data in the target rules, and obtain converted data; The converted data is used to replace the digital data in the question information and the initial data information to obtain the target question and target data information.
4. The method according to claim 3, wherein the step of replacing the digital data in the question information and the initial data information with the converted data to obtain the target question and the target data information comprises: Determine the information of the character string type in the question information and the initial data information, and perform character string conversion on the information of the character string type according to the conversion rule corresponding to the information of the character string type in the target rule to obtain converted information; The converted data and the converted information are combined according to the positions of the converted data and the converted information in the question information and the initial data information before the conversion, so as to obtain the converted target question and target data information.
5. The method according to claim 1, wherein if the question information representation generates a chart from the initial data information using the large model, the question information and the initial data information are converted according to the target rule to obtain the converted target question and target data information, comprising: If the question information represents the use of the big model to generate a chart from the initial data information, determine the type of the chart to be generated so that the type of the chart to be generated, the target question and the target data information are input into the big model to obtain a first chart output by the big model that conforms to the type of the chart to be generated.
6. The method according to claim 5, if the question information represents generating a chart from the initial data information using the large model, determining the type of the chart to be generated comprises: If it is determined that the question information represents the use of the large model to generate a first type of chart from the initial data information, determining that the type of the chart to be generated is the first type; If it is determined that the question information represents the use of the large model to generate a graph from the initial data information, the type of the graph to be generated is determined based on the attributes of the initial data information.
7. The method according to claim 6, wherein determining the type of the chart to be generated based on the attribute of the initial data information comprises: Determine the amount of string type information and the change range of digital type data in the initial data information; The type of the chart to be generated is determined based on the amount of string-type information in the initial data information and the variation interval of the digital-type data.
8. The method according to claim 1, further comprising: In response to the question information and initial data information input by the user, the second chart is displayed.
9. A chart generation system, comprising: An obtaining unit, used to obtain question information and initial data information input by the user; A first conversion unit is used to convert the question information and the initial data information according to a target rule to obtain a converted target question and target data information when determining that the question information represents the use of the large model to generate a chart from the initial data information; An input unit, used for inputting the target question and the target data information into the large model, and obtaining a first chart generated by the large model based on the target question and the target data information; The second conversion unit is used to reversely convert the first chart according to the target rule to obtain a second chart, so that the data corresponding to the second chart matches the initial data information.
10. An electronic device, comprising: A processor, used to obtain question information and initial data information input by the user; If the question information represents the use of the large model to generate a chart from the initial data information, the question information and the initial data information are converted according to the target rule to obtain the converted target question and target data information; the target question and target data information are input into the large model to obtain a first icon generated by the large model based on the target question and target data information; Reversely transforming the first icon according to the target rule to obtain a second chart, so that data corresponding to the second chart matches the initial data information; The memory is used to store the program required by the processor to execute the above processing process.