CN102750144A - Generating tool of function module - Google Patents

Generating tool of function module Download PDF

Info

Publication number
CN102750144A
CN102750144A CN2012101780675A CN201210178067A CN102750144A CN 102750144 A CN102750144 A CN 102750144A CN 2012101780675 A CN2012101780675 A CN 2012101780675A CN 201210178067 A CN201210178067 A CN 201210178067A CN 102750144 A CN102750144 A CN 102750144A
Authority
CN
China
Prior art keywords
module
function
information
called
functional module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2012101780675A
Other languages
Chinese (zh)
Inventor
董琦
李知伟
王岩峰
靳文辉
付晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huaya Microelectronics Shanghai Inc
Original Assignee
Huaya Microelectronics Shanghai Inc
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 Huaya Microelectronics Shanghai Inc filed Critical Huaya Microelectronics Shanghai Inc
Priority to CN2012101780675A priority Critical patent/CN102750144A/en
Publication of CN102750144A publication Critical patent/CN102750144A/en
Pending legal-status Critical Current

Links

Images

Abstract

A generating tool of a function module comprises a resource library, an acquisition unit, a matching unit, a searching unit and a generating unit, wherein the resource library is used for storing function information, a called module and called module information, the function information comprises function names and correspondingly achieved functions, the called module information comprises functions which are achieved by the called module, the acquisition unit is used for acquiring at least one piece of demanding information of the function module, the matching unit is used for acquiring the function names which are matched with the demanding information of the function module in the resource library, the searching unit is used for searching the called module information in the resource library to determine one called module to be called based on the achieved functions corresponding to the function names which are matched with the matching unit, and the generating unit is used for calling the called module which is searched by the searching unit to generate the function module. According to the generating tool of the function module, during the developing process of the function module, blocking phenomena and development cost increasing can be prevented, and conveniences are brought for developers.

Description

The Core Generator of functional module
Technical field
The invention belongs to field of computer technology, relate in particular to a kind of Core Generator of functional module.
Background technology
At present; For most program design; Normally a bigger program (project) is divided into the several function module by function, writes and debug each functional module is write as clear in structure, interface program segment simple, that understand easily, i.e. function by different personnel.This Programming Methodology is referred to as modular Programming Methodology.Adopt modular Programming Methodology can improve procedure development efficient, design efficiency, shorten the procedure development cycle; Avoided the repeated labor of program development; And adopt modular program design; Be convenient to the debugging and the misarrangement of module, and module is easy to safeguard that function also is easy to expand.
For each functional module in the program development process; It can not be an isolated operation, necessary cooperating, but do not hope other its inner operations of functional modules interference again; So API (API; Application Programming Interface) arises at the historic moment, come to connect mutually through calling API between the functional module, to realize function separately.Like: A module invokes the API of B module, the B module invokes API of C module.Through the API of calling functional modules, can guarantee the independence of oneself between the functional module, again collaborative work to each other.
Yet, for calling between the functional module, there is following problem:
First: in the functional module invoked procedure, tend to the situation that occurs blocking.As: in the process of exploitation complication system, need a plurality of functional modules of many people concurrent development, cooperating between a plurality of functional modules.And slip-stick artist's the work efficiency of developing each functional module is different, and the workload of functional module is also different, particularly; Comprising A module, B module, C module, D module with a project is example; If A module, C module, the D module all will call the B module and the A module also will be called the C module, in case the B module is not accomplished so, then C module, D module also can't be accomplished; And the A module should call the B module and call the C module again, so the A module also can't be accomplished.Final because the obstruction that calls between the functional module causes task can't expect completion.When system becomes increasingly complex, when cooperation part gets more and more, obstructing problem will be serious all the more.
Second: because the division of the version of called functional module causes writing the source code of functional module again, take time and effort, and performance history is loaded down with trivial details, has caused inconvenience also to increase cost of development to the developer.A plurality of versions that so-called version division refers to basic software there are differences.Because the version of basic software there are differences, so each version that can cause application software to be necessary for basic software is developed once.For instance; The developer writes the source code of functional module X; The code that has comprised calling functional modules Y in the source code of functional module X; When called functional module Y existed a plurality of version Y1, Y2, Y3, the developer then need write multiple source code X1, X2, X3 again with the different Y1 of correspondence, Y2, Y3.
The 3rd: in the system of complicacy, the quantity of code and document is quite huge, and the developer of difference in functionality module need spend the regular hour and just can find the API of its functional module of wanting to call, and will spend certain hour study and understand the usage of API.Like: parameter and the rreturn value of study API, call sequential (some API must match use, for example: malloc function and free function), special service regeulations (in multi-threaded system, some API can not call) etc. in some thread.And for a functional module; Often the user of functional module (caller) is more much more than the developer; Therefore for the user of functional module, each user will spend the time of seeking and learning API, has brought many inconvenience to the user.
The 4th: for the developer of functional module, it understands the usage of functional module most, if it is when writing the document of functional module usage; Failed to write some information; Must mate like: some interface of this functional module and to call, in calling the process of this functional module, bug will occur so.And the developer of the developer of functional module and called functional module is likely the slip-stick artist of different company; Therefore; Can not see source code between the two, in case bug occurs, the solution process of bug can become extremely difficult; Cause the construction cycle of functional module elongated, increased cost of development.In addition; When called functional module is upgraded, as: the SDK (SDK, Software Development Kit) of upgrading exploitation called functional module; Then call the functional module of this functional module and also must do corresponding modification; And the developer who calls this functional module also will relearn the API of called functional module, has brought inconvenience to the developer, also can increase the cost of development of functional module simultaneously.
Therefore; How can avoid the generation of choking phenomenon in the development function module process and, provide bigger facility to become one of present problem demanding prompt solution to the developer because the cost of development that factors such as called functional module upgrading, version division cause increases.
The correlation technique of other relevant functional modules can also be CN101650648 referring to publication number, and denomination of invention is the patented claim of the system and method for dynamically calling functional module.
Summary of the invention
The problem that the present invention solves provides a kind of Core Generator of functional module to prevent to occur in the functional module performance history increase of choking phenomenon and cost of development, more conveniently provides to the developer.
In order to address the above problem, the invention provides a kind of Core Generator of functional module, comprising:
Resources bank is used for memory function information, the module that is called and module information thereof, and said function information comprises function title and the corresponding function that realizes thereof, the module information of the said module that is called comprises the function that the said module that is called realizes;
Acquiring unit is used to obtain at least one demand information of functional module;
Matching unit is used for obtaining the function title of said resources bank and the demand information coupling of said functional module;
Search unit, the said resources bank of searching functions that is used for the corresponding realization of function title that foundation and matching unit the match module information of module that is called is with the module of confirming to call that is called;
Generation unit, be used to call search unit searches to the module that is called, to generate said functional module.
Optional, the Core Generator of said functional module also comprises:
First encapsulation unit is used for encapsulating at least two function informations of said resources bank;
First storage unit is used for the function information after said first encapsulation unit encapsulation is stored to said resources bank.
Optional, the Core Generator of said functional module also comprises:
Second encapsulation unit is used to the functional module interpolation module information that said generation unit generates, so that said functional module is packaged into the module that is called;
Second storage element is used for the module that is called of said second encapsulation unit encapsulation is stored to said resources bank;
Adding device is used for being stored to said resources bank based on the module systematic function information that is called of said second encapsulation unit encapsulation and with the function information of said generation.
Optional, the said module that is called is realized that by API the function that the said module that is called realizes is the function that API realizes, said module information also comprises API Name; Said function information and module information are all described with the natural language character string.
Optional, said module information also comprises the shape ginseng information of API; Said function information also comprises the shape ginseng information of API and the corresponding relation of function title.
Optional, said module information also comprises the rreturn value information of API; Said function information also comprises the corresponding relation of rreturn value information and the function title of API.
Optional, said matching unit adopts fuzzy matching algorithm to search for said resources bank.
Optional, the relation between said matching unit is referred to as based on the demand information of said functional module and function name is obtained in the said resources bank function title with said demand information coupling.
Optional, said acquiring unit comprises:
Input block is used to import the request of systematic function module;
Resolution unit is used to resolve described request, and to obtain at least one demand information, said demand information comprises actual parameter.
Optional, the said module that is called is realized that by API said module information also comprises the shape ginseng information of API, said generation unit comprises:
Call unit is used for said actual parameter is passed to the said module that is called that searches, to call this module that is called;
The code generation unit is used for generating the source code of said functional module based on the said result of calling.
Compared with prior art, technical scheme of the present invention has the following advantages:
In the generative process of functional module; Acquiring unit obtains its demand information; Matching unit obtains the function title in the resources bank that is stored in said demand information coupling; And then making the function of the realization that the search unit utilization is corresponding with said function title search the module that is called, generation unit calls the module that is called with the systematic function module.Because in the process of systematic function module; Only obtain the demand information of functional module earlier; Rather than directly call the module that is called, so the generation of functional module does not directly depend on the module that is called, the realization of functional module in other words no longer is just can carry out after the modular design that is called such as having only to accomplish; Therefore, avoided the appearance of choking phenomenon in the systematic function module process.
Because in the functional module generative process; What relate to is its demand information; And when the situation of version division appears in the module that is called; Function information in the resources bank can upgrade accordingly, thus need not to write again the functional module of corresponding different editions, but direct demand information according to functional module goes to obtain the function title with its coupling; And then according to the be called module information of module of the function search with the corresponding realization of said function title, the module and calling of confirming to be called with the systematic function module.Simplified the performance history of functional module, brought facility also to reduce cost of development to the developer.In addition, be complementary through its demand information and function title and carry out because functional module is called the module that is called, therefore; When being called module upgrade, functional module can not revised its demand information, as long as the function title of the module that is called and the demand information of functional module are complementary; Call unit just can be realized calling the module that is called; And then make generation unit can regenerate source code, and reduced the fussy degree of performance history, brought facility to the developer.
Cooperation through matching unit and search unit to be confirming the module that is called, and then through the call unit in the generation unit actual parameter is passed to the module that is called, and realizes calling the module that is called with the systematic function module.Therefore, developer need not learn again the to be called API of module brings great convenience to the developer, has also improved the efficient of development function module.In addition; Because the developer of functional module need not directly call the API of the module that is called again; So avoided the incomplete caused debug difficulties of API document to a certain extent, and owing in the process of systematic function module, only relate to the actual parameter in the demand information is passed to the module that is called because of the module that is called; Error probability when therefore having reduced functional module and calling the API of the module that is called, and then reduced the complexity in the debug process.In addition, function information and demand information are all represented with the form of natural language character string, have also improved the efficient of development function module when making things convenient for the developer.
Description of drawings
Fig. 1 is the structural representation of Core Generator of the functional module of embodiment of the present invention;
Fig. 2 is the structural representation of Core Generator of the functional module of the embodiment of the invention.
Embodiment
For make above-mentioned purpose of the present invention, feature and advantage can be more obviously understandable, does detailed explanation below in conjunction with the accompanying drawing specific embodiments of the invention.
Set forth detail in the following description so that make much of the present invention.But the present invention can be different from alternate manner described here and implements with multiple, and those skilled in the art can do similar popularization under the situation of intension of the present invention.Therefore the present invention does not receive the restriction of following disclosed embodiment.
As what describe in the background technology, in the process of existing systematic function module, functional module is when calling other functional modules; Can occur block and because problems such as version division, module upgrade appear in other functional modules; Also can cause the developer when calling other functional modules, the API that need relearn other functional modules lays equal stress on and newly writes the source code of functional module, causes performance history loaded down with trivial details; Cost of development increases, and has brought great inconvenience to the developer.
Therefore, the inventor considers whether to change the generative process of functional module; Make the generation of functional module directly not depend on the completion of its functional module of calling (module is called) as far as possible; Particularly, in the generative process of functional module, memory function information in resources bank; The module that is called and module information thereof; The demand information and the function information of functional module are mated, and then, call the module that is called then with the systematic function module through the corresponding module that is called that searches between the module information of function information and the module that is called.
See also the structural representation of Core Generator of the functional module of Fig. 1 embodiment of the present invention, as shown in Figure 1, the Core Generator of said functional module comprises:
Resources bank 101 is used for memory function information, the module that is called and module information thereof, and said function information comprises function title and the corresponding function that realizes thereof, the module information of the said module that is called comprises the function that the said module that is called realizes;
Acquiring unit 102 is used to obtain at least one demand information of functional module;
Matching unit 103 links to each other with said resources bank 101, acquiring unit 102, is used for obtaining the function title of said resources bank 101 and the demand information coupling of said functional module;
Search unit 104; Link to each other with said resources bank 101, matching unit 103; The said resources bank 101 of searching functions that is used for the corresponding realization of function title that foundation and matching unit 103 the match module information of module that is called is with the module of confirming to call that is called;
Generation unit 105 links to each other with said resources bank 101, search unit 104, is used to call the module that is called that search unit 104 searches, to generate said functional module.
In this embodiment; The said module that is called (being also referred to as the function that is called), functional module (being also referred to as power function) all are used for realizing certain function; Module, the functional module of being called all has module information separately; Said module information comprises some steps, relates to information such as variable, parameter, fundamental operation.
In this embodiment; The function title of storage is mated in the demand information of the functional module that matching unit 103 obtains acquiring unit 102 and the resources bank 101; Search unit 104 is according to the function of the corresponding realization of the function title that matching unit 103 obtains; Module information to the module that is called of storage in the resources bank 101 is searched for; And then searching out the module that is called, generation unit 105 calls the module that is called in the resources bank 101 according to the title of the module that is called that search unit 104 searches.
For technical scheme of the present invention is described better, technical scheme of the present invention is carried out detailed explanation below in conjunction with concrete embodiment.
Fig. 2 is the structural representation of Core Generator of the functional module of the embodiment of the invention, and as shown in Figure 2: the Core Generator of said functional module comprises: resources bank 101, acquiring unit 102, matching unit 103, search unit 104, generation unit 105; Said resources bank 101, acquiring unit 102 link to each other with said matching unit 103 respectively, and said search unit 104 links to each other with said resources bank 101, matching unit 103, and said generation unit 105 links to each other with said resources bank 101, search unit 104, wherein:
Said acquiring unit 102 comprises:
Input block 1021 is used to import the request of systematic function module;
Resolution unit 1022 links to each other with said input block 1021, matching unit 103, is used to resolve described request, and to obtain at least one demand information, said demand information comprises real ginseng information.
Said generation unit 105 comprises:
Call unit 1051 links to each other with said resolution unit 1022, resources bank 101, search unit 104, is used for said real ginseng information is passed to the said module that is called that searches, to call this module that is called;
Code generation unit 1052 links to each other with said call unit 1051, is used for generating the source code of said functional module based on the said result of calling.
In the present embodiment, store be called module and module information thereof in the said resources bank 101, the module information of the said module that is called is described with the natural language character string.The module information of the said module that is called comprises some steps, and wherein a part of step has related to information such as the variable, parameter, rreturn value, basic computing of this module, and another part step has then comprised the function that the module that is called realizes.In the present embodiment; The said module that is called is realized by API; The function that the module that is called that the module information of the module that is called is included realizes is the function that API realizes, the function that said API realizes also is the effect of API, and the module information of the said module that is called also comprises API Name.For instance: API Name is " Play Channel ", and the function of its realization is " broadcasting channel "; API Name is " GetFileLength ", and the function of its realization is " obtaining file size ".
Also store function information in the said resources bank 101, said function information is also described with the natural language character string.Said function information can be associated with the module that is called, and in other words, can search the module that is called through function information.For instance, can store function name in the said resources bank 101 and be called " broadcasting channel character string ", be the function information of " broadcasting channel " with the function of the corresponding realization of this function title.Perhaps storing function name and be called " obtain path be the big or small character string of the file of path string ", is the function information etc. of " acquisition file size " with the function of the corresponding realization of this function title.
In the process of systematic function module, obtain the demand information of functional module through said acquiring unit 102.Particularly; Said acquiring unit 102 comprises: input block 1021 and resolution unit 1022; The request of the systematic function module of said input block 1021 inputs is described with the natural language character string, and described request comprises call request, promptly in the process of systematic function module; This functional module will be called the request of other functional modules, and said call request is not unique; Said resolution unit 1022 is resolved the request of said input block 1021 inputs, and with acquiring demand information, said demand information is also described with the natural language character string, and said demand information comprises actual parameter (real ginseng).For instance, if request call broadcasting channel module is with broadcasting channel CCTV in the process that functional module generates, then its demand information is " broadcasting channel CCTV ", and wherein CCTV is an actual parameter.
Need to prove; The request of the systematic function module of said input block 1021 inputs is except comprising call request; Comprise also being used for the required association requests of systematic function module that described request obtains the essential information and the demand information of functional module after said resolution unit 1022 is resolved.Said essential information comprises some steps, has related to the information such as variable, parameter, rreturn value, basic computing of this functional module, and each step is still described with the natural language character string.Said demand information is also described with the natural language character string.
In addition; Also can comprise demand information in the module information of the module that is called; And also can comprise the function that functional module realizes in the module information of functional module; When functional module was realized by API, the function that functional module realizes then was the function of API realization, also comprised the title of API in the module information of functional module.That is to say that the functional module module that still is called all is relative, for any one functional module, it possibly be the module that is called of other functional modules; For the module that is called, it possibly be a functional module of calling other modules.For instance, functional module A calling functional modules B, functional module B calling functional modules C had then both comprised the function of API realization and the title of API in the module information of functional module B, also comprised the demand information of functional module B.
Behind the demand information that has obtained functional module, matching unit 103 is searched for the function title with the demand information of functional module coupling in said resources bank 101.And then by function search module information in resources bank 101 of the search unit 104 foundations realization corresponding, and then search out the module that is called with this function title.Because in the present embodiment, demand information and function information are all described with the natural language character string, so can adopt the natural language processing algorithm to come matching feature title and demand information.In the present embodiment, said matching unit 103 adopts fuzzy matching algorithm to come matching feature title and demand information.
Fuzzy matching is meant that the implication of two character strings is identical, but character string itself and inequality.For example: " I have eaten an apple " and " apple has been eaten by me " fuzzy matching." if " and " if " fuzzy matching." name of school " and " school name " fuzzy matching.The essence of fuzzy matching algorithm is to come semanteme to character string adopted conversion such as to carry out through diverse ways, and adopted conversion such as said has also comprised the type that character string is transformed to it.For instance: " I have eaten an apple " can by etc. justice be transformed to " I have eaten a fruit " because apple (character string) is a kind of fruit (type).After adopted conversion such as passing through,, then think these two character string fuzzy matching if final two character strings can be transformed to same character string.
In another embodiment, the relation between said matching unit also can be referred to as based on the demand information of said functional module and function name is confirmed the function title with said demand information coupling.Particularly, whether have relation of inclusion between the demand information of functional module and function name are referred to as, for example judge whether said demand information is the subclass of function title, if, coupling between then said demand information and said function name are referred to as.For instance, if the demand information of functional module is " broadcasting channel CCTV "; Matching unit is searched for the function title in the resources bank; Search function title " broadcasting channel character string "; And CCTV is a character string in the demand information " broadcasting channel CCTV ", is the subclass of character string, so " broadcasting channel CCTV " also is the subclass of " broadcasting channel character string "; Therefore, demand information " broadcasting channel CCTV " is complementary with function title " broadcasting channel character string ".
In another embodiment; Matching unit also can adopt fuzzy matching algorithm to come the demand information and the function title of matching feature module earlier; If coupling less than with the function title of the demand information of said functional module coupling, whether the demand information through confirming functional module is that the subclass of function title comes the two is mated again.
After matching unit 103 obtained the function title with the demand information of functional module coupling, search unit 104 was confirmed the function of the API realization corresponding with it according to said function title.The title of the API that the function that has also comprised function that the API of the module that is called realizes owing to be called in the module information of module and realized with this API is corresponding; Therefore search unit 104 finds the function of API realization identical with it in module information according to the function of API realization in the function information; And then the function that is realized by API in the module information again finds the title of the API corresponding with it, to search out the module that is called.
For instance: if the demand information of functional module is " broadcasting channel CCTV "; Matching unit 103 adopts fuzzy matching algorithm that the function title of storage in said demand information and the resources bank 101 is mated, and searches function title " broadcasting channel character string " and " broadcasting channel CCTV " coupling.And the function that " broadcasting channel character string " corresponding API realizes is " broadcasting channel "; The module information of the module that is called of storage in function " broadcasting channel " the searching resource storehouse 101 that the pairing API of the function title that search unit 104 matches according to matching unit 103 " broadcasting channel character string " realizes; Search also comprise in the module information of a certain module with function information in the function " broadcasting channel " that realizes of the identical API of function that realizes of API; Because the name of the pairing API of function that this API realizes is called " Play Channel ", so search unit 104 has been confirmed the module that is called.
In the process of actual systematic function module, the module that is called can have input parameter and rreturn value, also can have only input parameter or have only rreturn value, can also both not have input parameter also not have rreturn value; Therefore, in the present embodiment, for condition of different, the included content of the module information of the included content of function information, the module that is called is also different.Particularly,
Module has input parameter if be called, and the module information of the then said module that is called also comprises the shape ginseng information of API; Said function information also comprises: the shape ginseng information of API and the corresponding relation of function title.The shape ginseng information of said API comprises parameter name, parameter type and the meaning of parameters of the shape ginseng of API.The corresponding relation of the shape of said API ginseng information and function title specifically is meant the corresponding relation between the parameter name that the shape of partial character string and API in the said function title joins.For instance: the API Name of the module that is called comprises for " Play_Channel " its shape ginseng information: shape ginseng parameter name: " ch_name ", parameter type: char*, meaning of parameters: channel name to be play; And function name is called " broadcasting channel character string ", and then " character string " is corresponding with shape ginseng parameter name " ch_name ".
Module has rreturn value if be called, and the module information of the then said module that is called also comprises the rreturn value information of API; Said function information also comprises: the rreturn value information of API and the corresponding relation of API Name.The rreturn value information of said API comprises type and the implication of rreturn value of the rreturn value of API.The rreturn value information of said API and the corresponding relation of function title specifically are meant the corresponding relation between the rreturn value of partial character string and API in the said function title.
The existing input parameter of module has rreturn value again if be called, and the module information of the then said module that is called also comprises the shape ginseng information of API and the rreturn value information of API; Said function information also comprises: parameter name and the rreturn value of corresponding relation between a part of character string in the function title and API and the corresponding relation between another part character string in the function title of the shape ginseng of API.For instance: the API Name of the module that is called comprises for " GetFileLength " its shape ginseng information: shape ginseng parameter name: " file_path ", parameter type: char*, meaning of parameters: file path; Its rreturn value information comprises: the type of rreturn value: long; The implication of rreturn value: file size; And function name is called " obtain path be the big or small character string of the file of path string ", then " path string " and shape to join parameter name " file_path " corresponding, " big or small character string " and API Name are that the rreturn value of " GetFileLength " is corresponding.
After search unit 104 searches the module that is called, call the module that is called that searches through generation unit 105, with the systematic function module.Particularly; Through call unit 1051; Actual parameter in the demand information of functional module is passed to the module that is called; Corresponding relation between actual parameter in the said call unit 1051 analyze demands information and function name are referred to as, and according to the corresponding relation between the parameter name of the shape ginseng of the partial character string of function title in the function information and API said actual parameter is passed to the shape ginseng in the shape ginseng information of API of the module that is called, to realize calling to the module that is called.After call unit 1051 calls the module that is called, realized the request of functional module, with the systematic function module.In the present embodiment, functional module is described through the natural language character string, in order to make functional module may operate on the computing machine, through the source code of code generation unit 1052 systematic function modules.The source code of said functional module can be the C language, also can be that Java language is write.
In addition, in order to realize the demand information of difference in functionality module, the Core Generator of said functional module also comprises in the present embodiment:
First encapsulation unit is used for encapsulating at least two function informations of said resources bank;
First storage unit is used for the function information after said first encapsulation unit encapsulation is stored to said resources bank.
For instance; If store be called modules A and B in the resources bank; Wherein, The function name of the function information related with the modules A that is called is called " broadcasting channel character string ", and the function that the API corresponding with this function title realizes is " broadcasting channel ", and " character string " in the function title is corresponding with the parameter name " ch_name " of the shape of the API of the modules A that is called ginseng.Be called " obtaining current broadcasting channel character string " with the function name of the related function information of module B that is called; The function that the API corresponding with this function title realizes is " obtaining current broadcasting channel ", and " character string " in the function title is corresponding with the rreturn value " channel name of current broadcast " of the API of the module B that is called.Then can these two function informations be encapsulated as new function information through first encapsulation unit; The function name of the function information after the encapsulation is called " broadcast current channel ", and the function that the API corresponding with this function title realizes is " obtaining current broadcasting channel character string " and " broadcasting channel character string " these two function titles.That is to say that in the present embodiment, after through first encapsulation unit at least two function informations being encapsulated, the function that the corresponding API of function title realizes can be the set of the function title of packed function information.When the demand information of functional module and function title " broadcast current channel " coupling, the Core Generator of functional module can be realized calling earlier and obtain current broadcasting channel module (functional module B), calls broadcasting channel module (functional module A) again.
For bigger facility is provided to the developer, in other embodiments, the Core Generator of said functional module also comprises:
Second encapsulation unit is used to the functional module interpolation module information that said generation unit generates, so that said functional module is packaged into the module that is called;
Second storage element is used for the module that is called of said second encapsulation unit encapsulation is stored to said resources bank;
Adding device is used for being stored to said resources bank based on the module systematic function information that is called of said second encapsulation unit encapsulation and with the function information of said generation.
Said second encapsulation unit is that the module information that functional module is added comprises at least: the function that this functional module realizes, and the function that functional module realizes specifically refers to the function that API realizes; The function information that said adding device adds comprises the function that the function title that is associated with this functional module and corresponding API thereof realize.For different functional, the function information that the module information that second encapsulation unit adds, adding device add is also different, particularly,
If functional module has input parameter, the module information that said second encapsulation unit adds also comprises: the shape ginseng information of API; The function information that said adding device adds also comprises: the shape ginseng information of API and the corresponding relation of function title.
If functional module has rreturn value, the module information that said second encapsulation unit adds also comprises: the rreturn value information of API; The function information that said adding device adds also comprises: the rreturn value information of API and the corresponding relation of function title.
If the existing input parameter of functional module has rreturn value again, the module information that said second encapsulation unit adds also comprises: the shape ginseng information of API and the rreturn value information of API; The function information that said adding device adds also comprises: the shape ginseng information of API and corresponding relation and the rreturn value information of API and the corresponding relation of function title of function title.
Need to prove that function title and the corresponding function that realizes thereof can be related one to one with functional module, also can be that one-to-many is related.Particularly; It is identical being associated with function title and corresponding API function that realizes and the function title that is associated with functional module B thereof of functional module A and the function of corresponding API realization thereof; (module information is different and functional module A and functional module B self possibility is different; The source code of module is also different); It is example that the function that realizes with the function title that is associated with functional module A and corresponding API thereof has write resources bank: if related one to one; Then can directly in resources bank, duplicate the function that the function title that is associated with functional module A and corresponding API thereof realize, the function that the function title of duplicating and corresponding API thereof are realized is as the function of function title that is associated with functional module B and corresponding API realization thereof; If one-to-many is related; Then need not again to write the function that the function title that is associated with functional module B and corresponding API thereof realize to resources bank; Both can search functional module A (modules A is called) through this function title in the resources bank and the corresponding function that realizes thereof and also can search functional module B (module that is called B), so also improve the development efficiency of functional module.
And be the related situation of one-to-many for function title and the corresponding function that realizes thereof with functional module; In the process of actual calling functional modules; If search unit has not only searched functional module A but also has searched functional module B (function of functional module A is identical with the function of functional module B); Which functional module call unit specifically calls, and then can confirm in the following manner:
In general, in the actual performance history, a project generally includes the several function module, and the function of each functional module is all inequality.Realize the task of this project through the cooperation of all functional modules.For instance; Project P has comprised functional module A, functional module C, functional module D and functional module E; In the process of systematic function module C, in resources bank, search functional module A (modules A is called) and functional module B (module that is called B) according to its demand information search unit, because functional module A belongs to project P; Therefore, call unit calling functional modules A (modules A is called) is with systematic function module C.That is to say; If in the performance history of project; The Core Generator of functional module has searched a plurality of functional modules (module is called) according to the demand information of functional module in this project; If comprised the functional module (module is called) that searches in the project, then call unit calls the functional module (module is called) that comprises in the project.
If project P has comprised functional module C, functional module D, functional module E and functional module F; In the process of systematic function module C; In resources bank, search functional module A (modules A is called) and functional module B (module that is called B) according to its demand information search unit; And project P does not comprise functional module A or functional module B, and at this moment, call unit random call functional module A (modules A is called) or functional module B (module that is called B) are with systematic function module C.That is to say; If in the performance history of project; The Core Generator of functional module has searched a plurality of functional modules (module is called) according to the demand information of functional module in this project; If do not comprise the functional module (module is called) that searches in the project, the functional module (module is called) that searches of call unit random call then.
In addition, when the module that is called was upgraded, the function of its function title and the API realization corresponding with this function title can be constant, thus can keep to upgrade the preceding module that is called compatibility.In other words; Module is upgraded though be called; But comprised the information before not upgrading in the function information, functional module also can be revised demand information like this, after demand information and function name-matches; Still can be by the be called module of search unit searches after upgrade, and then realize calling to it.
For technical scheme of the present invention is described better, below the process of the Core Generator systematic function module of functional module is explained accordingly through real example.
Instance one
In this example, store the broadcasting channel module in the resources bank, its module information is following:
API Name: Play_Channel;
The function that API realizes: broadcasting channel;
Shape ginseng information: the char*ch_name (parameter type and parameter name) of API; Channel name to be play (meaning of parameters);
The function information of storing in the resources bank is following:
Function title: broadcasting channel character string;
The function that API realizes: broadcasting channel;
The shape ginseng parameter name of API and the corresponding relation of function title: shape ginseng parameter name " ch_name " is corresponding with " character string ";
In this example; Acquiring unit obtains the demand information " broadcasting channel CCTV " of functional module; Matching unit matees the function title of storing in said demand information " broadcasting channel CCTV " and the resources bank, searches function title " broadcasting channel character string " and " broadcasting channel CCTV " coupling.And the function that " broadcasting channel character string " corresponding API realizes is " broadcasting channel "; The module information of the module that is called of storing in function " broadcasting channel " the searching resource storehouse that the pairing API of the function title that search unit matches according to matching unit " broadcasting channel character string " realizes; Search also comprise in the module information of broadcasting channel module with function information in the function " broadcasting channel " that realizes of the identical API of function that realizes of API; Because the name of the pairing API of function that this API realizes is called " Play_Channel ", module is the broadcasting channel module so search unit has been confirmed to be called.
Call unit, the corresponding relation between demand information of analytic function module " broadcasting channel CCTV " and the function title " broadcasting channel character string " has obtained actual parameter " CCTV " correspondence " character string ".And can know by the corresponding relation between the shape ginseng information of function title in the function information and API: " character string " in the function title the is corresponding parameter name " ch_name " of API shape ginseng; Therefore; Actual parameter CCTV is passed to the shape ginseng of API; Be ch_name=CCTV, to call the broadcasting channel module.Call unit realizes that the code generation unit then can be based on the said result that calls, the source code of systematic function module to after the calling of broadcasting channel module.
Instance two
In this example, with based on file system for example: FAT32 or NTFS exploitation the text edit tool notepad are that example describes.Need the content of text be read in memory buffer in the notepad performance history, for the ease of explanation, just the content of text is read in memory buffer and is called the ReadTextFile module here, and the module information of this module comprises the steps:
Definition of data: name is called file_length, and type is int;
The definition pointer: name is called p_buffer, and type is char;
Obtain the big or small file_length of file f ile_path; // demand information, wherein parameter f ile_path is a file path
For p_buffer application size is the internal memory of file_length;
Size among the file f ile_path is read in p_buffer for the data of file_length;
Return p_buffer;
Store in the resources bank and obtain the file size module, its module information is following:
API Name: GetFileLength;
The function that API realizes: obtain file size;
Shape ginseng information: the char*file_path (parameter type and parameter name) of API; File path (meaning of parameters);
The rreturn value information of API: long (type of rreturn value); File size (implication of rreturn value);
The function information of storing in the resources bank is following:
The function title: obtaining the path is the big or small character string of the file of path string;
The function that API realizes: obtain file size;
The shape ginseng parameter name of API and the corresponding relation of function title: shape ginseng parameter name " file_path " is corresponding with " path string ";
The corresponding relation of the rreturn value of API and function title: API Name is that the rreturn value of " GetFileLength " is corresponding with " big or small character string ";
In this example; Acquiring unit obtains the demand information " obtain file path and be 123 the big or small file_length of file " of ReadTextFile module (functional module); Matching unit with said demand information " obtain file path and be the big or small file_length of the file of D:ing " with resources bank in the function title of storing mate, search function title " obtaining the path is the big or small character string of the file of path string " and " obtaining file path is the big or small file_length of the file of D: " coupling.And the function that " obtaining the path is the big or small character string of the file of path string " corresponding API realizes is " an acquisition file size "; The module information of the module that is called of storing in function " acquisition file size " the searching resource storehouse that the pairing API of the function title that search unit matches according to matching unit " obtaining the path is the big or small character string of the file of path string " realizes; Search the function " acquisition file size " that also comprises the API realization identical in the module information that obtains the file size module with the function of API realization in the function information; Because the pairing API Name of function that this API realizes is " GetFileLength ", module is for obtaining the file size module so search unit has been confirmed to be called.
Call unit; The demand information of analytic function module " obtain file path and be the big or small file_length of the file of D:ing " with function title " the acquisition path is the file size character string of path string " between corresponding relation; The acquisition actual parameter " 123 " correspondence " path string ", the rreturn value of the corresponding GetFileLength of file_length.And can know by the corresponding relation between the shape ginseng information of function title in the function information and API: " path string " in the function title the is corresponding parameter name " file_path " of API shape ginseng; Therefore; With actual parameter 123 pass to the shape ginseng of API; Be 123, obtain the file size module to call.With the rreturn value of GetFileLength as file size file_length, promptly file_length=GetFileLength (123).Call unit realizes that the code generation unit then can generate the source code of ReadTextFile module based on the said result that calls to after obtaining the calling of file size module.
Can be known that by instance two if file system FAT32 is developed by A company, file system NTFS is by the exploitation of B company, notepad is developed by C company.Because what C company write in the process of exploitation notepad is the demand information relevant to each module of file system; Therefore; No matter be the file system upgrading (as obtaining the file size module upgrade) of A company, or the upgrading of the file system of B company, the notepad of C company exploitation can be revised; And the notepad of its exploitation goes for all file system; The developer of C company is in exploitation during notepad, can bring facility to the developer without the method for application (as: obtaining the method for application of file size modules A PI) of the API of learning files system, improved development efficiency.In sum, technical scheme of the present invention has been avoided the choking phenomenon in the systematic function module process, has simplified the performance history of functional module; Reduced the fussy degree of performance history; Improved the efficient of development function module, also reduced cost of development, brought facility to the developer.
Though the present invention with preferred embodiment openly as above; But it is not to be used for limiting the present invention; Any those skilled in the art are not breaking away from the spirit and scope of the present invention; Can utilize the method and the technology contents of above-mentioned announcement that technical scheme of the present invention is made possible change and modification, therefore, every content that does not break away from technical scheme of the present invention; To any simple modification, equivalent variations and modification that above embodiment did, all belong to the protection domain of technical scheme of the present invention according to technical spirit of the present invention.

Claims (10)

1. the Core Generator of a functional module is characterized in that, comprising:
Resources bank is used for memory function information, the module that is called and module information thereof, and said function information comprises function title and the corresponding function that realizes thereof, the module information of the said module that is called comprises the function that the said module that is called realizes;
Acquiring unit is used to obtain at least one demand information of functional module;
Matching unit is used for obtaining the function title of said resources bank and the demand information coupling of said functional module;
Search unit, the said resources bank of searching functions that is used for the corresponding realization of function title that foundation and matching unit the match module information of module that is called is with the module of confirming to call that is called;
Generation unit, be used to call search unit searches to the module that is called, to generate said functional module.
2. the Core Generator of functional module as claimed in claim 1 is characterized in that, also comprises:
First encapsulation unit is used for encapsulating at least two function informations of said resources bank;
First storage unit is used for the function information after said first encapsulation unit encapsulation is stored to said resources bank.
3. the Core Generator of functional module as claimed in claim 1 is characterized in that, also comprises:
Second encapsulation unit is used to the functional module interpolation module information that said generation unit generates, so that said functional module is packaged into the module that is called;
Second storage element is used for the module that is called of said second encapsulation unit encapsulation is stored to said resources bank;
Adding device is used for being stored to said resources bank based on the module systematic function information that is called of said second encapsulation unit encapsulation and with the function information of said generation.
4. the Core Generator of functional module as claimed in claim 1 is characterized in that, the said module that is called is realized that by API the function that the said module that is called realizes is the function that API realizes, said module information also comprises API Name; Said function information and module information are all described with the natural language character string.
5. the Core Generator of functional module as claimed in claim 4 is characterized in that, said module information also comprises the shape ginseng information of API; Said function information also comprises the shape ginseng information of API and the corresponding relation of function title.
6. the Core Generator of functional module as claimed in claim 4 is characterized in that, said module information also comprises the rreturn value information of API; Said function information also comprises the corresponding relation of rreturn value information and the function title of API.
7. the Core Generator of functional module as claimed in claim 4 is characterized in that, said matching unit adopts fuzzy matching algorithm to search for said resources bank.
8. the Core Generator of functional module as claimed in claim 4 is characterized in that, the relation between said matching unit is referred to as based on the demand information of said functional module and function name is obtained in the said resources bank function title with said demand information coupling.
9. the Core Generator of functional module as claimed in claim 1 is characterized in that, said acquiring unit comprises:
Input block is used to import the request of systematic function module;
Resolution unit is used to resolve described request, and to obtain at least one demand information, said demand information comprises actual parameter.
10. the Core Generator of functional module as claimed in claim 9 is characterized in that, the said module that is called is realized that by API said module information also comprises the shape ginseng information of API, and said generation unit comprises:
Call unit is used for said actual parameter is passed to the said module that is called that searches, to call this module that is called;
The code generation unit is used for generating the source code of said functional module based on the said result of calling.
CN2012101780675A 2012-05-31 2012-05-31 Generating tool of function module Pending CN102750144A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012101780675A CN102750144A (en) 2012-05-31 2012-05-31 Generating tool of function module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012101780675A CN102750144A (en) 2012-05-31 2012-05-31 Generating tool of function module

Publications (1)

Publication Number Publication Date
CN102750144A true CN102750144A (en) 2012-10-24

Family

ID=47030367

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012101780675A Pending CN102750144A (en) 2012-05-31 2012-05-31 Generating tool of function module

Country Status (1)

Country Link
CN (1) CN102750144A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104102477A (en) * 2013-04-08 2014-10-15 腾讯科技(深圳)有限公司 Method and frame platform system for changing mobile terminal application into plugin
CN107066246A (en) * 2016-12-27 2017-08-18 深圳虚觅者科技有限公司 A kind of software development methodology and device
WO2018028027A1 (en) * 2016-08-12 2018-02-15 北京大学 Method for opening up data and functions of terminal application based on reconstruction technology
CN110647666A (en) * 2019-09-03 2020-01-03 平安科技(深圳)有限公司 Intelligent matching method and device for template and formula and computer readable storage medium
CN112698885A (en) * 2021-01-04 2021-04-23 联想(北京)有限公司 Operating method and device
CN113326038A (en) * 2021-06-11 2021-08-31 北京百度网讯科技有限公司 Method, apparatus, device, storage medium and program product for providing service

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1320874A (en) * 2001-05-25 2001-11-07 清华大学 Program mining method and system in network environment
US20030131339A1 (en) * 2001-08-06 2003-07-10 Kulkarni Vinay Vasant Methods and apparatus for batch program implementation
CN101620536A (en) * 2009-08-17 2010-01-06 用友软件股份有限公司 Method and device for invoking performance function

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1320874A (en) * 2001-05-25 2001-11-07 清华大学 Program mining method and system in network environment
US20030131339A1 (en) * 2001-08-06 2003-07-10 Kulkarni Vinay Vasant Methods and apparatus for batch program implementation
CN101620536A (en) * 2009-08-17 2010-01-06 用友软件股份有限公司 Method and device for invoking performance function

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104102477A (en) * 2013-04-08 2014-10-15 腾讯科技(深圳)有限公司 Method and frame platform system for changing mobile terminal application into plugin
WO2018028027A1 (en) * 2016-08-12 2018-02-15 北京大学 Method for opening up data and functions of terminal application based on reconstruction technology
CN107066246A (en) * 2016-12-27 2017-08-18 深圳虚觅者科技有限公司 A kind of software development methodology and device
CN107066246B (en) * 2016-12-27 2021-03-05 深圳虚觅者科技有限公司 Software development method and device
CN110647666A (en) * 2019-09-03 2020-01-03 平安科技(深圳)有限公司 Intelligent matching method and device for template and formula and computer readable storage medium
CN110647666B (en) * 2019-09-03 2023-12-19 平安科技(深圳)有限公司 Intelligent matching method and device for templates and formulas and computer readable storage medium
CN112698885A (en) * 2021-01-04 2021-04-23 联想(北京)有限公司 Operating method and device
CN113326038A (en) * 2021-06-11 2021-08-31 北京百度网讯科技有限公司 Method, apparatus, device, storage medium and program product for providing service
CN113326038B (en) * 2021-06-11 2023-11-10 北京百度网讯科技有限公司 Method, apparatus, device, storage medium and program product for providing service

Similar Documents

Publication Publication Date Title
Virding et al. Concurrent programming in ERLANG
CN102246150B (en) Transforming user script code for debugging
US8997070B2 (en) Extension mechanism for scripting language compiler
US8745584B2 (en) Dependency injection by static code generation
CN102750144A (en) Generating tool of function module
US8914780B2 (en) Incremental generation of managed assemblies
CN108027722A (en) The dynamically renewal application in compiling and deployment
CN101866315B (en) Test method and system of software development tool
CN103399734A (en) Method for generating REST service and achieving REST and corresponding equipment
US20120331340A1 (en) Method and Arrangement for Fault Handling in a Distributed IT Environment
CN103744891A (en) Method and system for data query
CN102323772A (en) State machine with the database operation symbol is expressed
CN100517222C (en) Model conversion frame supporting separation of conversion engine and mapping rule and the method
CN104077133A (en) Configuration type menu generating method
Tassi Deriving proved equality tests in Coq-elpi: Stronger induction principles for containers in Coq
CN101196812A (en) Method for script language calling multiple output parameter interface by component software system
Khatchadourian et al. [Engineering Paper] A Tool for Optimizing Java 8 Stream Software via Automated Refactoring
CN115562629A (en) RPA flow representation method, system, device and storage medium
US9454382B2 (en) Verification of UML state machines
CN101859246A (en) System and method for converting corresponding scripts according to different browsers
CN110795091B (en) Modularized route decoupling method, storage medium, electronic equipment and system
Kolovos et al. The epsilon pattern language
KR100884435B1 (en) A Method for Decoupling Service Components from Application-Specific Business Entities
US10606569B2 (en) Declarative configuration elements
CN113515303B (en) Project transformation method, device and equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20121024