CN100520718C - Script order registration method, method and device for calling source program code - Google Patents

Script order registration method, method and device for calling source program code Download PDF

Info

Publication number
CN100520718C
CN100520718C CNB2007101520658A CN200710152065A CN100520718C CN 100520718 C CN100520718 C CN 100520718C CN B2007101520658 A CNB2007101520658 A CN B2007101520658A CN 200710152065 A CN200710152065 A CN 200710152065A CN 100520718 C CN100520718 C CN 100520718C
Authority
CN
China
Prior art keywords
command
script
program code
source program
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB2007101520658A
Other languages
Chinese (zh)
Other versions
CN101126981A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2007101520658A priority Critical patent/CN100520718C/en
Publication of CN101126981A publication Critical patent/CN101126981A/en
Application granted granted Critical
Publication of CN100520718C publication Critical patent/CN100520718C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The utility model relates to a script command, in particular to a method and a device which call the source program code through the script command. The utility model also relates to a register method of the script command to call source program code; wherein, the steps comprise: receiving the configuration file, which is provided with the command information of the script command, the method information of source program code called by the script command; analyzing the configuration file and obtaining the command information of the script command and the method information of the source program code from the configuration file; generating the command name of the script according to the command information of the script command, calling back the object according to the register method of the method information of the source program code; registering the script command name and the method call-back object into the command list of the script engine correspondingly.

Description

The method and apparatus of script order registration method, calling source program code
Technical field
The present invention relates to script command, relate in particular to a kind of by script command calling source program code technology.
Background technology
Script is a kind of operation maintenance functional programs language that has.It is compared with language such as VB, C, Java has the advantages that grammer is simple, be easy to grasp, and closely related with application program, so often become operation maintenance personnel's instrument.At different network elements, the operation maintenance personnel can make a lot of routine works realize robotization by simply writing grand and function, have greatly improved the operation maintenance efficient of office side.
For secondary development, script has crucial meaning.For bigger convenience is provided to the user,, often provide secondary development function as manufacturer in order better to use the function of product or system.Manufacturer develops the partial function program resource and allows the user to use, and the user calls these functions by script, and the user only need write some simple grand and functions that are used for the invoke script order and just can call the function that manufacturer provides like this.
Come the function of calling source program code in some loaded down with trivial details periodic duties, also to have positive meaning by script.Some periodic regular works are very trifling, the for example periodic data of switch backup, though the instruction that relates to is few, but could continue to key in other instruction because some instruction needs to wait as long for after carrying out after the result, adopt and manually key in mode that instruction carries out and bother especially and make mistakes easily.The complexity of this work and workload are with the number of direct ratio and switch.So, need a program to finish the regular periodic duty of trifling complexity like that automatically especially.Such as the alarm of in time handling respective switch, definition office data, regularly make the charging CD, regularly switch is carried out system backup etc.At this moment only need write a bit of code execution script command that circulates, just can realize the function of expecting.
At present come the conventional method of calling source program code to comprise the steps: by script command
1, writing the source program code of realizing function, can be Java, the function code that language such as C/C++ are realized, i.e. source program code;
2, write the Wrapper code of code, promptly the code to order encapsulates;
The Wrapper code that 3, will encapsulate is with its corresponding language interpreter, i.e. script engine, and compiling becomes a script module;
4, the user uses the script command of this script module to come calling source program code.
The Jython interpreter is a kind of script language interpreter based on Java, in order to the support to script to be provided.Be below with the Jython interpreter as example, provide the general process that Java realizes the Jython script command:
1, write the source program code of realizing function:
package?test;
public?class?Client
{
public?static?void?testImp(int?a,int?b)
{
}
}
2, Wrapper encapsulation code:
Create a mymod class, be used for encapsulating top Client class.In this mymod class, the user must understand the api function of Jython script engine to realize encapsulation.Such as the ClassDictInit interface that must realize Jython, but also to realize the classDictInit static method of Jython:
public?class?mymod?implements?ClassDictInit
{
public?static?void?classDictInit(PyObject?dict)
{
dict.__setitem__("__doc__",
new?PyString("Test?class?to?confirm"+
"builtin?module"));
dict.__delitem__("classDictInit");
}
public?static?PyObject?test(PyObject[]args,String[]kws))
{
ArgParser?ap=new?ArgParser("test",args,kws,"a","b");
// call top testImp method, as ... testImp (1,2);
}
}
3, mymod is compiled the class file after, join in the class.path of Jython interpreter.
4, by manually importing such, could under script engine, call this source program code to issue orders.
>>>from?org.python.demo.modules?import?mymod
>>>mymod.test(1,2)
Need encapsulate in class outside, order place in the prior art again, increase a lot of redundant code amounts, the developer also will understand the api function of script engine simultaneously, therefore is not easy existing code is converted to script command.Because script command and Wrapper encapsulation code are tightly coupled by CompilerTools, so if the user wants to revise script command, just must revise Wrapper encapsulation code, and will compile again, this has brought inconvenience to secondary development.Bring great risk all for efficient, stability and the reliability of program to the modification of code and the process of recompility simultaneously.
Summary of the invention
The embodiment of the invention provides a kind of script order registration method and apparatus of calling source program code and the method and apparatus that passes through the script command calling source program code, is used to simplify the operation to the source program code secondary development.
A kind of script order registration method of calling source program code comprises:
Receive configuration file, dispose the command information of script command, the method information of source program code that script command calls in the described configuration file;
Resolve described configuration file, obtain the command information of script command and the method information of this source program code from described configuration file;
According to the command information generation script command name of described script command, according to the method information generating method callback object of described source program code;
In the corresponding command list (CLIST) that is registered to script engine of described script command name with described method callback object.
A kind of method by the script command calling source program code comprises:
Receive the script command of user's input; Resolve described script command, from described script command, obtain the parameter list information of script command name and script command; From script engine, obtain corresponding method callback object according to described script command name; Described script command name and described corresponding method callback object are in the corresponding command list (CLIST) that is registered to described script engine; Obtain the method object of source program code according to described method callback object; With in the described parameter list data inputting method object and carry out described method object, finish calling of described source program code.
A kind of script order registration device of calling source program code comprises:
The configuration file receiver module is used to receive configuration file, disposes the command information of script command, the method information of source program code that script command calls in the described configuration file;
The configuration file parsing module is used to resolve the configuration file that described configuration file receiver module receives, and obtains the command information of script command and the method information of this source program code from described configuration file;
The script order registration module, the command information generation script command name that is used for the described script command that parses according to described configuration file parsing module, according to the method information generating method callback object of described source program code, in the corresponding command list (CLIST) that is registered to script engine of described script command name with described method callback object.
A kind of device of calling source program code comprises:
The user command receiver module is used to receive the script command that the user imports;
The user command parsing module is used to resolve the script command that described user command receiver module receives, and obtains the parameter list information of script command name and script command from described script command;
The command mapping calling module, the script command name that is used for obtaining according to described user command parsing module obtains corresponding method callback object from script engine; Obtain the method object of source program code according to described method callback object,, finish calling of described source program code in the described parameter list data inputting method object and carry out described method object; Described script command name and described corresponding method callback object are in the corresponding command list (CLIST) that is registered to described script engine.
The embodiment of the invention is owing to adopt configuration information, the script command name that parses configuration file, and the method callback object that will generate according to configuration information and the script command name method that is registered to script engine, the mapping relations between script command and the source program code have been realized, so no longer need encapsulate again in the outside of source program code, and then reduced the redundant code amount, script command function library developer does not need to understand the api function of script engine yet simultaneously, has reduced the complexity of secondary development.
The embodiment of the invention is owing to adopt the method for the method callback object that generates to the script command name of script engine registration profile and according to configuration information, so realized the loose coupling relation between script command and source program code, in the time of the user's modification script command, need not to revise, compile source program code, only need to revise the attribute item of configuration file, and then reach and simplified secondary development, improve the expansion maintenance efficiency, improve the effect of the reliability of expansion maintenance.
Description of drawings
Fig. 1 a is the relationship map figure of the embodiment of the invention from the source program code to the script command;
Fig. 1 b is an embodiment of the invention configuration file node dendrogram;
Fig. 2 a is the structured flowchart that passes through the script command calling source program code of the embodiment of the invention;
Fig. 2 b is the internal frame diagram of the user command parsing module of the embodiment of the invention;
Fig. 2 c is the internal frame diagram of the script order registration module of the embodiment of the invention;
Fig. 2 d is the internal frame diagram of the command mapping calling module of the embodiment of the invention;
Fig. 3 is the process flow diagram that configuration file is registered to script engine of the embodiment of the invention;
Fig. 4 is the process flow diagram with the script command calling source program code of the embodiment of the invention.
Embodiment
Configuration file is a kind of record making language document, allows various specialty (as music, chemistry, mathematics etc.) the exploitation SGML relevant with the specific area of oneself.In configuration file, comprise flag node.The user can be as required, and the defined node attribute is to carry the information that needs.
The configuration file of description tree structure commonly used has XML (Extensible Markup Language, extend markup language) configuration file, INI (Initialization, initialization) configuration file etc., the embodiment of the invention illustrates the invention scheme with the XML configuration file.Those skilled in the art can realize other application of kind configuration file in embodiment of the invention scheme easily according to the disclosed technology contents of the embodiment of the invention.
Embodiment of the invention utilization adopts configuration file (for example XML configuration file) that tree structure describes mapping relations that the method information correspondence of script command and source program code correspondence is registered in the script engine, after having finished registration, if the user needs calling source program code, then according to the script command of user input, can in script engine, find the method information of the source program code corresponding, just can realize utilizing the purpose of script command calling source program code by the method information of these source program codes with this script command.
Each nodal community of predefine XML configuration file, be respectively applied for the method information of source of configuration program code and the command information of script command, when the information that disposes in the XML configuration file is registered in the script engine, according to the mapping relations of setting up, in fact exactly the method information of source program code and the command information of script command corresponding with it are registered in the script engine, thus the generation script order.Because the attribute item of configuration XML configuration file needn't encapsulate source program code, nor with recompilating, so make amendment, safeguard more convenient than revising the encapsulation code in the prior art to the XML configuration file.
Introduce each predefined node and nodal community thereof in the XML configuration file below in detail, and the method information of the source program code of each nodal community concrete configuration, and the command information of script command, referring to Fig. 1 a and Fig. 1 b:
1, the outermost layer of XML configuration file 102 is empty ScriptCommand nodes 111;
2, can dispose a plurality of " command sets " (CommandSet) node 112 below the ScriptCommand node 111 of XML configuration file 102, it has disposed the command set title of script command, command set the name attribute of " command set " node 112 " name attribute as<CommandSet name=" mymod ";
3, each " command set " node is 112 times, can dispose a plurality of " order sources " (CommandSource) node 113.The name attribute of " order source " node 113 has disposed the source program code title, promptly corresponding to the bag (package) and the class (class) of source program code 101, is test.Client in the example of Fig. 1; Its type attribute has disposed the source program code type, is Java in this example; Title of " order source " node 113 and type attribute are as<CommandSource name=" test.Client " type=" Java " 〉;
4, each " order source " node is 113 times, can also dispose a plurality of " orders " (Command) node 114.A method object of " order " correspondence " order source ", the name attribute of " order " node 114 has disposed the command name title of script command; The name attribute of " order " node 114 is as<Commandname=" getvalue " 〉;
5, each " order " node is 114 times, has disposed the information of method object, as, " method name " attribute configuration the method name of method object of source program code:
<Method?name="getValue"/>
" parameter " attribute configuration the parameter attribute of method object of source program code, comprise parameter name, parameter type, parameter value, " parameter " attribute has also disposed the parameter list information of script command simultaneously.The corresponding parameter name of Param name, type is a type of correspondence parameter, value is corresponding parameter value:
<Param?name="row"type=”short”value=”1”/>
<Param?name="col"type=”short”value=”2”/>
The corresponding rreturn value type of Return type:
<Return?type="int"/>
The above-mentioned naming method to each node and nodal community is not unique, adopted a kind of User Recognition and memory style be convenient at this, such as " command set " node called after " CommandSet ", " command set " nodename attribute is " CommandSet name ".Certainly, in the specific implementation, can adopt other name to represent the meaning of this node and attribute thereof fully.
Following table 1 has been represented above-mentioned configuration relation:
Table 1.
The XML configuration file Source program code Script command
The ScriptCommand node
The name attribute of " command set " node The command set title of script command
The name attribute of " order source " node The source program code title
" order source " node types attribute The source program code type
The name attribute of " order " node The command name title of script command
The method name attribute of " order " node The method name of source program code
The parameter name attribute of " order " node The method parameter title of source program code The parameter name of script command
The parameter type attribute of " order " node The method parameter type of source program code The parameter type of script command
The parameter value attribute of " order " node The method parameter value of source program code The parameter value of script command
The return type attribute of " order " node The method return type of source program code
The corresponding script command 103 that generates of top configuration mode is: " command set name command name title (parameter list information) ", wherein " command set name command name title " is the script command name, and be by name such as this routine script command: mymod.getvalue.The command information that in script command, has comprised script command, comprised the command set title of script command, the command name title of script command and the parameter list information of script command, and the parameter list information of script command comprises: the parameter value of the parameter name of script command, the parameter type of script command, script command.For example: (col=2 row=1) is script command legal and of equal value for mymod.getvalue (1,2), mymod.getvalue.The order set name of the XML configuration file 102 of Fig. 1 a can be revised as such as, user:
<CommandSet?name="mymod2">
The corresponding script command that generates of then amended configuration mode is by name: mymod2.getvalue.
The method information of above-mentioned source program code, comprise: the method name of source program code title, source program code type, source program code, the method parameter attribute of source program code, the dispensable method information of source program code type wherein, when adopting fixing source program code type (such as Java), the XML configuration file does not just need to have carried the information of type of code, has known the source program code type because given tacit consent to this moment.The method parameter attribute of source program code comprises again: the method parameter value of the method parameter title of source program code, the method parameter type of source program code, source program code and the method return type of source program code, the method information of these source program codes can be used when carrying out function call by the reflection mode.
As can be seen, compared with prior art, the embodiment of the invention has been saved the Wrapper encapsulation from the mapping relations of Fig. 1 a, and compiling source program and mymod class import this three processes.Expansion and when safeguarding script command need not to revise Wrapper encapsulation code, and an attribute item that only needs to revise the XML configuration node get final product, simplifies secondary development, improves and expands maintenance efficiency.
Command mapping mechanism by the XML configuration file, the user can revise, define script command name and command set voluntarily, needn't be subject to the practical methods title of order source program code, make script engine have more dirigibility and ease for use, be convenient to client's operation maintenance personnel and use.
Technical scheme and the beneficial effect that also in conjunction with the accompanying drawings the embodiment of the invention is provided with specific embodiment is elaborated below.
Shown in Fig. 2 a, be a kind of structured flowchart of the device that passes through the script command calling source program code of the embodiment of the invention, comprising: configuration file receiver module 201, configuration file parsing module 202, script order registration module 203, user command receiver module 211, user command parsing module 212, command mapping calling module 213.
Wherein, configuration file receiver module 201, configuration file parsing module 202 and script order registration module 203 are formed the register device of script command.
Configuration file receiver module 201 is used to receive the XML configuration file, disposes the command information of script command, the method information of source program code that script command calls in the XML configuration file.
Configuration file parsing module 202 is used to resolve the configuration file that configuration file receiver module 201 receives, and resolves the method information that obtains script command information and this source program code from this configuration file.
Script order registration module 203, the command information generation script command name that is used for the described script command that parses according to configuration file parsing module 202, according to the method information generating method callback object of source program code, in the corresponding command list (CLIST) that is registered to script engine 221 of described script command name with described method callback object.
Consult shown in Fig. 2 b, a kind of structure of above-mentioned configuration file parsing module 202 mainly comprises:
Predefine node recognin module 214 is used for discerning each pre-defined node of XML configuration file.
Obtain submodule 215, be used for obtaining the script command information of configuration and the method information of this source program code at each predefine node.
Shown in Fig. 2 c, a kind of structure of above-mentioned script order registration module 203 mainly comprises:
Script command generates submodule 251, is used for the command information generation script command name of the script command that parses according to configuration file parsing module 202.
The method callback object generates submodule 252, is used for the method information generating method callback object of the source program code that parses according to described configuration file parsing module 202.
Registration submodule 253 is used for described script command is generated the script command name of submodule 251 generations and the corresponding command list (CLIST) that is registered to script engine 221 of method callback object of described method callback object generation submodule 252 generations.
User command receiver module 211, user command parsing module 212 and command mapping calling module 213 are formed user's script command calling device.
Wherein, user command receiver module 211 is used to receive the script command that the user imports;
User command parsing module 212 is used to resolve the script command that user command receiver module 211 receives, and resolves the parameter list information that obtains script command name and script command from script command;
Command mapping calling module 213 is used for obtaining corresponding method callback object according to the script command name that described user command parsing module 212 obtains from script engine; Obtain the method object of source program code according to described method callback object, with in the described parameter list data inputting method object and the manner of execution object.
Shown in Fig. 2 d, a kind of structure of mentioned order mapping calling module 213 mainly comprises:
The method callback object obtains submodule 261, is used for obtaining corresponding method callback object according to the script command name that described user command parsing module 212 obtains from script engine 221;
The method object obtains submodule 262, is used for obtaining according to described method callback object the method object of the method callback object acquisition source program code of submodule 261 acquisitions;
Call submodule 263, be used for described parameter list information is input to the method object that described method object obtains the source program code of submodule 262 acquisitions, and call described method object.
If the user wants to go by the simple user script command registration process of the just necessary process earlier of the method object script command in the calling source program code, the relevant information of script command is registered in the script engine 221, later on just can be by the method object in the invoked procedure calling source program code of script command.When user's desired modifications, expansion just only need to change attribute item in the XML configuration file script command time, and need not revise source program code and compile.
Wherein, the registration process of script command is as shown in Figure 3:
Step S300: the source program code that the user calls as required, the attribute item in the configuration XML configuration file, the XML configuration file that configures is corresponding to script command.Configuration XML Profile Users can manual configuration, also can utilize special configuration tool to be configured.
Step S301: receive the XML configuration file.
Step S302: the analyzing XML configuration file parses the attribute in the XML configuration file, as configuration information.These configuration informations comprise: the method information of order set name, order parent name, command name, method name, parameter type, command set type, order etc.Wherein Ming Ling method information comprises method name, parameter list, rreturn value etc.
The analyzing XML configuration file specifically comprises the steps: again
Identification predefine node, each predefined node in the identification XML configuration file;
Obtain the information in the node, in each predefine node, obtain the script command information of configuration and the method information of this source program code.
Step S303:, obtain complete script command name according to order set name, command name.As order set name " mymod ", command name " getvalue " obtains script command name " mymod.getvalue ".
Step S304: according to the method information (as method name, parameter list, rreturn value etc.) of order source and corresponding order, generate a method callback object (CommandInvoker), this object carries the required information of callback method (can obtain class name, can obtain method name and parameter type from " order " node from " order source " node).Such as, according to the method information generating method callback object of order " getvalue ".
Step S305: according to the source program code type, use Register (CommandRegister), complete script command name and method callback object are registered in Ha Xi (Hash) table to planting the order source.Such as, the order source of this example is " test.Client ".Certainly, if adopt fixing source program code type, then this step just can directly have been registered with fixing Register.
Step S306: refresh the command list (CLIST) of Jython script engine 221, the content of hash is added in the command list (CLIST) of script engine 221 above being about to.
The script command invoked procedure is as shown in Figure 4:
Step S401: the script command that receives client user's input.Such as, the mymod.getvalue in this example (1,2).
Step S402: script command is resolved to script command name, parameter list information.Such as, parse script command name " testjave.getvalue " in this example, parameter list information: (1,2).
Step S403: the command list (CLIST) of searching script engine 221 according to the script command name.If this script command name not, execution in step S408; If execution in step S404 is arranged.
Step S404: from script engine 221, take out corresponding method callback object (CommandInvoker) according to the script command name.
Step S405: according to parameter list, compare, carry out the verification of user's input parameter legitimacy with the parameter list type of the method for method callback object (CommandInvoker) encapsulation.Such as, the parameter list of input is (1,2), can learn that the type of input parameter is the int type, and the parameter type of registration also is the int type in the method callback object (CommandInvoker).Type is identical then to be passed through for verification, otherwise verification is not passed through.
Step S406: whether the judgement verification is passed through, if verification is by execution in step S407; If verification is not by execution in step S409.
Step S407: if verification passes through, promptly the input parameter type is consistent with the parameter type of registration, according to the method object of Java principle of reflection calling source program code, and input parameter is imported in the method object, exports execution result.
Step S408: the input error of prompting script command name, execution in step S410 finishes.
Step S409: the input error of prompting parameter, execution in step S410 finishes.
Step S410: finish, finish calling of described source program code.
The embodiment of the invention is based on XML configuration script command information, with Jython as script engine.For by other similar mode configuration script command information, the script engine of other Java language, the embodiment of the invention has same effect.
The embodiment of the invention is owing to adopt configuration information, the script command name that parses the XML configuration file, and the method callback object that will generate according to configuration information and the script command name method that is registered to script engine, the mapping relations between script command and the source program code have been realized, so no longer need encapsulate again in the outside of source program code, and then reduced the redundant code amount, script command function library developer does not need to understand the api function of script engine yet simultaneously, has reduced the complexity of secondary development.
The embodiment of the invention is owing to adopt the method for the method callback object that generates to the script command name of script engine registration XML configuration file and according to configuration information, so realized the loose coupling relation between script command and source program code, in the time of the user's modification script command, need not to revise, compile source program code, only need to revise the attribute item of XML configuration file, and then reach and simplified secondary development, improve the expansion maintenance efficiency, improve the reliability that expansion is safeguarded.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to finish by program, described program can be stored in the computer read/write memory medium, this program is when carrying out, comprise all or part of step in the foregoing description method, described storage medium, as: ROM/RAM, magnetic disc, CD etc.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (16)

1, a kind of script order registration method of calling source program code is characterized in that, comprising:
Receive configuration file, dispose the command information of script command, the method information of source program code that script command calls in the described configuration file;
Resolve described configuration file, obtain the command information of script command and the method information of this source program code from described configuration file;
According to the command information generation script command name of described script command, according to the method information generating method callback object of described source program code;
In the corresponding command list (CLIST) that is registered to script engine of described script command name with described method callback object.
2, the method for claim 1 is characterized in that, the method information of described source program code comprises: the source program code type.
3, method as claimed in claim 2 is characterized in that, described the corresponding method that is registered in the script engine command list (CLIST) with the method callback object of described script command name is comprised:
Use the Register of described source program code type correspondence, described script command name and described method callback object are registered in the hash of script engine;
Refresh the command list (CLIST) of described script engine, described script command name and method callback object correspondence are added in the command list (CLIST) of script engine.
4, method as claimed in claim 2 is characterized in that, the method information configuration of the source program code that the command information of described script command, script command call is in configuration file in each pre-defined node.
5, method as claimed in claim 4 is characterized in that, described each pre-defined node comprises:
The command set node of described configuration file, the name attribute of this command set node are defined as the command set title of described script command, are used for the command set title of configuration script order;
The order source node of described configuration file, the name attribute of this order source node is defined as the title of described source program code, in order to the title of source of configuration program code; The type attribute of this order source node is defined as the type of described source program code, in order to the type of source of configuration program code;
The command node of described configuration file, the name attribute of this command node are defined as the command name title of described script command, in order to the command name title of configuration script order;
The method node of described configuration file, the name attribute of this method node is defined as the method name of described source program code, in order to the method name of source of configuration program code;
The parameter node of described configuration file, the method parameter attribute that this parameter node definition is described source program code is in order to the method parameter attribute of source of configuration program code; Described parameter node also is defined as the parameter list information of described script command simultaneously, in order to the parameter list information of while configuration script order.
6, a kind of method by the script command calling source program code is characterized in that, comprising:
Receive the script command of user's input;
Resolve described script command, from described script command, obtain the parameter list information of script command name and script command;
From script engine, obtain corresponding method callback object according to described script command name; Described script command name and described corresponding method callback object are in the corresponding command list (CLIST) that is registered to described script engine;
Obtain the method object of source program code according to described method callback object;
With in the described parameter list data inputting method object and carry out described method object, finish calling of described source program code.
7, method as claimed in claim 6 is characterized in that, before the script command of described reception user input, also comprises:
Receive configuration file, dispose the command information of script command, the method information of source program code that script command calls in the described configuration file;
Resolve described configuration file, obtain the command information of script command and the method information of this source program code from described configuration file;
Command information according to described script command generates described script command name, generates described method callback object according to the method information of described source program code;
With described script command name and the corresponding command list (CLIST) that is registered to described script engine of described corresponding method callback object.
8, method as claimed in claim 6 is characterized in that, described will comprising in the described parameter list data inputting method object:
According to the parameter type in the described parameter list information of the parameter type verification of described method callback object method for packing, and confirming that parameter type imports parameter list information in the method object interface of described source program code into after identical.
9, a kind of script order registration device of calling source program code is characterized in that, comprising:
The configuration file receiver module is used to receive configuration file, disposes the command information of script command, the method information of source program code that script command calls in the described configuration file;
The configuration file parsing module is used to resolve the configuration file that described configuration file receiver module receives, and obtains the command information of script command and the method information of this source program code from described configuration file;
The script order registration module, the command information generation script command name that is used for the described script command that parses according to described configuration file parsing module, according to the method information generating method callback object of described source program code, in the corresponding command list (CLIST) that is registered to script engine of described script command name with described method callback object.
10, device as claimed in claim 9 is characterized in that, described configuration file parsing module comprises:
Predefine node recognin module is used for discerning each pre-defined node of described configuration file, and wherein, the method information of the source program code that the command information of described script command, script command call is configured in described predefined each node;
Obtain submodule, be used for obtaining the command information of script command of configuration and the method information of this source program code from each predefine node that described predefine node recognin module identifies.
11, device as claimed in claim 9 is characterized in that, described script order registration module comprises:
Script command generates submodule, is used for the command information generation script command name of the described script command that parses according to described configuration file parsing module;
The method callback object generates submodule, is used for the method information generating method callback object of the described source program code that parses according to described configuration file parsing module;
The registration submodule is used for described script command is generated the script command name of submodule generation and the corresponding command list (CLIST) that is registered to script engine of method callback object of described method callback object generation submodule generation.
12, a kind of device of calling source program code is characterized in that, comprising:
The user command receiver module is used to receive the script command that the user imports;
The user command parsing module is used to resolve the script command that described user command receiver module receives, and obtains the parameter list information of script command name and script command from described script command;
The command mapping calling module, the script command name that is used for obtaining according to described user command parsing module obtains corresponding method callback object from script engine; Obtain the method object of source program code according to described method callback object,, finish calling of described source program code in the described parameter list data inputting method object and carry out described method object; Described script command name and described corresponding method callback object are in the corresponding command list (CLIST) that is registered to described script engine.
13, device as claimed in claim 12 is characterized in that, described command mapping calling module comprises:
The method callback object obtains submodule, and the script command name that is used for obtaining according to described user command parsing module obtains corresponding method callback object from script engine;
The method object obtains submodule, is used for obtaining according to described method callback object the method object of the method callback object acquisition source program code of submodule acquisition;
Call submodule, be used for described parameter list information is input to the method object that described method object obtains the source program code of submodule acquisition, and carry out described method object, finish calling of described source program code.
14, device as claimed in claim 12 is characterized in that, described device also comprises: register device is used for described script command name and method callback object correspondence are registered to described script engine.
15, device as claimed in claim 14 is characterized in that, described register device comprises:
The configuration file receiver module is used to receive configuration file, disposes the command information of script command, the method information of source program code that script command calls in the described configuration file;
The configuration file parsing module is used to resolve the configuration file that the configuration file receiver module receives, and obtains the command information of script command and the method information of this source program code from described configuration file;
The script order registration module, the command information generation script command name that is used for the described script command that parses according to the configuration file parsing module, according to the method information generating method callback object of described source program code, in the corresponding command list (CLIST) that is registered to script engine of described script command name with described method callback object.
16, device as claimed in claim 15 is characterized in that, described configuration file parsing module comprises:
Predefine node recognin module is used for discerning each pre-defined node of described configuration file, and wherein, the method information of the source program code that the command information of described script command, script command call is configured in described predefined each node;
Obtain submodule, be used for obtaining the command information of script command of configuration and the method information of this source program code from each predefine node that described predefine node recognin module identifies.
CNB2007101520658A 2007-09-28 2007-09-28 Script order registration method, method and device for calling source program code Expired - Fee Related CN100520718C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007101520658A CN100520718C (en) 2007-09-28 2007-09-28 Script order registration method, method and device for calling source program code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2007101520658A CN100520718C (en) 2007-09-28 2007-09-28 Script order registration method, method and device for calling source program code

Publications (2)

Publication Number Publication Date
CN101126981A CN101126981A (en) 2008-02-20
CN100520718C true CN100520718C (en) 2009-07-29

Family

ID=39095031

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007101520658A Expired - Fee Related CN100520718C (en) 2007-09-28 2007-09-28 Script order registration method, method and device for calling source program code

Country Status (1)

Country Link
CN (1) CN100520718C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559445A (en) * 2013-11-07 2014-02-05 北京奇虎科技有限公司 Application-program interactive control method and device

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101887375B (en) * 2010-06-30 2014-04-09 中兴通讯股份有限公司 Method and system for implementing man-machine command system
CN102244659A (en) * 2011-06-30 2011-11-16 成都市华为赛门铁克科技有限公司 Execution method and apparatus of security policy script and security policy system
CN103488524A (en) * 2012-06-13 2014-01-01 北大方正集团有限公司 Command management device and command management method
CN103593277A (en) * 2012-08-15 2014-02-19 深圳市世纪光速信息技术有限公司 Log processing method and system
CN102929645B (en) * 2012-11-23 2016-04-27 江苏现代造船技术有限公司 A kind of embedded Python interpreter realizes the method for software systems secondary development
EP3053056A4 (en) * 2013-09-30 2017-08-02 Hewlett-Packard Enterprise Development LP Legacy system
CN103645895B (en) * 2013-11-29 2016-12-07 广州视源电子科技股份有限公司 Method of automatic configuration and cloud compiling system
CN105515913A (en) * 2015-12-23 2016-04-20 北京奇虎科技有限公司 Method and device for monitoring device performance
CN107315576A (en) * 2016-04-26 2017-11-03 中兴通讯股份有限公司 A kind of method and system of dynamic expansion software flow
CN107168729A (en) * 2017-04-11 2017-09-15 深圳市艾数信息技术有限公司 The call method and system of a kind of service
CN108897545A (en) * 2018-06-29 2018-11-27 南昌华勤电子科技有限公司 Code compiling method and device
CN109101229A (en) * 2018-07-26 2018-12-28 郑州云海信息技术有限公司 A kind of code automatic generation method of object-oriented, device and equipment
CN110764779B (en) * 2019-10-21 2023-09-15 百度在线网络技术(北京)有限公司 Encapsulation method, registration method, device and rendering equipment
CN111240856B (en) * 2020-01-03 2024-04-23 北京小米移动软件有限公司 Message processing method and device and storage medium
CN112272135B (en) * 2020-10-15 2022-05-27 苏州浪潮智能科技有限公司 Mail sending method, device, equipment and storage medium for storage software

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559445A (en) * 2013-11-07 2014-02-05 北京奇虎科技有限公司 Application-program interactive control method and device
CN103559445B (en) * 2013-11-07 2018-03-02 北京奇虎科技有限公司 A kind of application program interaction control method and device

Also Published As

Publication number Publication date
CN101126981A (en) 2008-02-20

Similar Documents

Publication Publication Date Title
CN100520718C (en) Script order registration method, method and device for calling source program code
US7065744B2 (en) System and method for converting management models to specific console interfaces
US7526490B2 (en) Method of and system for providing positional based object to XML mapping
US9804837B2 (en) System and method for creating, managing, and reusing schema type definitions in services oriented architecture services, grouped in the form of libraries
US7676786B2 (en) System and method and apparatus for using UML tools for defining web service bound component applications
US8375351B2 (en) Extensible rapid application development for disparate data sources
US7743066B2 (en) Anonymous types for statically typed queries
US20090254881A1 (en) Code generation techniques for administrative tasks
US20050108684A1 (en) Method and system for generating an application object repository from application framework metadata
US7177793B2 (en) System and method for managing translatable strings displayed on console interfaces
WO2000075849A2 (en) Method and apparatus for data access to heterogeneous data sources
US7191404B2 (en) System and method for mapping management objects to console neutral user interface
US7240326B2 (en) System and method for obtaining display names from management models
CN102566984A (en) Method and device for configuring parameters
JP2010525452A (en) Description of expected entity relationships in the model
US20030135661A1 (en) System and method for packaging and installing management models with specific console interfaces
CN116795351A (en) Method and device for generating software tool package and readable storage medium
JP2011514596A (en) Efficiently correlate nominally incompatible types
CN103714035B (en) Multilayer software bus structure for integrated environment
Eels et al. Aligning patterns to the Wikibase model
CN114595246B (en) Statement generation method, device, equipment and storage medium
US20100023923A1 (en) Method for medeling objects in a hetrogenious computing environment
CN115454401A (en) Frame code generation method and device based on Spring frame
Paternostro et al. Advanced features of the eclipse modeling framework
Stephan Detection of Java EE EJB antipattern instances using framework-specific models

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090729

Termination date: 20150928

EXPY Termination of patent right or utility model