Chart generation method and device, storage medium and electronic equipment

By combining the large-scale chart processing model and the document object model, the chart generation is automatically generated, which solves the problem of low efficiency and accuracy of manual chart drawing, and achieves efficient and accurate chart generation and editing.

CN119152072AInactive Publication Date: 2024-12-17BEIJING QIHOOD TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411618746.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2024-12-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, manually drawing charts is time-consuming and labor-intensive, especially when the amount of information is large and the complexity of the chart increases, efficiency and accuracy are difficult to ensure, and there is a lack of an efficient way to automatically generate charts.

Method used

Through the chart processing large model, the natural language chart description text entered by the user is converted into a simple chart statement of the chart description, and the document object model is used for chart rendering to achieve automated and accurate chart generation without the need for manual drawing by the user.

Benefits of technology

It simplifies the chart production process, improves the efficiency and accuracy of complex chart generation, and supports further editing and customization of charts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152072A_ABST
    Figure CN119152072A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a chart generation method and device, a storage medium and electronic device.The method comprises the steps that a chart description text input by a user is obtained, chart description language conversion processing is conducted on the basis of the chart description text through a chart processing large model, and chart description sketch statements are obtained; determining target vector graphic data corresponding to the chart description sketch statement, performing chart drawing processing by adopting 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.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a chart generation method, device, storage medium and electronic device. Background Art

[0002] With the rapid development of information technology, the way of presenting data and the efficiency of information transmission are becoming more and more important. As an effective form of diagram, mind mapping can help users intuitively express ideas, organize information, and build complex thinking structures. In various fields such as teaching, business, and product development, mind maps, flow charts, swimlane diagrams and other forms of diagrams have become indispensable tools. At present, users usually draw diagrams manually and then display them. Summary of the invention

[0003] The embodiments of this specification provide a chart generation method, device, storage medium and electronic device, and the technical solution is as follows: In a first aspect, an embodiment of the present specification provides a method for generating a chart, the method comprising: 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.

[0004] In a feasible implementation manner, the converting the chart description language based on the chart description text through the chart processing big model to obtain the 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.

[0005] In a feasible implementation manner, converting the diagram description diagram statement into a visible vector graphic format to obtain target vector graphic data includes: 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.

[0006] In a feasible implementation manner, the process of performing a chart drawing process based on the target vector graphic data using a document object model to obtain the target chart data includes: 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.

[0007] In a feasible implementation manner, the method of using a document object model to parse the target vector graphics data 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: 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.

[0008] In a feasible implementation manner, 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.

[0009] In a feasible implementation manner, the connecting and associating the plurality of chart elements using element connection lines based on the element connection information includes: 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.

[0010] In a second aspect, an embodiment of the present specification provides a chart generating device, the device comprising: 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.

[0011] In a feasible implementation manner, the processing module is used to: 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.

[0012] In a feasible implementation manner, the processing module is used to: 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.

[0013] In a feasible implementation manner, the drawing module is used to: 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.

[0014] In a feasible implementation manner, the drawing module is used to: 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.

[0015] In a feasible implementation manner, the drawing module is used to: 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.

[0016] In a feasible implementation manner, the drawing module is used to: 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.

[0017] In a third aspect, an embodiment of the present specification provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.

[0018] In a fourth aspect, an embodiment of the present specification provides an electronic device, which may include: 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 above-mentioned method steps.

[0019] The beneficial effects brought by the technical solutions provided by some embodiments of this specification include at least: In one or more embodiments of this specification, the natural language chart description text input by the user is automatically converted into a chart description diagram statement through the chart processing model, and the corresponding target vector graphic data is generated. The chart is rendered through the document object model to achieve automatic, accurate and efficient chart generation, and the final chart is displayed to the user. The whole process simplifies the chart production process. There is no need for users to draw manually. Users only need to enter the corresponding chart description text to automatically generate complex charts, which greatly improves the efficiency and accuracy of generating complex charts, and also supports further editing and customization of charts. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 is a scenario diagram of a chart generation system provided by an embodiment of this specification; Figure 2 It is a flowchart of a method for generating a chart provided in an embodiment of this specification; Figure 3 It is an example diagram of a diagram description diagram statement provided in an embodiment of this specification; Figure 4 It is an example diagram of a diagram description diagram statement provided in an embodiment of this specification; Figure 5 is a schematic diagram of target chart data provided by an embodiment of this specification; Figure 6 It is a flowchart of a chart processing method provided in an embodiment of this specification; Figure 7 It is a flowchart of a method for drawing a line chart provided in an embodiment of this specification; Figure 8 It is a flowchart of a method for drawing a chart provided in an embodiment of this specification; Fig. 9 It is a structural schematic diagram of a chart generating device provided in an embodiment of this specification; Fig.10 It is a structural schematic diagram of an electronic device provided in an embodiment of this specification; Fig.11 It is a schematic diagram of the structure of the operating system and user space provided in the embodiments of this specification; Fig.12 yes Fig.11 The architecture diagram of the Android operating system; Fig.13 yes Fig.11 Architecture diagram of the IOS operating system. DETAILED DESCRIPTION

[0022] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0023] In the description of this specification, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of this specification, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in this specification can be understood by specific circumstances. In addition, in the description of this specification, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship.

[0024] In the related art, manual drawing of charts 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 guarantee. In order to improve the efficiency of chart generation, a method of automatically generating charts is needed.

[0025] The present specification is described in detail below with reference to specific embodiments.

[0026] See also Figure 1 , is a schematic diagram of a scenario of a chart generation system provided in an embodiment of the present application. Figure 1 As shown, the chart generation system may include at least a client cluster and a service platform 100 .

[0027] In some embodiments, a client cluster may include at least one client, such as Figure 1 As shown, it specifically includes client 1 corresponding to user 1, client 2 corresponding to user 2, ..., client n corresponding to user n, where n is an integer greater than 0.

[0028] Each client in the client cluster may be an electronic device with communication function, including but not limited to: wearable device, handheld device, personal computer, tablet computer, vehicle-mounted device, smart phone, computing device or other processing device connected to a wireless modem, etc. Electronic devices may be called different names in different networks, such as: user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device, cellular phone, cordless phone, personal digital assistant (PDA), electronic device in 5G network or future evolution network, etc.

[0029] In some embodiments, the service platform 100 can be a separate server device, such as a rack-mounted, blade, tower, or cabinet-mounted server device, or a hardware device with strong computing power such as a workstation or a mainframe computer; it can also be a server cluster composed of multiple servers, and the servers in the service cluster can be composed in a symmetrical manner, wherein each server has equivalent functions and status in the transaction link, and each server can provide services to the outside independently, and the independent service can be understood as not requiring the assistance of other servers.

[0030] In one or more embodiments of the present specification, the service platform 100 may establish a communication connection with at least one client in the client cluster, and complete the data interaction during the chart generation process based on the communication connection.

[0031] For example, a user may send a chart description text to the service platform 100 through a client; the service platform 100 may receive the chart description text input by the user, perform chart description language conversion processing based on the chart description text through a chart processing large model to obtain a chart description simplified diagram sentence, determine the target vector graphic data corresponding to the chart description simplified diagram sentence; perform chart drawing processing based on the target vector graphic data using a document object model to obtain target chart data; For another example, the service platform 100 displays the target chart data to the user of the client.

[0032] It should be noted that the service platform 100 and at least one client in the client cluster establish a communication connection through a network for interactive communication, wherein the network can be a wireless network or a wired network, 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 Ethernet, a universal serial bus (USB) or a controller local area network. In one or more embodiments of the specification, technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. are used to represent data (such as a target compressed package) exchanged through the network. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec), etc. can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.

[0033] The chart generation system embodiment provided in this specification and the chart generation method described in one or more embodiments belong to the same concept. The execution subject corresponding to the chart generation method involved in one or more embodiments of the specification can be an electronic device, and the electronic device can be the above-mentioned service platform 100, or the above-mentioned client, which is determined based on the actual application environment. The specific implementation process of the demonstration file generation system embodiment can be found in the following method embodiment, which will not be repeated here.

[0034] In one embodiment, Figure 2 As shown, a diagram generation method is proposed, which can be implemented by a computer program and can be run on a diagram generation device based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application. The diagram generation device can be an electronic device.

[0035] Specifically, the chart generation method includes: S102: Obtaining the chart description text input by the user; In this specification, the types of automatically generated charts supported include but are not limited to one or more fittings of mind maps, flow charts, timing diagrams, class diagrams, time week charts, Gantt charts, entity relationship diagrams, state diagrams, etc., to meet the user needs of different application scenarios.

[0036] The traditional way of generating diagrams relies on manual operation, which involves drawing diagrams, adding texts and defining connection relationships step by step through visualization tools (such as mind mapping software, flowchart software, etc.). It is not only time-consuming, but also very difficult to maintain and modify complex diagrams, such as multi-level and multi-branch mind maps. This specification specifically involves one or more diagram generation solutions to improve or even completely solve the above problems.

[0037] Exemplarily, the electronic device receives a chart description text input by a user. The chart description text is usually a natural language description of the chart by the user or a text input based on a specific chart generation requirement. For example, the user may input "show a flowchart about the login verification process". The chart description text description represents the initial idea or requirement of the chart that the user wants to generate.

[0038] S104: 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; Chart processing big model: It can be obtained after model training for chart processing scenarios based on the basic big model. The basic big model (Large Language Model, LLM for short) is an artificial intelligence content generation model that aims to understand and generate human language. LLM is trained on a large amount of data and can perform a wide range of tasks, including text summarization, translation, sentiment analysis, etc. Optionally, the basic big model can adopt the Tongyi Qianwen big model, the Bailing big model, the GPT system big model, etc. The trained chart processing big model can automatically analyze the chart description text and at least convert it into a chart description diagram statement. In some embodiments, the chart processing big model can further determine the target vector graphic data corresponding to the chart description diagram statement.

[0039] The chart description statement is to use a simple preset chart description language to define the chart to be generated in a text character description manner. The syntax used by the chart description statement is concise and suitable for quickly generating various charts, such as flow charts, timing charts, Gantt charts, etc. The syntax of the chart description statement is simple and clear, which is very suitable for subsequent conversion into vector graphic data to quickly create visual charts. The preset chart description language used by the chart description statement to describe the graphic structure includes but is not limited to one or more fittings of the Mermaid description language, the DOT description language, the PlantUML description language, etc.; Optionally, in some embodiments, the Mermaid description language may be used to generate diagram description statements. The diagram description statement syntax of the Mermaid description language can avoid only generating process-oriented diagrams and graphics, and cannot generate graphics such as class diagrams and sequence diagrams. In addition, the syntax is relatively complex, and the time required to generate large diagram models is shorter. The target vector graphics data is a data in a visualized vector graphics data format (Scalable Vector Graphics, SVG), which can also be called target SVG data. It is a vector graphics format based on the extensible markup language XML, which is scalable and resolution-independent. It is widely used in graphics presentation in web pages and is used to draw graphics that can be infinitely enlarged without distortion.

[0040] Exemplarily, the chart processing model is used to understand and convert the chart description text input by the user. The specific chart processing model converts the chart description text described in natural language into a chart description language, such as a Mermaid statement. Usually, the chart processing model analyzes the user's chart description text and extracts the core information and structural logic and other parsing information. For example, "display login verification process" will be parsed into a series of step nodes and conditional branches. According to the parsing information, the chart processing model automatically generates chart structure information based on the parsing information and converts to generate corresponding chart description statements, such as Mermaid statements. Mermaid is a textual chart description language that supports the generation of flow charts, timing diagrams, etc. Further, the target vector graphics data corresponding to the generated chart description diagram statement is determined, and the Mermaid statement and other chart description diagram statements will be converted into target vector graphics data (such as SVG data) through the Mermaid rendering engine (usually using a browser or a headless browser, such as Puppeteer), which is suitable for the visualization of chart graphics.

[0041] For example, after the user inputs the diagram description text a, the diagram description text a may be, for example, "Now that you are a programming master, you can implement the mind map code by writing a preset diagram description language such as mermaid code, so as to preliminarily generate diagram description diagram statements, and then determine the vector graphics data to assist in generating the diagram; wherein, the mind map of the process knowledge point has at least 3 levels of directories, and the in-degree can only be 1, and the in-degree can only be 1 means that the node on the right can only appear once"; The chart processing model is used to understand and convert the chart description text entered by the user and display it to the user, such as Figure 3 As shown, Figure 3 is an example diagram of a diagram describing a simple diagram statement. Figure 3The diagram processing model is to understand the diagram description text a described in natural language, automatically generate the diagram structure (also known as diagram structure information), and then convert the diagram structure into a diagram description statement. Figure 3 The diagram shown describes the simplified diagram statement.

[0042] Figure 3 It shows the core process of planning an event and the logical relationship between each step. The following is an explanation of the main steps of the Mermaid code described in the diagram: 1. Core process of event planning (Node A): All event planning steps start from here, defining the overall planning framework of the event.

[0043] 2. Determine the activity goals (Node B): This is the first key step in activity planning, which clarifies the purpose of the activity and the expected results.

[0044] 3. Develop an activity plan (node ​​C): including detailed planning of the activity time, location, budget, content and form, ensuring that every aspect of the activity is carefully planned. Main components: Determine the activity time and location (node ​​D) Determine the activity budget (node ​​E) Determine the activity content and form (node ​​F) 4. Organize an activity team (node ​​G): form a team to carry out the planned tasks and clarify the responsibilities of team members. Main components: determine team members (node ​​H) assign team tasks (node ​​I) 5. Promotion activities (Node J): Develop effective promotion strategies, select appropriate channels, and prepare promotional materials to promote activities. Main components: Develop promotion strategies (Node K) Select promotion channels (Node L) Prepare promotional materials (Node M) 6. Execute the activity (node ​​N): Ensure that the activity is carried out as planned, and coordinate the activities of the venue, process and participants. Main components: Prepare the venue and equipment for the activity (node ​​O) Organize the activity process (node ​​P) Coordinate the participants of the activity (node ​​Q) 7. Evaluate the effectiveness of the activity (Node R): After the activity is over, evaluate the effectiveness of the activity by collecting feedback and analyzing data. Main components: Collect participant feedback (Node S) Analyze activity data (Node T) Summarize activity experience (node ​​U) 8. Improve event planning (node ​​V): Based on the feedback from the event, adjust and optimize the future event planning process to ensure continuous improvement. Adjust planning based on feedback (node ​​W) Optimize event process (node ​​X) Improve activity effect (node ​​Y) like Figure 3The flowchart described by the diagram description simplified statement shown clearly shows the main steps of planning, executing and evaluating an activity, helping users to advance activity planning work in an orderly manner. Furthermore, the user can edit and modify the diagram description simplified statement, and after the user confirms or the electronic device automatically confirms, the diagram processing large model can automatically execute and determine the target vector graphic data corresponding to the diagram description simplified statement.

[0045] S106: Performing a chart drawing process based on the target vector graphic data using a document object model to obtain target chart data; Exemplarily, the target vector graphics data generated by the document object model (DOM model) is processed to draw the chart. The target vector graphics data such as SVG (Scalable Vector Graphics) is an XML-based format, and each element in the chart (such as rectangles, lines, text, etc.) can be parsed and operated through the DOM tree.

[0046] Exemplarily, the target vector graphics data is first parsed. The target vector graphics data is essentially a DOM tree. The target vector graphics data is parsed using a DOM parsing tool (such as JavaScript's Document Object Model). Each graphic element is a node, and these nodes can be operated to extract the structure, coordinates, text and other chart element information of the graphic; then a chart is drawn based on the chart element information, and a chart is drawn on the page based on the coordinates and element types in the target vector graphics data. When drawing, you can also customize the style, such as node color, text color, line style, etc.

[0047] The target chart data supports editing and modification, which means that the chart can be further processed, such as dynamically adjusting nodes, adding additional chart information, or adjusting the chart style according to user needs.

[0048] S108: Displaying the target chart data to the user.

[0049] The generated chart data is displayed to the user, and the user can see the target chart data automatically generated based on the description text, and the chart mode of the target chart data supports an editable mode and a chart file output mode.

[0050] For example, the target chart data can be directly displayed on the web page using HTML Tags or <svg>The tag displays the SVG graphics corresponding to the target chart data.

[0051] For another example, the electronic device may automatically output a chart file, that is, the generated chart may be in the form of an SVG file or other formats (such as PNG, PDF) for the user to download.

[0052] For another example, users can also interact with the target chart data through the front-end interface to adjust the data, such as dragging nodes, modifying text, adjusting connection lines, etc. Users can further modify and save the generated chart.

[0053] Exemplarily, after the user inputs the chart description text b, the chart description text b may be, for example, "Now that you are a programming master, you can implement the mind map code by writing a preset chart description language such as mermaid code, so as to preliminarily generate chart description diagram statements, and then determine the vector graphics data to assist in generating charts; among them, you need to generate a mind map about project processing, and you need to consider all aspects of the project from project establishment to completion;" the chart processing model is used to understand and convert the chart description text input by the user, and display it to the user, such as Figure 4 As shown, Figure 4 is an example diagram of a diagram describing a simple diagram statement. Figure 4 The large model of graph processing in the paper is to understand the graph description text ba described in natural language, automatically generate the graph structure, and then convert the graph structure into a graph description statement, so as to obtain Figure 4 The diagram shown describes the simplified diagram statement. Figure 4 The diagram shown describes the flowchart corresponding to the diagram statement, including the steps of project establishment, review, execution, problem solving, acceptance, completion, termination and project closure. Figure 4 The chart description statement in the diagram can be edited and modified. After confirmation by the user or the electronic device, the chart processing model can automatically determine the target vector graphics data corresponding to the chart description statement. Based on the target vector graphics data, the document object model is used to perform chart drawing processing to obtain the target chart data; Figure 5 As shown, Figure 5 is a schematic diagram of target chart data. Figure 5 It shows the main steps and decision-making process of project management in the automatically generated target chart data, reflecting the complete management process of a project from initiation, review, execution, acceptance to final completion or termination, emphasizing the decision nodes in review and acceptance, as well as the problem-solving steps in the project to ensure the smooth progress of the project.

[0054] In one or more embodiments of this specification, the natural language chart description text input by the user is automatically converted into a chart description diagram statement through the chart processing model, and the corresponding target vector graphic data is generated. The chart is rendered through the document object model to achieve automatic, accurate and efficient chart generation, and the final chart is displayed to the user. The whole process simplifies the chart production process. There is no need for users to draw manually. Users only need to enter the corresponding chart description text to automatically generate complex charts, which greatly improves the efficiency and accuracy of generating complex charts, and also supports further editing and customization of charts.

[0055] Optional, see Figure 6 , Figure 6 It is a flowchart of a diagram processing method proposed in this specification. Specifically, the diagram description text is converted into a diagram description language by a diagram processing model to obtain a diagram description simplified statement, and the target vector graphics data corresponding to the diagram description simplified statement is determined by referring to the following method: S202: inputting the chart description text into a chart processing macromodel, determining chart structure information based on the chart description text through the chart processing macromodel, and performing chart description language conversion processing based on the chart structure information to obtain a chart description simplified diagram statement; The chart structure information can be understood as the chart logic and chart layout structure automatically generated by the big model based on the chart description text input by the user. The chart structure information defines the relationship, hierarchy, layout and arrangement of specific chart elements among the elements in the chart. The chart structure information includes but is not limited to: node (element) information, the relationship between nodes, the hierarchy, the arrangement and layout of nodes, and the attributes of nodes.

[0056] Example: Assuming that the chart description text entered by the user is: "The process of planning an activity, including determining goals, organizing a team, promoting activities, execution and evaluation", the chart result information automatically generated by the chart processing model may include the following: Node information: Determining goals, organizing teams, promoting activities, executing, evaluating, etc. are nodes in the flowchart.

[0057] The relationship between nodes: These steps are in a sequential order: determine the goal → organize the team → promote the event → execute → evaluate.

[0058] Hierarchy: Some steps may have subtasks, such as developing a strategy, selecting channels, etc. under a campaign.

[0059] Layout: A flowchart may be arranged from top to bottom or from left to right, depending on the type of diagram.

[0060] Attributes: Each node may have a different color or shape to indicate its importance or status, such as green for completion and yellow for in progress.

[0061] Exemplarily, the diagram description text input by the user is input into the diagram processing model. The diagram processing model will parse the key diagram information in the text based on the natural language description in the input diagram description text, and generate diagram structure information based on the key diagram information (such as diagram type, user diagram requirements, etc.), such as various nodes, process steps and their relationships. Then, the diagram processing model will generate corresponding diagram description language, such as Mermaid statements, based on the diagram structure information.

[0062] S204: Convert the diagram description statement into a visual vector graphic format to obtain target vector graphic data.

[0063] After the chart description language (such as Mermaid statement) is generated, the chart description language can be selectively displayed to the user. Further, the target vector graphics data corresponding to the generated chart description diagram statement is determined. The Mermaid statement and other chart description diagram statements will be converted into target vector graphics data (such as SVG data) through the Mermaid rendering engine (usually using a browser or headless browser, such as Puppeteer), that is, the chart description diagram statement will be further converted into a visual vector graphics format to obtain the target vector graphics data, such as SVG. SVG is a scalable vector graphics format suitable for displaying charts in high resolution on web pages or applications.

[0064] In a feasible implementation manner, the conversion of the diagram description diagram statement into a visual vector graphic format to obtain the target vector graphic data may be performed in the following manner: 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.

[0065] Furthermore, the target vector graphic data corresponding to the generated chart description diagram statements is determined. Chart description diagram statements such as Mermaid statements are converted into target vector graphic data (such as SVG data) through a rendering engine (usually using a browser or a headless browser, such as Puppeteer) of a preset chart description language (such as Mermaid), which is suitable for visual presentation of chart graphics.

[0066] As an example, the model training process of a large graph processing model is introduced below: 1. Obtain a basic large language model, and create an initial demonstration template processing large model for a chart processing scenario based on the basic large language model; The Large Language Model (LLM) is an AI content generation model designed to understand and generate human language. LLM is trained on a large amount of data and can perform a wide range of tasks, including text summarization, translation, sentiment analysis, and more. Optionally, the Large Language Model can use the Tongyi Qianwen Large Model, the Bailing Large Model, the GPT System Large Model, and more.

[0067] 2. Obtain sample chart description text from sample users, call the expert end service to annotate the sample chart description text with output result labels, and the output result labels include but are not limited to one or more fittings of chart description simple diagram statement labels and vector graphic data labels; 3. Use sample chart description text to perform at least one round of model training on the initial chart processing large model. During the model forward propagation training process, determine the generated prediction chart description text, and convert the prediction chart description diagram statement into a visual vector graphic format to obtain prediction vector graphic data; during the model reverse propagation training process, calculate the comprehensive model loss based on at least the prediction chart description text and the chart description diagram statement label, and use the comprehensive model loss to adjust the parameters of the initial chart processing large model until the model training conditions are met to obtain the chart processing large model.

[0068] Specifically, the first model loss may be calculated based on the predicted chart description text and the chart description diagram sentence labels, and the first model loss may be used as the comprehensive model loss; Optionally, a first model loss is calculated based on the predicted chart description text and the chart description diagram statement label, a second model loss is calculated based on the predicted vector graphic data and the vector graphic data label, and a comprehensive model loss is obtained based on the first model loss and the second model loss; Optionally, the first model loss and the second model loss can be obtained using a model loss calculation function in related technologies. For example, the model loss calculation function includes but is not limited to any one of a hinge loss function, a contrast loss function, a Euclidean distance loss function, and a cross entropy loss function.

[0069] Optionally, the model training end condition may include that the value of the loss function is less than or equal to a preset loss function threshold, the number of iterations reaches a preset number threshold, etc. The model training end condition may be determined based on actual conditions and is not specifically limited here.

[0070] In one or more embodiments of the present specification, the above-mentioned method is adopted to simplify the complexity of user input. The user only needs to describe the requirements for the chart in natural language, and the chart processing model can automatically parse and generate a structured chart description language. By converting simple chart statements into vector graphic data (such as SVG), it ensures that the chart can be clearly displayed on different devices and resolutions, and provides the possibility of further editing and adjustment.

[0071] Optionally, the process of performing the chart drawing process based on the target vector graphic data using the document object model to obtain the target chart data may be performed in the following manner: 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.

[0072] The document object model can also be called the DOM model; Exemplarily, the document object model is used to parse the target vector graphics data into a DOM object, for example, Java's "javax.xml.parsers.DocumentBuilderFactory" method is used to parse the target vector graphics data and generate a DOM object. The target vector graphics data is essentially an XML document. Through DOM model parsing, the elements and tags in the SVG file can be traversed. When parsing the target vector graphics data, multiple chart elements and element connection information are filtered out through tag names and attributes, and then the target chart data is generated based on them. For example, <rect>Labels, or labels with specific attributes (such as class="label"). This step extracts the coordinates, size, shape, text, and other information of the graphic.

[0073] See also Figure 7 , Figure 7 It is a flowchart of a method for drawing a line chart proposed in this specification. Specifically, the following method can be used to parse the target vector graphics data using the document object model to obtain the chart element attribute information, determine multiple chart elements and element connection information in the image editing tool based on the chart element attribute information, and generate the target chart data based on the chart elements and element connection information: S3002: Parsing the target vector graphics data to generate a document object model tree; Exemplarily, the electronic device parses the target vector graphics data (e.g., SVG data) and generates a document object model tree (DOM tree). SVG files are essentially vector graphics formats based on XML, and generating a DOM tree is equivalent to structuring the SVG data into a tree structure containing various elements (e.g., graphics, lines, text, etc.). Each graphic element (e.g., rectangle, circle, line) is stored as a node in the DOM tree.

[0074] Generating a DOM tree makes subsequent operations on various elements in the chart (such as nodes and connecting lines) more convenient, and facilitates program traversal and extraction of specific information of the graphics, such as the coordinates, size, color, etc. of the graphics.

[0075] 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 the specific coordinate information, size, shape and other chart element attribute information of each chart element; Element connection information can be understood as the connection information between elements, such as connection distance, connection mode, etc. Schematically, the electronic device traverses the document object model tree and extracts the specific coordinate information, size, shape and other chart element attribute information of each chart element, as well as the element connection information between the elements. Based on the chart element attribute information and the element connection information, the electronic device draws the corresponding chart elements (such as nodes, boxes, etc.) and connecting lines in the image editing tool. The chart element attribute information determines the position of the element in the diagram, and the element connection information determines the relationship between the elements, such as the arrows between the steps in the flowchart.

[0076] Optional, see Figure 8 , Figure 8 It is a flowchart of another method for processing a chart drawing, specifically executing the traversal of 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 can refer to the following implementation mode: 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 will traverse the document object model tree (DOM tree) and extract the attribute information of each chart element. The attribute information includes the type of element (such as rectangle, circle, etc.), size, position, color, text content, etc. Based on this attribute information, the system automatically draws the corresponding chart element in the image editing tool. For example, an element may be a step node in a flowchart, and its attribute information may include position coordinates, text description, and the shape of the element. The "nasdanika.drawio" function method can be used to generate the Draw.io graphics corresponding to the chart element, and the color, border color, text color, etc. of the graphics can be set.

[0077] This ensures that each element in the chart is drawn correctly based on its attribute information, including its specific visual style, size, and position. Users do not need to draw chart elements manually, which greatly improves the efficiency of chart generation.

[0078] S4004: traversing the document object model tree to determine the element connection information, and performing connection and association processing on the multiple chart elements using element connection lines based on the element connection information.

[0079] Next, the electronic device traverses the DOM tree again and extracts the element connection information between each chart element. The element connection information usually defines the logical relationship between elements (such as the step connection in a flowchart, the node hierarchy relationship in a mind map, etc.). Based on this element connection information, a connection line is drawn in the image editing tool to associate the related chart elements. The connection line can clearly show the process, hierarchy or data flow in the chart.

[0080] By automatically drawing connections and associating diagram elements, the generated diagram not only has independent elements, but also accurately displays the relationship and logic between elements. The resulting diagram can fully express the structure of data or processes.

[0081] In this specification, the above method can not only extract the attribute information of the chart elements and automatically generate the visualized chart elements, but also generate the connection lines and perform the association processing according to the relationship information between the elements. This process greatly simplifies the manual drawing of the chart, ensures that the generated chart accurately reflects the needs of the user, and has a good logical structure and visualization effect.

[0082] S3006: Obtain target chart data based on the chart elements and the element connection lines.

[0083] The final target chart data can be generated based on the previously drawn chart elements and element connection lines. The target chart data can be in a specific file format (such as Draw.io files, SVG files), and can be further operated in image editing tools. This integrates all elements and their connection relationships, ensuring that the generated chart is complete and meets user needs. Users can edit, save or export based on the automatically generated chart data for subsequent use and modification. This step can also be output according to different format requirements, such as generating editable files for users to use in image editing tools.

[0084] In a feasible implementation manner, the process of connecting and associating the multiple chart elements using element connection lines based on the element connection information may refer to the following method: 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.

[0085] For example, first, based on the extracted element connection information, the coordinate information of the starting point and the end point of each connection line is determined. These connection lines usually represent the logical relationship between the elements in the diagram, such as the step connection in a flowchart or the hierarchical relationship in a mind map. When determining the coordinates, the system analyzes the position of each diagram element and generates accurate coordinates for the connection line to ensure that the starting point and the end point of the connection line correspond to the correct diagram element. Then, after determining the coordinate information of the connection line, the electronic device can parse the distance between the coordinates of the starting point and the end point of the connection line and the chart element to determine the reference chart element to which the connection line should be connected. For example, the distance between the starting point and the end point of the connection line and the nearest chart element is usually calculated to ensure that the connection line is accurately connected to the correct chart element. The system will traverse multiple elements, find the element closest to the connection line, and use it as the reference point for connection.

[0086] Finally, the reference chart elements that the connection lines should connect and the distance of the connection lines are determined, and the electronic device can automatically generate and connect the connection lines based on the reference chart elements and the distance of the connection lines. The connection lines associate the chart elements at the starting point and the end point to form a logical or hierarchical relationship in the chart. The generated connection lines can be straight lines, curves, or lines with directional arrows, depending on the needs and design of the chart.

[0087] In one or more embodiments of the present specification, the simplicity of the chart description diagram statement is utilized, and it is rendered into SVG through a browser service such as Puppeteer and a preset chart description diagram voice plug-in, and then the coordinates and connection information of the graphic are obtained through document object model parsing. After that, it is processed in two steps: the first traversal generates the graphic, the second traversal generates the connection line, and finally an editable target chart data is generated. The process is highly automated and provides flexible theme selection and subsequent editing functions.

[0088] The following will be combined Fig. 9 , the chart generating device provided in the embodiment of this specification is introduced in detail. It should be noted that, Fig. 9 The diagram generating device shown is used to execute the present specification Figure 1 to Figure 8 For the convenience of explanation, only the part related to the embodiment of this specification is shown. For the specific technical details not disclosed, please refer to this specification. Figure 1 to Figure 8 The embodiment shown.

[0089] See also Fig. 9 , which shows a schematic diagram of the structure of a chart generating device according to an embodiment of the present specification. The chart generating device 1 can be implemented as all or part of a device by software, hardware or a combination of both. According to some embodiments, the chart generating device 1 includes an input module 11, a processing module 12, a drawing module 13 and a display module 1, which are specifically used to: An input module 11, used to obtain a chart description text input by a user; A processing module 12 is used 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 13, configured to perform a chart drawing process based on the target vector graphic data using a document object model to obtain target chart data; The display module 14 is used to display the target chart data to the user.

[0090] In a feasible implementation manner, the processing module 12 is used to: 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.

[0091] In a feasible implementation manner, the processing module 12 is used to: 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.

[0092] In a feasible implementation manner, the drawing module 13 is used to: 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.

[0093] In a feasible implementation manner, the drawing module 13 is used to: 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.

[0094] In a feasible implementation manner, the drawing module 13 is used to: 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.

[0095] In a feasible implementation manner, the drawing module 13 is used to: 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.

[0096] It should be noted that the chart generation device provided in the above embodiment only uses the division of the above functional modules as an example when executing the chart generation method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the chart generation device provided in the above embodiment and the chart generation method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.

[0097] The serial numbers of the embodiments of this specification are for description only and do not represent the advantages or disadvantages of the embodiments.

[0098] In one or more embodiments of this specification, the natural language chart description text input by the user is automatically converted into a chart description diagram statement through the chart processing model, and the corresponding target vector graphic data is generated. The chart is rendered through the document object model to achieve automatic, accurate and efficient chart generation, and the final chart is displayed to the user. The whole process simplifies the chart production process. There is no need for users to draw manually. Users only need to enter the corresponding chart description text to automatically generate complex charts, which greatly improves the efficiency and accuracy of generating complex charts, and also supports further editing and customization of charts.

[0099] The present specification also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 1 to Figure 8 The specific execution process of the diagram generation method in the embodiment shown can be found in Figure 1 to Figure 8 The specific description of the illustrated embodiment will not be repeated here.

[0100] The present specification also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor as described above. Figure 1 to Figure 8 The specific execution process of the diagram generation method in the embodiment shown can be found in Figure 1 to Figure 8 The specific description of the illustrated embodiment will not be repeated here.

[0101] Please refer to Fig.10 , which shows a block diagram of the structure of an electronic device provided by an exemplary embodiment of this specification. The electronic device in this specification may include one or more of the following components: 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 via the bus 150.

[0102] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.

[0103] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an IOS system developed by Apple, including a system deeply developed based on the IOS system or other systems. The data storage area may also store data created by the electronic device during use, such as a phone book, audio and video data, chat record data, etc.

[0104] See also Fig.11 As shown, the memory 120 can be divided into an operating system space and a user space. The operating system runs in the operating system space, and native and third-party applications run in the user space. In order to ensure that different third-party applications can achieve good operating results, the operating system allocates corresponding system resources to different third-party applications. However, different application scenarios in the same third-party application also have different requirements for system resources. For example, in the local resource loading scenario, the third-party application has higher requirements for disk reading speed; in the animation rendering scenario, the third-party application has higher requirements for GPU performance. The operating system and third-party applications are independent of each other, and the operating system often cannot perceive the current application scenario of the third-party application in a timely manner, resulting in the operating system being unable to perform targeted system resource adaptation according to the specific application scenario of the third-party application.

[0105] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.

[0106] Taking the Android operating system as an example, the programs and data stored in the memory 120 are as follows: Fig.12 As shown, the memory 120 may store a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360 and an application layer 380, wherein the Linux kernel layer 320, the system runtime library layer 340 and the application framework layer 360 belong to the operating system space, and the application layer 380 belongs to the user space. The Linux kernel layer 320 provides underlying drivers for various hardware of electronic devices, such as display drivers, audio drivers, camera drivers, Bluetooth drivers, Wi-Fi drivers, power management, etc. 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 database support, the OpenGL / ES library provides 3D drawing support, and the Webkit library provides browser kernel support, etc. The system runtime library layer 340 also provides an Android runtime library (Android runtime), which mainly provides some core libraries that allow developers to use Java language to write Android applications. The application framework layer 360 provides various APIs that may be used when building applications. Developers can also use these APIs to build their own applications, such as activity management, window management, view management, notification management, content provider, package management, call management, resource management, and location management. At least one application runs in the application layer 380. These applications can be native applications that come with the operating system, such as contact applications, text messaging applications, clock applications, camera applications, etc.; they can also be third-party applications developed by third-party developers, such as game applications, instant messaging applications, photo beautification applications, etc.

[0107] Taking the operating system as an IOS system as an example, the programs and data stored in the memory 120 are as follows: Fig.13 As shown, 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 the operating system kernel, drivers, and underlying program frameworks. These underlying program frameworks provide functions closer to the hardware for use by the program frameworks located in the core service layer 440. The core service layer 440 provides system services and / or program frameworks required by applications, such as the foundation framework, account framework, advertising framework, data storage framework, network connection framework, geographic location framework, motion framework, etc. The media layer 460 provides audio-visual interfaces for applications, such as graphics and image-related interfaces, audio technology-related interfaces, video technology-related interfaces, and wireless playback (AirPlay) interfaces for audio and video transmission technologies. The touchable layer 480 provides various commonly used interface-related frameworks for application development, and the touchable layer 480 is responsible for the user's touch interaction operations on electronic devices. For example, local notification service, remote push service, advertising framework, game tool framework, message user interface (UI) framework, user interface UIKit framework, map framework, etc.

[0108] exist Fig.13 Among the frameworks shown, the frameworks related to most applications include but are not limited to: the basic framework in the core service layer 440 and the UIKit framework in the touchable layer 480. The basic framework provides many basic object classes and data types, provides the most basic system services for all applications, and has nothing to do with UI. The classes provided by the UIKit framework are basic UI class libraries for creating touch-based user interfaces. iOS applications can provide UIs based on the UIKit framework, so it provides the basic architecture of applications for building user interfaces, drawing, processing and user interaction events, responding to gestures, etc.

[0109] Among them, the method and principle of implementing data communication between third-party applications and the operating system in the IOS system can be referred to the Android system, and this manual will not go into details here.

[0110] Among them, the input device 130 is used 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 and a speaker. In one example, the input device 130 and the output device 140 can be combined, and the input device 130 and the output device 140 are touch screen displays, which are used to receive touch operations on or near the user using any suitable object such as a finger or a touch pen, and to display the user interface of each application. The touch screen display is usually set on the front panel of the electronic device. The touch screen display can be designed as a full screen, a curved screen or a special-shaped screen. The touch screen display can also be designed as a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of this specification.

[0111] In addition, those skilled in the art will understand that the structure of the electronic device shown in the above drawings does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the electronic device also includes radio frequency circuits, input units, sensors, audio circuits, wireless fidelity (WiFi) modules, power supplies, Bluetooth modules and other components, which will not be described in detail here.

[0112] In the embodiments of this specification, the execution subject of each step may be the electronic device described above. Optionally, the execution subject of each step is the operating system of the electronic device. The operating system may be an Android system, an IOS system, or other operating systems, which is not limited in the embodiments of this specification.

[0113] The electronic device of the embodiment of this specification may also be equipped with a display device, which may be various devices capable of realizing display functions, such as cathode ray tube display (CR), light-emitting diode display (LED), electronic ink screen, liquid crystal display (LCD), plasma display panel (PDP), etc. The user may use the display device on the electronic device to view displayed text, images, videos and other information. The electronic device may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality) device, a car, a data storage device, an audio playback device, a video playback device, a notebook, a desktop computing device, a wearable device such as an electronic watch, an electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, electronic clothing and other devices.

[0114] exist Fig.10 In the electronic device shown, the processor 110 may be used to call an application stored in the memory 120 and specifically perform the following operations: 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.

[0115] In one embodiment, the processor 110 performs the following steps when executing the process of converting the chart description text into a chart description language by using a chart processing model to obtain a chart description simplified diagram statement and determining the target vector graphics data corresponding to the chart description simplified diagram statement: 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.

[0116] In one embodiment, the processor 110 performs the following steps when executing the conversion of the chart description diagram statement into a visible vector graphic format to obtain target vector graphic data: 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.

[0117] In one embodiment, the processor 110 performs the following steps when executing the process of performing chart drawing processing based on the target vector graphic data using the document object model to obtain the target chart data: 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.

[0118] In one embodiment, the processor 110 performs the following steps when parsing the target vector graphic 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 target chart data based on the chart elements and element connection information: 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.

[0119] In one embodiment, the processor 110 performs the following steps when 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: 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.

[0120] In one embodiment, the processor 110 performs the following steps when performing the process of connecting and associating the multiple chart elements using element connection lines based on the element connection information: 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.

[0121] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0122] The above disclosure is only the preferred embodiment of this specification, which certainly cannot be used to limit the scope of rights of this specification. Therefore, equivalent changes made according to the claims of this specification are still within the scope covered by this specification.< / rect> < / svg>

Claims

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. The method according to claim 1, 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 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. 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 includes: 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. The method according to claim 1, characterized in that: The process of performing a chart drawing process based on the target vector graphic data using a document object model to obtain target chart data includes: 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. The method according to claim 4, characterized in that The method of using a document object model to parse the target vector graphics data 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: 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. The method according to claim 5, characterized in that The step of 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. The method according to claim 6, characterized in that The connecting and associating the plurality of chart elements using element connection lines based on the element connection information includes: 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. 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. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, and 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. An electronic device, characterized in that: include: 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.

Citation Information

Patent Citations

  • Method and device for automatically generating marketing strategy canvas and storage medium

    CN117610538A

  • Statistical report generation method and system based on large language model

    CN117875296A

  • Database automatic man-machine interaction method based on large language model

    CN118363984A

  • LLM model-based natural language chart generation method and system, and medium

    CN118733612A

  • Graph generation method and device, equipment and storage medium

    CN118736057A

Cited By

  • Statistical analysis chart generation method and system based on NLP and storage medium

    CN119722852A

  • Multi-dimensional data processing method and system

    CN121033876A