CN104049959A - Method for converting flow chart into executable language - Google Patents
Method for converting flow chart into executable language Download PDFInfo
- Publication number
- CN104049959A CN104049959A CN201310081740.8A CN201310081740A CN104049959A CN 104049959 A CN104049959 A CN 104049959A CN 201310081740 A CN201310081740 A CN 201310081740A CN 104049959 A CN104049959 A CN 104049959A
- Authority
- CN
- China
- Prior art keywords
- node
- statement
- flow diagram
- process flow
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
The invention provides a method for converting a flow chart into an executable language. The method comprises the following steps: a) obtaining and storing target flow chart data, node data and node relational data information; b) according to the node data and the node relational data information, generating the node sequence of flow direction relationship between nodes; c) causing node numbers in the node data into corresponding statement mark numbers; d) according to the node data information, generating an expression corresponding to each node of the flow chart; e) according to the information of the next node in the node sequence, generating a goto statement. According to the method for converting the flow chart into the executable language, which is disclosed by the invention, the jumping function of the goto statement and the node flow direction relationship in the flow chart are fully utilized, and influence of chaos caused by using if conditional statements to nest for multiple times in the process of converting the complex flow chart made by a user into the executable language is avoided. The structure is clear, time for programming personnel to detect wrong statements when programmed statements go wrong is shortened, thereby being convenient to maintain, and improving the programming efficiency. According to the method for converting the flow chart into the executable language, which is disclosed by the invention, the user and the flow chart can be better interacted.
Description
Technical field
The present invention relates to areas of information technology, particularly a kind of by process flow diagram be converted to can effective language method.
Background technology
Process flow diagram is the flow through information flow of a system, the figure representative that viewpoint flows or parts flow.Process flow diagram is the effective means that discloses and grasp closed system moving situation.As diagnostic tool, it can be formulated by aid decision making, allows supvr's problem of knowing clearly where may go out, thereby determines alternative action scheme.
From the angle using, user or supvr are for visioning procedure figure such as a certain business, management, producing and selling flow processs and use or allow other people to use, and do not spend consideration and how process flow diagram and content thereof are converted to executable computerese; From the angle of technology, programming personnel need to obtain the data message of the each node of process flow diagram, and the process flow diagram that user is done converts to can effective language, and promotes as much as possible the implementation effect of language, realizes user and process flow diagram mutual better.
But, in actual process, user's process flow diagram content is converted to can effective language time because most of process flow diagram relates to one or more decision node, form multiple choices path, especially especially huge and complicated process flow diagram, need to use multiple if conditional statements to realize if programming personnel uses conventional methods, the in the situation that of tens even up to a hundred of Nested conditions, be easy to cause statement confusion, programming personnel also to waste time and energy in the time of inspect statement and be unfavorable for safeguarding.
Summary of the invention
For existing by process flow diagram be converted to can effective language problem, the present invention proposes a kind of by process flow diagram be converted to can effective language method, obtain process flow diagram related data information, generate sequence node according to the relation that flows between node, generated statement label, generate node expression, then according to the Information generation goto statement of next node in sequence node.
For realizing foregoing invention content, the present invention adopted a kind of by process flow diagram be converted to can effective language optimization method, the method comprises the following steps:
A. obtain target flow process diagram data, node data, node relationships data message and preserve;
B. generate according to node data, node relationships data message the sequence node that flows to relation between node;
C. the node serial number in node data is generated to corresponding statement label;
D. according to expression formula corresponding to the each node of node data Information generation process flow diagram;
E. according to the information of next node in sequence node, generate goto statement.
Further, described process flow diagram node type comprises start node, decision node, XM, end node.
Further, process flow diagram be converted to can the process of effective language in, obtain node type according to node data information, if node type is start node, get the numbering of its next node, generation goto statement makes it jump to its next node and numbers corresponding statement label; If node type is XM, get the numbering of its next node, generation goto statement makes it jump to its next node and numbers corresponding statement label; If node type is decision node, uses particular statement to process its branch's content, and generate goto statement and make it jump to corresponding child node to number corresponding statement label; If node type is end node, this node is without next node, without generating goto statement.
Further, for decision node, this node has several child nodes, under statement label corresponding to its node serial number, generates several corresponding goto statements.
Further, described particular statement is if statement.
Further, described particular statement is switch statement.
In addition, process flow diagram involved in the present invention is the process flow diagram of having determined, can not make an amendment again; If amendment, treats as new process flow diagram.
Compared with prior art, the present invention takes full advantage of node-flow in turn function and the process flow diagram of goto statement to relation, converts to and can in the process of effective language, avoid repeatedly using the nested impact causing confusion of if conditional statement user being done to Complicated Flow figure; Clear in structure, has reduced in the time that programmed statements goes wrong programming personnel and has detected time of wrong statement, is convenient to safeguard, improves programming efficiency; Meanwhile, the present invention has realized user and process flow diagram is mutual better.
Brief description of the drawings
Fig. 1 is a kind of process flow diagram that process flow diagram is converted to method that can effective language provided by the present invention;
Fig. 2 is a kind of node transfer process figure that process flow diagram is converted to method that can effective language provided by the present invention;
Fig. 3-1 is decision node conversion if statement embodiment in process flow diagram provided by the present invention;
Fig. 3-2 are decision node conversion switch statement embodiment in process flow diagram provided by the present invention.
Embodiment
For make that the present invention mentions a kind of by process flow diagram be converted to can effective language method and advantage thereof more explicit, referring to accompanying drawing, the present invention is further described in detail.
Fig. 1 is a kind of process flow diagram that process flow diagram is converted to method that can effective language provided by the present invention, and as shown in Figure 1, the main process step of the method is as follows:
Step 1, obtains target flow process diagram data, node data, node relationships data message and preserves.
Process flow diagram is converted to can effective language, first needs to obtain the related data information of process flow diagram, and wherein, process flow diagram data mainly comprise the information such as process flow diagram numbering, title, type, state, description; Node data mainly comprises the information such as node serial number, type expression, expression formula state, expression formula return type, expression formula description; Node relationships data mainly comprise node serial number, child node numbering, node state, node description etc.
Step 2, generates according to node data, node relationships data message the sequence node that flows to relation between node.
Realizing an important step of the present invention is exactly the internodal relation that flows to, and present node is the node of which kind of type, and which node its next node or each condition node are, the like, form sequence node.
Step 3, generates corresponding statement label by the node serial number in node data.
All nodes in process flow diagram, according to certain rule numbers, are orderly, and the coding rule using in same process flow diagram is identical with numbering data type.Equally, statement label corresponding to node serial number, also according to certain regular label, is orderly, and the label using in same process flow diagram rule is identical with statement label data type.For example: use P to represent node, P1, P2, P3 ..., PN (wherein N >=3) represents the numbering of each node.Use L to represent the statement label that it is corresponding, generate L1, L2, L3 ..., LN (wherein N >=3).
Step 4, according to expression formula corresponding to the each node of node data Information generation process flow diagram.
In process flow diagram, no matter be start node, XM, decision node, end node, each node has its corresponding expression formula.
Step 5, according to the information of next node in sequence node, generates goto statement.
According to the numbering of the next node of each node in the sequence node in step 2, generation goto statement jumps to the statement label of the numbering correspondence of next node.
Fig. 2 is a kind of node transfer process figure that process flow diagram is converted to method that can effective language provided by the present invention, and as shown in Figure 2, this process is as follows:
Obtain node type according to node data information, if node type is start node, get the numbering of its next node, generation goto statement makes it jump to its next node and numbers corresponding statement label.In Fig. 2, the statement label of supposing the next node that start node is corresponding is A, generates goto statement and makes it jump to A, " goto A "; If node type is XM, get the numbering of its next node, generation goto statement makes it jump to its next node and numbers corresponding statement label.The statement label of supposing next node corresponding to XM is B, generates goto statement and makes it jump to B, " gotoB "; If node type is decision node, uses particular statement to process its branch's content, and generate goto statement and make it jump to corresponding child node to number corresponding statement label.The statement label of supposing child node corresponding to decision node be C1, C2 ..., generate successively goto statement make its jump to C1, C2 ..., " goto C1 ", " goto C2 " " goto... "; If node type is end node, this node is without next node, without generating goto statement.
Further, if target flowchart logic has problem, the process flow diagram that user draws is in other words incorrect, adopts time of the present invention and there will be the situation that cannot continue execution midway, can not completely complete that process flow diagram is converted to can effective language.Now, can take various ways to carry out ensuing operation, for example: process flow diagram mistake, direct method ends, prompting makes mistakes in finishing interior node of perhaps makeing mistakes, permission user continue execution etc. after amendment.
Fig. 3-1 is decision node conversion if statement embodiment in process flow diagram provided by the present invention, as shown in the figure, the content in the node frame upper left corner is node serial number, content in node frame before@symbol is the statement label that node is corresponding, @symbol content is below nodename, ": " below content is node expression, and the result that decision node executes after expression formula is true " Y ", and result is false " N ".Table 1 is process flow diagram interdependent node information, this information not necessarily will exist with the form of table, for clarity, the present embodiment represents with the form of table, can be clearly seen that the title (S of each node from table 1, a, b, c, d, e, E), numbering (P0, P1, P2, P3, P4, P5, P6), statement label (L0, L1, L2, L3, L4, L5, L6), expression formula (x0, x1, x, x3, x4, x5, x6), node type (start node, XM, decision node, decision node, decision node, XM, end node) and the numbering (P1 of next node, P2, P3, P6, P4, P6, P1, P5, P6, without).
Nodename | Node serial number | Statement label | Expression formula | Node type | Next node |
S | P0 | L0 | x0 | Start node | P1 |
a | P1 | L1 | x1 | XM | P2 |
b | P2 | L2 | x2 | Decision node | P3、P6 |
c | P3 | L3 | x3 | Decision node | P4、P6 |
d | P4 | L4 | x4 | Decision node | P1、P5 |
e | P5 | L5 | x5 | XM | P6 |
E | P6 | L6 | x6 | End node | Nothing |
Table 1 process flow diagram nodal information
Node in dotted line frame is decision node b, c, and d, and the statement label of child node corresponding to the node serial number P2 of decision node b is L3, L6; The statement label of the child node that the node serial number P3 of decision node c is corresponding is L4, L6; The statement label of the child node that the node serial number P4 of decision node d is corresponding is L1, L5.It is as follows that the form of employing if statement converts executable code to the node in dotted line frame:
Fig. 3-2 are decision node conversion switch statement embodiment in process flow diagram provided by the present invention, as shown in the figure, the content in the node frame upper left corner is node serial number, content in node frame before@symbol is the statement label that node is corresponding, @symbol content is below nodename, ": " below content is node expression, and the result that decision node executes after expression formula is true " Y ", and result is false " N ".Table 2 is process flow diagram interdependent node information, this information not necessarily will exist with the form of table, for clarity, the present embodiment represents with the form of table, can be clearly seen that the title (S of each node from table 2, a, b, c, d, e, f, E), numbering (P0, P1, P2, P3, P4, P5, P6, P7), statement label (L0, L1, L2, L3, L4, L5, L6, L7), expression formula (x0, x1, x, x3, x4, x5, x6, x7), node type (start node, XM, decision node, decision node, XM, decision node, XM, end node) and the numbering (P1 of next node, P2, P3, P7, P4, P5, P6, P1, P6, P7, without).
Nodename | Node serial number | Statement label | Expression formula | Node type | Next node |
S | P0 | L0 | x0 | Start node | P1 |
a | P1 | L1 | x1 | XM | P2 |
b | P2 | L2 | x2 | Decision node | P3、P7 |
c | P3 | L3 | x3 | Decision node | P4、P5 |
d | P4 | L4 | x4 | XM | P6 |
e | P5 | L5 | x5 | Decision node | P1、P6 |
f | P6 | L6 | x6 | XM | P7 |
E | P7 | L7 | x7 | End node | Nothing |
Table 2 process flow diagram nodal information
Node in dotted line frame is decision node b, c, and e, and the statement label of child node corresponding to the node serial number P2 of decision node b is L3, L7; The statement label of the child node that the node serial number P3 of decision node c is corresponding is L4, L5; The statement label of the child node that the node serial number P5 of decision node e is corresponding is L1, L6.It is as follows that the form of employing switch statement converts executable code to the node in dotted line frame:
The above is to preferably embodiment of the present invention, and the art personnel should be appreciated that described embodiment non-limiting protection scope of the present invention.Not departing under Spirit Essence of the present invention and principle, aspect details, can change or revise, within all should being encompassed in claim scope of the present invention.
Claims (6)
1. process flow diagram is converted to can effective language a method, it is characterized in that, the method comprises the following steps:
A. obtain target flow process diagram data, node data, node relationships data message and preserve;
B. generate according to node data, node relationships data message the sequence node that flows to relation between node;
C. the node serial number in node data is generated to corresponding statement label;
D. according to expression formula corresponding to the each node of node data Information generation process flow diagram;
E. according to the information of next node in sequence node, generate goto statement.
As claimed in claim 1 a kind of by process flow diagram be converted to can effective language method, it is characterized in that, described process flow diagram node type comprises start node, decision node, XM, end node.
As claimed in claim 1 a kind of by process flow diagram be converted to can effective language method, it is characterized in that, process flow diagram be converted to can the process of effective language in, obtain node type according to node data information, if node type is start node, get the numbering of its next node, generation goto statement makes it jump to its next node and numbers corresponding statement label; If node type is XM, get the numbering of its next node, generation goto statement makes it jump to its next node and numbers corresponding statement label; If node type is decision node, uses particular statement to process its branch's content, and generate goto statement and make it jump to corresponding child node to number corresponding statement label; If node type is end node, this node is without next node, without generating goto statement.
As described in claim 1 or 3 a kind of by process flow diagram be converted to can effective language method, it is characterized in that, for decision node, this node has several child nodes, under statement label corresponding to its node serial number, generates several corresponding goto statements.
As claimed in claim 3 a kind of by process flow diagram be converted to can effective language method, it is characterized in that, described particular statement is if statement.
As claimed in claim 3 a kind of by process flow diagram be converted to can effective language method, it is characterized in that, described particular statement is switch statement.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310081740.8A CN104049959A (en) | 2013-03-15 | 2013-03-15 | Method for converting flow chart into executable language |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310081740.8A CN104049959A (en) | 2013-03-15 | 2013-03-15 | Method for converting flow chart into executable language |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104049959A true CN104049959A (en) | 2014-09-17 |
Family
ID=51502869
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310081740.8A Pending CN104049959A (en) | 2013-03-15 | 2013-03-15 | Method for converting flow chart into executable language |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104049959A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109189758A (en) * | 2018-07-26 | 2019-01-11 | 新华三技术有限公司 | O&M flow designing method, device and equipment, operation method, device and host |
CN111652580A (en) * | 2020-05-29 | 2020-09-11 | 平安医疗健康管理股份有限公司 | Method and device for processing data of nodes |
CN112732643A (en) * | 2021-04-01 | 2021-04-30 | 南京国睿信维软件有限公司 | Method for interconversion of flow chart graphic file data and S1000D standard XML format data |
CN112950744A (en) * | 2021-01-28 | 2021-06-11 | 平安普惠企业管理有限公司 | Method, device and equipment for drawing flow chart by visual drag and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040088689A1 (en) * | 2002-10-31 | 2004-05-06 | Jeffrey Hammes | System and method for converting control flow graph representations to control-dataflow graph representations |
CN1704934A (en) * | 2004-05-31 | 2005-12-07 | 国际商业机器公司 | Method and apparatus for flowchart editing, recombination checking, establishing and conversion |
CN101957745A (en) * | 2009-07-16 | 2011-01-26 | 沈阳高精数控技术有限公司 | Method for converting ladder diagram language into structure text language |
CN102591654A (en) * | 2011-12-28 | 2012-07-18 | 方正国际软件有限公司 | Code generator based on SSH (secure shell) architecture and method |
-
2013
- 2013-03-15 CN CN201310081740.8A patent/CN104049959A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040088689A1 (en) * | 2002-10-31 | 2004-05-06 | Jeffrey Hammes | System and method for converting control flow graph representations to control-dataflow graph representations |
CN1704934A (en) * | 2004-05-31 | 2005-12-07 | 国际商业机器公司 | Method and apparatus for flowchart editing, recombination checking, establishing and conversion |
CN101957745A (en) * | 2009-07-16 | 2011-01-26 | 沈阳高精数控技术有限公司 | Method for converting ladder diagram language into structure text language |
CN102591654A (en) * | 2011-12-28 | 2012-07-18 | 方正国际软件有限公司 | Code generator based on SSH (secure shell) architecture and method |
Non-Patent Citations (2)
Title |
---|
王黎明等: ""程序流程图到代码的自动生成算法"", 《西安电子科技大学学报(自然科学版)》 * |
钟志超等: ""流程图与类C语言实时转换方法"", 《东南大学学报(自然科学版)》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109189758A (en) * | 2018-07-26 | 2019-01-11 | 新华三技术有限公司 | O&M flow designing method, device and equipment, operation method, device and host |
CN109189758B (en) * | 2018-07-26 | 2021-02-09 | 新华三技术有限公司 | Operation and maintenance flow design method, device and equipment, operation method, device and host |
CN111652580A (en) * | 2020-05-29 | 2020-09-11 | 平安医疗健康管理股份有限公司 | Method and device for processing data of nodes |
CN111652580B (en) * | 2020-05-29 | 2023-02-14 | 深圳平安医疗健康科技服务有限公司 | Method and device for processing data of nodes |
CN112950744A (en) * | 2021-01-28 | 2021-06-11 | 平安普惠企业管理有限公司 | Method, device and equipment for drawing flow chart by visual drag and storage medium |
CN112950744B (en) * | 2021-01-28 | 2024-02-27 | 深圳市兴海物联科技有限公司 | Visual drag drawing flow chart method, device, equipment and storage medium |
CN112732643A (en) * | 2021-04-01 | 2021-04-30 | 南京国睿信维软件有限公司 | Method for interconversion of flow chart graphic file data and S1000D standard XML format data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Sadeghi et al. | Markov properties for mixed graphs | |
CN104049959A (en) | Method for converting flow chart into executable language | |
CN107783762A (en) | Interface creating method, device, storage medium and computer equipment | |
CN102354144B (en) | Method for converting ladder diagram into PLC (Programmable Logic Controller) program command | |
Secui | A method based on the ant colony optimization algorithm for dynamic economic dispatch with valve‐point effects | |
CN103400025B (en) | A kind of analysis method of reachability of hybrid system | |
CN103248041B (en) | Looped network detection method based on bus depth conflict calculation | |
CN104049958A (en) | Optimization method for converting flow chart into executable language | |
CN105302889B (en) | The conversion method and device of data store organisation | |
Amir et al. | Positive speed for high-degree automaton groups | |
CN110765730A (en) | Method for simplifying combined logic circuit | |
CN104572457B (en) | A kind of method transformed the non-universal finite state machine containing special transfer process | |
Lee et al. | Boosting SBDS for partial symmetry breaking in constraint programming | |
Ehlers et al. | Faster sorting networks for $17 $, $19 $ and $20 $ inputs | |
CN105447134A (en) | Optimization method of a frequent item set mining algorithm | |
Elmasry et al. | A new algorithm for the shortest‐path problem | |
CN105550215B (en) | A kind of storage and the method for quickly retrieving of vehicle diagnosis condition randomness and relevance | |
CN104484368A (en) | Algorithm for searching keywords of large-scale graph data on basis of MapReduce | |
CN108804273A (en) | A kind of method that the logic of modality is converted into state transition system | |
Chao et al. | Representation of supervisory controls using state tree structures, binary decision diagrams, automata, and supervisor reduction | |
Pham et al. | On optimization of minimized assumption generation method for component-based software verification | |
Messinger et al. | The robot cleans up | |
Adamaszek | Efficient enumeration of graceful permutations | |
Kumar et al. | Bidirectional Graph Search Techniques for Finding Shortest Path in Image Based Maze Problem | |
Mahmood et al. | An efficient multi-stages algorithm for the determination of communication network reliability |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20140917 |
|
WD01 | Invention patent application deemed withdrawn after publication |