CN104049958A - Optimization method for converting flow chart into executable language - Google Patents

Optimization method for converting flow chart into executable language Download PDF

Info

Publication number
CN104049958A
CN104049958A CN201310081739.5A CN201310081739A CN104049958A CN 104049958 A CN104049958 A CN 104049958A CN 201310081739 A CN201310081739 A CN 201310081739A CN 104049958 A CN104049958 A CN 104049958A
Authority
CN
China
Prior art keywords
node
flow diagram
class
process flow
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310081739.5A
Other languages
Chinese (zh)
Inventor
牟春林
冯平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SUZHOU JINGYIHUI INFORMATION TECHNOLOGY Co Ltd
Original Assignee
SUZHOU JINGYIHUI INFORMATION TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SUZHOU JINGYIHUI INFORMATION TECHNOLOGY Co Ltd filed Critical SUZHOU JINGYIHUI INFORMATION TECHNOLOGY Co Ltd
Priority to CN201310081739.5A priority Critical patent/CN104049958A/en
Publication of CN104049958A publication Critical patent/CN104049958A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention provides an optimization 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) packaging the target flow chart into an independent class X; c) causing the flow direction relationship between nodes to be generated into the sequence attribute of the class X; d) according to a node number and a data type in node information, generating the node number and the data type into the class X attribute; e) according to an expression in each piece of node information, generating a corresponding class X method; f) generating a class X configuration method, wherein the function is that the method generated in step e is analyzed and executed according to the sequence attribute information in step c. According to the optimization method disclosed by the invention, the class function in an object-oriented language and the node relationship in the flow chart are fully utilized, influence of chaos caused by using if conditional statements to nest for multiple times in the process of converting the complex flow chart into the executable language is avoided.

Description

A kind of by process flow diagram be converted to can effective language optimization method
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 optimization 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 of 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 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.
Yet, 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, formed multiple choices path, especially especially huge and complicated process flow diagram, if programming personnel uses conventional methods, need to use a plurality of if conditional statements to realize, the in the situation that of tens even up to a hundred of Nested conditions, be easy to cause statement chaotic, programming personnel is also wasted time and energy and is unfavorable for safeguarding when inspect statement.
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 optimization method, the method on the basis that obtains process flow diagram relevant information using whole process flow diagram as a class X independently, generate sequence properties, nodal community and the corresponding method of class X, then by building method, resolve the method generating.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. target process flow diagram is packaged into an independently class X;
C. the relation that flows between node is generated as to the sequence properties of class X;
D. according to the node serial number in nodal information and data type, generated the attribute of class X;
E. according to the expression formula in each nodal information, generate the method for corresponding class X;
F. generate the building method of class X, function is the method generating according in the sequence properties information analysis execution step e in step c.
Further, process flow diagram node type comprises start node, decision node, XM, end node.
Further, the technology implementation procedure of the building method of step f is: according to the ID that imports node into, from nodal information, get the type of this node, if this node type is end node, and method ends; If this node type is start node, according to the id information of the next node in nodal information, using present node ID as importing parameter into, recursive call this method; If node is decision node, obtain each condition node id information of this node, by reflex mechanism, carry out successively the method that ID is corresponding, and to obtain execution result be genuine nodal information, obtain the next node id information that this node is corresponding, using this ID as parameter recursive call this method; If node type is XM, by reflex mechanism, call method corresponding to this node ID of carrying out, the complete rear next node ID by this node is as parameter recursive call this method.
Further, nodal information refers to the content in node data or node relationships data.
Further, sequence properties is the data of json form.
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 revise, treat as new process flow diagram.
Compared with prior art, the present invention takes full advantage of the function of class in object oriented language and the node relationships in process flow diagram, converts to and can in the process of effective language, avoid the impact that repeatedly service condition nesting of statements causes confusion user being done to Complicated Flow figure; Reduce the time that when programmed statements goes wrong programming personnel detects wrong statement, be convenient to safeguard, improved programming efficiency; Meanwhile, the present invention has realized user and process flow diagram is mutual better.
Accompanying drawing explanation
Fig. 1 is a kind of process flow diagram that process flow diagram is converted to optimization method that can effective language provided by the present invention;
Fig. 2 be provided by the present invention a kind of by process flow diagram be converted to can the optimization method of effective language in the technology resolving figure of building method;
Fig. 3 is a kind of embodiment that process flow diagram is converted to optimization method that can effective language 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 optimization 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 optimization 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, is packaged into an independently class X by target process flow diagram.
Using target process flow diagram as a class X independently, the related content of process flow diagram all realizes in such.The title of class can be carried out according to process flow diagram title ID self-defined, also can realize according to other modes.For example: utilize process flow diagram title ID to generate corresponding class name, or generate corresponding class name with the specific function of process flow diagram.
Step 3, is generated as the relation that flows between node the sequence properties of class X.
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, the sequence properties using these contents as class X.Sequence properties can be the data of json form or the data of XML form or the data of HTML form or the data of self-defined form, and data mode is determined according to actual user demand.
Step 4, according to the node serial number in nodal information and data type, is generated the attribute of class X.
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, then by the attribute of node serial number Information generation class X.For example: use P to represent node, P1, P2, P3 ..., PN (wherein N >=3) represents the numbering of each node.
Step 5, according to the expression formula in each nodal information, generates the method for corresponding class X.
In process flow diagram, no matter be start node, XM, decision node, end node, each node, to there being expression formula, is generated as the method in class X by these expression formula contents.
Step 6, the building method of generation class X, function is to carry out according to the sequence properties information analysis in class X the method generating in class X.
Generate the building method of class X, according to the sequence properties in step 3, resolve the method generating in execution step 5.According to the ID that imports node into, from nodal information, get the type of this node, then carry out corresponding parse operation.A complete target process flow diagram only has a start node and an end node, and building method can first find start node from sequence properties information, starts to carry out parse operation.
Fig. 2 be provided by the present invention a kind of by process flow diagram be converted to can the optimization method of effective language in the technology resolving figure of building method, this process is as follows:
According to the ID that imports node into, from nodal information, get the type of this node, if this node type is end node, method ends; If this node type is start node, according to the id information of the next node in nodal information, using present node ID as importing parameter into, recursive call this method; If node is decision node, obtain each condition node id information of this node, by reflex mechanism, carry out successively the method that ID is corresponding, and to obtain execution result be genuine nodal information, obtain the next node id information that this node is corresponding, using this ID as parameter recursive call this method; If node type is XM, by reflex mechanism, call method corresponding to this node ID of carrying out, the complete rear next node ID by this node is as parameter recursive call this method.
A kind of implementation that meets technology resolving described in Fig. 2: obtain data from database, data-switching is become to json form.According to the ID that imports node into, from nodal information, get the type of this node, if this node type is end node, method ends; According to the json array of importing node ID into and get its child node, if this node type is start node, from json array, gets the id information of present node, then according to this information, take out the id information of its next node, using present node ID as importing parameter into, recursive call this method; If the size of child node json array is greater than 1, it is decision node, obtain each condition child node id information of this node, by reflex mechanism, carry out successively the method that ID is corresponding, and result is forced to transfer to Boolean type, if result is true, obtain the next node id information that this node is corresponding, using this ID as parameter recursive call this method; If the size of child node json array equals 1, it is XM, by reflex mechanism, calls method corresponding to this node ID of carrying out, and the complete rear next node ID by this node is as parameter recursive call this method.
Further, if target flowchart logic has problem, the process flow diagram that user draws is in other words incorrect, adopts when 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 when finishing interior node of perhaps makeing mistakes, permission user continue execution etc. after modification.
Fig. 3 is a kind of embodiment that process flow diagram is converted to optimization method that can effective language provided by the present invention, as shown in the figure, content in node frame before@symbol is node serial number, @symbol content is below nodename, ": " below content is node expression, 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, from table 1, can be clearly seen that the numbering of title, numbering, expression formula, node type and the next node of each node, in actual storing process, each node might not be placed in order.
Nodename Node serial number Expression formula Node type Next node
S P0 x0 Start node P1
a P1 x1 XM P2
b P2 x2 Decision node P3、P6
c P3 x3 Decision node P4、P6
d P4 x4 Decision node P1、P5
e P5 x5 XM P6
E P6 x6 End node Nothing
Table 1 process flow diagram nodal information
According to method of the present invention, first obtain process flow diagram related data information; Process flow diagram is packaged into class X, if need to quote some bag, before class X, quotes; Content in raw according to table 1 becomes the sequence properties of class X; By process flow diagram related data, according to the numbering of node (P0, P1 ..., P6) and node type (start node, decision node, XM, end node), generate the attribute of class X; According to the expression formula in each nodal information (x0, x1 ..., x6), generate corresponding class X method (x0, x1 ..., x6); Generate the building method of class X, according to sequence properties information analysis, carry out the method generating.
The process of resolving execution generation method is: according to the ID that imports node into, from nodal information, get the type of this node, from node P0, the type of node P0 is start node, manner of execution x0; According to the id information of the next node P1 of P0 in nodal information, the type of node P1 is XM, manner of execution x1; According to the id information of the next node P2 of P1 in nodal information, the type of node P2 is decision node, and its condition node is P3, P6, carries out successively method x3, x6 that P3, P6 are corresponding, and obtaining execution result is genuine node P3 information; According to the id information of the next node P3 of P2 in nodal information, the type of node P3 is decision node, and its condition node is P4, P6, carries out successively method x4, x6 that P4, P6 are corresponding, and obtaining execution result is genuine node P4 information; According to the id information of the next node P4 of P3 in nodal information, the type of node P4 is decision node, and its condition node is P1, P5, carries out successively method x1, x5 that P1, P5 are corresponding, and obtaining execution result is genuine node P5 information; According to the id information of the next node P5 of P4 in nodal information, the type of node P5 is XM, manner of execution x5; According to the id information of the next node P6 of P5 in nodal information, the type of node P6 is end node, method ends.
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 (5)

1. process flow diagram is converted to can effective language an optimization 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. target process flow diagram is packaged into an independently class X;
C. the relation that flows between node is generated as to the sequence properties of class X;
D. according to the node serial number in nodal information and data type, generated the attribute of class X;
E. according to the expression formula in each nodal information, generate the method for corresponding class X;
F. generate the building method of class X, function is the method generating according in the sequence properties information analysis execution step e in step c.
As claimed in claim 1 a kind of by process flow diagram be converted to can effective language optimization 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 or 2 a kind of by process flow diagram be converted to can effective language optimization method, it is characterized in that, the technology implementation procedure of the building method of step f is: the type of getting this node according to the ID that imports node into from nodal information, if this node type is end node, method ends; If this node type is start node, according to the id information of the next node in nodal information, using present node ID as importing parameter into, recursive call this method; If node is decision node, obtain each condition node id information of this node, by reflex mechanism, carry out successively the method that ID is corresponding, and to obtain execution result be genuine nodal information, obtain the next node id information that this node is corresponding, using this ID as parameter recursive call this method; If node type is XM, by reflex mechanism, call method corresponding to this node ID of carrying out, the complete rear next node ID by this node is as parameter recursive call this method.
As claimed in claim 1 a kind of by process flow diagram be converted to can effective language optimization method, it is characterized in that, described nodal information refers to the content in node data or node relationships data.
As claimed in claim 1 a kind of by process flow diagram be converted to can effective language optimization method, it is characterized in that, described sequence properties is the data of json form.
CN201310081739.5A 2013-03-15 2013-03-15 Optimization method for converting flow chart into executable language Pending CN104049958A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310081739.5A CN104049958A (en) 2013-03-15 2013-03-15 Optimization method for converting flow chart into executable language

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310081739.5A CN104049958A (en) 2013-03-15 2013-03-15 Optimization method for converting flow chart into executable language

Publications (1)

Publication Number Publication Date
CN104049958A true CN104049958A (en) 2014-09-17

Family

ID=51502868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310081739.5A Pending CN104049958A (en) 2013-03-15 2013-03-15 Optimization method for converting flow chart into executable language

Country Status (1)

Country Link
CN (1) CN104049958A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117207A (en) * 2017-06-21 2019-01-01 深圳联友科技有限公司 A kind of data processing method of business process model
CN109189758A (en) * 2018-07-26 2019-01-11 新华三技术有限公司 O&M flow designing method, device and equipment, operation method, device and host

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1704934A (en) * 2004-05-31 2005-12-07 国际商业机器公司 Method and apparatus for flowchart editing, recombination checking, establishing and conversion
CN101873334A (en) * 2009-04-24 2010-10-27 同济大学 State-driven executable service flow execution method
CN102591654A (en) * 2011-12-28 2012-07-18 方正国际软件有限公司 Code generator based on SSH (secure shell) architecture and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1704934A (en) * 2004-05-31 2005-12-07 国际商业机器公司 Method and apparatus for flowchart editing, recombination checking, establishing and conversion
CN101873334A (en) * 2009-04-24 2010-10-27 同济大学 State-driven executable service flow execution method
CN102591654A (en) * 2011-12-28 2012-07-18 方正国际软件有限公司 Code generator based on SSH (secure shell) architecture and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘运求: "基于图形的代码自动生成系统优化设计与实现", 《万方数据库》 *
钟志超 等: "流程图与类C语言实时转换方法", 《东南大学学报(自然科学版)》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117207A (en) * 2017-06-21 2019-01-01 深圳联友科技有限公司 A kind of data processing method of business process model
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

Similar Documents

Publication Publication Date Title
CN105095075B (en) Partly legalized fuzz testing case generation method based on finite state machine procotol
Chen Basic properties of the infinite critical-FK random map
CN104392010A (en) Subgraph matching query method
CN104615703B (en) A kind of RDF data distributed parallel inference method of combination Rete algorithms
Matheus et al. Basevisor: A triples-based inference engine outfitted to process ruleml and r-entailment rules
Secui A method based on the ant colony optimization algorithm for dynamic economic dispatch with valve‐point effects
CN105912721B (en) RDF data distributed semantic parallel inference method
Barto et al. New conditions for Taylor varieties and CSP
CN104049959A (en) Method for converting flow chart into executable language
CN104049958A (en) Optimization method for converting flow chart into executable language
CN105701128B (en) A kind of optimization method and device of query statement
Xu et al. Level permutation method for constructing uniform designs under the wrap-around L2-discrepancy
Walsh Breaking value symmetry
Xiao et al. Improving Rete algorithm to enhance performance of rule engine systems
Shi et al. Bidirectional transformation between BPMN and BPEL with graph grammar
Zhang et al. Controllability of probabilistic Boolean control networks with time-variant delays in states
Koriche et al. Compiling constraint networks into multivalued decomposable decision graphs
US10922278B2 (en) Systems and methods for database compression and evaluation
dos Santos et al. Evolutionary algorithm using random multi-point crossover operator for learning Bayesian network structures
Samiullah et al. Automated construction of an object-oriented Bayesian network (OOBN) class hierarchy
Bienvenu et al. On the parameterised complexity of tree-shaped ontology-mediated queries in OWL 2 QL
WO2015125483A1 (en) Telegraphic message conversion system and telegraphic message conversion method for use in m2m
Lee et al. Axioms for quantum gauge fields
Swartjes et al. Why is my supervisor empty? Finding causes for the unreachability of states in synthesized supervisors
Rosati Query rewriting under extensional constraints in dl-lite

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