Movatterモバイル変換


[0]ホーム

URL:


CN119152072A - Chart generation method and device, storage medium and electronic equipment - Google Patents

Chart generation method and device, storage medium and electronic equipment
Download PDF

Info

Publication number
CN119152072A
CN119152072ACN202411618746.9ACN202411618746ACN119152072ACN 119152072 ACN119152072 ACN 119152072ACN 202411618746 ACN202411618746 ACN 202411618746ACN 119152072 ACN119152072 ACN 119152072A
Authority
CN
China
Prior art keywords
chart
data
target
information
elements
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411618746.9A
Other languages
Chinese (zh)
Inventor
梁博
杨亦威
韦庆龙
周航宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co LtdfiledCriticalBeijing Qihoo Technology Co Ltd
Priority to CN202411618746.9ApriorityCriticalpatent/CN119152072A/en
Publication of CN119152072ApublicationCriticalpatent/CN119152072A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The embodiment of the application discloses a chart generation method, a chart generation device, a storage medium and electronic equipment, wherein the method comprises the steps of obtaining chart description text input by a user, performing chart description language conversion processing through a chart processing large model based on the chart description text to obtain chart description sketch sentences, determining target vector graphic data corresponding to the chart description sketch sentences, performing chart drawing processing through a document object model based on the target vector graphic data to obtain target chart data, and displaying the target chart data to the user.

Description

Chart generation method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a chart generating method, a chart generating device, a storage medium, and an electronic device.
Background
With the rapid development of information technology, the data presentation mode and the information transfer efficiency become more and more important. The mind map is used as an effective chart form, and can help users intuitively express ideas, organize information and construct complex mind structures. In various fields of teaching, business, product development and the like, a chart of thinking, a flow chart, a lane chart and the like has become an indispensable tool. Currently, users usually draw a chart manually and then display the chart.
Disclosure of Invention
The embodiment of the specification provides a chart generation method, a chart generation device, a storage medium and electronic equipment, wherein the technical scheme is as follows:
in a first aspect, embodiments of the present disclosure provide a chart generating method, including:
Acquiring a chart description text input by a user;
performing graph description language conversion processing on the graph description text through a graph processing large model to obtain graph description sketch sentences, and determining target vector graphic data corresponding to the graph description sketch sentences;
performing graph drawing processing by adopting a document object model based on the target vector graph data to obtain target graph data;
and displaying the target chart data to the user.
In a possible implementation manner, the chart description language conversion processing is performed through a chart processing large model based on the chart description text to obtain a chart description sketch sentence, and determining target vector graphic data corresponding to the chart description sketch sentence includes:
Inputting the chart description text into a chart processing large model, determining chart structure information based on the chart description text through the chart processing large model, and performing chart description language conversion processing based on the chart structure information to obtain chart description sketch sentences;
and performing visual vector diagram format conversion on the diagram description sketch sentence to obtain target vector graphic data.
In a possible implementation manner, the performing visual vector diagram format conversion on the diagram description sketch sentence to obtain target vector graphic data includes:
And calling a browser service to create an HTML page, performing visual vector diagram rendering on the diagram description sketch statement in the HTML page to obtain a visual vector image, and outputting target vector graphic data aiming at the visual vector image.
In a possible implementation manner, the graph drawing processing is performed by adopting a document object model based on the target vector graph data to obtain target graph data, and the method comprises the following steps:
And analyzing the target vector graphic data by adopting a document object model to obtain chart element attribute information, determining a plurality of chart elements and element connection information in an image editing tool based on the chart element attribute information, and generating target chart data based on the chart elements and the element connection information.
In a possible implementation manner, the parsing the target vector graphic data with the document object model to obtain chart element attribute information, determining a plurality of chart elements and element connection information in an image editing tool based on the chart element attribute information, and generating target chart data based on the chart elements and element connection information includes:
analyzing the target vector graphic data to generate a document object model tree;
Traversing the document object model tree to obtain chart element attribute information and element connection information, and drawing a plurality of chart elements and element connection lines in an image editing tool based on the chart element attribute information and the element connection information;
And obtaining target chart data based on the chart elements and the element connecting lines.
In a possible implementation manner, the traversing the document object model tree to obtain chart element attribute information and element connection information, and drawing a plurality of chart elements and element connection lines in an image editing tool based on the chart element attribute information and the element connection information, including:
Determining chart element attribute information by traversing the document object model tree, and drawing a plurality of chart elements in an image editing tool based on the chart element attribute information;
and traversing the document object model tree to determine the element connection information, and carrying out connection association processing on the plurality of chart elements by adopting element connection lines based on the element connection information.
In a possible implementation manner, the connection association processing for the plurality of chart elements by adopting element connection lines based on the element connection information includes:
And determining connection line coordinate information based on the element connection information, determining reference chart elements to be connected and connection line distances from the plurality of chart elements based on the connection line coordinate information, and connecting the reference chart elements by adopting element connection lines based on the connection line distances.
In a second aspect, embodiments of the present disclosure provide a chart generating apparatus, including:
the input module is used for acquiring a chart description text input by a user;
The processing module is used for carrying out graph description language conversion processing on the graph description text through a graph processing large model to obtain graph description sketch sentences and determining target vector graph data corresponding to the graph description sketch sentences;
The drawing module is used for carrying out chart drawing processing by adopting a document object model based on the target vector graphic data to obtain target chart data;
And the display module is used for displaying the target chart data to the user.
In a possible embodiment, the processing module is configured to:
Inputting the chart description text into a chart processing large model, determining chart structure information based on the chart description text through the chart processing large model, and performing chart description language conversion processing based on the chart structure information to obtain chart description sketch sentences;
and performing visual vector diagram format conversion on the diagram description sketch sentence to obtain target vector graphic data.
In a possible embodiment, the processing module is configured to:
And calling a browser service to create an HTML page, performing visual vector diagram rendering on the diagram description sketch statement in the HTML page to obtain a visual vector image, and outputting target vector graphic data aiming at the visual vector image.
In a possible implementation manner, the drawing module is configured to:
And analyzing the target vector graphic data by adopting a document object model to obtain chart element attribute information, determining a plurality of chart elements and element connection information in an image editing tool based on the chart element attribute information, and generating target chart data based on the chart elements and the element connection information.
In a possible implementation manner, the drawing module is configured to:
analyzing the target vector graphic data to generate a document object model tree;
Traversing the document object model tree to obtain chart element attribute information and element connection information, and drawing a plurality of chart elements and element connection lines in an image editing tool based on the chart element attribute information and the element connection information;
And obtaining target chart data based on the chart elements and the element connecting lines.
In a possible implementation manner, the drawing module is configured to:
Determining chart element attribute information by traversing the document object model tree, and drawing a plurality of chart elements in an image editing tool based on the chart element attribute information;
and traversing the document object model tree to determine the element connection information, and carrying out connection association processing on the plurality of chart elements by adopting element connection lines based on the element connection information.
In a possible implementation manner, the drawing module is configured to:
And determining connection line coordinate information based on the element connection information, determining reference chart elements to be connected and connection line distances from the plurality of chart elements based on the connection line coordinate information, and connecting the reference chart elements by adopting element connection lines based on the connection line distances.
In a third aspect, the present description provides a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-described method steps.
In a fourth aspect, the present description provides an electronic device, which may comprise a processor and a memory, wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-described method steps.
The technical scheme provided by some embodiments of the present specification has the following beneficial effects:
In one or more embodiments of the present disclosure, a natural language chart description text input by a user is automatically converted into a chart description sketch sentence through a chart processing large model, corresponding target vector graphic data is generated, chart rendering is performed through a document object model, automatic, precise and efficient chart generation is realized, and a final chart is displayed to the user. The whole process simplifies the chart making process, does not need manual drawing by a user, can automatically generate a complex chart by only inputting corresponding chart description text by the user, greatly improves the efficiency and accuracy of generating the complex chart, and can also support further editing and customization of the chart.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic view of a scenario of a chart generation system provided in an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart of a chart generation method according to an embodiment of the present disclosure;
FIG. 3 is an exemplary diagram of a schematic diagram description statement provided by an embodiment of the specification;
FIG. 4 is an exemplary diagram of a schematic diagram description statement provided by an embodiment of the specification;
FIG. 5 is a schematic diagram of target chart data provided by an embodiment of the present disclosure;
FIG. 6 is a schematic flow chart of a graph processing method according to an embodiment of the present disclosure;
Fig. 7 is a flow chart of a line graph drawing processing method according to an embodiment of the present disclosure;
FIG. 8 is a schematic flow chart diagram of a chart drawing processing method according to an embodiment of the present disclosure;
fig. 9 is a schematic structural view of a chart generating apparatus provided in the embodiment of the present specification;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
FIG. 11 is a schematic diagram of an operating system and user space provided by an embodiment of the present disclosure;
FIG. 12 is an architecture diagram of the android operating system of FIG. 11;
FIG. 13 is an architecture diagram of the IOS operating system of FIG. 11.
Detailed Description
The technical solutions of the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
In the description of the present specification, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present specification, it should be noted that, unless expressly specified and limited otherwise, "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus. The specific meaning of the terms in this specification will be understood by those of ordinary skill in the art in the light of the specific circumstances. In addition, in the description of the present specification, unless otherwise indicated, "a plurality" means two or more. "and/or" describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate that there are three cases of a alone, a and B together, and B alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
In the related art, manually drawing a chart is not only time consuming and laborious, but also as the amount of information increases, the complexity of the chart increases, and the efficiency and accuracy of manual drawing are difficult to ensure. In order to improve the efficiency of generating a graph, a method of automatically generating a graph is required.
The present specification is described in detail below with reference to specific examples.
Fig. 1 is a schematic view of a scenario of a chart generating system according to an embodiment of the present application. As shown in fig. 1, the graph generation system may include at least a client cluster and a service platform 100.
In some embodiments, the client cluster may include at least one client, as shown in fig. 1, specifically including a client 1 corresponding to a user 1, a client 2 corresponding to a user 2, and a client n corresponding to a user n, where n is an integer greater than 0.
Each client in the client cluster may be a communication enabled electronic device including, but not limited to, a wearable device, a handheld device, a personal computer, a tablet, a vehicle mount device, a smart phone, a computing device, or other processing device connected to a wireless modem, etc. The electronic devices in different networks may be called different names, such as user equipment, access terminals, subscriber units, subscriber stations, mobile stations, remote terminals, mobile devices, user terminals, wireless communication devices, user agents or user equipment, cellular telephones, cordless telephones, personal Digital Assistants (PDAs), electronic devices in 5G networks or future evolution networks, etc.
In some embodiments, the service platform 100 may be a separate server device, such as a rack-mounted, blade, tower-type, or cabinet-type server device, or a hardware device with a relatively high computing power, such as a workstation, a mainframe, or the like, or may be a server cluster formed by a plurality of servers, where each server in the service cluster may be formed in a symmetrical manner, where each server is functionally equivalent and functionally equivalent in a transaction link, and each server may separately provide services to the outside, and the separately providing services may be understood as not requiring assistance of another server.
In one or more embodiments of the present description, the service platform 100 may establish a communication connection with at least one client in the client cluster, based on which interaction of data in the chart generation process is completed.
For example, a user may send a graph description text to the service platform 100 through a client, the service platform 100 may receive the graph description text input by the user, perform graph description language conversion processing through a graph processing large model based on the graph description text to obtain graph description sketch sentences, determine target vector graphic data corresponding to the graph description sketch sentences, and perform graph drawing processing through a document object model based on the target vector graphic data to obtain target graph data;
for another example, service platform 100 presents the target chart data to the user of the client.
It should be noted that, the service platform 100 establishes a communication connection with at least one client in the client cluster through a network for interactive communication, where the network may be a wireless network, or may be a wired network, where the wireless network includes, but is not limited to, a cellular network, a wireless local area network, an infrared network, or a bluetooth network, and the wired network includes, but is not limited to, an ethernet network, a universal serial bus (universal serial bus, USB), or a controller area network. In one or more embodiments of the specification, techniques and/or formats including HyperText Mark-up Language (HTML), extensible markup Language (Extensible Markup Language, XML), and the like are used to represent data exchanged over a network (e.g., a target compression package). All or some of the links may also be encrypted using conventional encryption techniques such as secure sockets layer (Secure Socket Layer, SSL), transport layer security (Transport Layer Security, TLS), virtual private network (Virtual Private Network, VPN), internet protocol security (Internet Protocol Security, IPsec), etc. In other embodiments, custom and/or dedicated data communication techniques may also be used in place of or in addition to the data communication techniques described above.
The embodiment of the chart generation system provided in the present disclosure belongs to the same concept as the chart generation method described in one or more embodiments, and the execution subject corresponding to the chart generation method related in one or more embodiments in the present disclosure may be an electronic device, which may be the service platform 100 or the client, and is specifically determined based on an actual application environment. The specific implementation process of the embodiment of the presentation file generation system may be described in the following method embodiments, which are not described herein.
In one embodiment, as shown in fig. 2, a graph generation method is specifically proposed, which may be implemented in dependence on a computer program, and may be run on a graph generation device based on von neumann system. The computer program may be integrated in the application or may run as a stand-alone tool class application. The chart generating means may be an electronic device.
Specifically, the chart generation method includes:
s102, acquiring a chart description text input by a user;
In this specification, the supported graph types of the automatically generated graph include, but are not limited to, fitting of one or more of a mind map, a flow chart, a time sequence diagram, a class diagram, a time cycle diagram, a Gantt chart, an entity relationship diagram, a state diagram, and the like, so as to meet the user requirements of different application scenarios.
Traditional chart generation relies on manual operations to gradually draw graphics, add text, and define connections through visualization tools (e.g., mind map software, flow chart software, etc.). Not only is time consuming, but also maintenance and modification of complex charts, such as multi-level, multi-branched mind charts, becomes very difficult. One or more chart generation schemes are specifically referred to based on the present specification to improve or even completely solve the above-mentioned problems.
Illustratively, the electronic device receives chart description text entered by a user. Chart description text is typically a user's natural language description of a chart or text input that generates a demand based on a particular chart. For example, the user may enter "show a flow chart for login verification flow". The chart description text description represents preliminary assumptions or requirements of the chart that the user wants to generate.
S104, carrying out graph description language conversion processing on the graph description text through a graph processing large model to obtain graph description sketch sentences, and determining target vector graph data corresponding to the graph description sketch sentences;
The graph processing big model can be obtained after model training is carried out on a graph processing scene based on a basic big model (Large Language Model, LLM for short), and the basic big model is an artificial intelligent content generation model and aims at understanding and generating human language. LLM trains on a large amount of data and can perform a wide range of tasks including text summarization, translation, emotion analysis, and the like. Alternatively, the basic large model may employ a sense thousands large model, a lark large model, a GPT system large model, or the like. The trained graphic processing large model can automatically analyze and convert at least the graphic description text into graphic description sketches, and in some embodiments, the graphic processing large model can further determine target vector graphic data corresponding to the graphic description sketches.
The diagram description sketch sentence is a simple preset diagram description language which is used for defining a diagram to be generated in a text character description mode, and the grammar used by the diagram description sketch sentence is concise and suitable for quickly generating various diagrams, such as a flow chart, a time sequence chart, a Gantt chart and the like. The grammar of the diagram description sketch sentence is simple, and is very suitable for being converted into vector graphic data at the subsequent time so as to quickly create a visual diagram. The preset chart description language describing the graph structure used by the chart description schematic sentence comprises, but is not limited to, one or more of Mermaid description language, DOT description language, plantUML description language and the like;
Optionally, in some embodiments, the schematic diagram statement may be generated following Mermaid description language, the schematic diagram syntax of the schematic diagram description language Mermaid may avoid that only the chart graphics can be generated in a flow manner, the graphics such as class diagrams and time sequence diagrams cannot be generated, the grammar is complex, and the time for generating the large graph processing model is shorter;
The target vector graphic data is data adopting a visualized vector graphic data format (Scalable Vector Graphics, SVG), also can be called target SVG data, is a vector graphic format based on extensible markup language (XML), has the characteristics of scalability and independent resolution, is widely used for graphic presentation in a webpage, and is used for drawing graphics which can be infinitely amplified and not distorted.
Illustratively, the chart description text entered by the user is understood and converted using a chart processing large model. The specific graphic processing large model is to convert the graphic description text of the natural language description into graphic description language, such as Mermaid sentences, and generally the graphic processing large model can analyze the graphic description text of a user and extract analysis information such as core information, structural logic and the like. For example, the "display login verification process" may be parsed into a series of step nodes and conditional branches, and according to the parsing information, the chart processing large model automatically generates chart structure information based on the parsing information and converts the chart structure information into a corresponding chart description sentence, such as Mermaid sentences. Mermaid is a textual diagram description language supporting the generation of flowcharts, timing diagrams, and the like. Further, the generated graphic sketch statement such as the graphic sketch statement and the Mermaid statement is determined to be converted into the target vector graphic data (such as SVG data) through a rendering engine (usually using a browser or a headless browser, such as Puppeteer) of Mermaid, so that the graphic sketch statement is applicable to visual presentation of graphic charts.
After the user inputs the chart description text a, the chart description text a can be a programming master, namely, you can initially generate chart description sketch sentences by writing codes of a preset chart description language such as mermaid codes to realize the thinking guide chart, and further determine vector graphic data to assist in generating the chart;
The diagram description text input by the user is understood and converted by using a diagram processing big model, and is shown by a user, as shown in fig. 3, fig. 3 is an exemplary diagram of a diagram description sketch sentence, in fig. 3, the diagram processing big model is that diagram description text a described by natural language is understood, a diagram architecture (also called diagram structure information) is automatically generated, and then the diagram architecture is converted into the diagram description sketch sentence, so that the diagram description sketch sentence shown in fig. 3 is obtained.
FIG. 3 illustrates the logic relationship between the core flow and the various steps of planning an activity. The following is a main step explanation of the diagram description sketch sentence-Mermaid code:
1. Core flow of planning activities (node a) all activity planning steps begin here, defining the overall planning framework for the activity.
2. The determination of the activity target (node B), which is the first key step in the activity planning, clarifies the purpose and the desired effect of the activity.
3. The planning of the activity (node C) includes planning the time, place, budget, content and form of the activity in detail, ensuring that each link of the activity is carefully scheduled. The main composition is that the activity time and place are determined (node D) and the activity budget is determined (node E) and the activity content and form are determined (node F)
4. The team of activities (node G) is organized to build a team to perform the tasks in the plan and to define the responsibilities of the team members. The main composition is to determine team members (node H) to distribute team tasks (node I)
5. Propaganda promotion (joint J) establishes effective propaganda strategy, selects proper channel, and prepares propaganda material to promote the activity. Mainly comprises the steps of making a propaganda strategy (node K) and selecting a propaganda channel (node L) to manufacture propaganda materials (node M)
6. The execution of the activity (node N) ensures that the activity is scheduled to be executed, coordinating the activities of the venue, the process and the participants. The main components are that preparing the activity site and the equipment (node O) organize the activity flow (node P) to coordinate the activity participator (node Q)
7. Assessing the effect of the activity (node R) after the end of the activity, the effect of the activity is assessed by collecting feedback and analyzing the data. The main components are that collecting participant feedback (node S) analyzes activity data (node T)
Summarizing Activity experience (node U)
8. The activity plan (node V) is improved by adjusting and optimizing future activity plan flows based on activity feedback, ensuring continued improvement. Optimizing an activity flow (node X) based on a feedback adjustment plan (node W)
Promote activity effect (node Y)
The flow chart depicted by the schematic diagram statement shown in fig. 3 clearly illustrates the main steps of planning, executing and evaluating an activity, helping a user to advance the activity planning work in an orderly fashion. Further, the user can edit and modify the diagram statement, and after the user confirms or the electronic device confirms automatically, the diagram processing large model can automatically execute and determine the target vector graphic data corresponding to the diagram statement.
S106, performing graph drawing processing by adopting a document object model based on the target vector graph data to obtain target graph data;
Illustratively, the generated target vector graphics data is processed using a document object model (DOM model) to draw a chart. Target vector graphics data such as SVG (scalable vector graphics) is an XML-based format in which each element (e.g., rectangle, line, text, etc.) in a graph can be parsed and manipulated through the DOM tree.
Illustratively, the target vector graphics data is parsed first, which is essentially a DOM tree, using a DOM parsing tool (e.g., document Object Model of JavaScript). Each graphic element is a node which can be operated to extract the information of the graphic elements such as the structure, the coordinates, the text and the like of the graphic, then drawing a chart according to the information of the graphic elements, and drawing the chart on a page according to the coordinates and the element types in the target vector graphic data. The drawing can also be performed by customizing patterns, such as node colors, text colors, line patterns and the like.
The target chart data supports editing and modification, i.e., the chart can be further processed, such as dynamically adjusting nodes, adding additional chart information, or adjusting chart styles according to user needs.
S108, displaying the target chart data to the user.
The generated chart data is presented to the user, the user can see the target chart data automatically generated based on the descriptive text, and the chart mode of the target chart data supports an editable mode and a chart file output mode.
For example, the target chart data may be directly presented by way of a web page, and the SVG graphics corresponding to the target chart data are displayed using the < img > tag or the < SVG > tag of HTML.
For another example, the electronic device may automatically perform chart file output, i.e., the generated charts may be downloaded by the user in SVG files or other formats (e.g., PNG, PDF).
For another example, the user may also interact with the target chart data through the front-end interface to perform data adjustment, such as dragging nodes, modifying text, adjusting connecting lines, etc., and the user may further modify and save the generated chart.
After the user inputs the chart description text b, the chart description text b can be, for example, a programming master, and you can initially generate chart description sketch sentences by writing codes of a preset chart description language such as mermaid codes to realize the thinking guide, and further determine vector graphic data to assist in generating charts, wherein you need to generate a thinking guide about project processing, and you need to consider each link from the stand to the end of the project, understand and convert the chart description text input by the user by using a chart processing big model, and show the chart description text to the user, as shown in fig. 4, fig. 4 is an example diagram of a chart description sketch sentence, and in fig. 4, the chart processing big model is an example diagram of a chart description sketch sentence which is described by natural language, automatically generates a chart architecture, and then converts the chart architecture into the chart description sketch sentence, so as to obtain the chart description sketch sentence shown in fig. 4. The chart shown in fig. 4 depicts a flow chart corresponding to the sketch statement, including the steps of project stand, review, execution, problem solving, acceptance, tie, termination, and project closing. Further, the user can edit and modify the schematic diagram statement of fig. 4, and after the user confirms or the electronic device confirms automatically, the large model of the diagram processing can automatically execute the determination of the target vector graphic data corresponding to the schematic diagram statement. As shown in FIG. 5, FIG. 5 is a schematic diagram of target chart data, and in FIG. 5, main steps and decision flow of item management in automatically generated target chart data are shown, a complete management process from starting, evaluating, executing, checking and accepting to the final item or ending of an item is reflected, decision nodes in evaluating and checking and accepting and problem solving steps in the item are emphasized, and smooth proceeding of the item is ensured.
In one or more embodiments of the present disclosure, a natural language chart description text input by a user is automatically converted into a chart description sketch sentence through a chart processing large model, corresponding target vector graphic data is generated, chart rendering is performed through a document object model, automatic, precise and efficient chart generation is realized, and a final chart is displayed to the user. The whole process simplifies the chart making process, does not need manual drawing by a user, can automatically generate a complex chart by only inputting corresponding chart description text by the user, greatly improves the efficiency and accuracy of generating the complex chart, and can also support further editing and customization of the chart.
Optionally, referring to fig. 6, fig. 6 is a schematic flow chart of a graph processing method set forth in the present specification. Specifically, the graph description text is executed to perform graph description language conversion processing through a graph processing large model to obtain a graph description sketch sentence, and the target vector graphic data corresponding to the graph description sketch sentence is determined by referring to the following manner:
S202, inputting the diagram description text into a diagram processing large model, determining diagram structure information based on the diagram description text through the diagram processing large model, and performing diagram description language conversion processing based on the diagram structure information to obtain diagram description sketch sentences;
Chart structure information can be understood as chart logic and chart layout structures automatically generated by a large model based on user input chart description text, and the chart structure information defines relationships, layers and layouts among various elements in a chart and the arrangement mode of specific chart elements, and the chart structure information comprises, but is not limited to, node (element) information, relationships among nodes, hierarchical structures, arrangement and layout of nodes and attributes of nodes.
Example assuming that the chart description text entered by the user is "plan a flow of an activity, including determine goals, organize teams, campaigns, executions, and evaluations," the chart processing big model automatically generates determined chart result information may include the following:
node information, determining targets, organizing teams, campaigns, executions, evaluations, etc., are nodes in the flow chart.
The relation among the nodes is that the steps are sequenced, and the steps of target determination, team organization, campaign execution and assessment are performed.
Hierarchical structure some steps may have subtasks, such as subtasks under a campaign to make policies, select channels, etc.
Layout the flow chart may be in a top-to-bottom or left-to-right arrangement depending on the type of chart.
The attribute that each node may represent its importance or status in a different color or shape, e.g., green for completion and yellow for ongoing.
Illustratively, a chart description text entered by a user is entered into a chart processing large model. The big graphic processing model analyzes key graphic information in the text based on natural language description in the inputted graphic description text, generates graphic structure information based on the key graphic information (such as graphic type, user graphic requirement and the like), and generates corresponding graphic description language such as Mermaid sentences according to the graphic structure information.
And S204, performing visual vector diagram format conversion on the diagram description sketch sentence to obtain target vector graphic data.
After the diagram description language (such as Mermaid sentence) is generated, the diagram description language may be selectively presented to the user, further, it is determined that the generated diagram description schematic sentence corresponds to the target vector graphic data, and the diagram description schematic sentence such as Mermaid sentence is converted into the target vector graphic data (such as SVG data) through the rendering engine of Mermaid (typically using a browser or headless browser, such as Puppeteer), that is, the diagram description schematic sentence is further converted into the visualized vector graphic format to obtain the target vector graphic data, such as SVG. SVG is a scalable vector graphics format suitable for displaying charts in high resolution in web pages or applications.
In a possible implementation manner, the visual vector diagram format conversion of the diagram description sketch sentence to obtain the target vector graphic data may be as follows:
And calling a browser service to create an HTML page, performing visual vector diagram rendering on the diagram description sketch statement in the HTML page to obtain a visual vector image, and outputting target vector graphic data aiming at the visual vector image.
Further, the target vector graphic data corresponding to the generated diagram statement, and diagram statement such as Mermaid statement, etc. are converted into target vector graphic data (such as SVG data) by a rendering engine (usually using a browser or headless browser, such as Puppeteer) of a preset diagram description language (such as Mermaid), so that the method is suitable for visual presentation of diagram graphics.
By way of example, the following describes a model training process for graphically processing a large model:
1. acquiring a basic large language model, and creating an initial demonstration template processing large model aiming at a chart processing scene based on the basic large language model;
The basic large model (Large Language Model, LLM for short) is an artificial intelligence content generation model, which aims at understanding and generating human language. LLM trains on a large amount of data and can perform a wide range of tasks including text summarization, translation, emotion analysis, and the like. Alternatively, the basic large model may employ a sense thousands large model, a lark large model, a GPT system large model, or the like.
2. Acquiring a sample chart description text of a sample user, calling expert terminal service to label the sample chart description text with an output result label, wherein the output result label comprises, but is not limited to, fitting of one or more of a chart description sketch sentence label and a vector graphic data label;
3. And in the model back propagation training process, calculating comprehensive model loss at least based on the predicted graph description text and graph description sketch sentence labels, and carrying out parameter adjustment on the initial graph processing large model by adopting the comprehensive model loss until model training conditions are met to obtain the graph processing large model.
Specifically, the first model loss can be calculated based on the predictive graph description text and the graph description sketch sentence label, and the first model loss is taken as the comprehensive model loss;
Optionally, calculating a first model loss based on the predictive graph description text and the graph description sketch sentence label, calculating a second model loss based on the predictive vector graphic data and the vector graphic data label, and obtaining a comprehensive model loss based on the first model loss and the second model loss;
Alternatively, the first model loss and the second model loss may be obtained using model loss calculation functions in the related art, for example, the model loss calculation functions include, but are not limited to, any one of hinge loss functions, contrast loss functions, euclidean distance loss functions, cross entropy loss functions, and the like.
Optionally, the model ending training condition may include that the value of the loss function is smaller than or equal to a preset loss function threshold, the iteration number reaches a preset number of times threshold, and the like. The model end training conditions may be determined based on actual conditions and are not particularly limited herein.
In one or more embodiments of the present disclosure, the complexity of user input is simplified in the manner described above, the user need only describe the requirements of the chart in natural language, the chart process large model can automatically parse and generate structured chart description language, by converting the sketch sentence into vector graphic data (e.g., SVG), ensure that the chart can be clearly displayed at different devices and resolutions, and provide the possibility of further editing and adjustment.
Optionally, executing the graph drawing processing based on the target vector graphic data by using a document object model to obtain target graph data may adopt the following manner:
And analyzing the target vector graphic data by adopting a document object model to obtain chart element attribute information, determining a plurality of chart elements and element connection information in an image editing tool based on the chart element attribute information, and generating target chart data based on the chart elements and the element connection information.
The document object model may also be referred to as a DOM model;
Illustratively, the document object model is employed to parse the target vector graphics data into a DOM object, for example, using the Java 'Java. Xml. Parameters. DocurtuilderFactoy' method to parse the target vector graphics data and generate the DOM object. The object vector graphic data is essentially an XML document, elements and labels in the SVG file can be traversed through DOM model analysis, when the object vector graphic data is analyzed, a plurality of chart elements and element connection information are filtered through label names and attributes, and then object chart data is generated based on the object vector graphic data, such as < rect > labels needing to be extracted or labels with specific attributes (such as class= "label"). This step extracts information such as coordinates, size, shape, text, etc. of the graphics.
Referring to fig. 7, fig. 7 is a flow chart illustrating a line graph drawing processing method according to the present disclosure. Specifically, the analyzing the target vector graphic data by using the document object model to obtain chart element attribute information, determining a plurality of chart elements and element connection information in an image editing tool based on the chart element attribute information, and generating target chart data based on the chart elements and element connection information may be performed in the following manner:
S3002, analyzing the target vector graphic data to generate a document object model tree;
Illustratively, the electronic device parses target vector graphics data (e.g., SVG data) and generates a document object model tree (DOM tree). SVG files are essentially XML-based vector graphics formats, generating DOM trees amounts to structuring SVG data into a tree structure that contains individual elements (e.g., graphics, lines, text, etc.). Each graphic element (e.g., rectangle, circle, line) is stored as a node in the DOM tree.
The DOM tree is generated, so that the subsequent operation on each element (such as nodes and connecting lines) in the chart is more convenient, and the program can traverse and extract specific information of the graph, such as the coordinates, the size, the color and the like of the graph.
S3004, traversing the document object model tree to obtain chart element attribute information and element connection information, and drawing a plurality of chart elements and element connection lines in an image editing tool based on the chart element attribute information and the element connection information;
the chart element attribute information can be understood as specific coordinate information, size, shape and other chart element attribute information of each chart element;
the element connection information may be understood as connection information between elements, such as connection distance, connection pattern, etc.;
Schematically, the electronic device traverses the document object model tree, and extracts specific coordinate information, size, shape and other chart element attribute information of each chart element and element connection information among the elements. Based on these chart element attribute information and the element connection information, the electronic device draws corresponding chart elements (e.g., nodes, boxes, etc.) and connection lines in the image editing tool. The chart element attribute information determines the position of the elements in the chart, and the element connection information determines the relationships between the elements, such as arrows between steps in the flowchart.
Optionally, referring to fig. 8, fig. 8 is a flowchart of another chart drawing processing method, specifically executing the traversing the document object model tree to obtain chart element attribute information and element connection information, and drawing a plurality of chart elements and element connection lines in an image editing tool based on the chart element attribute information and the element connection information, which may refer to the following embodiments:
S4002, traversing the document object model tree to determine chart element attribute information, and drawing a plurality of chart elements in an image editing tool based on the chart element attribute information;
First, the electronic device traverses a document object model tree (DOM tree) from which attribute information for each chart element is extracted. The attribute information includes the type (e.g., rectangle, circle, etc.), size, location, color, text content, etc. of the element. The system automatically draws corresponding chart elements in the image editing tool according to the attribute information. For example, an element may be a step node in a flowchart, and its attribute information may include position coordinates, text descriptions, and shapes of the elements, a "nasdanika. Drawio" function method may be used to generate a draw. Io graphic corresponding to the chart element, and a color, a border color, a text color, and the like of the graphic may be set.
In this way, it is ensured that each element in the chart can be correctly drawn based on its attribute information, including its specific visual style, size and position. The user does not need to manually draw chart elements, so that the efficiency of chart generation is greatly improved.
S4004, traversing the document object model tree to determine the element connection information, and carrying out connection association processing on the plurality of chart elements by adopting element connection lines based on the element connection information.
Next, the electronic device traverses the DOM tree again, extracting element connection information between the various chart elements. Element connection information generally defines logical relationships between elements (e.g., step connections in a flowchart, node hierarchies in a mind map, etc.). And drawing connecting lines in the image editing tool according to the element connection information, and associating related chart elements. The flow, hierarchy or data flow in the graph can be clearly shown through the connecting lines.
By automatically drawing connecting lines and associating chart elements, the generated chart not only has independent elements, but also can accurately show the relationship and logic among the elements. The resulting graph can fully represent the structure of the data or flow.
In the present specification, by the above-described method, not only the attribute information of the chart element can be extracted, but also the visualized chart element can be automatically generated, and the connection line can be generated and the association process can be performed according to the relationship information between the elements. The process greatly simplifies the manual drawing of the chart, ensures that the generated chart accurately reflects the demands of users, and has good logic structure and visualization effect.
And S3006, obtaining target chart data based on the chart elements and the element connecting lines.
Final target chart data can be generated from previously drawn chart elements and element connection lines. The target chart data may be in a particular file format (e.g., draw. Io file, SVG file) and may be further manipulated in an image editing tool. Therefore, all elements and connection relations thereof are integrated, and the generated chart is ensured to be complete and meets the requirements of users. The user can edit, save or export based on the automatically generated chart data, thereby facilitating subsequent use and modification. This step may also be output according to different format requirements, for example generating an editable file for use by the user in an image editing tool.
In a possible implementation manner, the connection association processing is performed on the plurality of chart elements by adopting element connection lines based on the element connection information, and the following manner may be referred to:
And determining connection line coordinate information based on the element connection information, determining reference chart elements to be connected and connection line distances from the plurality of chart elements based on the connection line coordinate information, and connecting the reference chart elements by adopting element connection lines based on the connection line distances.
Illustratively, first, the coordinate information of the start point and the end point of each connection line is determined based on the extracted element connection information. These connecting lines typically represent logical relationships between various elements in the diagram, such as step connections in a flowchart or hierarchical relationships in a mind map. In determining the coordinates, the system analyzes the position of each chart element and generates accurate coordinates for the connection lines to ensure that the start and end points of the connection lines respectively correspond to the correct chart elements
Then, after determining the coordinate information of the connection line, the electronic device may parse the distances between the coordinates of the start and end points of the connection line and the chart elements to determine the reference chart elements to which the connection line should be connected. For example, it is common to ensure that a connection line is accurately connected to the correct chart element by calculating the distance between the start and end points of the connection line and the nearest chart element. The system will traverse the elements, find the element closest to the connection line, and take it as the reference point for the connection.
Finally, determining the distance that the connecting line should be connected with the reference chart element and the connecting line, and the electronic equipment can automatically generate the connecting line and perform connection processing based on the reference chart element and the connecting line distance. The connecting lines correlate the chart elements of the starting point and the ending point to form a logic or hierarchical relationship in the chart. The resulting connection lines may be straight lines, curved lines or lines with directional arrows, depending on the requirements and design of the graph.
In one or more embodiments of the present disclosure, the simplicity of the sketch statement is utilized to render the sketch statement into SVG through a browser service such as Puppeteer and a preset table description sketch speech plug-in, and then the coordinates and connection information of the graph are obtained through analysis of the document object model. And then performing two steps of processing, namely performing first traversal to generate a graph, performing second traversal to generate a connecting line, and finally generating the editable target chart data. The process is highly automated and provides flexible theme selection and subsequent editing functions.
The chart generating apparatus provided in the embodiment of the present specification will be described in detail with reference to fig. 9. Note that, the chart generating device shown in fig. 9 is used to execute the method of the embodiment shown in fig. 1 to 8 of the present specification, and for convenience of explanation, only the portion relevant to the embodiment of the present specification is shown, and specific technical details are not disclosed, please refer to the embodiment shown in fig. 1 to 8 of the present specification.
Referring to fig. 9, a schematic diagram of the chart generating apparatus according to the embodiment of the present specification is shown. The chart generating apparatus 1 may be realized as all or a part of the apparatus by software, hardware, or a combination of both. According to some embodiments, the chart generating device 1 comprises an input module 11, a processing module 12, a drawing module 13 and a presentation module 1, specifically for:
an input module 11, configured to obtain a chart description text input by a user;
the processing module 12 is configured to perform a graph description language conversion process through a graph processing large model based on the graph description text to obtain a graph description sketch sentence, and determine target vector graphic data corresponding to the graph description sketch sentence;
A drawing module 13, configured to perform graph drawing processing by using a document object model based on the target vector graphic data to obtain target graph data;
and a display module 14, configured to display the target chart data to the user.
In a possible embodiment, the processing module 12 is configured to:
Inputting the chart description text into a chart processing large model, determining chart structure information based on the chart description text through the chart processing large model, and performing chart description language conversion processing based on the chart structure information to obtain chart description sketch sentences;
and performing visual vector diagram format conversion on the diagram description sketch sentence to obtain target vector graphic data.
In a possible embodiment, the processing module 12 is configured to:
And calling a browser service to create an HTML page, performing visual vector diagram rendering on the diagram description sketch statement in the HTML page to obtain a visual vector image, and outputting target vector graphic data aiming at the visual vector image.
In a possible embodiment, the drawing module 13 is configured to:
And analyzing the target vector graphic data by adopting a document object model to obtain chart element attribute information, determining a plurality of chart elements and element connection information in an image editing tool based on the chart element attribute information, and generating target chart data based on the chart elements and the element connection information.
In a possible embodiment, the drawing module 13 is configured to:
analyzing the target vector graphic data to generate a document object model tree;
Traversing the document object model tree to obtain chart element attribute information and element connection information, and drawing a plurality of chart elements and element connection lines in an image editing tool based on the chart element attribute information and the element connection information;
And obtaining target chart data based on the chart elements and the element connecting lines.
In a possible embodiment, the drawing module 13 is configured to:
Determining chart element attribute information by traversing the document object model tree, and drawing a plurality of chart elements in an image editing tool based on the chart element attribute information;
and traversing the document object model tree to determine the element connection information, and carrying out connection association processing on the plurality of chart elements by adopting element connection lines based on the element connection information.
In a possible embodiment, the drawing module 13 is configured to:
And determining connection line coordinate information based on the element connection information, determining reference chart elements to be connected and connection line distances from the plurality of chart elements based on the connection line coordinate information, and connecting the reference chart elements by adopting element connection lines based on the connection line distances.
It should be noted that, when the chart generating apparatus provided in the foregoing embodiment performs the chart generating method, only the division of the foregoing functional modules is used as an example, and in practical application, the foregoing functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the chart generating device and the chart generating method embodiment provided in the foregoing embodiments belong to the same concept, which embody the detailed implementation process in the method embodiment, and are not repeated here.
The foregoing embodiment numbers of the present specification are merely for description, and do not represent advantages or disadvantages of the embodiments.
In one or more embodiments of the present disclosure, a natural language chart description text input by a user is automatically converted into a chart description sketch sentence through a chart processing large model, corresponding target vector graphic data is generated, chart rendering is performed through a document object model, automatic, precise and efficient chart generation is realized, and a final chart is displayed to the user. The whole process simplifies the chart making process, does not need manual drawing by a user, can automatically generate a complex chart by only inputting corresponding chart description text by the user, greatly improves the efficiency and accuracy of generating the complex chart, and can also support further editing and customization of the chart.
The embodiment of the present disclosure further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are adapted to be loaded by a processor and execute the chart generating method according to the embodiment shown in fig. 1 to 8, and the specific execution process may refer to the specific description of the embodiment shown in fig. 1 to 8, which is not repeated herein.
The present disclosure further provides a computer program product, where at least one instruction is stored in the computer program product, where the at least one instruction is loaded by the processor and executed by the processor to perform the chart generating method according to the embodiment shown in fig. 1 to 8, and the specific execution process may refer to the specific description of the embodiment shown in fig. 1 to 8, which is not repeated herein.
Referring to fig. 10, a block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown. An electronic device in this specification may include one or more of a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and lines to connect various portions of the overall electronic device, perform various functions of the electronic device, and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in at least one hardware form of Digital Signal Processing (DSP), field-programmable gate array (FPGA), programmable logic array (programmable logic Array, PLA). The processor 110 may integrate one or a combination of several of a central processing unit (central processing unit, CPU), an image processor (graphics processing unit, GPU), a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like, the GPU is used for rendering and drawing display contents, and the modem is used for processing wireless communication. It will be appreciated that the modem may not be integrated into the processor 110 and may be implemented solely by a single communication chip.
The memory 120 may include a random access memory (random Access Memory, RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer readable medium (non-transitory computer-readable storage medium). Memory 120 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, which may be an Android (Android) system, including an Android system-based deep development system, an IOS system developed by apple corporation, including an IOS system-based deep development system, or other systems, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the electronic device in use, such as phonebooks, audiovisual data, chat log data, and the like.
Referring to FIG. 11, the memory 120 may be divided into an operating system space in which the operating system runs and a user space in which native and third party applications run. In order to ensure that different third party application programs can achieve better operation effects, the operating system allocates corresponding system resources for the different third party application programs. However, the requirements of different application scenes in the same third party application program on system resources are different, for example, the third party application program has higher requirements on disk reading speed in a local resource loading scene, and the third party application program has higher requirements on GPU performance in an animation rendering scene. The operating system and the third party application program are mutually independent, and the operating system often cannot timely sense the current application scene of the third party application program, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third party application program.
In order to enable the operating system to distinguish specific application scenes of the third-party application program, data communication between the third-party application program and the operating system needs to be communicated, so that the operating system can acquire current scene information of the third-party application program at any time, and targeted system resource adaptation is performed based on the current scene.
Taking an operating system as an Android system as an example, as shown in fig. 12, a program and data stored in the memory 120 may be stored in the memory 120 with a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360 and an application layer 380, where the Linux kernel layer 320, the system runtime library layer 340 and the application framework layer 360 belong to an operating system space, and the application layer 380 belongs to a user space. The Linux kernel layer 320 provides the underlying drivers for various hardware of the electronic device, such as display drivers, audio drivers, camera drivers, bluetooth drivers, wi-Fi drivers, power management, and the like. The system runtime library layer 340 provides the main feature support for the Android system through some C/c++ libraries. For example, the SQLite library provides support for databases, the OpenGL/ES library provides support for 3D graphics, the Webkit library provides support for browser kernels, and the like. Also provided in the system runtime library layer 340 is An Zhuoyun runtime library (Android runtime), which primarily provides some core libraries that can allow developers to write Android applications using the Java language. The application framework layer 360 provides various APIs that may be used in building applications, which developers can also build their own applications by using, for example, campaign management, window management, view management, notification management, content provider, package management, call management, resource management, location management. The application layer 380 runs at least one application program, which may be a native application program of the operating system, such as a contact program, a short message program, a clock program, a camera application, etc., or a third party application program developed by a third party developer, such as a game application program, an instant messaging program, a photo beautification program, etc.
Taking an operating system as an IOS system as an example, programs and data stored in the memory 120 are shown in fig. 13, the IOS system includes a Core operating system layer 420 (Core OS layer), a Core service layer 440 (Core SERVICES LAYER), a media layer 460 (MEDIA LAYER), and a touchable layer 480 (Cocoa Touch Layer). The core operating system layer 420 includes an operating system kernel, drivers, and underlying program frameworks that provide more hardware-like functionality for use by the program frameworks at the core services layer 440. The core services layer 440 provides system services and/or program frameworks required by the application, such as a Foundation (Foundation) framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a sports framework, and the like. The media layer 460 provides an interface for applications related to audiovisual aspects, such as a graphics-image related interface, an audio technology related interface, a video technology related interface, an audio video transmission technology wireless play (AirPlay) interface, and so forth. The touchable layer 480 provides various commonly used interface-related frameworks for application development, with the touchable layer 480 being responsible for user touch interactions on the electronic device. Such as a local notification service, a remote push service, an advertisement framework, a game tool framework, a message User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.
Among the frameworks shown in FIG. 13, the frameworks related to most applications include, but are not limited to, the base framework in core services layer 440 and UIKit frameworks in touchable layer 480. The infrastructure provides many basic object classes and data types, providing the most basic system services for all applications, independent of the UI. While the class provided by the UIKit framework is a base UI class library for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides the application's infrastructure for building user interfaces, drawing, handling and user interaction events, responding to gestures, and so on.
The manner and principle of implementing data communication between the third party application program and the operating system in the IOS system may refer to the Android system, and this description is not repeated here.
The input device 130 is configured to receive input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are a touch display screen for receiving a touch operation thereon or thereabout by a user using a finger, a touch pen, or any other suitable object, and displaying a user interface of each application program. Touch display screens are typically provided on the front panel of an electronic device. The touch display screen may be designed as a full screen, a curved screen, or a contoured screen. The touch display screen may also be designed as a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, and the embodiments of the present disclosure are not limited thereto.
In addition, those skilled in the art will appreciate that the configuration of the electronic device shown in the above-described figures does not constitute a limitation of the electronic device, and the electronic device may include more or less components than illustrated, or may combine certain components, or may have a different arrangement of components. For example, the electronic device further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WIRELESS FIDELITY, wiFi) module, a power supply, and a bluetooth module, which are not described herein.
In the embodiment of the present specification, the execution subject of each step may be the electronic device described above. Optionally, the execution subject of each step is an operating system of the electronic device. The operating system may be an android system, an IOS system, or other operating systems, which embodiments of the present specification are not limited to.
The electronic device of the embodiment of the present disclosure may further have a display device mounted thereon, and the display device may be various devices capable of implementing a display function, such as a cathode ray tube display (cathode ray tubedisplay, abbreviated as CR), a light-emitting diode display (light-emitting diode display, abbreviated as LED), an electronic ink screen, a liquid crystal display (liquid CRYSTAL DISPLAY, abbreviated as LCD), a plasma display panel (PLASMA DISPLAY PANEL, abbreviated as PDP), and the like. A user may utilize a display device on an electronic device to view displayed text, images, video, etc. The electronic device may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality ) device, an automobile, a data storage, an audio playing device, a video playing device, a notebook, a desktop computing device, a wearable device such as an electronic watch, electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic article of clothing, etc.
In the electronic device shown in fig. 10, the processor 110 may be configured to call an application program stored in the memory 120, and specifically perform the following operations:
Acquiring a chart description text input by a user;
performing graph description language conversion processing on the graph description text through a graph processing large model to obtain graph description sketch sentences, and determining target vector graphic data corresponding to the graph description sketch sentences;
performing graph drawing processing by adopting a document object model based on the target vector graph data to obtain target graph data;
and displaying the target chart data to the user.
In one embodiment, the processor 110 performs the graph description language conversion processing through the graph processing large model based on the graph description text to obtain a graph description schematic sentence, determines target vector graphic data corresponding to the graph description schematic sentence, and performs the following steps:
Inputting the chart description text into a chart processing large model, determining chart structure information based on the chart description text through the chart processing large model, and performing chart description language conversion processing based on the chart structure information to obtain chart description sketch sentences;
and performing visual vector diagram format conversion on the diagram description sketch sentence to obtain target vector graphic data.
In one embodiment, the processor 110 performs the following steps when performing the visual vector diagram format conversion of the diagram description sketch sentence to obtain target vector graphics data:
And calling a browser service to create an HTML page, performing visual vector diagram rendering on the diagram description sketch statement in the HTML page to obtain a visual vector image, and outputting target vector graphic data aiming at the visual vector image.
In one embodiment, the processor 110 performs the following steps when performing the graph drawing process using a document object model based on the target vector graphics data to obtain target graph data:
And analyzing the target vector graphic data by adopting a document object model to obtain chart element attribute information, determining a plurality of chart elements and element connection information in an image editing tool based on the chart element attribute information, and generating target chart data based on the chart elements and the element connection information.
In one embodiment, the processor 110, when executing the parsing of the target vector graphics data using the document object model to obtain chart element attribute information, determines a plurality of chart elements and element connection information in an image editing tool based on the chart element attribute information, generates target chart data based on the chart elements and element connection information, and executes the following steps:
analyzing the target vector graphic data to generate a document object model tree;
Traversing the document object model tree to obtain chart element attribute information and element connection information, and drawing a plurality of chart elements and element connection lines in an image editing tool based on the chart element attribute information and the element connection information;
And obtaining target chart data based on the chart elements and the element connecting lines.
In one embodiment, the processor 110, when executing the traversing the document object model tree to obtain chart element attribute information and element connection information, draws a plurality of chart elements and element connection lines in an image editing tool based on the chart element attribute information and the element connection information, and performs the following steps:
Determining chart element attribute information by traversing the document object model tree, and drawing a plurality of chart elements in an image editing tool based on the chart element attribute information;
and traversing the document object model tree to determine the element connection information, and carrying out connection association processing on the plurality of chart elements by adopting element connection lines based on the element connection information.
In one embodiment, the processor 110 performs the following steps when performing the connection association processing on the plurality of chart elements using element connection lines based on the element connection information:
And determining connection line coordinate information based on the element connection information, determining reference chart elements to be connected and connection line distances from the plurality of chart elements based on the connection line coordinate information, and connecting the reference chart elements by adopting element connection lines based on the connection line distances.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, or the like.
The foregoing disclosure is only illustrative of the preferred embodiments of the present invention and is not to be construed as limiting the scope of the claims, which follow the meaning of the claims of the present invention.

Claims (10)

Translated fromChinese
1.一种图表生成方法,其特征在于,所述方法包括:1. A method for generating a chart, characterized in that the method comprises:获取用户输入的图表描述文本;Get the chart description text entered by the user;基于所述图表描述文本通过图表处理大模型进行图表描述语言转换处理得到图表描述简图语句,确定所述图表描述简图语句对应的目标矢量图形数据;Based on the chart description text, a chart description language conversion process is performed through a chart processing large model to obtain a chart description simplified diagram statement, and target vector graphics data corresponding to the chart description simplified diagram statement is determined;基于所述目标矢量图形数据采用文档对象模型进行图表绘制处理得到目标图表数据;Based on the target vector graphics data, a document object model is used to perform a chart drawing process to obtain target chart data;向所述用户展示所述目标图表数据。The target chart data is presented to the user.2.根据权利要求1所述的方法,其特征在于,所述基于所述图表描述文本通过图表处理大模型进行图表描述语言转换处理得到图表描述简图语句,确定所述图表描述简图语句对应的目标矢量图形数据,包括:2. The method according to claim 1 is characterized in that the step of converting the chart description text into a chart description language by using a chart processing large model to obtain a chart description simplified diagram statement and determining the target vector graphics data corresponding to the chart description simplified diagram statement comprises:将所述图表描述文本输入图表处理大模型,通过所述图表处理大模型基于所述图表描述文本确定图表结构信息,基于所述图表结构信息进行图表描述语言转换处理得到图表描述简图语句;Input the chart description text into a chart processing macro model, determine chart structure information based on the chart description text through the chart processing macro model, and perform chart description language conversion processing based on the chart structure information to obtain a chart description simplified diagram statement;对所述图表描述简图语句进行可视矢量图格式转换得到目标矢量图形数据。The diagram description diagram statement is converted into a visual vector graphic format to obtain target vector graphic data.3.根据权利要求2所述的方法,其特征在于,所述对所述图表描述简图语句进行可视矢量图格式转换得到目标矢量图形数据,包括:3. The method according to claim 2, characterized in that the step of converting the diagram description statement into a visual vector graphic format to obtain target vector graphic data comprises:调用浏览器服务创建HTML页面,在所述HTML页面中对所述图表描述简图语句进行可视矢量图渲染得到可视矢量图像,输出针对所述可视矢量图形的目标矢量图形数据。The browser service is called to create an HTML page, in which the chart description diagram statement is rendered as a visual vector graphic to obtain a visual vector image, and target vector graphic data for the visual vector graphic is output.4.根据权利要求1所述的方法,其特征在于,所述基于所述目标矢量图形数据采用文档对象模型进行图表绘制处理得到目标图表数据,包括:4. The method according to claim 1, characterized in that the step of performing a chart drawing process based on the target vector graphic data using a document object model to obtain the target chart data comprises:采用文档对象模型对所述目标矢量图形数据进行解析得到图表元素属性信息,基于所述图表元素属性信息在图像编辑工具中确定多个图表元素和元素连接信息,基于所述图表元素和元素连接信息生成目标图表数据。The target vector graphics data is parsed using a document object model to obtain chart element attribute information, multiple chart elements and element connection information are determined in an image editing tool based on the chart element attribute information, and target chart data is generated based on the chart elements and element connection information.5.根据权利要求4所述的方法,其特征在于,所述采用文档对象模型对所述目标矢量图形数据进行解析得到图表元素属性信息,基于所述图表元素属性信息在图像编辑工具中确定多个图表元素和元素连接信息,基于所述图表元素和元素连接信息生成目标图表数据,包括:5. The method according to claim 4, characterized in that the step of parsing the target vector graphics data using a document object model to obtain chart element attribute information, determining a plurality of chart elements and element connection information in an image editing tool based on the chart element attribute information, and generating the target chart data based on the chart elements and element connection information comprises:对所述目标矢量图形数据进行解析生成文档对象模型树;Parsing the target vector graphics data to generate a document object model tree;遍历所述文档对象模型树得到图表元素属性信息和元素连接信息,基于所述图表元素属性信息和所述元素连接信息在图像编辑工具中绘制多个图表元素和元素连接线;Traversing the document object model tree to obtain chart element attribute information and element connection information, and drawing a plurality of chart elements and element connection lines in an image editing tool based on the chart element attribute information and the element connection information;基于所述图表元素和所述元素连接线得到目标图表数据。Target chart data is obtained based on the chart elements and the element connecting lines.6.根据权利要求5所述的方法,其特征在于,所述遍历所述文档对象模型树得到图表元素属性信息和元素连接信息,基于所述图表元素属性信息和所述元素连接信息在图像编辑工具中绘制多个图表元素和元素连接线,包括:6. The method according to claim 5, characterized in that traversing the document object model tree to obtain chart element attribute information and element connection information, and drawing a plurality of chart elements and element connection lines in an image editing tool based on the chart element attribute information and the element connection information, comprises:遍历所述文档对象模型树确定图表元素属性信息,基于所述图表元素属性信息在图像编辑工具中绘制多个图表元素;Traversing the document object model tree to determine chart element attribute information, and drawing a plurality of chart elements in an image editing tool based on the chart element attribute information;遍历所述文档对象模型树确定所述元素连接信息,基于所述元素连接信息对所述多个图表元素采用元素连接线进行连接关联处理。The document object model tree is traversed to determine the element connection information, and based on the element connection information, the plurality of chart elements are connected and associated using element connection lines.7.根据权利要求6所述的方法,其特征在于,所述基于所述元素连接信息对所述多个图表元素采用元素连接线进行连接关联处理,包括:7. The method according to claim 6, characterized in that the connecting and associating processing of the plurality of chart elements using element connecting lines based on the element connection information comprises:基于所述元素连接信息确定连接线坐标信息,基于所述连接线坐标信息从所述多个图表元素确定待连接的参考图表元素和连接线距离,基于所述连接线距离采用元素连接线连接所述参考图表元素。Determine connection line coordinate information based on the element connection information, determine reference chart elements to be connected and connection line distances from the multiple chart elements based on the connection line coordinate information, and connect the reference chart elements using element connection lines based on the connection line distances.8.一种图表生成装置,其特征在于,所述装置包括:8. A chart generating device, characterized in that the device comprises:输入模块,用于获取用户输入的图表描述文本;Input module, used to obtain the chart description text input by the user;处理模块,用于基于所述图表描述文本通过图表处理大模型进行图表描述语言转换处理得到图表描述简图语句,确定所述图表描述简图语句对应的目标矢量图形数据;A processing module, configured to convert the chart description text into a chart description language through a chart processing model to obtain a chart description simplified diagram statement, and determine target vector graphics data corresponding to the chart description simplified diagram statement;绘制模块,用于基于所述目标矢量图形数据采用文档对象模型进行图表绘制处理得到目标图表数据;A drawing module, used for performing a chart drawing process based on the target vector graphic data by using a document object model to obtain target chart data;展示模块,用于向所述用户展示所述目标图表数据。A display module is used to display the target chart data to the user.9.一种计算机存储介质,其特征在于,所述计算机存储介质存储有多条指令,所述指令适于由处理器加载并执行如权利要求1~7任意一项的所述方法步骤。9. A computer storage medium, characterized in that the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the method steps as claimed in any one of claims 1 to 7.10.一种电子设备,其特征在于,包括:处理器和存储器;其中,所述存储器存储有计算机程序,所述计算机程序适于由所述处理器加载并执行如权利要求1~7任意一项的所述方法步骤。10. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 7.
CN202411618746.9A2024-11-132024-11-13Chart generation method and device, storage medium and electronic equipmentPendingCN119152072A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202411618746.9ACN119152072A (en)2024-11-132024-11-13Chart generation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202411618746.9ACN119152072A (en)2024-11-132024-11-13Chart generation method and device, storage medium and electronic equipment

Publications (1)

Publication NumberPublication Date
CN119152072Atrue CN119152072A (en)2024-12-17

Family

ID=93814020

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202411618746.9APendingCN119152072A (en)2024-11-132024-11-13Chart generation method and device, storage medium and electronic equipment

Country Status (1)

CountryLink
CN (1)CN119152072A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN119722852A (en)*2025-02-272025-03-28杰软科技(集团)有限公司 NLP-based statistical analysis chart generation method, system and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20220405314A1 (en)*2021-06-222022-12-22Adobe Inc.Facilitating generation of data visualizations via natural language processing
CN117610538A (en)*2023-08-152024-02-27北京数势云创科技有限公司Method, device and storage medium for automatically generating marketing strategy canvas
CN117875296A (en)*2024-02-042024-04-12联通(广东)产业互联网有限公司Statistical report generation method and system based on large language model
CN118363984A (en)*2024-05-142024-07-19北京理工大学 A database automatic human-computer interaction method based on large language model
CN118736057A (en)*2024-06-192024-10-01百度国际科技(深圳)有限公司 Graphics generation method, device, equipment and storage medium
CN118733612A (en)*2024-07-172024-10-01数字郑州科技有限公司 Method, system and medium for generating diagrams from natural language based on LLM model

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20220405314A1 (en)*2021-06-222022-12-22Adobe Inc.Facilitating generation of data visualizations via natural language processing
CN117610538A (en)*2023-08-152024-02-27北京数势云创科技有限公司Method, device and storage medium for automatically generating marketing strategy canvas
CN117875296A (en)*2024-02-042024-04-12联通(广东)产业互联网有限公司Statistical report generation method and system based on large language model
CN118363984A (en)*2024-05-142024-07-19北京理工大学 A database automatic human-computer interaction method based on large language model
CN118736057A (en)*2024-06-192024-10-01百度国际科技(深圳)有限公司 Graphics generation method, device, equipment and storage medium
CN118733612A (en)*2024-07-172024-10-01数字郑州科技有限公司 Method, system and medium for generating diagrams from natural language based on LLM model

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN119722852A (en)*2025-02-272025-03-28杰软科技(集团)有限公司 NLP-based statistical analysis chart generation method, system and storage medium

Similar Documents

PublicationPublication DateTitle
US12079626B2 (en)Methods and systems for creating applications using scene trees
US10678406B1 (en)Conversational user interface design
US9575950B2 (en)Systems and methods for managing spreadsheet models
US20150049951A1 (en)Presenting meaningful information summary for analyzing complex visualizations
US20250021309A1 (en)Ui design system with automatic front-end/back-end code generator
CN119152072A (en)Chart generation method and device, storage medium and electronic equipment
Schwab et al.Scalable scalable vector graphics: Automatic translation of interactive svgs to a multithread vdom for fast rendering
CN117971914A (en) Data analysis method, device, equipment and storage medium
US20240427558A1 (en)Graphic design code generation plugin system
CN115510347A (en)Presentation file conversion method and device, electronic equipment and storage medium
CN113391808A (en)Page configuration method and device and electronic equipment
TianApplication and analysis of artificial intelligence graphic element algorithm in digital media art design
WO2025082243A1 (en)Video processing method and apparatus, and device and storage medium
CN114118045A (en) Report data retrieval method, device, storage medium and computer equipment
CN118035546A (en)Training method for text intention recognition model, text intention recognition method and device
US12266071B2 (en)User-interface-framework based processing method, apparatus, device, and medium
CN118012424A (en)Dynamic intelligent UI prototype design method based on large language model
CN116700704A (en)Image processing method, device, storage medium and electronic equipment
CN119150821B (en)Multidimensional form processing method and device, storage medium and electronic equipment
CN106933563B (en)Page flow editor
CN119150834B (en)Content template generation method and device, storage medium and electronic equipment
UsmaniGuidelines for selection of web designing tool & framework for web frontend application
US20250307482A1 (en)Generative filling of design content
CN118918199A (en)Drawing processing method and device, storage medium and electronic equipment
SwearnginExpanding Interface Design Capabilities through Semantic and Data-Driven Analyses

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp