CN106202006A - Document generating method and device - Google Patents

Document generating method and device Download PDF

Info

Publication number
CN106202006A
CN106202006A CN201610479082.1A CN201610479082A CN106202006A CN 106202006 A CN106202006 A CN 106202006A CN 201610479082 A CN201610479082 A CN 201610479082A CN 106202006 A CN106202006 A CN 106202006A
Authority
CN
China
Prior art keywords
node
code
connecting line
flow chart
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.)
Granted
Application number
CN201610479082.1A
Other languages
Chinese (zh)
Other versions
CN106202006B (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

This application discloses document generating method and device.One detailed description of the invention of described method includes: receive the request generating code according to flow chart;According to described request, obtain the flow chart of code to be generated, wherein, described flow chart includes connecting line between at least one node and at least one node, described node includes: node identification and nodal information, described nodal information includes: the filename at the code place corresponding with described node and function name, between described node, connecting line includes: route data between the node identification of start node, the node identification of terminal node and node, and between described node, route data is for indicating the execution route after having performed the code corresponding with described start node;Extensible markup language xml configuration file is generated according to described flow chart;Generate code file according to described xml configuration file and store described code file.This embodiment achieves high efficiency code building based on flow chart.

Description

Document generating method and device
Technical field
The application relates to field of computer technology, is specifically related to programmatics field, particularly relates to file generated side Method and and device.
Background technology
Configurable programming is to put forward about the limitation of interface to solve object-oriented programming A kind of Programming Methodology, the most basic employing configuration file changes setting, it is not necessary to recompile application program so that business is patrolled Collect and separate.
But prior art realizes the method for configurable programming not intuitively, logic is unintelligible, and code efficiency is low, reason Solution is poor.
Summary of the invention
The purpose of the application is to propose document generating method and the device of a kind of improvement, solves background above technology department Divide the technical problem mentioned.
First aspect, this application provides a kind of document generating method, and described method includes: receives and generates according to flow chart The request of code;According to described request, obtaining the flow chart of code to be generated, wherein, described flow chart includes that at least one saves Connecting line between point and at least one node, described node includes: node identification and nodal information, and described nodal information includes: with The filename at the code place that described node is corresponding and function name, between described node, connecting line includes: the node mark of start node Know, route data between the node identification of terminal node and node, between described node, route data is used for indicating and has performed with described Execution route after the code that start node is corresponding;Xml (eXtensible Markup is generated according to described flow chart Language, extensible markup language) configuration file;Generate code file according to described xml configuration file and store described generation Code file.
In certain embodiments, described node also includes node figure, and between described node, connecting line also includes connecting between node Wiring figure, between described node, connecting line figure is to originate in described start node to terminate at the directed graph of described terminal node Shape, between described node figure, described node, between route data and described node, connecting line figure is used for display at described flow chart In.
In certain embodiments, between described node, route data has performed the generation corresponding with described start node for indicating Execution route after Ma, including: between described node, route data is performing the generation corresponding with described start node for instruction Code after generating return value, selects between the node with described start node as starting point between connecting line interior joint route data with described Between the node that return value is identical, the terminal node of connecting line is as next node, and continues executing with corresponding with described next node Code.
In certain embodiments, described according to described flow chart generate xml configuration file, including: newly-built xml configures literary composition Part;To each node in described flow chart, described xml configuration file adds a node elements, wherein, described node Element includes node elements identity property, and the value of the node elements identity property of described node elements is set to the joint of this node Point identification;To each node elements in described xml configuration file, add function daughter element for this node elements, wherein, described Function daughter element includes filename attribute and function name attribute, respectively by value and the letter of the filename attribute of described function daughter element The value of several attributes is set to filename and the function name of the node corresponding to this node elements;To in described xml configuration file Each node elements, for this node elements add route daughter element, choose from connecting line between the node of described flow chart Connecting line between the node that beginning node identification is identical with the node elements identity property value of this node elements, between selected node Connecting line between every node in connecting line, adds next step daughter element, next step daughter element bag described for described route daughter element Include return value attribute and next step node identification attribute, respectively next step daughter element described is returned the value of value attribute and next step The value of node identification attribute is set between this node route data and terminal node mark between the node of connecting line;Preserve described Xml configuration file.
In certain embodiments, described generate code file store described code file according to described xml configuration file, Including: described xml configuration file and code building template file are loaded onto in caching;By the described code being loaded onto in caching Generate design variables in template file according to preset rules replace with described in each in the xml configuration file that is loaded onto in caching Individual element, thus generate code file and store described code file.
In certain embodiments, described node figure is closed figure, described nodal information also include to described node The description information that the function of corresponding code is described;And described description information is presented on described node diagram with written form In shape.
Second aspect, this application provides a kind of file creating apparatus, and described device includes: receives unit, is configured to Receive the request generating code according to flow chart;Acquiring unit, is configured to, according to described request, obtain the stream of code to be generated Cheng Tu, wherein, described flow chart includes that connecting line between at least one node and at least one node, described node include: node Mark and nodal information, described nodal information includes: the filename at the code place corresponding with described node and function name, described Between node, connecting line includes: route data between the node identification of start node, the node identification of terminal node and node, described joint Between point, route data is for indicating the execution route after having performed the code corresponding with described start node;Configuration file generates single Unit, is configured to generate xml configuration file according to described flow chart;Code file signal generating unit, is configured to according to described xml Configuration file generates code file and stores described code file.
In certain embodiments, described node also includes node figure, and between described node, connecting line also includes connecting between node Wiring figure, between described node, connecting line figure is to originate in described start node to terminate at the directed graph of described terminal node Shape, between described node figure, described node, between route data and described node, connecting line figure is used for display at described flow chart In.
In certain embodiments, between described node, route data has performed the generation corresponding with described start node for indicating Execution route after Ma, including: between described node, route data is performing the generation corresponding with described start node for instruction Code after generating return value, selects between the node with described start node as starting point between connecting line interior joint route data with described Between the node that return value is identical, the terminal node of connecting line is as next node, and continues executing with corresponding with described next node Code.
In certain embodiments, described configuration file signal generating unit includes: newly-built module, is configured to newly-built xml configuration File;Node elements adds module, is configured to, to each node in described flow chart, add in described xml configuration file Adding a node elements, wherein, described node elements includes node elements identity property, by the node elements of described node elements The value of identity property is set to the node identification of this node;Function daughter element adds module, is configured to described xml configuration literary composition Each node elements in part, adds function daughter element for this node elements, and wherein, described function daughter element includes that filename belongs to Property and function name attribute, be set to this joint by the value of filename attribute and the value of function name attribute of described function daughter element respectively The filename of some node corresponding to element and function name;Route daughter element adds module, is configured to from described flow chart Between node, connecting line is chosen and connect between the node that start node mark is identical with the node elements identity property value of this node elements Wiring, to connecting line between every node in connecting line between selected node, adds next step unit for described route daughter element Element, next step daughter element described includes returning value attribute and next step node identification attribute, respectively by next step daughter element described Return the value of the value of value attribute and next step node identification attribute be set between this node between the node of connecting line route data and Terminal node identifies;Preserve module, be configured to preserve described xml configuration file.
In certain embodiments, described code file signal generating unit includes: load-on module, is configured to join described xml Put file and code building template file is loaded onto in caching;Replace and generation module, be configured to be loaded onto caching by described In code building template file in design variables according to preset rules replace with described in be loaded onto in caching xml configuration literary composition Each element in part, thus generate code file and store described code file.
In certain embodiments, described node figure is closed figure, described nodal information also include to described node The description information that the function of corresponding code is described;And described description information is presented on described node diagram with written form In shape.
The document generating method of the application offer and device, by receiving the request generating code according to flow chart, then According to above-mentioned request, obtain the flow chart of code to be generated, generate xml configuration file then according to flow chart, finally according to xml Configuration file generates code file and stores code file, it is achieved that by Automatic generation code file intuitively, improve Code efficiency.
Accompanying drawing explanation
By the detailed description that non-limiting example is made made with reference to the following drawings of reading, other of the application Feature, purpose and advantage will become more apparent upon:
Fig. 1 is that the application can apply to exemplary system architecture figure therein;
Fig. 2 is the flow chart of an embodiment of the document generating method according to the application;
Fig. 3 a-Fig. 3 b is the schematic diagram of an application scenarios of the document generating method according to the application;
Fig. 4 is the structural representation of an embodiment of the file creating apparatus according to the application;
Fig. 5 is adapted for the structural representation of the computer system of the electronic equipment for realizing the embodiment of the present application.
Detailed description of the invention
With embodiment, the application is described in further detail below in conjunction with the accompanying drawings.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to this invention.It also should be noted that, in order to It is easy to describe, accompanying drawing illustrate only the part relevant to about invention.
It should be noted that in the case of not conflicting, the embodiment in the application and the feature in embodiment can phases Combination mutually.Describe the application below with reference to the accompanying drawings and in conjunction with the embodiments in detail.
Fig. 1 shows the exemplary system of the embodiment that can apply the document generating method of the application or file creating apparatus System framework 100.
As it is shown in figure 1, system architecture 100 can include electronic equipment 101,102 and network 103.Network 103 is in order at electricity The medium of communication link is provided between subset 101 and 102.Network 103 can include various connection type, the most wired, nothing Line communication link or fiber optic cables etc..
User can use electronic equipment 101 mutual with electronic equipment 102 by network 103, to receive or to send message Deng.Various client application, such as graphics edition class application, IDE can be installed on electronic equipment 101,102 (IDE, Integrated Development Environment) class application etc..Such as, electronic equipment 101 can set to electronics Standby 102 send the request generating code according to flow chart, and electronic equipment 102 can generate code to receive according to flow chart The data such as request be analyzed waiting and process, and obtain the flow chart of code to be generated from electronic equipment 101.
Electronic equipment 101,102 can be the various electronic equipments with display screen and processor, includes but not limited to Pocket computer on knee, desk computer, server, work station etc..
It should be noted that the document generating method that the embodiment of the present application is provided can be by electronic equipment 101 or 102 Arbitrary electronic equipment perform, correspondingly, file creating apparatus is generally positioned in electronic equipment 101 or 102.
Refer to Fig. 2, it illustrates the flow process 200 of an embodiment of the document generating method according to the application.Described Document generating method, comprise the following steps:
Step 201, receives the request generating code according to flow chart.
In the present embodiment, document generating method runs on electronic equipment thereon and can locally or remotely receive root Generate the request of code according to flow chart, the most above-mentioned request can be user use that above-mentioned electronic equipment this locality sends according to flow process Figure generates the request of code, and above-mentioned request can also be remotely to connect from other electronic equipments being connected with above-mentioned electronic equipment The request generating code according to flow chart received.
In the present embodiment, the above-mentioned request according to flow chart generation code includes the flow chart of code to be generated.
Step 202, according to above-mentioned request, obtains the flow chart of code to be generated.
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, the request according to flow chart generation code can be that user draws in above-mentioned electronic equipment this locality I.e. initiate to generate according to this flow chart the request of code after completing flow chart;Can also be that user selects to be stored in above-mentioned electronics and sets The standby local flow chart completed the request according to this flow chart generation code, so, above-mentioned electronic equipment can With according to above-mentioned request, the local flow chart obtaining code to be generated.
In the present embodiment, generating the request of code according to flow chart can also be user by with above-mentioned electronic equipment even The request that other electronic equipments of connecing are initiated, so, above-mentioned electronic equipment can according to above-mentioned request, remotely from above-mentioned other Electronic equipment obtains the flow chart of code to be generated.
In the present embodiment, flow chart can include connecting line between at least one node and at least one node, wherein, joint Point includes: node identification and nodal information, nodal information includes: the filename at the code place corresponding with this node and function Name, between node, connecting line includes: route data between the node identification of start node, the node identification of terminal node and node, its In, between node, route data is for indicating the execution route after having performed the 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 Can also include connecting line figure between node, between node, connecting line figure can be to originate in start node to terminate at terminal node Directed graph, between node figure, node, between route data and node, connecting line figure is displayed in flow charts.
In some optional implementations of the present embodiment, between node route data can serve to indicate that performed with Code that start node is corresponding after generating return value, selects between the node with start node as starting point road between connecting line interior joint Between the node identical with above-mentioned return value by data, the terminal node of connecting line is as next node, and continue executing with above-mentioned under The code that one node is corresponding.
In some optional implementations of the present embodiment, node figure can be closed figure, and nodal information also may be used To include the description information being described the function of the code corresponding with node, 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, starts Node and end node, flow chart with start node for starting point with end node as terminal.Start node and terminal node are permissible There is no the code of correspondence.
Step 203, generates xml configuration file according to flow chart.
In the present embodiment, above-mentioned electronic equipment can generate xml configuration file by various methods according to flow chart.
In some optional implementations of the present embodiment, above-mentioned electronic equipment can be in accordance with the following steps according to flow process Figure generation xml configuration file:
Step 2031, newly-built xml configuration file.
Step 2032, to each node in flow chart, adds a node elements 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 Adding a node elements in xml configuration file newly-built in rapid 2031, here, node elements includes that node elements mark belongs to Property, and the value of the node elements identity property of this node elements is set to the node identification of this node.
Step 2033, to each node elements in xml configuration file, adds function daughter element for this node elements.
In the present embodiment, above-mentioned electronic equipment can be to each joint added in step 2032 in xml configuration file Point element, adds function daughter element for this node elements, and wherein, function daughter element includes filename attribute and function name attribute, And respectively the value of the filename attribute of this function daughter element and the value of function name attribute are set to corresponding to this node elements The filename of node and function name.
Step 2034, to each node elements in xml configuration file, adds route daughter element for this node elements.
In the present embodiment, above-mentioned electronic equipment can be to each joint added in step 2032 in xml configuration file Point element, first for this node elements add route daughter element, then choose from connecting line between the node of above-mentioned flow chart Connecting line between the node that beginning node identification is identical with the node elements identity property value of this node elements, then to selected joint Connecting line between every node in connecting line between point, adds next step daughter element, here, next step unit for above-mentioned route daughter element Element includes returning value attribute and next step node identification attribute, the most respectively this next step daughter element is returned value attribute value and The value of next step node identification attribute is set between this node route data and terminal node mark between the node of connecting line.
Step 2035, preserves above-mentioned xml configuration file.
In the present embodiment, above-mentioned electronic equipment can add node elements and joint for above-mentioned xml configuration file Above-mentioned xml configuration file is preserved after the function daughter element of some element and route daughter element.
Step 204, generates code file according to xml configuration file and stores code file.
In the present embodiment, above-mentioned electronic equipment can generate code file by various methods according to xml configuration file.
In the present embodiment, when the request generating code according to flow chart is sent by above-mentioned electronic equipment this locality, deposit Storage code file can be that storage is local to above-mentioned electronic equipment;When according to flow chart generate code request be by with above-mentioned electricity Other electronic equipments that subset is connected send, and storage code file can also be that remotely storage sets to other electronics above-mentioned In Bei.
In some optional implementations of the present embodiment, generate code file according to xml configuration file and store generation Code file can be carried out in accordance with the following steps:
Step 2041, is loaded onto xml configuration file and code building template file in caching.
In the present embodiment, first above-mentioned electronic equipment can obtain xml configuration file and code building template file Store path, then according to above-mentioned xml configuration file and the store path of code building template file, reads this xml configuration literary composition Part and the content of code building template file are also written in caching.Xml configuration file and code building template file can be deposited Store up in other electronic equipments that are local at above-mentioned electronic equipment or that be connected with above-mentioned electronic equipment.
In the present embodiment, code building template file can be that type according to code file to be generated is different and different Template file.The type of code file to be generated can be the source code file of various computer language.Code to be generated literary composition The type of part can be arranged according to the instruction of user by above-mentioned electronic equipment, arranges interface for example, it is possible to provide the user with, It is set to " Java source code " with the type by code file to be generated, or the type of code file to be generated can also be lacked Save and arrange, such as " C language source code ".
Step 2042, the design variables in the code building template file that will be loaded onto in caching is replaced according to preset rules For each element in the xml configuration file that is loaded onto in caching, thus 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 that will be loaded onto in caching replaces with according to preset rules and is loaded onto Each element in xml configuration file in caching, thus generate code file and store above-mentioned code file.
In some optional implementations of the present embodiment, above-mentioned preset rules can include that following two is regular:
Function Substitution Rules, i.e. to each node elements in xml configuration file, will be loaded onto the code building in caching Code corresponding with this node elements in template file replaces with the filename property value in the function daughter element of this node elements With the code in the function indicated by function name property value;
Route Substitution Rules, i.e. to each node elements in xml configuration file, will be loaded onto the code building in caching Conditional judgment code after code corresponding with this node elements in template file replaces with: according to having performed this node elements The return value obtained after corresponding code, select this node elements route daughter element next step daughter element in return value attribute The code of the node corresponding to value of next step node identification attribute of value next step daughter element identical with above-mentioned return value The code that will perform as next step.
It is the effect schematic diagram according to embodiment described in the application Fig. 2 below with reference to Fig. 3 a-Fig. 3 b, Fig. 3 a-Fig. 3 b.
First, user initiated according to as shown in Figure 3 a flow chart generate code request, in fig. 3 a, flow chart by Start node 301, solution packet node 302, common parameter initialize end node 303, public inspection node 304, amendment DNS node 305, change host name node 306, renewal mode of operation node 307, packing node 308 and end node 309 to form, with public As a example by parameter initialization node 303, the node identification of this node is " InitVar ", and the description information of this node is " common parameter Initialize ", the code corresponding with this node is stored in " InitVar " function of the file of file entitled " Common_Operate " In, between the node with this node as starting point, connecting line has two, and wherein between a node, the terminal node of connecting line is node mark Knowing the public inspection node 304 for " TCZF_ComCheck ", internodal data is " 0 ", the termination of connecting line between another node Node be node identification be the packing node 308 of " TCZF_ComPack ", internodal data is "-1 ".Wherein, " 0 " represents successfully Return value, "-1 " represents failed return value.
Then, after above-mentioned electronic equipment receives above-mentioned request, obtain above-mentioned flow chart 3a, and according to above-mentioned flow chart 3a Generate xml configuration file, initialize as a example by node 303 by common parameter equally, the joint for this node in xml configuration file Point element shows in fig 3b.Wherein, as in Fig. 3 b, icon 310 show node elements, icon 311 show function unit Element, it is two of the route daughter element shown in icon 312 respectively that icon 312 show route daughter element, icon 313 and icon 314 Next step daughter element individual.
Generate code file finally according to above-mentioned xml configuration file and store above-mentioned code file.
The document generating method that above-described embodiment of the application provides is by obtaining the flow chart of code to be generated, then root Generate xml configuration file according to flow chart, generate code file finally according to xml configuration file and store code file, it is achieved that By Automatic generation code file intuitively, improve code efficiency.
With further reference to Fig. 4, as to the realization of method shown in above-mentioned each figure, this application provides a kind of file generated dress The embodiment put, this device embodiment is corresponding with the embodiment of the method shown in Fig. 2, and this device specifically can apply to respectively Plant in electronic equipment.
As it is shown in figure 5, the file creating apparatus 400 described in the present embodiment includes: receive unit 401, acquiring unit 402, Configuration file signal generating unit 403 and code file signal generating unit 404.Wherein, receive unit 401, be configured to receive according to stream Journey figure generates the request of code;Acquiring unit 402, is configured to, according to above-mentioned request, obtain the flow chart of code to be generated, its In, above-mentioned flow chart includes that connecting line between at least one node and at least one node, above-mentioned node include: node identification and joint Dot information, above-mentioned nodal information includes: the filename at the code place corresponding with above-mentioned node and function name, connects between above-mentioned node Wiring includes: route data between the node identification of start node, the node identification of terminal node and node, route between above-mentioned node Data are for indicating the execution route after having performed the code corresponding with above-mentioned start node;Configuration file signal generating unit 403, joins Put for generating xml configuration file according to above-mentioned flow chart;Code file signal generating unit 404, is configured to join according to above-mentioned xml Put file generated code file and store above-mentioned code file.
In some optional implementations of the present embodiment, above-mentioned node also includes node figure, connects between above-mentioned node Wiring also includes connecting line figure between node, and between above-mentioned node, connecting line figure is to originate in above-mentioned start node to terminate at above-mentioned The directed graph of terminal node, between above-mentioned node figure, above-mentioned node, between route data and above-mentioned node, connecting line figure is used for Display is in above-mentioned flow chart.
In some optional implementations of the present embodiment, between above-mentioned node route data be used for indicating performed with State the execution route after the code that start node is corresponding, including: between above-mentioned node route data for instruction having performed and After stating code corresponding to start node and generating return value, select between the node with above-mentioned start node as starting point, connecting line to save Between the node that between point, route data is identical with above-mentioned return value, the terminal node of connecting line is as next node, and continue executing with The code that above-mentioned next node is corresponding.
In some optional implementations of the present embodiment, above-mentioned configuration file signal generating unit 403 may include that newly-built Module 4031, is configured to newly-built xml configuration file;Node elements adds module 4032, is configured in above-mentioned flow chart Each node, in above-mentioned xml configuration file add a node elements, wherein, above-mentioned node elements includes node elements Identity property, is set to the node identification of this node by the value of the node elements identity property of above-mentioned node elements;Function unit Element adds module 4033, is configured to, to each node elements in above-mentioned xml configuration file, add function for this node elements Daughter element, wherein, above-mentioned function daughter element includes filename attribute and function name attribute, respectively by the literary composition of above-mentioned function daughter element The value of part name attribute and the value of function name attribute are set to filename and the function name of the node corresponding to this node elements;Route Daughter element adds module 4034, is configured to, to each node elements in above-mentioned xml configuration file, add for this node elements Route daughter element, chooses the node elements of start node mark and this node elements between the node of above-mentioned flow chart connecting line Connecting line between the node that identity property value is identical, to connecting line between every node in connecting line between selected node, for above-mentioned Route daughter element adds next step daughter element, and next step daughter element above-mentioned includes returning value attribute and next step node identification belongs to Property, the value of the value and next step node identification attribute that respectively this next step daughter element are returned value attribute is set between this node connect Route data and terminal node mark between the node of wiring;Preserve module 4035, be configured to preserve above-mentioned xml configuration file.
In some optional implementations of the present embodiment, above-mentioned code file signal generating unit 404 may include that loading Module 4041, is configured to be loaded onto in caching above-mentioned xml configuration file and code building template file;Replace and generate mould Block 4042, is configured to replace the design variables in the above-mentioned code building template file being loaded onto in caching according to preset rules It is changed to each element in the above-mentioned xml configuration file being loaded onto in caching, thus generates 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 Also include the description information that the function of the code corresponding with above-mentioned node is described;And foregoing description information is with word shape Formula is presented in above-mentioned node figure.
Below with reference to Fig. 5, it illustrates the computer system 500 being suitable to the electronic equipment for realizing the embodiment of the present application Structural representation.
As it is shown in figure 5, computer system 500 includes CPU (CPU) 501, it can be read-only according to being stored in Program in memorizer (ROM) 502 or be loaded into the program random access storage device (RAM) 503 from storage part 508 and Perform various suitable action and process.In RAM 503, also storage has system 500 to operate 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.
It is connected to I/O interface 505: include the importation 506 of keyboard, mouse etc. with lower component;Penetrate including such as negative electrode The output part 507 of spool (CRT), liquid crystal display (LCD) etc. and speaker etc.;Storage part 508 including hard disk etc.; And include the communications portion 509 of the NIC of such as LAN card, modem etc..Communications portion 509 via such as because of The network of special net performs communication process.Driver 510 is connected to I/O interface 505 also according to needs.Detachable media 511, such as Disk, CD, magneto-optic disk, semiconductor memory etc., be arranged in driver 510, in order to read from it as required Computer program as required be mounted into storage part 508.
Especially, according to embodiment of the disclosure, the process described above with reference to flow chart may be implemented as computer Software program.Such as, embodiment of the disclosure and include a kind of computer program, it includes being tangibly embodied in machine readable Computer program on medium, described computer program comprises the program code for performing the method shown in flow chart.At this In the embodiment of sample, this computer program can be downloaded and installed from network by communications portion 509, and/or from removable Unload medium 511 to be mounted.When this computer program is performed by CPU (CPU) 501, perform in the present processes The above-mentioned functions limited.
Flow chart in accompanying drawing and block diagram, it is illustrated that according to system, method and the computer journey of the various embodiment of the application Architectural framework in the cards, function and the operation of sequence product.In this, each square frame in flow chart or block diagram can generation One module of table, program segment or a part for code, a part for described module, program segment or code comprises one or more For realizing the executable instruction of the logic function of regulation.It should also be noted that some as replace realization in, institute in square frame The function of mark can also occur to be different from the order marked in accompanying drawing.Such as, the square frame that two succeedingly represent is actual On can perform substantially in parallel, they can also perform sometimes in the opposite order, and this is depending on involved function.Also want It is noted that the combination of the square frame in each square frame in block diagram and/or flow chart and block diagram and/or flow chart, Ke Yiyong The special hardware based system of the function or operation that perform regulation realizes, or can refer to computer with specialized hardware The combination of order realizes.
It is described in the embodiment of the present application involved unit to realize by the way of software, it is also possible to by firmly The mode of part realizes.Described unit can also be arranged within a processor, for example, it is possible to be described as: a kind of processor bag Include reception unit, acquiring unit, configuration file signal generating unit and code file signal generating unit.Wherein, the title of these unit exists It is not intended that the restriction to this unit itself in the case of certain, such as, receives unit and be also described as " receiving according to flow 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, this non-volatile calculating Machine storage medium can be the nonvolatile computer storage media described in above-described embodiment included in device;Can also be Individualism, is unkitted the nonvolatile computer storage media allocating in terminal.Above-mentioned nonvolatile computer storage media is deposited Contain one or more program, when one or more program is performed by an equipment so that described equipment: receive The request of code is generated according to flow chart;According to above-mentioned request, obtain the flow chart of code to be generated, 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 joint Dot information includes: the filename at the code place corresponding with above-mentioned node and function name, and between above-mentioned node, connecting line includes: initial Route data between the node identification of node, the node identification of terminal node and node, between above-mentioned node, route data is used for indicating Perform the execution route after the 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.People in the art Member should be appreciated that invention scope involved in the application, however it is not limited to the technology of the particular combination of above-mentioned technical characteristic Scheme, also should contain in the case of without departing from described inventive concept simultaneously, above-mentioned technical characteristic or its equivalent feature carry out Combination in any and other technical scheme of being formed.Such as features described above has similar merit with (but not limited to) disclosed herein The technical scheme that the technical characteristic of energy is replaced mutually and formed.

Claims (12)

1. a document generating method, it is characterised in that described method includes:
Receive the request generating code according to flow chart;
According to described request, obtaining the flow chart of code to be generated, wherein, described flow chart includes at least one node and at least Article one, connecting line between node, described node includes: node identification and nodal information, and described nodal information includes: with described node The filename at corresponding code place and function name, between described node, connecting line includes: the node identification of start node, terminal node Route data between the node identification of point and node, between described node, route data is used for indicating and has performed and described start node pair Execution route after the code answered;
Extensible markup language xml configuration file is generated according to described flow chart;
Generate code file according to described xml configuration file and store described code file.
Method the most according to claim 1, it is characterised in that described node also includes node figure, connects between described node Wiring also includes connecting line figure between node, and between described node, connecting line figure is to originate in described start node to terminate at described The directed graph of terminal node, between described node figure, described node, between route data and described node, connecting line figure is used for Display is in described flow chart.
Method the most according to claim 1, it is characterised in that between described node, route data is used for indicating and has performed and institute State the execution route after the code that start node is corresponding, including:
Between described node, route data is for indicating after having performed the code corresponding with described start node and having generated return value, Select the node that between the node with described start node as starting point, between connecting line interior joint, route data is identical with described return value Between the terminal node of connecting line as next node, and continue executing with the code corresponding with described next node.
Method the most according to claim 1, it is characterised in that described according to described flow chart generation xml configuration file, bag Include:
Newly-built xml configuration file;
To each node in described flow chart, described xml configuration file adds a node elements, wherein, described joint Point element includes node elements identity property, and the value of the node elements identity property of described node elements is set to this node Node identification;
To each node elements in described xml configuration file, add function daughter element, wherein, described letter for this node elements Number daughter element includes filename attribute and function name attribute, respectively by value and the function of the filename attribute of described function daughter element The value of name attribute is set to filename and the function name of the node corresponding to this node elements;
To each node elements in described xml configuration file, add route daughter element for this node elements, from described flow chart Node between connecting line is chosen between the node that start node mark is identical with the node elements identity property value of this node elements Connecting line, to connecting line between every node in connecting line between selected node, adds next step for described route daughter element Element, next step daughter element described includes returning value attribute and next step node identification attribute, respectively by next step unit described Element returns the value of the value of value attribute and next step node identification attribute and is set between this node route data between the node of connecting line Identify with terminal node;
Preserve described xml configuration file.
Method the most according to claim 4, it is characterised in that described according to described xml configuration file generation code file And store described code file, including:
Described xml configuration file and code building template file are loaded onto in caching;
By the design variables in the described code building template file being loaded onto in caching according to preset rules replace with described in add Each element in the xml configuration file being loaded onto in caching, thus generate code file and store described code file.
Method the most according to claim 2, it is characterised in that described node figure is closed figure, described nodal information Also include the description information that the function of the code corresponding with described node is described;And
Described description information is presented in described node figure with written form.
7. a file creating apparatus, it is characterised in that described device includes:
Receive unit, be configured to receive the request generating code according to flow chart;
Acquiring unit, is configured to according to described request, obtains the flow chart of code to be generated, and wherein, described flow chart includes Connecting line between at least one node and at least one node, described node includes: node identification and nodal information, and described node is believed Breath includes: the filename at the code place corresponding with described node and function name, between described node, connecting line includes: start node Node identification, the node identification of terminal node and node between route data, between described node, route data is used for indicating execution Execution route after the code that complete and described start node is corresponding;
Configuration file signal generating unit, is configured to generate xml configuration file according to described flow chart;
Code file signal generating unit, is configured to generate code file according to described xml configuration file and store described code literary composition Part.
Device the most according to claim 7, it is characterised in that described node also includes node figure, connects between described node Wiring also includes connecting line figure between node, and between described node, connecting line figure is to originate in described start node to terminate at described The directed graph of terminal node, between described node figure, described node, between route data and described node, connecting line figure is used for Display is in described flow chart.
Device the most according to claim 7, it is characterised in that between described node, route data is used for indicating and has performed and institute State the execution route after the code that start node is corresponding, including:
Between described node, route data is for indicating after having performed the code corresponding with described start node and having generated return value, Select the node that between the node with described start node as starting point, between connecting line interior joint, route data is identical with described return value Between the terminal node of connecting line as next node, and continue executing with the code corresponding with described next node.
Device the most according to claim 7, it is characterised in that described configuration file signal generating unit includes:
Newly-built module, is configured to newly-built xml configuration file;
Node elements adds module, is configured to each node in described flow chart, adds in described xml configuration file One node elements, wherein, described node elements includes node elements identity property, by the node elements mark of described node elements The value knowing attribute is set to the node identification of this node;
Function daughter element adds module, is configured to each node elements in described xml configuration file, for this node elements Adding function daughter element, wherein, described function daughter element includes filename attribute and function name attribute, respectively by described function The value of the filename attribute of element and the value of function name attribute are set to filename and the letter of the node corresponding to this node elements Several;
Route daughter element adds module, be configured between the node of described flow chart, connecting line to be chosen start node mark with Connecting line between the node that the node elements identity property value of this node elements is identical, in connecting line between selected node every Connecting line between node, adds next step daughter element for described route daughter element, and next step daughter element described includes returning value attribute With next step node identification attribute, respectively next step daughter element described is returned value and next step node identification attribute of value attribute Value be set between this node route data and terminal node mark between the node of connecting line;
Preserve module, be configured to preserve described xml configuration file.
11. devices according to claim 10, it is characterised in that described code file signal generating unit includes:
Load-on module, is configured to be loaded onto in caching described xml configuration file and code building template file;
Replace and generation module, be configured to by the design variables in the described code building template file being loaded onto in caching by According to preset rules replace with described in each element in the xml configuration file that is loaded onto in caching, thus generate code file also Store described code file.
12. devices according to claim 8, it is characterised in that described node figure is closed figure, described nodal information Also include the description information that the function of the code corresponding with described node is described;And
Described description information is presented in described 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 true CN106202006A (en) 2016-12-07
CN106202006B 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)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN107977236A (en) * 2017-12-21 2018-05-01 上海智臻智能网络科技股份有限公司 Generation method, terminal device, storage medium and the question answering system of question answering system
CN108256870A (en) * 2016-12-27 2018-07-06 阿里巴巴集团控股有限公司 Description information and update, data processing method and device are generated based on topological structure
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
CN114461198A (en) * 2021-12-27 2022-05-10 上海交通大学四川研究院 Program generation method, device, equipment and medium based on visual low code
CN115348178A (en) * 2022-08-29 2022-11-15 安天科技集团股份有限公司 Node control scheme generation method and system
CN115935012A (en) * 2023-02-21 2023-04-07 云筑信息科技(成都)有限公司 Service processing method of process visualization markup language based on xml
CN113535151B (en) * 2020-04-14 2024-05-17 北京京东振世信息技术有限公司 Code generation method and device

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

Cited By (14)

* 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
CN108256870A (en) * 2016-12-27 2018-07-06 阿里巴巴集团控股有限公司 Description information and update, data processing method and device are generated 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
CN107977236A (en) * 2017-12-21 2018-05-01 上海智臻智能网络科技股份有限公司 Generation method, terminal device, storage medium and the question answering system of 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
CN113535151B (en) * 2020-04-14 2024-05-17 北京京东振世信息技术有限公司 Code generation method and device
CN114461198A (en) * 2021-12-27 2022-05-10 上海交通大学四川研究院 Program generation method, device, equipment and medium based on visual low code
CN115348178A (en) * 2022-08-29 2022-11-15 安天科技集团股份有限公司 Node control scheme generation method and system
CN115935012A (en) * 2023-02-21 2023-04-07 云筑信息科技(成都)有限公司 Service processing method of process visualization markup language based on xml
CN115935012B (en) * 2023-02-21 2023-06-23 云筑信息科技(成都)有限公司 Service processing method of flow visual markup language based on xml

Also Published As

Publication number Publication date
CN106202006B (en) 2019-01-01

Similar Documents

Publication Publication Date Title
CN106202006A (en) Document generating method and device
CN108334387B (en) Dynamic interface rendering method and device
US11132114B2 (en) Method and apparatus for generating customized visualization component
CN108156022A (en) A kind of service calling method, device and electronic equipment
CN105574092B (en) Information mining method and device
CN111506444A (en) Form approval method and device, storage medium and electronic equipment
CN106980508A (en) Method and apparatus for generating the page
CN107066609A (en) Image display method and device
CN112100550A (en) Page construction method and device
CN106055383A (en) Request processing method and device
CN108279882B (en) Framework generation method, device, equipment and computer readable medium
CN105120006A (en) Live commenting control method, live commenting server and live commenting control device for electronic readings
CN107741935A (en) Data lead-in method and data importing device
CN106302103A (en) A kind of information processing method and system, application server
CN109447406A (en) A kind of method of visioning procedure and the device of visioning procedure
CN109271160A (en) Active rule construction method, device and computer system, medium
CN114003451B (en) Interface testing method, device, system and medium
US8683425B2 (en) System for generating application architecture design work products
CN107357810A (en) A kind of method and system for being used to export special topic landing page
CN109766095A (en) A kind of thematic page creation method of activity, relevant apparatus and equipment
Addie et al. Netml: networking networks
CN107147732A (en) Image processing method, device, client and service end
CN112486482A (en) Page display method and device
CN107229503A (en) Visio document conversion methods and system
CN108810105A (en) For pushed information, the method and apparatus for showing information

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