CN106202006B - Document generating method and device - Google Patents

Document generating method and device Download PDF

Info

Publication number
CN106202006B
CN106202006B CN201610479082.1A CN201610479082A CN106202006B CN 106202006 B CN106202006 B CN 106202006B CN 201610479082 A CN201610479082 A CN 201610479082A CN 106202006 B CN106202006 B CN 106202006B
Authority
CN
China
Prior art keywords
node
code
file
flow chart
configuration file
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.)
Active
Application number
CN201610479082.1A
Other languages
Chinese (zh)
Other versions
CN106202006A (en
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201610479082.1A priority Critical patent/CN106202006B/en
Publication of CN106202006A publication Critical patent/CN106202006A/en
Application granted granted Critical
Publication of CN106202006B publication Critical patent/CN106202006B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents

Abstract

This application discloses document generating methods and device.One specific embodiment of the method includes: to receive the request that code is generated according to flow chart;According to the request, obtain the flow chart of code to be generated, wherein, the flow chart includes connecting line between at least one node and at least one node, the node includes: node identification and nodal information, the nodal information includes: the filename and function name where code corresponding with the node, between the node connecting line include: the node identification of start node, terminal node node identification and node between route data, routing data are used to indicate the execution route after having executed code corresponding with the start node between the node;Extensible markup language xml configuration file is generated according to the flow chart;Code file is generated according to the xml configuration file and stores the code file.The embodiment realizes the efficient code building based on flow chart.

Description

Document generating method and device
Technical field
This application involves field of computer technology, and in particular to programmatics field more particularly to file generated side Method and and device.
Background technique
Configurable programming is to solve object-oriented programming about the limitation of interface and put forward A kind of Programming Methodology changes setting, it is not necessary to application program is recompiled, so that business is patrolled using configuration file substantially at present It collects and separates.
However the prior art realizes that the method for configurable programming is not intuitive enough, logic is unintelligible, and code efficiency is low, reason Solution property is poor.
Summary of the invention
The purpose of the application is to propose a kind of improved document generating method and device, to solve background above technology department Divide the technical issues of mentioning.
In a first aspect, this application provides a kind of document generating methods, which comprises reception is generated according to flow chart The request of code;According to the request, the flow chart of code to be generated is obtained, wherein the flow chart includes at least one section Point at least one node between connecting line, the node includes: node identification and nodal information, the nodal information include: with Filename and function name where the corresponding code of the node, connecting line includes: the node mark of start node between the node Know, route data between the node identification and node of terminal node, between the node routing data be used to indicate executed with it is described Execution route after the corresponding code of start node;Xml (eXtensible Markup is generated according to the flow chart Language, extensible markup language) configuration file;Code file is generated according to the xml configuration file and stores the generation Code file.
In some embodiments, the node further includes node figure, and connecting line further includes connecting between node between the node Wiring figure, connection line graph is the digraph for originating in the start node and terminating at the terminal node between the node Shape routes connection line graph between data and the node and is used to be shown in the flow chart between the node figure, the node In.
In some embodiments, routing data are used to indicate and have executed generation corresponding with the start node between the node Execution route after code, comprising: routing data, which are used to indicate, between the node is executing generation corresponding with the start node Code and after generating return value, select using the start node between the node of starting point between connecting line interior joint routing data with it is described The terminal node of connecting line is as next node between the identical node of return value, and continues to execute corresponding with the next node Code.
In some embodiments, described that xml configuration file is generated according to the flow chart, comprising: newly-built xml configuration text Part;To each node in the flow chart, a node elements are added in the xml configuration file, wherein the node Element includes node elements identity property, sets the value of the node elements identity property of the node elements at the section of the node Point identification;To each node elements in the xml configuration file, function daughter element is added for the node elements, wherein described Function daughter element includes filename attribute and function name attribute, respectively by the value and letter of the filename attribute of the function daughter element The value of several attributes is set as the filename and function name of node corresponding to the node elements;To in the xml configuration file Each node elements, for the node elements add routing daughter element, between the node of the flow chart in connecting line choose Connecting line between the identical node of the node elements identity property value of beginning node identification and the node elements, between selected node Connecting line between every node in connecting line adds next step daughter element, the next step daughter element packet for the routing daughter element It includes and returns to value attribute and next step node identification attribute, the next step daughter element is returned to the value and next step of value attribute respectively The value of node identification attribute is set as between the node routing data and terminal node mark between the node of connecting line;Described in preservation Xml configuration file.
It is in some embodiments, described that code file is generated according to the xml configuration file and stores the code file, It include: that the xml configuration file and code building template file are loaded onto caching;By the code being loaded onto caching Design variables in generation template file replace with each in the xml configuration file being loaded onto caching according to preset rules A element, to generate code file and store the code file.
In some embodiments, the node figure be closed figure, the nodal information further include to the node The description information that the function of corresponding code is described;And the description information is presented on the node diagram with written form In shape.
Second aspect, this application provides a kind of file creating apparatus, described device includes: receiving unit, is configured to Receive the request that code is generated according to flow chart;Acquiring unit is configured to obtain the stream of code to be generated according to the request Cheng Tu, wherein the flow chart includes connecting line between at least one node and at least one node, and the node includes: node Mark and nodal information, the nodal information includes: the filename and function name where code corresponding with the node, described Between node connecting line include: the node identification of start node, terminal node node identification and node between route data, the section Data are routed between point is used to indicate the execution route after having executed code corresponding with the start node;Configuration file generates single Member is configured to generate xml configuration file according to the flow chart;Code file generation unit is configured to according to the xml Configuration file generates code file and stores the code file.
In some embodiments, the node further includes node figure, and connecting line further includes connecting between node between the node Wiring figure, connection line graph is the digraph for originating in the start node and terminating at the terminal node between the node Shape routes connection line graph between data and the node and is used to be shown in the flow chart between the node figure, the node In.
In some embodiments, routing data are used to indicate and have executed generation corresponding with the start node between the node Execution route after code, comprising: routing data, which are used to indicate, between the node is executing generation corresponding with the start node Code and after generating return value, select using the start node between the node of starting point between connecting line interior joint routing data with it is described The terminal node of connecting line is as next node between the identical node of return value, and continues to execute corresponding with the next node Code.
In some embodiments, the configuration file generation unit includes: newly-built module, is configured to newly-built xml configuration File;Node elements adding module is configured to add each node in the flow chart in the xml configuration file Add a node elements, wherein the node elements include node elements identity property, by the node elements of the node elements The value of identity property is set as the node identification of the node;Function daughter element adding module is configured to configure text to the xml Each node elements in part add function daughter element for the node elements, wherein the function daughter element includes filename category Property and function name attribute, set the section for the value of the value of the filename attribute of the function daughter element and function name attribute respectively The filename and function name of node corresponding to point element;Daughter element adding module is routed, is configured to from the flow chart It chooses between start node mark and the identical node of node elements identity property value of the node elements and connects in connecting line between node It is first to add next step for the routing daughter element between connecting line every node in connecting line selected node for wiring Element, the next step daughter element includes returning to value attribute and next step node identification attribute, respectively by the next step daughter element The value of the value and next step node identification attribute that return to value attribute be set as between the node between the node of connecting line routing data and Terminal node mark;Preserving module is configured to save the xml configuration file.
In some embodiments, the code file generation unit includes: loading module, is configured to match the xml It sets file and code building template file is loaded onto caching;Replacement and generation module, are configured to be loaded onto caching for described In code building template file in design variables replace with the xml being loaded onto caching according to preset rules and configure text Each element in part, to generate code file and store the code file.
In some embodiments, the node figure be closed figure, the nodal information further include to the node The description information that the function of corresponding code is described;And the description information is presented on the node diagram with written form In shape.
Document generating method and device provided by the present application generate the request of code by receiving, then according to flow chart According to above-mentioned request, the flow chart of code to be generated is obtained, xml configuration file is generated then according to flow chart, finally according to xml Configuration file generates code file and store code file, realizes with intuitive Automatic generation code file, raising Code efficiency.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that this application can be applied to exemplary system architecture figures therein;
Fig. 2 is the flow chart according to one embodiment of the document generating method of the application;
Fig. 3 a- Fig. 3 b is the schematic diagram according to an application scenarios of the document generating method of the application;
Fig. 4 is the structural schematic diagram according to one embodiment of the file creating apparatus of the application;
Fig. 5 is adapted for the structural schematic diagram for the computer system for realizing the electronic equipment of the embodiment of the present application.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can be using the exemplary system of the embodiment of the document generating method or file creating apparatus of the application System framework 100.
As shown in Figure 1, system architecture 100 may include electronic equipment 101,102 and network 103.Network 103 is in electricity The medium of communication link is provided between sub- equipment 101 and 102.Network 103 may include various connection types, such as wired, nothing Line communication link or fiber optic cables etc..
User can be used electronic equipment 101 and be interacted by network 103 with electronic equipment 102, to receive or send message Deng.Various client applications, such as the application of graphics edition class, Integrated Development Environment can be installed on electronic equipment 101,102 (IDE, Integrated Development Environment) class application etc..For example, electronic equipment 101 can be set to electronics Standby 102 send the request that code is generated according to flow chart, and electronic equipment 102 can generate code according to flow chart to what is received The data such as request carry out the processing such as analyzing, and the flow chart of code to be generated is obtained from electronic equipment 101.
Electronic equipment 101,102 can be the various electronic equipments with display screen and processor, including but not limited to Pocket computer on knee, desktop computer, server, work station etc..
It should be noted that document generating method provided by the embodiment of the present application can be by electronic equipment 101 or 102 Any electronic equipment execute, correspondingly, file creating apparatus is generally positioned in electronic equipment 101 or 102.
Referring to FIG. 2, it illustrates the processes 200 according to one embodiment of the document generating method of the application.It is described Document generating method, comprising the following steps:
Step 201, the request that code is generated according to flow chart is received.
In the present embodiment, the electronic equipment of document generating method operation thereon can locally or remotely receive root According to flow chart generate code request, i.e., above-mentioned request can be user using above-mentioned electronic equipment locally issue according to process Figure generates the request of code, and above-mentioned request is also possible to remotely connect from other electronic equipments connecting with above-mentioned electronic equipment That receives generates the request of code according to flow chart.
In the present embodiment, the above-mentioned request for generating code according to flow chart includes the flow chart of code to be generated.
Step 202, according to above-mentioned request, the flow chart of code to be generated is obtained.
In the present embodiment, above-mentioned electronic equipment can obtain the flow chart of code to be generated according to above-mentioned request.
In the present embodiment, it can be user according to the request that flow chart generates code locally to draw in above-mentioned electronic equipment The request that code is generated according to the flow chart is initiated after completing flow chart;It is also possible to user's selection to be stored in above-mentioned electronics and set The standby local flow chart completed and the request that code is generated according to the flow chart, in this way, above-mentioned electronic equipment can According to above-mentioned request, the local flow chart for obtaining code to be generated.
In the present embodiment, user is also possible to by connecting with above-mentioned electronic equipment according to the request that flow chart generates code The request that other electronic equipments for connecing are initiated, in this way, above-mentioned electronic equipment can according to above-mentioned request, remotely from it is above-mentioned other Electronic equipment obtains the flow chart of code to be generated.
In the present embodiment, flow chart may include connecting line between at least one node and at least one node, wherein section Point includes: node identification and nodal information, and nodal information includes: the filename and function where code corresponding with the node Name, between node connecting line include: the node identification of start node, terminal node node identification and node between route data, In, data are routed between node is used to indicate the execution route after having executed code corresponding with above-mentioned start node.
In some optional implementations of the present embodiment, node can also include node figure, connecting line between node It can also include connecting line graph between node, connection line graph, which can be, between node originates in start node and terminate at terminal node Directed graph, connection line graph between data and node is routed between node figure, node and is displayed in flow charts.
Routed in some optional implementations of the present embodiment, between node data can serve to indicate that having executed and The corresponding code of start node and after generating return value selects using start node between the node of starting point road between connecting line interior joint By the terminal node of connecting line between data and the identical node of above-mentioned return value as next node, and continue to execute with it is above-mentioned under The corresponding code of one node.
In some optional implementations of the present embodiment, node figure can be closed figure, and nodal information may be used also To include the description information that the function of code corresponding with node is described, and foregoing description information can be with written form It is presented in above-mentioned node figure.
In some optional implementations of the present embodiment, flow chart can also include two kinds of special nodes, start Node and end node, flow chart are starting point using end node as terminal using start node.Start node and terminal node can be with There is no corresponding code.
Step 203, xml configuration file is generated according to flow chart.
In the present embodiment, above-mentioned electronic equipment can generate xml configuration file according to flow chart with various methods.
In some optional implementations of the present embodiment, above-mentioned electronic equipment can be in accordance with the following steps according to process Figure generates xml configuration file:
Step 2031, xml configuration file is created.
Step 2032, to each node in flow chart, a node elements are added in xml configuration file.
In the present embodiment, above-mentioned electronic equipment can be to each node in the flow chart obtained in step 202, in step A node elements are added in the xml configuration file created in rapid 2031, here, node elements include that node elements mark belongs to Property, and set the value of the node elements identity property of the node elements to the node identification of the node.
Step 2033, to each node elements in xml configuration file, function daughter element is added for the node elements.
In the present embodiment, above-mentioned electronic equipment can be to each section being added in xml configuration file in step 2032 Point element adds function daughter element for the node elements, wherein and function daughter element includes filename attribute and function name attribute, And it respectively sets the value of the value of the filename attribute of the function daughter element and function name attribute to corresponding to the node elements The filename and function name of node.
Step 2034, to each node elements in xml configuration file, routing daughter element is added for the node elements.
In the present embodiment, above-mentioned electronic equipment can be to each section being added in xml configuration file in step 2032 Point element adds routing daughter element first for the node elements, then from choosing in connecting line between the node of above-mentioned flow chart Connecting line between the identical node of the node elements identity property value of beginning node identification and the node elements, then to selected section Connecting line between every node in connecting line between point adds next step daughter element for above-mentioned routing daughter element, here, next step member Element includes returning to value attribute and next step node identification attribute, finally respectively by the next step daughter element return value attribute value and The value of next step node identification attribute is set as between the node routing data and terminal node mark between the node of connecting line.
Step 2035, above-mentioned xml configuration file is saved.
In the present embodiment, above-mentioned electronic equipment can add node elements and section for above-mentioned xml configuration file Above-mentioned xml configuration file is saved after the function daughter element and routing daughter element of point element.
Step 204, code file and store code file are generated according to xml configuration file.
In the present embodiment, above-mentioned electronic equipment can generate code file according to xml configuration file with various methods.
In the present embodiment, it when generating the request of code according to flow chart is locally issued by above-mentioned electronic equipment, deposited It is local to above-mentioned electronic equipment that storage code file can be storage;When according to flow chart generate code request be by with above-mentioned electricity Other connected electronic equipments of sub- equipment issue, and store code file, which is also possible to remotely to store other above-mentioned electronics, to be set In standby.
In some optional implementations of the present embodiment, code file is generated according to xml configuration file and stores generation Code file can carry out in accordance with the following steps:
Step 2041, xml configuration file and code building template file are loaded onto caching.
In the present embodiment, above-mentioned electronic equipment can obtain xml configuration file and code building template file first Store path reads xml configuration text then according to the store path of above-mentioned xml configuration file and code building template file The content of part and code building template file is simultaneously written in caching.Xml configuration file and code building template file can be deposited It stores up in other electronic equipments that above-mentioned electronic equipment is local or connect with above-mentioned electronic equipment.
In the present embodiment, code building template file can be different and different according to the type of code file to be generated Template file.The type of code file to be generated can be the source code file of various computer languages.Code text to be generated The type of part can be arranged by above-mentioned electronic equipment according to the instruction of user, for example, may provide the user with set interface, It can also be lacked with the type for setting " Java source code " or code file to be generated for the type of code file to be generated Save setting, such as " C language source code ".
Step 2042, the design variables in the code building template file being loaded onto caching are replaced according to preset rules For be loaded onto caching in xml configuration file in each element, to generate code file and store above-mentioned code file.
In the present embodiment, xml configuration file and code building template file can be loaded onto slow by above-mentioned electronic equipment After depositing, the design variables in the code building template file being loaded onto caching are replaced with according to preset rules and are loaded onto Each element in xml configuration file in caching, to generate code file and store above-mentioned code file.
In some optional implementations of the present embodiment, above-mentioned preset rules may include following two rule:
Function Substitution Rules will be loaded onto the code building in caching that is, to each node elements in xml configuration file Code corresponding with the node elements replaces with the filename attribute value in the function daughter element of the node elements in template file With the code in function indicated by function name attribute value;
Substitution Rules are routed, i.e., to each node elements in xml configuration file, the code building in caching will be loaded onto Condition in template file after code corresponding with the node elements judges that code is replaced are as follows: according to having executed the node elements The return value obtained after corresponding code selects to return to value attribute in the next step daughter element of the routing daughter element of the node elements Value next step daughter element identical with above-mentioned return value next step node identification attribute value corresponding to node code As next step by the code of execution.
It is the effect diagram of the embodiment according to the application Fig. 2 below with reference to Fig. 3 a- Fig. 3 b, Fig. 3 a- Fig. 3 b.
Firstly, user has initiated the request for generating code according to flow chart as shown in Figure 3a, in fig. 3 a, flow chart by Start node 301, solution packet node 302, common parameter initialization end node 303, public inspection node 304, modification DNS node 305, change host name node 306, update mode of operation node 307, be packaged node 308 and the composition of end node 309, with public For parameter initialization node 303, the node identification of the node is " InitVar ", and the description information of the node is " common parameter Initialization ", code corresponding with the node is stored in " InitVar " function of the file of file entitled " Common_Operate " Interior, using the node, connecting line has two between the node of starting point, wherein the terminal node of connecting line is node mark between a node Know the public inspection node 304 for " TCZF_ComCheck ", internodal data is " 0 ", the termination of connecting line between another node Node is the packing node 308 that node identification is " TCZF_ComPack ", and internodal data is " -1 ".Wherein, " 0 " represents successfully Return value, " -1 " represent failure return value.
Then, after above-mentioned electronic equipment receives above-mentioned request, above-mentioned flow chart 3a is obtained, and according to above-mentioned flow chart 3a Xml configuration file is generated, the section for the node equally by taking common parameter initializes node 303 as an example, in xml configuration file Point element is shown in fig 3b.Wherein, as in Fig. 3 b icon 310 show node elements, icon 311 show function member Element, icon 312 show routing daughter element, and icon 313 and icon 314 are that the two of daughter element is routed shown in icon 312 respectively A next step daughter element.
Code file is finally generated according to above-mentioned xml configuration file and stores above-mentioned code file.
The document generating method provided by the above embodiment of the application passes through the flow chart for obtaining code to be generated, then root Xml configuration file is generated according to flow chart, code file and store code file are finally generated according to xml configuration file, realized With intuitive Automatic generation code file, code efficiency is improved.
With further reference to Fig. 4, as the realization to method shown in above-mentioned each figure, this application provides a kind of file generated dresses The one embodiment set, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically can be applied to respectively In kind electronic equipment.
As shown in figure 5, file creating apparatus 400 described in the present embodiment include: receiving unit 401, acquiring unit 402, Configuration file generation unit 403 and code file generation unit 404.Wherein, receiving unit 401 are configured to receive according to stream The request of journey figure generation code;Acquiring unit 402 is configured to obtain the flow chart of code to be generated according to above-mentioned request, In, above-mentioned flow chart includes connecting line between at least one node and at least one node, and above-mentioned node includes: node identification and section Point information, above-mentioned nodal information include: the filename and function name where code corresponding with above-mentioned node, are connected between above-mentioned node Wiring include: the node identification of start node, terminal node node identification and node between route data, routed between above-mentioned node Data are used to indicate the execution route after having executed code corresponding with above-mentioned start node;Configuration file generation unit 403, matches It sets for generating xml configuration file according to above-mentioned flow chart;Code file generation unit 404 is configured to be matched according to above-mentioned xml It sets file generated code file and stores above-mentioned code file.
In some optional implementations of the present embodiment, above-mentioned node further includes node figure, is connected between above-mentioned node Wiring further includes that line graph is connected between node, between above-mentioned node connection line graph be originate in above-mentioned start node terminate at it is above-mentioned The directed graph of terminal node routes connection line graph between data and above-mentioned node and is used between above-mentioned node figure, above-mentioned node It is shown in above-mentioned flow chart.
In some optional implementations of the present embodiment, between above-mentioned node route data be used to indicate executed with it is upper Execution route after stating the corresponding code of start node, comprising: between above-mentioned node route data be used to indicate executed with it is upper After stating the corresponding code of start node and generating return value, select to save in connecting line between the node of starting point using above-mentioned start node The terminal node of connecting line between data and the identical node of above-mentioned return value is routed between point as next node, and continue to execute and The corresponding code of above-mentioned next node.
In some optional implementations of the present embodiment, above-mentioned configuration file generation unit 403 may include: newly-built Module 4031 is configured to newly-built xml configuration file;Node elements adding module 4032 is configured to in above-mentioned flow chart Each node, in above-mentioned xml configuration file add a node elements, wherein above-mentioned node elements include node elements Identity property sets the value of the node elements identity property of above-mentioned node elements to the node identification of the node;Function member Plain adding module 4033, is configured to each node elements in above-mentioned xml configuration file, adds function for the node elements Daughter element, wherein above-mentioned function daughter element includes filename attribute and function name attribute, respectively by the text of above-mentioned function daughter element The value of part name attribute and the value of function name attribute are set as the filename and function name of node corresponding to the node elements;Routing Daughter element adding module 4034 is configured to each node elements in above-mentioned xml configuration file, for node elements addition Daughter element is routed, from the node elements for choosing start node mark and the node elements between the node of above-mentioned flow chart in connecting line Connecting line between the identical node of identity property value is above-mentioned between connecting line every node in connecting line selected node It routes daughter element and adds next step daughter element, above-mentioned next step daughter element includes returning to value attribute and next step node identification category Property, respectively the value of the value of next step daughter element return value attribute and next step node identification attribute is set as connecting between the node Data and terminal node mark are routed between the node of wiring;Preserving module 4035 is configured to save above-mentioned xml configuration file.
In some optional implementations of the present embodiment, above-mentioned code file generation unit 404 may include: load Module 4041 is configured to for above-mentioned xml configuration file and code building template file being loaded onto caching;Replacement and generation mould Block 4042 is configured to replace the design variables in the above-mentioned code building template file being loaded onto caching according to preset rules The each element being changed in the above-mentioned xml configuration file being loaded onto caching, to generate code file and store above-mentioned code File.
In some optional implementations of the present embodiment, above-mentioned node figure is closed figure, above-mentioned nodal information It further include the description information that the function of code corresponding with above-mentioned node is described;And foregoing description information is with text shape Formula is presented in above-mentioned node figure.
Below with reference to Fig. 5, it illustrates the computer systems 500 for the electronic equipment for being suitable for being used to realize the embodiment of the present application Structural schematic diagram.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data. CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.; And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon Computer program be mounted into storage section 508 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be tangibly embodied in machine readable Computer program on medium, the computer program include the program code for method shown in execution flow chart.At this In the embodiment of sample, which can be downloaded and installed from network by communications portion 509, and/or from removable Medium 511 is unloaded to be mounted.When the computer program is executed by central processing unit (CPU) 501, execute in the present processes The above-mentioned function of limiting.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, Ke Yiyong The dedicated hardware based system of defined functions or operations is executed to realize, or can be referred to specialized hardware and computer The combination of order is realized.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packet Include receiving unit, acquiring unit, configuration file generation unit and code file generation unit.Wherein, the title of these units exists The restriction to the unit itself is not constituted in the case of certain, for example, receiving unit is also described as " receiving according to process Figure generates the unit of the request of code ".
As on the other hand, present invention also provides a kind of nonvolatile computer storage media, the non-volatile calculating Machine storage medium can be nonvolatile computer storage media included in device described in above-described embodiment;It is also possible to Individualism, without the nonvolatile computer storage media in supplying terminal.Above-mentioned nonvolatile computer storage media is deposited One or more program is contained, when one or more of programs are executed by an equipment, so that the equipment: receiving The request of code is generated according to flow chart;According to above-mentioned request, the flow chart of code to be generated is obtained, wherein above-mentioned flow chart Including connecting line between at least one node and at least one node, above-mentioned node includes: node identification and nodal information, above-mentioned section Point information includes: the filename and function name where code corresponding with above-mentioned node, and connecting line includes: starting between above-mentioned node Data are routed between the node identification of node, the node identification of terminal node and node, routing data are used to indicate between above-mentioned node Execution route after having executed code corresponding with above-mentioned start node;Xml configuration file is generated according to above-mentioned flow chart;According to Above-mentioned xml configuration file generates code file and stores above-mentioned code file.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from the inventive concept, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (12)

1. a kind of document generating method, which is characterized in that the described method includes:
Receive the request that code is generated according to flow chart;
According to the request, the flow chart of code to be generated is obtained, wherein the flow chart includes at least one node and at least Connecting line between one node, the node include: node identification and nodal information, and the nodal information includes: and the node Filename and function name where corresponding code, connecting line includes: the node identification of start node, terminal node between the node Data are routed between the node identification and node of point, routing data, which are used to indicate, between the node has executed and the start node pair Execution route after the code answered;
Extensible markup language xml configuration file is generated according to the flow chart;
Code file is generated according to the xml configuration file and stores the code file.
2. connecting between the node the method according to claim 1, wherein the node further includes node figure Wiring further includes that line graph is connected between node, between the node connection line graph be originate in the start node terminate at it is described The directed graph of terminal node routes connection line graph between data and the node and is used between the node figure, the node It is shown in the flow chart.
3. having been executed and institute the method according to claim 1, wherein routing data between the node and being used to indicate Execution route after stating the corresponding code of start node, comprising:
Data are routed between the node to be used to indicate after having executed code corresponding with the start node and having generated return value, It selects to route data node identical with the return value between connecting line interior joint between the node of starting point using the start node Between connecting line terminal node as next node, and continue to execute code corresponding with the next node.
4. the method according to claim 1, wherein described generate xml configuration file, packet according to the flow chart It includes:
Newly-built xml configuration file;
To each node in the flow chart, a node elements are added in the xml configuration file, wherein the section Point element includes node elements identity property, sets the node for the value of the node elements identity property of the node elements Node identification;
To each node elements in the xml configuration file, function daughter element is added for the node elements, wherein the letter Number daughter element includes filename attribute and function name attribute, respectively by the value and function of the filename attribute of the function daughter element The value of name attribute is set as the filename and function name of node corresponding to the node elements;
To each node elements in the xml configuration file, routing daughter element is added for the node elements, from the flow chart Node between choose in connecting line start node mark between the identical node of node elements identity property value of the node elements Connecting line is the next step of routing daughter element addition between connecting line every node in connecting line selected node Element, the next step daughter element include returning to value attribute and next step node identification attribute, respectively by next step member Element returns to the value of value attribute and the value of next step node identification attribute is set as routing data between the node of connecting line between the node It is identified with terminal node;
Save the xml configuration file.
5. according to the method described in claim 4, it is characterized in that, described generate code file according to the xml configuration file And store the code file, comprising:
The xml configuration file and code building template file are loaded onto caching;
Design variables in the code building template file being loaded onto caching are replaced with into described add according to preset rules The each element being loaded onto the xml configuration file in caching, to generate code file and store the code file.
6. according to the method described in claim 2, it is characterized in that, the node figure is closed figure, the nodal information It further include the description information that the function of code corresponding with the node is described;And
The description information is presented in the node figure with written form.
7. a kind of file creating apparatus, which is characterized in that described device includes:
Receiving unit is configured to receive the request for generating code according to flow chart;
Acquiring unit is configured to obtain the flow chart of code to be generated according to the request, wherein the flow chart includes Connecting line between at least one node and at least one node, the node include: node identification and nodal information, the node letter Breath includes: the filename and function name where code corresponding with the node, and connecting line includes: start node between the node Node identification, terminal node node identification and node between route data, routing data are used to indicate execution between the node Execution route after complete code corresponding with the start node;
Configuration file generation unit is configured to generate xml configuration file according to the flow chart;
Code file generation unit is configured to generate code file according to the xml configuration file and stores the code text Part.
8. device according to claim 7, which is characterized in that the node further includes node figure, is connected between the node Wiring further includes that line graph is connected between node, between the node connection line graph be originate in the start node terminate at it is described The directed graph of terminal node routes connection line graph between data and the node and is used between the node figure, the node It is shown in the flow chart.
9. device according to claim 7, which is characterized in that route data between the node and be used to indicate and executed and institute Execution route after stating the corresponding code of start node, comprising:
Data are routed between the node to be used to indicate after having executed code corresponding with the start node and having generated return value, It selects to route data node identical with the return value between connecting line interior joint between the node of starting point using the start node Between connecting line terminal node as next node, and continue to execute code corresponding with the next node.
10. device according to claim 7, which is characterized in that the configuration file generation unit includes:
Newly-built module is configured to newly-built xml configuration file;
Node elements adding module is configured to add each node in the flow chart in the xml configuration file One node elements, wherein the node elements include node elements identity property, by the node elements mark of the node elements The value for knowing attribute is set as the node identification of the node;
Function daughter element adding module is configured to each node elements in the xml configuration file, for the node elements Add function daughter element, wherein the function daughter element includes filename attribute and function name attribute, respectively by function The value of the filename attribute of element and the value of function name attribute are set as the filename and letter of node corresponding to the node elements It is several;
Route daughter element adding module, be configured between the node of the flow chart in connecting line choose start node mark with Connecting line between the identical node of node elements identity property value of the node elements, between selected node every in connecting line Connecting line between node adds next step daughter element for the routing daughter element, and the next step daughter element includes returning to value attribute With next step node identification attribute, the next step daughter element is returned to the value and next step node identification attribute of value attribute respectively Value be set as between the node routing data and terminal node mark between the node of connecting line;
Preserving module is configured to save the xml configuration file.
11. device according to claim 10, which is characterized in that the code file generation unit includes:
Loading module is configured to for the xml configuration file and code building template file being loaded onto caching;
Replacement and generation module, be configured to by it is described be loaded onto caching in code building template file in design variables by Each element in the xml configuration file being loaded onto caching is replaced with according to preset rules, to generate code file simultaneously Store the code file.
12. device according to claim 8, which is characterized in that the node figure is closed figure, the nodal information It further include the description information that the function of code corresponding with the node is described;And
The description information is presented in the node figure with written form.
CN201610479082.1A 2016-06-27 2016-06-27 Document generating method and device Active CN106202006B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610479082.1A CN106202006B (en) 2016-06-27 2016-06-27 Document generating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610479082.1A CN106202006B (en) 2016-06-27 2016-06-27 Document generating method and device

Publications (2)

Publication Number Publication Date
CN106202006A CN106202006A (en) 2016-12-07
CN106202006B true CN106202006B (en) 2019-01-01

Family

ID=57461825

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610479082.1A Active CN106202006B (en) 2016-06-27 2016-06-27 Document generating method and device

Country Status (1)

Country Link
CN (1) CN106202006B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256870B (en) * 2016-12-27 2022-03-01 阿里巴巴集团控股有限公司 Method and device for generating description information, updating and processing data based on topological structure
CN107301129A (en) * 2017-06-28 2017-10-27 百度在线网络技术(北京)有限公司 Method and apparatus for generating test case
CN107766304A (en) * 2017-10-23 2018-03-06 国电南瑞科技股份有限公司 A kind of binary profile file generation method based on XML
CN107977236B (en) * 2017-12-21 2020-11-13 上海智臻智能网络科技股份有限公司 Question-answering system generation method, terminal device, storage medium and question-answering system
CN110363828A (en) * 2019-06-18 2019-10-22 深圳壹账通智能科技有限公司 A kind of method for drawing flow chart and the equipment for drawing flow chart
CN110659027A (en) * 2019-09-20 2020-01-07 京东方科技集团股份有限公司 Code generation method and device and electronic equipment
CN113535151A (en) * 2020-04-14 2021-10-22 北京京东振世信息技术有限公司 Code generation method and device
CN115348178A (en) * 2022-08-29 2022-11-15 安天科技集团股份有限公司 Node control scheme generation method and system
CN115935012B (en) * 2023-02-21 2023-06-23 云筑信息科技(成都)有限公司 Service processing method of flow visual markup language based on xml

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102033748A (en) * 2010-12-03 2011-04-27 中国科学院软件研究所 Method for generating data processing flow codes
CN102591654A (en) * 2011-12-28 2012-07-18 方正国际软件有限公司 Code generator based on SSH (secure shell) architecture and method
CN102831167A (en) * 2012-07-24 2012-12-19 东软集团股份有限公司 XML (extensive makeup language) processing method and device for graph structure
CN102915242A (en) * 2012-09-26 2013-02-06 北京广利核系统工程有限公司 Method for implementing code programming by graphical operations
CN102999323A (en) * 2011-09-16 2013-03-27 北京百度网讯科技有限公司 Method for generating object code, and data processing method and device
CN104866298A (en) * 2014-02-26 2015-08-26 阿里巴巴集团控股有限公司 Flow chart based process business implementing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102033748A (en) * 2010-12-03 2011-04-27 中国科学院软件研究所 Method for generating data processing flow codes
CN102999323A (en) * 2011-09-16 2013-03-27 北京百度网讯科技有限公司 Method for generating object code, and data processing method and device
CN102591654A (en) * 2011-12-28 2012-07-18 方正国际软件有限公司 Code generator based on SSH (secure shell) architecture and method
CN102831167A (en) * 2012-07-24 2012-12-19 东软集团股份有限公司 XML (extensive makeup language) processing method and device for graph structure
CN102915242A (en) * 2012-09-26 2013-02-06 北京广利核系统工程有限公司 Method for implementing code programming by graphical operations
CN104866298A (en) * 2014-02-26 2015-08-26 阿里巴巴集团控股有限公司 Flow chart based process business implementing method and device

Also Published As

Publication number Publication date
CN106202006A (en) 2016-12-07

Similar Documents

Publication Publication Date Title
CN106202006B (en) Document generating method and device
CN108279932B (en) Method and device for dynamically configuring user interface of mobile terminal
CN105630684B (en) Software Development Kit recognition methods and device
CN109062563B (en) Method and device for generating page
CN109634598A (en) A kind of page display method, device, equipment and storage medium
CN108156022A (en) A kind of service calling method, device and electronic equipment
CN110109659A (en) A kind of system that realizing front end applications scaffold and server
CN106250104B (en) A kind of remote operating system for server, method and device
CN112217656B (en) Method and device for synchronizing configuration information of network equipment in SD-WAN (secure digital-to-Wide area network) system
CN112100550A (en) Page construction method and device
CN106843976B (en) Method and apparatus for generating image file
CN113010827B (en) Page rendering method and device, electronic equipment and storage medium
CN108958992A (en) test method and device
CN108733317A (en) Date storage method and device
CN105739970B (en) The method and apparatus that data are mapped as self defined class object
CN113760324A (en) Method and device for constructing micro front-end application
US8683425B2 (en) System for generating application architecture design work products
CN112737805B (en) Configuration method, related device and system
CN112000343B (en) Method and system for deploying multi-version services in Kubernetes by using Devops
CN105912328A (en) Method and device for displaying web system page, and web system
US20180196928A1 (en) Network visualization for access controls
CN113312148B (en) Big data service deployment method, device, equipment and medium
CN115729604A (en) Micro application integration method, system, electronic device and storage medium
CN111176652A (en) Application program management method, device, equipment and medium
CN114817379A (en) Qunee-based configuration item relation visualization method, system, equipment and medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant