Flow chart generation method and device, equipment and computer medium

By obtaining the content of the code file and using the drawio plug-in built-in VS Code, the problem of automatically generating flowcharts in the code editor is solved, and efficient flowchart generation and editing is achieved.

CN119940302APending Publication Date: 2025-05-06NEUSOFT REACH AUTOMOBILE TECH (SHENYANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411735354.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The prior art is difficult to automatically generate flow charts in a code editor, and the process of generating flow charts is time-consuming, and the flow chart export file cannot be edited.

Method used

By obtaining the file content of the flowchart code file, determining the target flowchart with the format that can be recognized by the preset plug-in based on the file content, the target flowchart is rendered and displayed using the drawio plug-in built into VS Code.

Benefits of technology

It realizes automatic generation of flowcharts in the code editor, improves the efficiency of flowchart generation, and allows editing of the generated flowcharts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0005161422700000011
    Figure HDA0005161422700000011
  • Figure HDA0005161422700000012
    Figure HDA0005161422700000012
  • Figure HDA0005161422700000021
    Figure HDA0005161422700000021
Patent Text Reader

Abstract

The invention discloses a flow chart generation method and device, equipment and a computer medium. The method comprises the steps that file content of a flow chart code file is acquired; determining a target flow chart of which the format is a preset format capable of being recognized by a preset plug-in based on the file content, wherein the preset plug-in is built in a VS Code; and the target flow chart is transmitted to the preset plug-in, so that the preset plug-in renders and displays the target flow chart, and the effect of automatically generating the flow chart in a code editor can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and in particular, relates to a flowchart generation method, device, equipment and computer medium. Background Art

[0002] Flowcharts are widely used in various industries and organizations. They are a graphical method of showing workflow steps and information flow. By graphically displaying complex workflows, flowcharts can help people understand workflows more clearly, improve work efficiency, and reduce errors and duplication of work.

[0003] Currently, the tools for generating flowcharts are generally applications that need to be installed separately in Windows or other systems. There are the following disadvantages: they cannot be linked with the code editor, and the code snippets in the code editor need to be copied to the flowchart tool before the flowchart can be generated. The process of generating flowcharts is time-consuming: it takes time to get familiar with the flowchart tool and copy the code. The exported flowchart file cannot be edited: most flowchart tools can only export images in formats such as png after generating the flowchart, and the generated flowchart cannot be edited.

[0004] In summary, how to automatically generate a flowchart in a code editor without installing a flowchart tool has become a technical problem that urgently needs to be solved. Summary of the invention

[0005] The embodiment of the present application provides an implementation scheme different from the prior art to solve the technical problem of how to automatically generate a flowchart in a code editor.

[0006] In a first aspect, the present application provides a flowchart generation method, the method comprising: obtaining the file content of a flowchart code file; determining a target flowchart in a preset format that can be recognized by a preset plug-in based on the file content, the preset plug-in being built into VS Code; passing the target flowchart to the preset plug-in, so that the preset plug-in renders and displays the target flowchart.

[0007] In a second aspect, the present application provides a flow chart generating device, the device comprising:

[0008] An acquisition unit, used for acquiring the file content of the flowchart code file;

[0009] A determining unit, configured to determine, based on the file content, a target flowchart in a preset format that can be recognized by a preset plug-in, wherein the preset plug-in is built into VS Code;

[0010] The transfer unit is used to transfer the target flowchart to the preset plug-in, so that the preset plug-in renders and displays the target flowchart.

[0011] In a third aspect, the present application provides an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any method in the first aspect or any possible implementation manner of the first aspect by executing the executable instructions.

[0012] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the computer program implements any method in the first aspect or any possible implementation manner of the first aspect.

[0013] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in the first aspect or any possible implementation manner of the first aspect.

[0014] The present application provides a method for obtaining the file content of a flowchart code file; determining a target flowchart in a preset format that can be recognized by a preset plug-in based on the file content, and the preset plug-in is built into VS Code; and passing the target flowchart to the preset plug-in so that the preset plug-in renders and displays the target flowchart. This method can automatically generate flowcharts in a code editor, and improves the efficiency of flowchart generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0016] Figure 1a A flowchart diagram of a flowchart generation method provided in an embodiment of the present application;

[0017] Figure 1b Another flowchart diagram of a flowchart generation method provided in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of the structure of a flowchart generating device provided in one embodiment of the present application;

[0019] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, but cannot be understood as limiting the present application.

[0021] The terms "first" and "second" etc. in the specification, claims and drawings of the embodiments of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0022] First, some terms in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0023] Drawio is a powerful diagramming software that provides rich drawing functions and templates for creating various types of diagrams, flowcharts, organizational charts, graphic designs, etc. It supports online cloud versions, which users can access and use directly through the browser. It has built-in libraries of hundreds of visual elements and shapes, including rectangles, circles, arrows, flowchart symbols, etc. Users can choose the appropriate shape to draw as needed. The preset search function not only indexes the file name of the diagram, but also the title and content of the page containing the diagram, as well as the text in all diagrams.

[0024] VS Code, the full name of Visual Studio Code, is a cross-platform source code editor that runs on Mac OS X, Windows, and Linux. VS Code can run on multiple operating systems such as Windows, macOS, and Linux, providing developers with the convenience of developing on different platforms. The installation package is small, starts quickly, and takes up few resources, which will not bring too much burden to the computer. It provides a wealth of themes, plug-ins, and setting options, and users can personalize the configuration according to their preferences and work habits. It supports almost all mainstream programming languages, including Java, Python, JavaScript, C++, C#, etc., providing developers with a wide range of choices. Based on the context and the code that has been entered, VS Code can automatically infer possible code snippets and give suggestions to improve coding efficiency.

[0025] A directed graph (or digraph) is an important graph data structure with a wide range of applications in mathematics and computer science. The following is a detailed explanation of the directed graph data structure: A directed graph is a binary<V,E> , where V is a non-empty set, called the vertex set; E is a subset of V×V, called the arc set (or directed edge set). In a directed graph, the edge has directionality, that is, it points from one vertex to another, indicating a unidirectional relationship from the starting point to the end point. Vertex (node): A small dot or element in the graph, representing an entity or object. Edge (arc): A directed line segment connecting two vertices, indicating a unidirectional relationship between vertices.

[0026] DOT is a textual graph description language that provides a concise and efficient way to describe graphs, which can be network diagrams, trees, state machines, or any structure consisting of nodes (objects) and edges (relationships). DOT is part of the Graphviz toolkit, an open source graph visualization software package widely used in software engineering, enabling engineers to use vector images to represent software behavior, architecture, etc., such as UML (Unified Modeling Language) diagrams.

[0027] Converting code into a directed graph data structure aims to capture the structural relationships and flows in the code in a graphical way. Code is usually composed of components such as variables, functions, classes, modules, etc., which are connected to each other through relationships such as calls and references. A directed graph is a graph data structure in which nodes represent objects or entities, and edges represent directed relationships between objects. In a directed graph, each edge has a clear direction, indicating a relationship from one node to another. When converting code into a directed graph, each code element (such as a variable, function, class, etc.) can be regarded as a node. Nodes can contain additional information about the code element, such as name, type, scope, etc. Edges are used to represent the relationship between code elements. For example, a function call relationship can be represented as a directed edge from the caller node to the callee node. The type of edge can be subdivided according to the nature of the relationship, such as function call, variable reference, inheritance relationship, etc.

[0028] Flowcharts are widely used in various industries and organizations. They are a graphical method of showing workflow steps and information flow. By graphically showing complex workflows, people can understand the workflow more clearly, improve work efficiency, and reduce errors and duplication of work.

[0029] Currently, the tools for generating flowcharts are generally applications that need to be installed separately in Windows or other systems. There are the following disadvantages: they cannot be linked with the code editor, and the code snippets in the code editor need to be copied to the flowchart tool before the flowchart can be generated. The process of generating flowcharts is time-consuming: it takes time to get familiar with the flowchart tool and copy the code. The exported flowchart file cannot be edited: most flowchart tools can only export images in formats such as png after generating the flowchart, and the generated flowchart cannot be edited.

[0030] In summary, how to automatically generate a flowchart in a code editor without installing a flowchart tool has become a technical problem that urgently needs to be solved.

[0031] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0032] Figure 1a A flowchart diagram of a flowchart generation method provided for an exemplary embodiment of the present application, the execution subject of the method can be any computer device, and the computer device can be a terminal or server and other devices. The terminal can be a smart phone, a tablet computer, a laptop computer, an intelligent voice interaction device, a smart home appliance, a wearable smart device, an aircraft, an intelligent vehicle terminal and other devices, and the terminal can also include a client, which can be a video client, a browser client or an instant messaging client, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The method includes at least the following steps S101-S103:

[0033] S101, obtaining the file content of the flowchart code file;

[0034] The flowchart code file is the source code file of the target flowchart finally obtained after rendering in this application. The file content of the flowchart code file refers to the source code in the flowchart code file.

[0035] S102, determining, based on the file content, a target flowchart in a preset format that can be recognized by a preset plug-in, where the preset plug-in is built into VS Code;

[0036] In some optional embodiments of the present application, the preset plug-in is a drawio plug-in.

[0037] The aforementioned preset format may be Visio xml html, etc. Preferably, the preset format is xml.

[0038] S103: passing the target flowchart to the preset plug-in, so that the preset plug-in renders and displays the target flowchart.

[0039] The target flowchart can be displayed in VS Code.

[0040] In the VS Code plug-in drawio, you can edit the nodes and edges of the rendered target flowchart, and you can also export the rendered target flowchart to Microsoft Visio format for editing.

[0041] In some optional embodiments of the present application, the aforementioned S101-S103 are implemented by a target plug-in built into VS Code.

[0042] Furthermore, the present application provides a target plug-in having the functions in S101-S103 above.

[0043] In some optional embodiments of the present application, the method further includes the following S1-S2:

[0044] S1. Obtain the absolute path of the flowchart code file;

[0045] The absolute path of a file is the complete path from the root directory of the file system (for example, the drive letter C:\ in Windows and / in Unix-like systems) to a file. It includes all directory levels and file names from the root directory to the target file, separated by path separators (such as \ in Windows and / in Unix-like systems).

[0046] S2. Determine the file content of the flowchart code file based on the absolute path.

[0047] Specifically, the file content of the flowchart code file can be read through an absolute path.

[0048] In some optional embodiments of the present application, the method further includes the following S01-S02:

[0049] S01, displaying the file content of the flowchart code file;

[0050] In some optional embodiments of the present application, relevant personnel can open the aforementioned flowchart code file in VS Code, so that the file content of the flowchart code file, that is, the source code, is displayed in the interface of VS Code.

[0051] S02. When an operation of generating the target flowchart corresponding to the flowchart code file is detected, which is triggered on the display interface of the file content, the absolute path of the flowchart code file is obtained, and the execution is triggered.

[0052] Optionally, in the aforementioned S101, obtaining the file content of the flowchart code file further includes: obtaining the file content of the flowchart code file through a display interface of the file content.

[0053] Optionally, the aforementioned operation may be an operation of clicking an option for generating the target flowchart corresponding to the flowchart code file among the displayed multiple options. The aforementioned option for generating the target flowchart corresponding to the flowchart code file may be a "Generate Flowchart" button.

[0054] Optionally, relevant personnel may right-click on the display interface of the file content, and then multiple options are displayed on the display interface. When it is detected that the relevant personnel clicks on the option for generating the target flowchart corresponding to the flowchart code file among the multiple options, it is deemed that an operation triggered on the display interface of the file content to generate the target flowchart corresponding to the flowchart code file is detected.

[0055] In some optional embodiments of the present application, the method further includes: obtaining the programming language of the flowchart code file. Optionally, the flowchart code file can be found by an absolute path, and then the suffix of the flowchart code file can be read out, and then the programming language of the flowchart code file can be obtained, such as: the C++ language corresponding to the cpp suffix, the Java language corresponding to the java suffix, etc.

[0056] In S102, the target flow chart of determining the format of the file based on the file content as a preset format that can be recognized by a preset plug-in includes the following steps S1021-S1023:

[0057] S1021, creating a corresponding parser based on the programming language;

[0058] For example, the C++ language creates a C++ parser.

[0059] The parser corresponding to the programming language needs to design and implement a parser that can understand and process the language code according to the characteristics and grammatical rules of the specific programming language. Each programming language has its own unique characteristics, such as grammatical structure, data types, operators, control flow statements, etc. The design of the parser usually includes the following parts: Lexer: Responsible for converting the input source code into a series of lexical units (Tokens), which are the basic elements that constitute the source code, such as keywords, identifiers, operators, etc. Syntax Analyzer: According to the grammatical rules of the target programming language, the lexical unit sequence generated by the lexical analyzer is organized into a grammar tree (Parse Tree) or an abstract syntax tree (Abstract Syntax Tree, AST). The syntax tree reflects the structure and grammatical relationship of the source code. Semantic Analyzer: Based on the syntax tree, semantic checks are performed, such as type checking and scope checking, to ensure that the source code conforms to the semantic rules of the language.

[0060] S1022, using the parser to parse the file content to obtain a parsing result;

[0061] Use the parser to parse the file content to parse out the corresponding if / else, switch, while and other branch contents (lexical and grammatical information).

[0062] S1023: Determine, according to the parsing result, a target flowchart in a preset format that can be recognized by a preset plug-in.

[0063] In some optional embodiments of the present application, in S1023, the target flow chart whose format is determined to be a preset format that can be recognized by a preset plug-in according to the parsing result includes the following S231-S234:

[0064] S231, converting the parsing result into a to-be-processed code having a directed graph data structure;

[0065] In some optional embodiments of the present application, the conversion process of converting the parsing result into the to-be-processed code of the directed graph data structure may include:

[0066] Analyze the parsing results and identify all code elements and their relationships in the parsing results;

[0067] Create a node for each code element and create corresponding edges based on the relationship;

[0068] The nodes and edges are combined into a directed graph data structure to obtain a to-be-processed code having a structure of the directed graph data structure.

[0069] S232, converting the code to be processed into dot language code;

[0070] The basic elements of the DOT language include:

[0071] 1) Graph: In the DOT language, each file is used to represent a graph. A graph can be an undirected graph, which represents a relationship between nodes without arrows, or a directed graph, which represents a relationship between nodes with arrows pointing to them.

[0072] 2) Node: Nodes represent objects in the graph. In the DOT language, to declare a node, you only need to enter the name of the node directly.

[0073] 3) Edge: An edge represents the relationship between nodes. In an undirected graph, the relationship between nodes is represented by a double dash “--”; in a directed graph, the relationship between nodes is represented by an arrow “->”.

[0074] 5) Attribute: Attributes are used to control the appearance of graphs, nodes, and edges, such as color, shape, line style, etc. Attributes can be set globally or for individual nodes or edges.

[0075] SVG is an image file format. Its full English name is Scalable Vector Graphics, which means scalable vector graphics.

[0076] In the DOT language, nodes (usually representing entities or objects) and edges (representing the relationship between nodes) are defined using a simple syntax. For example, a node can be defined in the format of node[attribute...]nodeID, while a directed edge can be defined in the format of nodeID1->nodeID2[attribute...].

[0077] S233, determining a flowchart file in svg format according to the dot language code;

[0078] Specifically, the Graphviz tool can be used to output a flowchart file in svg format based on the dot language code.

[0079] Graphviz supports multiple output formats (such as PNG, PDF, SVG, etc.), and you can choose the appropriate output format as needed. Graphviz is an open source graph visualization software that is good at converting DOT language into graphic images in multiple formats, including flowchart files in SVG (Scalable Vector Graphics) format.

[0080] Graphviz contains multiple layout engines (such as dot, neato, twopi, and circo), which are responsible for calculating the layout of the graph according to the description of the DOT language. The layout engine takes into account factors such as the position of nodes, the length and curvature of edges to generate a visually clear and easy-to-understand graph. Different layout engines may be suitable for different types of graphs. For example, the dot engine is usually used for directed graphs and hierarchical graphs, while the neato engine is more suitable for undirected graphs.

[0081] Once the layout engine has calculated the layout of the graph, Graphviz uses a renderer to convert this layout into an image. Graphviz supports a variety of renderers, including gdiplus, png, and jpg renderers for generating bitmap images, and svg, pdf, and ps renderers for generating vector images.

[0082] Graphviz can use the SVG renderer to convert the layout of the graph into a vector image in SVG format. SVG is an XML-based file format that uses text to describe the shape, color, position and other attributes of the graph.

[0083] S234: Convert the flowchart file into a target flowchart in a preset format that can be recognized by a preset plug-in.

[0084] In some optional embodiments of the present application, the method further includes: exporting the target flowchart in response to an export instruction to export the rendered target flowchart.

[0085] The following combinations can be combined Figure 1b To further explain the solution of the present application, the solution of the present application includes: using VSCode to open the source code, right-clicking on the file and selecting the "Generate Flowchart" button, reading the absolute path of the file, reading the content of the file, reading the suffix of the file name, and obtaining which programming language it is, creating a corresponding parser according to the programming language, using the parser to parse the file content, converting the parsed content into a directed graph data structure, converting the directed graph data structure into dot language content, using the Graphviz tool to output a flowchart file in svg format in dot language, converting the flowchart file in svg format into drawio format content, using the drawio plug-in of VS Code to open the above drawio content, editing the flowchart content in the drawio plug-in of VS Code, and exporting the flowchart in visio format in the drawio plug-in of VS Code.

[0086] The present application provides a method for obtaining the file content of a flowchart code file; determining a target flowchart in a preset format that can be recognized by a preset plug-in based on the file content, and the preset plug-in is built into VS Code; passing the target flowchart to the preset plug-in, so that the preset plug-in renders and displays the target flowchart, which can play a role in automatically generating flowcharts in a code editor, and mentions the efficiency of flowchart generation. The present application uses a VS Code plug-in to realize a method for automatically generating editable flowcharts without installing third-party software.

[0087] Figure 2 A schematic diagram of a flow chart generating device provided for an exemplary embodiment of the present application; wherein the device comprises:

[0088] An acquisition unit 21 is used to acquire the file content of the flowchart code file;

[0089] A determining unit 22, configured to determine, based on the file content, a target flowchart in a preset format that can be recognized by a preset plug-in, wherein the preset plug-in is built into VS Code;

[0090] The transfer unit 23 is used to transfer the target flowchart to the preset plug-in, so that the preset plug-in renders and displays the target flowchart.

[0091] In some optional embodiments of the present application, the aforementioned device is also used for:

[0092] Get the file content of the flowchart code file;

[0093] Determine, based on the file content, a target flowchart in a preset format that can be recognized by a preset plug-in, where the preset plug-in is built into VS Code;

[0094] The target flowchart is passed to the preset plug-in, so that the preset plug-in renders and displays the target flowchart.

[0095] In some optional embodiments of the present application, the aforementioned device is also used for:

[0096] Get the absolute path of the flowchart code file;

[0097] The file content of the flowchart code file is determined based on the absolute path.

[0098] In some optional embodiments of the present application, the aforementioned device is also used for:

[0099] Display the file content of the flowchart code file;

[0100] When an operation of generating the target flowchart corresponding to the flowchart code file is detected, which is triggered on the display interface of the file content, the absolute path of obtaining the flowchart code file is triggered to execute.

[0101] In some optional embodiments of the present application, the aforementioned device is further used to: obtain the programming language of the flowchart code file, and when the aforementioned device is used to determine the target flowchart in a preset format that can be recognized by a preset plug-in based on the file content, it is specifically used to:

[0102] Creating a corresponding parser based on the programming language;

[0103] Parsing the file content using the parser to obtain a parsing result;

[0104] A target flow chart having a preset format that can be recognized by a preset plug-in is determined according to the parsing result.

[0105] In some optional embodiments of the present application, when the aforementioned apparatus is used to determine, according to the parsing result, a target flow chart in a preset format that can be recognized by a preset plug-in, specifically:

[0106] Convert the parsing result into a to-be-processed code having a directed graph data structure;

[0107] Convert the code to be processed into dot language code;

[0108] Determine a flowchart file in svg format according to the dot language code;

[0109] The flowchart file is converted into a target flowchart in a preset format that can be recognized by a preset plug-in.

[0110] In some optional embodiments of the present application, the preset plug-in is a drawio plug-in.

[0111] In some optional embodiments of the present application, the aforementioned apparatus is further used for: exporting the target flowchart in response to an export instruction for exporting the rendered target flowchart.

[0112] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further description is given here. Specifically, the device may perform the above method embodiment, and the above and other operations and / or functions of each module in the device are the corresponding processes in each method in the above method embodiment, respectively, and no further description is given here for the sake of brevity.

[0113] The above describes the device of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0114] Figure 3 is a schematic block diagram of an electronic device provided in an embodiment of the present application, and the electronic device may include:

[0115] The memory 301 and the processor 302, the memory 301 is used to store the computer program and transmit the program code to the processor 302. In other words, the processor 302 can call and run the computer program from the memory 301 to implement the method in the embodiment of the present application.

[0116] For example, the processor 302 may be configured to execute the above method embodiments according to instructions in the computer program.

[0117] In some embodiments of the present application, the processor 302 may include but is not limited to:

[0118] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0119] In some embodiments of the present application, the memory 301 includes but is not limited to:

[0120] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0121] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 301 and executed by the processor 302 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0122] like Figure 3 As shown, the electronic device may also include:

[0123] The transceiver 303 may be connected to the processor 302 or the memory 301 .

[0124] The processor 302 may control the transceiver 303 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 303 may include a transmitter and a receiver. The transceiver 303 may further include an antenna, and the number of antennas may be one or more.

[0125] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0126] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0127] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0128] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

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

[0130] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0131] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A flowchart generation method, characterized in that: The method comprises: Get the file content of the flowchart code file; Determine, based on the file content, a target flowchart in a preset format that can be recognized by a preset plug-in, where the preset plug-in is built into VS Code; The target flowchart is passed to the preset plug-in, so that the preset plug-in renders and displays the target flowchart.

2. The method according to claim 1, characterized in that The method further comprises: Get the absolute path of the flowchart code file; The file content of the flowchart code file is determined based on the absolute path.

3. The method according to claim 2, characterized in that The method further comprises: Display the file content of the flowchart code file; When an operation of generating the target flowchart corresponding to the flowchart code file is detected, which is triggered on the display interface of the file content, the absolute path of obtaining the flowchart code file is triggered to execute.

4. The method according to claim 1, characterized in that: The method further includes: obtaining a programming language of the flowchart code file, and determining, based on the file content, a target flowchart in a preset format that can be recognized by a preset plug-in, including: Creating a corresponding parser based on the programming language; Parsing the file content using the parser to obtain a parsing result; A target flow chart having a preset format that can be recognized by a preset plug-in is determined according to the parsing result.

5. The method according to claim 4, characterized in that The step of determining, according to the parsing result, a target flow chart whose format is a preset format that can be recognized by a preset plug-in comprises: Convert the parsing result into a to-be-processed code having a directed graph data structure; Convert the code to be processed into dot language code; Determine a flowchart file in svg format according to the dot language code; The flowchart file is converted into a target flowchart in a preset format that can be recognized by a preset plug-in.

6. The method according to claim 1, characterized in that The preset plug-in is a drawio plug-in.

7. The method according to claim 1, characterized in that The method further comprises: In response to an export instruction to export the rendered target flowchart, the target flowchart is exported.

8. A flow chart generating device, characterized in that: The device comprises: An acquisition unit, used for acquiring the file content of the flowchart code file; A determining unit, configured to determine, based on the file content, a target flowchart in a preset format that can be recognized by a preset plug-in, wherein the preset plug-in is built into VS Code; The transfer unit is used to transfer the target flowchart to the preset plug-in, so that the preset plug-in renders and displays the target flowchart.

9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.