Disclosure of Invention
By providing the method, the device, the equipment and the medium for generating the function flow chart based on the code characteristics, the technical problem that the function flow chart cannot be acquired through the code data in the project in the prior art is solved, and the technical effect of acquiring the function flow chart through the code data is achieved.
In a first aspect, the present application provides a method for generating a functional flowchart based on code features, the method comprising:
responding to a flow chart generation instruction of the page code, and acquiring an incidence relation between page identification nodes in the page code;
carrying out logic identification on the page code by using the keywords to obtain a logic judgment result;
and generating a flow chart corresponding to the page code according to the association relation and the logic judgment result.
Further, acquiring an association relationship between page identification nodes in the page code, including:
identifying a recursive path of the page code;
and determining the association relation between the page identification nodes in the page code according to the recursive path.
Further, according to the association relationship and the logic judgment result, generating a flow chart corresponding to the page code, including:
determining the shape of the preset flow chart according to the incidence relation and the logic judgment result;
and generating a flow chart corresponding to the page code according to the association relation, the logic judgment result and the preset flow chart.
Further, generating a flow chart corresponding to the page code according to the association relation, the logic judgment result and the preset flow chart, wherein the flow chart comprises:
and filling page identification nodes in the preset flow chart according to the incidence relation and the logic judgment result to generate the flow chart corresponding to the page code.
In a second aspect, the present application provides an apparatus for generating a functional flowchart based on code features, the apparatus comprising:
the acquisition module is used for responding to a flow chart generation instruction of the page code and acquiring the incidence relation between the page identification nodes in the page code;
the identification module is used for carrying out logic identification on the page code by utilizing the keywords to obtain a logic judgment result;
and the generating module is used for generating a flow chart corresponding to the page code according to the association relation and the logic judgment result.
Further, the obtaining module specifically includes:
the identification submodule is used for identifying a recursion path of the page code;
and the determining submodule is used for determining the incidence relation between the page identification nodes in the page code according to the recursive path.
Further, the generating module specifically includes:
the determining submodule is used for determining the shape of the preset flow chart according to the incidence relation and the logic judgment result;
and the generation submodule is used for generating a flow chart corresponding to the page code according to the association relation, the logic judgment result and the preset flow chart.
And further, the generation submodule is used for filling the page identification nodes in the preset flow chart according to the association relation and the logic judgment result, and generating the flow chart corresponding to the page code.
In a third aspect, the present application provides an electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute to implement a method of generating a functional flowchart based on code characteristics.
In a fourth aspect, the present application provides a non-transitory computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform a method for implementing a functional flowchart generation based on code features.
One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
when a flow chart generation instruction of a page code is received, the incidence relation between page identification nodes in the page code is acquired, the page code is logically identified by utilizing keywords to obtain a logical judgment result, and then the flow chart corresponding to the page code is generated according to the incidence relation and the logical judgment result, so that the purpose of constructing a functional flow chart according to the code is realized, and then the corresponding functional flow chart can be constructed aiming at a project in the research and development process, so that the research and development progress and research and development general view of the project are determined, the project progress communication of a project research and development team is facilitated, and the research and development efficiency of the project is improved.
Detailed Description
By providing the method for generating the function flow chart based on the code characteristics, the embodiment of the application solves the technical problem that the function flow chart cannot be acquired through code data in a project in the prior art.
In order to solve the technical problems, the general idea of the embodiment of the application is as follows:
a method for generating a functional flow chart based on code characteristics, the method comprising: responding to a flow chart generation instruction of the page code, and acquiring an incidence relation between page identification nodes in the page code; carrying out logic identification on the page code by using the keywords to obtain a logic judgment result; and generating a flow chart corresponding to the page code according to the association relation and the logic judgment result.
When a flow chart generation instruction of a page code is received, not only is an incidence relation between page identification nodes in the page code obtained, but also a keyword is utilized to carry out logic identification on the page code to obtain a logic judgment result, and then a flow chart corresponding to the page code is generated according to the incidence relation and the logic judgment result, so that the purpose of constructing a functional flow chart according to the code is achieved, and a corresponding functional flow chart can be constructed aiming at a project in a research and development process to determine the research and development progress and research and development overview of the project, so that the project progress communication of a project research and development team is facilitated, and the research and development efficiency of the project is improved.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
First, it is stated that the term "and/or" appearing herein is merely one type of associative relationship that describes an associated object, meaning that three types of relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
In the related art, the functional flow chart is mainly compiled based on the requirement document of the user, and then project research and development are carried out. That is, the functional flowchart can only be determined based on the user's requirements profile. However, in the actual development process, there is also project development without requirement documents, which results in difficulty in acquiring the functional flowchart.
In order to solve the above problem, the present embodiment provides a method for generating a function flowchart based on code features as shown in fig. 1, where the method includes steps S11-S13.
Step S11, responding to the flow chart generation instruction of the page code, and acquiring the incidence relation between the page identification nodes in the page code;
step S12, carrying out logic identification on the page code by using the keyword to obtain a logic judgment result;
and step S13, generating a flow chart corresponding to the page code according to the incidence relation and the logic judgment result.
The interfaces of the software are mainly associated through page identification. The page identification may be a link address. And acquiring the incidence relation among the page identification nodes in the page code, and determining the relation between the upper page and the lower page among the page identification nodes. Specifically, by identifying a recursive path of the page code, and determining an association relationship between page identification nodes in the page code according to the recursive path.
For example, as shown in fig. 2, the page code includes 3 page identifier nodes, which are respectively a page identifier node No. 1, a page identifier node No. 2, and a page identifier node No. 3, and the page identifier node No. 2 or the page identifier node No. 3 can be reached through the page identifier node No. 1. The association relationship is a link relationship between the page identifier node 1 and the page identifier node 2 or the page identifier node 3.
The plurality of page identification nodes have a sequential or parallel relationship, so that in actual operation, a root node in the plurality of page identification nodes can be determined first, and child nodes related to the root node are determined by taking the root node as a starting point.
In a page, there is typically a logical decision, such as a subsequent node selection using an if statement. In this embodiment, the logical judgment in the page code is identified according to the keyword, and the logical judgment result of each node is obtained.
The sequence of each page identification node can be determined according to the association relationship, and a flow chart corresponding to the page code can be generated by combining the logic judgment result.
When the flow chart corresponding to the page code is generated according to the association relation and the logic judgment result, the following steps can be adopted:
determining the shape of the preset flow chart according to the incidence relation and the logic judgment result;
and generating a flow chart corresponding to the page code according to the association relation, the logic judgment result and the preset flow chart.
According to the type of the association relationship and the logic judgment result, the shape of each flow frame in the preset flow chart can be determined. For example, as shown in fig. 3, when the page code includes 5 page identifier nodes, which are respectively the page identifier node 1, the page identifier node 2, the page identifier node 3, the page identifier node 4, and the page identifier node 5, where the page identifier node 1 is a start node, a flow frame with a rounded rectangle may be used, and the page identifier node 3 is a logic judgment node, which may be represented by a diamond, and the page identifier node 2, the page identifier node 4, and the page identifier node 5 all represent a common flow, and thus a common rectangle may be used.
And according to the incidence relation and the logic judgment result, filling the page identification nodes in the preset flow chart to generate the flow chart corresponding to the page code.
Fig. 4 is a flowchart of an embodiment of the present application.
And identifying a recursion path of the page code, and acquiring a recursion incidence relation between page identification nodes. Meanwhile, the logic judgment in the page code can be identified by the keywords, and a logic judgment result is obtained. And setting the shape of a preset flow chart according to the recursion association relation and the logic judgment result between the page identification nodes, generating the flow chart associated with the recursion path, and adding the logic judgment result to further generate the flow chart of the page code.
In summary, when the flow chart generation instruction of the page code is received, the embodiment not only obtains the association relationship between the page identifier nodes in the page code, but also performs logical identification on the page code by using the keyword to obtain a logical judgment result, and then generates the flow chart corresponding to the page code according to the association relationship and the logical judgment result, thereby achieving the purpose of constructing the functional flow chart according to the code, and further constructing the corresponding functional flow chart for the project in the research and development process to determine the research and development progress and research and development profile of the project, facilitating project progress communication of a project research and development team, and improving the research and development efficiency of the project.
Based on the same inventive concept, the present embodiment provides an apparatus for generating a functional flowchart based on code features as shown in fig. 5, the apparatus comprising:
an obtaining module 51, configured to respond to a flowchart generation instruction for the page code, and obtain an association relationship between page identifier nodes in the page code;
the identification module 52 is configured to perform logic identification on the page code by using the keyword to obtain a logic judgment result;
and the generating module 53 is configured to generate a flowchart corresponding to the page code according to the association relationship and the logic determination result.
The obtaining module 51 specifically includes:
the identification submodule is used for identifying a recursion path of the page code;
and the determining submodule is used for determining the incidence relation between the page identification nodes in the page code according to the recursive path.
The generating module 53 specifically includes:
the determining submodule is used for determining the shape of the preset flow chart according to the incidence relation and the logic judgment result;
and the generation submodule is used for generating a flow chart corresponding to the page code according to the association relation, the logic judgment result and the preset flow chart. Specifically, the method and the device are used for filling the page identifier nodes in the preset flow chart according to the association relation and the logic judgment result, and generating the flow chart corresponding to the page code.
The interfaces of the software are mainly associated through page identification. The page identification may be a link address. And acquiring the incidence relation among the page identification nodes in the page code, and determining the relation between the upper page and the lower page among the page identification nodes. Specifically, by identifying a recursion path of the page code, and according to the recursion path, determining an association relationship between page identification nodes in the page code.
For example, as shown in fig. 2, the page code includes 3 page identifier nodes, which are respectively the page identifier node No. 1, the page identifier node No. 2, and the page identifier node No. 3, and the page identifier node No. 2 or the page identifier node No. 3 can be reached through the page identifier node No. 1. The association relationship is a link relationship between the page identifier node 1 and the page identifier node 2 or the page identifier node 3.
The plurality of page identification nodes have a sequential or parallel relationship, so that in actual operation, a root node in the plurality of page identification nodes can be determined first, and child nodes related to the root node are determined by taking the root node as a starting point.
In a page, there is typically a logical decision, such as a subsequent node selection using an if statement. In this embodiment, the logical judgment in the page code is identified according to the keyword, and the logical judgment result of each node is obtained.
The sequence of each page identification node can be determined according to the association relationship, and a flow chart corresponding to the page code can be generated by combining the logic judgment result.
When the flow chart corresponding to the page code is generated according to the association relation and the logic judgment result, the following steps can be adopted:
determining the shape of the preset flow chart according to the incidence relation and the logic judgment result;
and generating a flow chart corresponding to the page code according to the association relation, the logic judgment result and the preset flow chart.
According to the type of the association relationship and the logic judgment result, the shape of each flow frame in the preset flow chart can be determined. For example, when the page code includes 5 page identifier nodes, which are respectively the page identifier node No. 1, the page identifier node No. 2, the page identifier node No. 3, the page identifier node No. 4, and the page identifier node No. 5, where the page identifier node No. 1 is a start node, a flow frame with a rounded rectangle may be used, and the page identifier node No. 3 is a logic judgment node, which may be represented by a diamond, and the page identifier node No. 2, the page identifier node No. 4, and the page identifier node No. 5 all represent a common flow, and thus a common rectangle may be used.
And according to the incidence relation and the logic judgment result, filling the page identification nodes in the preset flow chart to generate the flow chart corresponding to the page code.
The embodiment provides a specific implementation method as follows:
and identifying a recursion path of the page code, and acquiring a recursion incidence relation between page identification nodes. Meanwhile, the logic judgment in the page code can be identified by the keywords, and a logic judgment result is obtained. And setting the shape of a preset flow chart according to the recursion association relation and the logic judgment result between the page identification nodes, generating the flow chart associated with the recursion path, and adding the logic judgment result to further generate the flow chart of the page code.
In summary, when the flow chart generation instruction of the page code is received, the embodiment not only obtains the association relationship between the page identifier nodes in the page code, but also performs logical identification on the page code by using the keyword to obtain a logical judgment result, and then generates the flow chart corresponding to the page code according to the association relationship and the logical judgment result, thereby achieving the purpose of constructing the functional flow chart according to the code, and further constructing the corresponding functional flow chart for the project in the research and development process to determine the research and development progress and research and development profile of the project, facilitating project progress communication of a project research and development team, and improving the research and development efficiency of the project.
Based on the same inventive concept, the present embodiment provides an electronic device as shown in fig. 6, including:
a processor 61;
a memory 62 for storing instructions executable by the processor 61;
wherein the processor 61 is configured to execute to implement a method of generating a functional flowchart based on code characteristics.
Based on the same inventive concept, the present embodiment provides a non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor 61 of an electronic device, the electronic device is enabled to execute a method for generating a functional flowchart based on code features.
Since the electronic device described in this embodiment is an electronic device used for implementing the method for processing information in the embodiment of the present application, a person skilled in the art can understand the specific implementation of the electronic device of this embodiment and various modifications thereof based on the method for processing information described in this embodiment of the present application, and therefore, how to implement the method in the embodiment of the present application by the electronic device is not described in detail herein. Electronic devices used by those skilled in the art to implement the method for processing information in the embodiments of the present application are all within the scope of the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.