Summary of the invention
The invention provides a kind of application and generate method and apparatus, solved the problem of the wasting of resources in the software development process.
A kind of application generation method comprises:
Receive external command, generate based on said external command and carry out stream file;
According to said execution stream file, call the function in the code resource storehouse of presetting, generate and use.
Preferably, said execution stream file comprises that at least one carries out record, and every executive logging all comprises sequence number, command word, input, function redirect and five parameters of note, generates the execution stream file according to said external command and comprises:
Receive said external command,, obtain carrying out record according to the parameters of the said execution stream file of said external command editor;
Carry out the record combination with many and obtain carrying out stream file.
Preferably, above-mentioned application generation method also comprises:
One code resources bank is set, and said code resource storehouse comprises at least one function;
For each function setup one command word, command word and this function are associated, the incidence relation of command word and function is recorded in command word-function name mapped file.
Preferably, above-mentioned application generation method also comprises:
At least one function is arranged the set that obtains more than one function according to permanent order; Should gather as an integrated functionality item; The command word of said at least one function is obtained the command word sequence according to said permanent order arrangement, said command word sequence and this integrated functionality item are associated.
Preferably, said according to said execution stream file, call the function in the code resource storehouse of presetting, generate application and comprise:
Resolve said execution stream file, each bar that obtains in the said execution stream file is carried out record;
According to the command word of carrying out in the record, inquire about said command word-function name mapped file, from said code resource storehouse, extract corresponding function or integrated functionality item;
Said function or integrated functionality item are confirmed the operation order according to the sequence number and the redirect mode of said execution record, move function or integrated functionality item successively, generate and use according to this operation order.
The present invention also provides a kind of application generating apparatus, comprising:
Carry out the stream file generation module, be used to receive external command, generate according to said external command and carry out stream file;
Dynamically execution module is used for calling the function in the code resource storehouse of presetting according to said execution stream file, generates to use.
Preferably, said execution stream file generation module comprises:
Carry out the record generation unit, be used to receive said external command,, obtain carrying out record according to the parameters of the said execution stream file of said external command editor;
File generating unit is used for carrying out the record combination with many and obtains carrying out stream file.
Preferably, above-mentioned application generating apparatus also comprises:
The code resource library module is used to be provided with a code resources bank, and said code resource storehouse comprises at least one function;
Mapping block is used for for each function setup one command word command word and this function being associated, and the incidence relation of command word and function is recorded in command word-function name mapped file.
Preferably, above-mentioned application generating apparatus also comprises:
Integrated functionality item module; Be used at least one function is arranged the set that obtains more than one function according to permanent order; Should gather as an integrated functionality item; The command word of said at least one function is obtained the command word sequence according to said permanent order arrangement, said command word sequence and this integrated functionality item are associated.
Preferably, said dynamic execution module comprises:
Resolution unit is used to resolve said execution stream file, and each bar that obtains in the said execution stream file is carried out record;
Extraction unit is used for inquiring about said command word-function name mapped file according to the command word of carrying out record, from said code resource storehouse, extracts corresponding function or integrated functionality item;
Use generation unit, be used for said function or integrated functionality item are confirmed the operation order according to the sequence number and the redirect mode of said execution record, move function or integrated functionality item successively, generate and use according to this operation order.
The invention provides a kind of application and generate method and apparatus; Receive external command, generate according to said external command and carry out stream file, and according to said execution stream file; Call the function in the code resource storehouse of presetting; Generate and use, build software environment or a large amount of repetitive operation of revising software code again, improved the efficient that makes up application software.
Embodiment
General character is not enough because regular software all is to develop to concrete relevant hardware environment, and individual character is obvious, has great number of issues such as transplantability is poor, the code reusability is low.And along with the continual renovation of product type and the continuous application of new technology; The software developer can not be absorbed in the concrete realization of new technology; And great amount of time is wasted among the repetitive operation of building software environment or a large amount of modification software codes again, cause the huge wasting of resources.
In order to address the above problem, embodiments of the invention provide a kind of application to generate method and apparatus.Hereinafter will combine accompanying drawing that embodiments of the invention are elaborated.Need to prove that under the situation of not conflicting, embodiment among the application and the characteristic among the embodiment be combination in any each other.
Embodiments of the invention provide a kind of application to generate method and apparatus, have realized that a general software generates platform automatically.And can add the visualization interface of user's operation, operate more intuitive and convenient with use.
At first, embodiments of the invention one are described.
The embodiment of the invention provides a kind of application generation method, and it is as shown in Figure 1 to use this method to accomplish the flow process of software development automatically, comprising:
Step 101, reception external command generate the execution stream file according to said external command;
Step 102, according to said execution stream file, call the function in the code resource storehouse of presetting, generate to use.
Below in conjunction with accompanying drawing, embodiments of the invention two are described.
The embodiment of the invention provides a kind of application generation method, uses this method can realize software development flow automatically, and is specifically as shown in Figure 2, comprising:
Step 201, a code resources bank is set, said code resource storehouse comprises at least one function;
In this step, carry out abstract the relevant common function module of software and encapsulation, constitute function one by one.Each class members's function performance of encapsulation back is single, can abstractly be and command word performance element one to one.This part common code resource storehouse that does not rely on concrete software of forming.The code resource storehouse is easy to expansion, to adapt to the individual demand of different software.
Fig. 3 is the cut-away view in code resource storehouse.As shown in Figure 3, the code resource library module is made up of the code resource of each software association area.These fields comprise communication, database manipulation, execution current control, development platform interface interchange, demonstration, Log Message Record etc.; For above each field; All there is corresponding separate modular corresponding with it in the code resource storehouse, realizes the tissue in code resource storehouse with modular mode.
For the internal organizational structure of a certain designated module in the code resource storehouse, the mode of inheriting through class realizes.Can define a public parent earlier, realize that by its different subclass each subclass can be inherited realization by its corresponding subclass again with the function refinement again from level to level according to actual functional capability then.
It should be noted that; In the code resource storehouse during type of carrying out framework; Each function should be the former subfunction that can realize independent function, is the minimal step that whole type function realizes, like this function in the code resource storehouse just can flexible combination with realization user's various different demands; Also should note simultaneously the tissue of function name, should take out function name as much as possible it is mentioned his father's class definition, farthest reduce the quantity of function, thereby reduce the required workload of query function name when using the code resource storehouse with public implication.
The code resource storehouse can use the mode of similar dynamic link library to realize, to make things convenient for other program the function that it comprises is called, and also can easierly extract the mapping relations of function and command word simultaneously.
Concrete; The code resource storehouse is an expert system; Each field function by software is relevant is formed, and these functions include but not limited to communication identification code module, database manipulation code module and device control code module, carry out each functional module such as stream correlative code module, commercial development platform interface code module, reveal codes module, Log Message Record code module.
The code resource storehouse be open, be easy to expand, can realize the warehouse-in of what's new code resource through the similar approach such as class that interpolation has a good inheritance.In addition, the code resource storehouse can be realized through methods such as dynamic link libraries, in the hope of conveniently being called by external module.Preferably, can realize the code resource storehouse, set up efficient and stability with what promote the code resource storehouse according to the prioris such as code module that possess concrete function.
The code resource storehouse should comprise the complete function of its association area, all should support for each correlation technique commonly used.With the communication identification code function is example; Need to support network interface/serial ports/various hardware devices such as parallel port, should support various communication modes such as obstruction/unblock simultaneously, also should support various communications protocol such as TCP/UDP; Various common combinations for being made up of it all should have corresponding processing.
Each function in the code resource storehouse all comes the tissue of code resource by technology such as class succession and encapsulation, in the hope of realize the complete function of each several part with minimum atom function numbers.Function with communication class is an example equally, can take out common subfunctions such as reading and writing, through the rationalization that class is inherited and the virtual function technology realizes the communication identification code function.
More than be equally applicable to the function of the other types in the code resource storehouse for the requirement of communication class function.
Step 202, be each function setup one command word, command word and this function are associated, the incidence relation of command word and function is recorded in command word-function name mapped file;
Need to safeguard a cover command word in the embodiment of the invention; The mapping relations one to one that realize all functions in command word and the code resource storehouse through a command word-function name mapping table simultaneously are realizing the shielding to specific code, and both can quote easily each other.
Command word-function name mapping table content is as shown in Figure 4.Command word-function name mapping table is the mapping relations record sheet of each member function in command word and the code resource storehouse.Here it is to be noted; Not only to set up the mapping relations one to one of command word and function name in this table; Also should message reflections such as the input format of each function, rreturn value, note be come out; Fill the required input information of each function in order to the external program format, obtain the rreturn value of specified type, thereby realize the information processing and the flow process control of whole procedure.
Because command word-function name mapping table format specification; Therefore can generate or update command word-function name mapping table by header file in the code resource storehouse very easily; The naming method of just stipulating out the corresponding command word of all kinds of member functions in the code resource storehouse that the developer need do can realize the management of command word.
Command word has the expression-form more succinct than function name, can realize the shielding to specific code, can organized and be mapped to more easily on the visualization interface simultaneously, therefore is necessary to safeguard a command word-function name mapped file.
Command word-function name mapped file, with each Function Mapping in the code resource storehouse in unified command word system.Command word can adopt the form of " public parent name+concrete class name+function another name " to generate, to guarantee the uniqueness of command word.
Step 203, at least one function is arranged the set obtain more than one function according to permanent order, should gather as an integrated functionality item;
Because the software implementing course of some identical functions is very similar, its corresponding code body also is essentially identical, therefore; If the code that these are similar extracts; Form public integrated functionality item code piece, can improve the reusability of software, reduce cost of software development.
In this step, a plurality of functions of accomplishing a function jointly according to the operation series arrangement of accomplishing this function, are obtained a set, this set is exactly an integrated functionality item.
After obtaining the integrated functionality item, also need be this function items assignment commands word, the concrete command word with said at least one function is arranged according to said permanent order and is obtained the command word sequence, and said command word sequence and this integrated functionality item are associated.
Through the integrated functionality item, can or realize that the execution sequence of specific function is abstract with the software process of identical function to preserve for module, prepare against code reuse.
Fig. 5 is an integrated functionality item inside structure synoptic diagram, can be found out by figure, and the integrated functionality item is by the set of a plurality of functions of being made up of fix command word sequence.Form module to command word sequence with specific function, the workload that repeats to generate with minimizing, thus improve Development of Software efficient.Each function in the integrated functionality item can be used as the command word sequence and is performed stream file generation module editor, to realize interpolation, modification and the deletion action to it.
Related each the interior function of integrated functionality item of the embodiment of the invention all is the particular command word series arrangement according to permanent order.Each function all has input, the output format of standard and the software function of confirming.It is the same with the code resource storehouse, also be open, be easy to expand, only need during expansion to get final product through the specified command word is combined according to the PS of frock.
Step 204, reception external command generate the execution stream file according to said external command;
Every executive logging all comprises sequence number, command word, input, function redirect and five parameters of note.The related external command of embodiments of the invention can be issued by the user.Preferably, can add a user interface, the user carries out visualized operation through this interface.
Carrying out stream file is a file that strict set form is arranged, and carries out in the stream file to comprise all required in one whole performance history information, comprises software execution flow process control, I/O control, stores various aspects such as controlling, show control.Concrete, every executive logging all comprises sequence number, command word, input, function redirect and five parameters of note.But it is pointed out that the order of carrying out function when carrying out stream file just supplies dynamic executive software function, real software executing still realizes through the respective function in the code resource storehouse.
It is as shown in Figure 6 to carry out the stream file content.The corresponding execution stream file of application software comprises sequence number, command word, input, function redirect and five parameters of note.Wherein sequence number is to increase progressively and unique, indicates the position of command word in carrying out stream file, the foundation during also as the program redirect.Information in command word, input, the redirect mode all with command word-function name mapping table in certain bar record corresponding, different is, and the input row have been imported data really replaces, and the return of value row have also been stipulated the redirect rule based on the requirement of designated software.
Carrying out the generation of stream file can accomplish through the module with visual attribute, and this module can derive all information of carrying out in the stream file and to the interface, edit for the user, and the content after also can the user being edited imports to be carried out in the stream file.Simultaneously, it should move by duplex mode, and this module both can resolve to a certain function of integrated functionality item the command word record of wall scroll, also can specific command word record sequence be generated integrated functionality item corresponding command word.
It is to be noted; Carrying out stream file does not generally need the user directly to edit; But through the module of above-mentioned visual attribute make amendment, import/derive operation; The implication of its concrete realization details and each field is sightless for the user, and the user only needs on the visual editing interface, to accomplish corresponding operating can form correct execution stream file, and information such as the redirect branch form that it comprises, variable use all can be handled by carrying out the unification of stream file generation module.
Step 205, according to said execution stream file, call the function in the code resource storehouse of presetting, generate to use;
This step is specifically as shown in Figure 7, comprising:
Step 2051, the said execution stream file of parsing, each bar that obtains in the said execution stream file is carried out record;
In this step, at first extract every record carrying out in the stream file.
Step 2052, according to the command word of carrying out in the record, inquire about said command word-function name mapped file, from said code resource storehouse, extract corresponding function or integrated functionality item;
In this step,, find each to carry out the pairing function of command word or the integrated functionality item of record according to command word-function name mapping table.
Step 2053, said function or integrated functionality item are confirmed the operation order according to the sequence number and the redirect mode of said execution record, move function or integrated functionality item successively, generate and use according to this operation order.
In this step; Confirm the operation order of operation function or integrated functionality item according to redirect mode and sequence number; Promptly at first carrying out record from article one brings into operation; After having moved this function of carrying out the record correspondence, confirm the execution record that next bar will move according to the content of redirect mode parameter, jump to this execution record.
Owing to the integrated functionality item is the combination with command sequence of fixed function, therefore can edit it, on the rank of section, realize associative operation to it, be about to the integrated functionality item and be converted into many execution record Unified Treatment of carrying out in the stream file.
Below in conjunction with accompanying drawing, embodiments of the invention three are described.
Embodiments of the invention provide a kind of application generating apparatus, and the structure of this device is as shown in Figure 8, comprising:
Carry out stream file generation module 801, be used to receive external command, generate according to said external command and carry out stream file;
Dynamically execution module 802 is used for calling the function in the code resource storehouse of presetting according to said execution stream file, generates to use.
Preferably, the structure of said execution stream file generation module 801 is as shown in Figure 9, comprising:
Carry out record generation unit 8011, be used to receive said external command,, obtain carrying out record according to the parameters of the said execution stream file of said external command editor;
File generating unit 8012 is used for carrying out the record combination with many and obtains carrying out stream file.
Preferably, the structure of above-mentioned application generating apparatus is shown in figure 10, also comprises:
Code resource library module 803 is used to be provided with a code resources bank, and said code resource storehouse comprises at least one function;
Mapping block 804 is used for for each function setup one command word command word and this function being associated, and the incidence relation of command word and function is recorded in command word-function name mapped file.
Preferably, the structure of above-mentioned application generating apparatus is shown in figure 11, also comprises:
Integrated functionality item module 805; Be used at least one function is arranged the set that obtains more than one function according to permanent order; Should gather as an integrated functionality item; The command word of said at least one function is obtained the command word sequence according to said permanent order arrangement, said command word sequence and this integrated functionality item are associated.
Preferably, the structure of said dynamic execution module 802 is shown in figure 12, comprising:
Resolution unit 8021 is used to resolve said execution stream file, and each bar that obtains in the said execution stream file is carried out record;
Extraction unit 8022 is used for according to the command word of carrying out record, from said code resource storehouse, extracts corresponding function or integrated functionality item;
Use generation unit 8023, be used for said function or the integrated functionality item series arrangement according to said execution record, the function after operation is arranged successively generates and uses.
Carrying out stream file is a file that strict set form is arranged, and carries out in the stream file to comprise all required in one whole performance history information, comprises software execution flow process control, I/O control, stores various aspects such as controlling, show control.But it is pointed out that carrying out stream file just supplies dynamic execution module to read the record set of information, real software executing still realizes through the respective function in the code resource storehouse.
Carrying out the stream file generation module is a module with visual attribute, and it can be derived all information of carrying out in the stream file and to the interface, edit for the user, and the content after also can the user being edited imports to be carried out in the stream file.Simultaneously, it should move by duplex mode, and this module both can resolve to a certain function of integrated functionality item the command word record of wall scroll, also can specific command word record sequence be generated integrated functionality item function.
Dynamically execution module at first extracts every record carrying out in the stream file; Then it is found corresponding function and realize the execution to function according to command word-function name mapping table; Require to realize the corresponding redirect of program circuit according to the redirect mode at last, thereby realize software function.
Wherein, carry out stream file generation module, dynamic execution module and all information interaction is arranged with the execution stream file.Carry out the stream file generation module and be responsible for constituting the content of carrying out in the stream file, perhaps the content in a certain execution stream file is presented at user interface and edits for the user by user interface selection information; Dynamically execution module is the unique information input interface to carry out stream file, and a rule is obtained execution stream file record and used for subsequent process.
In addition, because unified utility command word shields concrete function name among the present invention, therefore, each upper layer module all depends on command word-function name mapping table.Simultaneously, command word-function name mapping table and code resource library module have corresponding relation closely, have information interaction between these two parts.
Because integrated functionality item module is the combination with command sequence of fixed function; Therefore can edit it with carrying out the stream file generation module; On the rank of section, realize associative operation, be converted into the records series Unified Treatment of carrying out in the stream file at last it.
It is to be noted; Carrying out stream file does not generally need the user directly to edit; But make amendment, import through carrying out the stream file generation module/derive operation; Therefore the implication of its concrete realization details and each field is sightless for the user, and the user only needs on the visual editing interface, to accomplish corresponding operating can form correct execution stream file, and information such as the redirect branch form that it comprises, variable use all can be handled by carrying out the unification of stream file generation module.
Carry out the stream file generation module and be responsible for realizing carrying out functions such as the generation of stream file and integrated functionality item function, importing, modification, derivation, it is a visual user interface.In order to let the user on the interface, generate or revise the execution stream sequence that certain workflow needs easily, carry out the stream file generation module and have following function:
1, the interface is selected to organize through the class formation mode that is similar to the code resource library module; Realize through combobox or other similar type; With different levels complete order word of on visualization interface, showing; And all corresponding unique note property information of each command word, thereby make the user can find certain required bar command word to insert operation fast to accomplish;
2, before every command word record generates in the main workspace; All should be in advance based on the type and the form of the information standard input parameter and function return of value in command word-function name mapping table; The user can accomplish the processing of filling in of each parameter and return of value on visualization interface, simultaneously based on concrete its redirect mode of execution flow process adjustment;
3, the user carry out the main workspace of stream editor can the flexible sequence in the position of each bar record, and can conveniently realize insert or delete operation;
4, carry out that the stream file generation module can realize carrying out the main workspace of importing to of stream file easily and export to the operation of file from main workspace;
5, for carrying out subfunction and integrated functionality item function in the sequence, can it be done as a whole the record with wall scroll execution stream and handle equally.For itself and execution stream file recorded corresponding relation, both can be translated into the execution stream sequence Unified Treatment of carrying out permanent order in the stream file, also can carry out stream file by newly-built son, carry out stream file through the master and call final its corresponding function of realizing;
6, the user can define and use various types of variablees easily in carrying out the stream file generation module, and the definition of variable is operated in to be inserted into automatically before variable uses for the first time and carries out in the stream file.
The work that dynamic execution module need be done is exactly to read each bar record of carrying out in the stream file; Find respective function according to the command word information searching command word-function name mapping table that comprises in the record earlier, the input parameter information that will comprise in then will writing down is imported in this function and correct execution according to corresponding form.At last based on the return information of function with carry out the redirect mode of stipulating in the stream file and change corresponding record over to
Dynamically execution module can be realized through a software architecture that is similar to the switch-case structure; Its major function is exactly to go to correct program branches according to different commands word information to carry out respective function; As for the input information of carrying out in the stream file; Can be converted into the input parameter of function easily by the field of from file, reading, repeat no more at this.
Dynamically a key of execution module steady operation is exactly for the management of carrying out variable in the stream file and correctly calls.For each process variable, need prevent that it from re-defining, accomplish control and management by dynamic execution module to variable.
For the certain applications exploitation, if the code resource storehouse correctly sets up and its corresponding command word-function name mapping table generates, the user only need accomplish the automatic generation that following two steps can be accomplished application software:
1, generates the execution stream file through carrying out the stream file generation module;
Among the present invention; User at first fibrous root requires to select required particular command word on the stream file generation module carrying out according to workflow, and the input format that then requires according to command word is inserted real data and carried out in the stream sequence correspondence position to accomplish wall scroll and carry out the input of stream record and be inserted into.After carrying out the whole generations of stream sequence, the jump information of each record of adjustment can derive complete execution stream file and call for dynamic execution module.
2, dynamically execution module calls;
Dynamically execution module only need know that the path of carrying out stream file can reference command word-its corresponding correlation function of function name mapping table completion.
In order to improve execution efficient, can also adopt EMS memory mappings method to realize carrying out the processing of stream file; Simultaneously also can sacrificial section readable, the function of directly using the function external interface by name in the code resource storehouse to come implementation platform through omitting the command word link; Can also be divided into the main stream file and a plurality of of carrying out carrying out stream file in addition from carrying out stream file; Each is responsible for defining independent subfunction and integrated functionality item function from carrying out stream file, and the main stream file of carrying out is responsible for unified calling from carrying out wheel stream file and principal function body content; Situation for integral body execution flow process more complicated can generate a plurality of execution stream files and handle respectively.In a word, anyly all should be encompassed in protection scope of the present invention for simple optimizing of the present invention.
Can find out from above technical scheme,, can improve the extent for multiplexing of software greatly through correlative code is realized with unified code resource storehouse; Secondly, through carrying out the use of stream file, can code compiling work be converted into visual file logging interpolation work; At last, realize separating of software early development work and instant software development work, can better tackle the actual conditions that the individual demand requirement is urgent, the construction cycle is short.
Compared with prior art, this invention has realized the pattern development of software, has improved Development of Software efficient greatly; Can make the professional software developer more be absorbed in the realization of new technology and over head and ears software is again in the mire of framework, the workload of simultaneously instant software development also significantly reduces, and has lowered developer's technology barriers.The workload of software modification also becomes very light because of the present invention, and the user only needs on visualization interface, to revise the content of carrying out in the stream file and can accomplish.
The all or part of step that the one of ordinary skill in the art will appreciate that the foregoing description program circuit that can use a computer is realized; Said computer program can be stored in the computer-readable recording medium; Said computer program (like system, unit, device etc.) on the relevant hardware platform is carried out; When carrying out, comprise one of step or its combination of method embodiment.
Alternatively, all or part of step of the foregoing description also can use integrated circuit to realize, these steps can be made into integrated circuit modules one by one respectively, perhaps a plurality of modules in them or step is made into the single integrated circuit module and realizes.Like this, the present invention is not restricted to any specific hardware and software combination.
Each device/functional module/functional unit in the foregoing description can adopt the general calculation device to realize, they can concentrate on the single calculation element, also can be distributed on the network that a plurality of calculation element forms.
Each device/functional module/functional unit in the foregoing description is realized with the form of software function module and during as independently production marketing or use, can be stored in the computer read/write memory medium.The above-mentioned computer read/write memory medium of mentioning can be a ROM (read-only memory), disk or CD etc.
Any technician who is familiar with the present technique field is in the technical scope that the present invention discloses, and the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the described protection domain of claim.