CN105204855B - A kind of dispatching method and device - Google Patents
A kind of dispatching method and device Download PDFInfo
- Publication number
- CN105204855B CN105204855B CN201510587648.8A CN201510587648A CN105204855B CN 105204855 B CN105204855 B CN 105204855B CN 201510587648 A CN201510587648 A CN 201510587648A CN 105204855 B CN105204855 B CN 105204855B
- Authority
- CN
- China
- Prior art keywords
- function
- module
- mark information
- functional module
- mark
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000008569 process Effects 0.000 abstract description 19
- 238000011161 development Methods 0.000 abstract description 13
- 238000012360 testing method Methods 0.000 abstract description 6
- 230000000694 effects Effects 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 101
- 238000010586 diagram Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Abstract
A kind of dispatching method, which comprises application program is divided into different functional modules, distributes unique mark information to each functional module;The mark information is added to function corresponding with the functional module, the function is called from function library.Technical solution of the present invention, it can achieve functional module and the mutual corresponding technical effect of called function, simplify the handover process in development process between the developer of disparate modules, shorten the development cycle, reduce the debugging and difficulty of test in software later period, the stability of program is increased, there is very high practicability.
Description
Technical field
The present invention relates to computer program technique of compiling field, especially a kind of dispatching method and device.
Background technique
With the continuous renewal and rapid development of software field, the demand across language trans-platform programming is also more and more, because
This promotes the birth of many new technologies, and JNA is one of them.JNA (Java Native Access) frame is one and opens
The java frame in source is established on the basis JNI (Java Native Interface), provides java code and other languages
Say the interaction and calling between (especially C/C++).Its implementation is that developer describes target using java interface first
The structure and function of dynamic base, then the shared library with application program of dynamic link are bound at runtime, pass through dynamic link
Dynamic base is mapped into the executable memory of application program by device, and finally when running application program, dynamic loading device will be required
Target dynamic library be mapped in the memory of application program.
Fig. 3 is a kind of embodiment schematic diagram of the prior art;
When without using the present invention shown in system when, JNA call C language process as shown in figure 3,
Step S301: JAVA interface is write;
Step S302: it is compiled as intermediate code;
Step S303: link dynamic library file;
Step S304: operation program.
Developer uses the function and structure of java language description local shared library first, then according to symbol in compilation process
Info Link dynamic base in number table, last executing application.
But when local shared library is write by C language and when the multiple dynamic bases of program chains, if in these dynamics
There are functions of the same name in library, then symbol table can be written in the information of function by the dynamic base loaded first when the program is run
In, since C language does not have the function of function overloading, the function of the same name of this in the dynamic base next run, which can be directed toward in symbol table, to be remembered
Function in the position of record, that is, the dynamic base of first loading causes program to collapse so as to cause program error when serious
It bursts.
Summary of the invention
To solve the above-mentioned problems, the present invention provides
A kind of dispatching method, which comprises
It will be divided into different functional modules in application program, distributes unique mark information to each functional module;
The mark information is added to function corresponding with the functional module;
The function is called from function library.
Optionally, the function is called to include: from function library
Function corresponding with the functional module is called according to the mark information.
Optionally, function corresponding with the functional module is called according to the mark information, comprising:
The function name of the function and mark information progress is right, function call is carried out if completely the same,
Otherwise error message is issued.
A kind of dispatching device, comprising: described device includes:
Mark module is distributed, for different functional modules will to be divided into application program, to each functional module point
With unique mark information;
Mark module is added, for the mark information to be added to function corresponding with the functional module;
Function call module, for calling the function from function library.
Optionally, wherein function call module, for calling the function from function library, comprising:
Function corresponding with the functional module is called according to the mark information.
Optionally, the function call module is used to call letter corresponding with the functional module according to the mark information
Number, comprising: the function name of the function and mark information progress is right, function call is carried out if completely the same,
Otherwise error message is issued.
Technical solution of the present invention can achieve functional module and the mutual corresponding technical effect of called function, letter
Change the handover process in development process between the developer of disparate modules, shortened the development cycle, reduces the software later period
Debugging and difficulty of test, increase the stability of program, have very high practicability.
Detailed description of the invention
Fig. 1 is a kind of flow chart of dispatching method of the invention;
Fig. 2 is a kind of structure chart of dispatching device of the invention;
Fig. 3 is a kind of embodiment schematic diagram of the prior art;
Fig. 4 is one embodiment of the present invention schematic diagram.
Specific embodiment
Technical solution of the present invention is described in detail below in conjunction with accompanying drawings and embodiments.
It should be noted that each feature in the embodiment of the present invention and embodiment can be tied mutually if do not conflicted
It closes, it is within the scope of the present invention.In addition, though logical order is shown in flow charts, but in certain situations
Under, it can be with the steps shown or described are performed in an order that is different from the one herein.
A kind of dispatching method, which comprises
It will be divided into different functional modules in application program, distributes unique mark information to each functional module;
The mark information is added to function corresponding with the functional module;
The function is called from function library.
Fig. 1 is a kind of flow chart of dispatching method of the invention;
Step S01: will be divided into different functional modules in application program, give the distribution of each functional module unique mark
Remember information;
Step S02: the mark information is added to function corresponding with the functional module.
Step S03: the function is called from function library.
Technical solution of the present invention can achieve functional module and the mutual corresponding technical effect of called function, letter
Change the handover process in development process between the developer of disparate modules, shortened the development cycle, reduces the software later period
Debugging and difficulty of test, increase the stability of program, have very high practicability.
Optionally, the function is called from function library, comprising:
Function corresponding with the functional module is called according to the mark information.
Optionally, function corresponding with the functional module is called according to the mark information, comprising:
The function name of the function and mark information progress is right, function call is carried out if completely the same,
Otherwise error message is issued.
Fig. 2 is a kind of structure chart of dispatching device of the invention;
A kind of dispatching device, comprising: described device includes:
Mark module 201 is distributed, for different functional modules will to be divided into application program, gives each functional module
Distribute unique mark information;
Mark module 202 is added, for the mark information to be added to function corresponding with the functional module.
Function call module 203, for calling the function from function library.
Optionally, wherein function call module, for calling the function from function library, comprising:
Function corresponding with the functional module is called according to the mark information.
Optionally, the function call module 203 is used to be called according to the mark information corresponding with the functional module
Function, comprising: it is right to carry out the function name of the function and the mark information, and function tune is carried out if completely the same
With otherwise issuing error message.
The present invention safeguards a third party system between application program and dynamic base, which includes distribution label, adds
It labels and three modules of function call forms.It distributes mark module and the module in application program is pressed into function division, and
The different label of each module is distributed to distinguish, which can be module title or module serial number, but necessary
It uniquely determines and expansible;The function of addition mark module is that label letter is added to each of dynamic base function
Breath, wherein label is the label distributed in the first step, dynamic base corresponds to the function mould distributed in the first step
Block can thus be mapped functional module with the function in dynamic base, effectively distinguish the letter of the same name in Different Dynamic library
Number;Function call module acts on the process that each in program operation process calls dynamic base, and user program calls shared library
In function before, the right of function name and mark information is carried out by this module, function call is carried out if completely the same,
Otherwise error message is issued.
The beneficial effects of the present invention are: the characteristic of distribution mark module 201, is mainly by the function division of application program
Different modules, and the unique mark information of each module assignment is given, wherein module division can be application development mistake
The module that different developers are responsible in journey can thus shield the constraint that different developers name function, shorten software development
Process, reduces development difficulty, while for the test in software later period and integrated offering convenience;The characteristic of mark module 202 is added, it is main
If mark information obtained in previous step is added in the function of dynamic base, for function mould different under application program
Block, each can be added the mark information of this module by the dynamic base that the module is called, and be used to distinguish with other modules, this
Of the same name function of the sample in disparate modules just has different mark informations, to be directed toward correctly when function call
Location increases the stability of program;The characteristic of function call module 203 is mainly to ensure that in program operation process to disparate modules
The correctness of function call of the same name is jumped to correct by the comparison to the mark information of function in functional module and dynamic base
Called function address, guarantee the correct operation of program.Above-mentioned advantage possessed by this dispatching method, using to difference
The method of function of the same name addition label in module, simplifies the handover stream in development process between the developer of disparate modules
Journey shortens the development cycle, reduces the debugging and difficulty of test in software later period, increases the stability of program, has very high
Practicability.
Fig. 4 is one embodiment of the present invention schematic diagram;
Step S401: JAVA interface is write;
Step S402: distribution label;
Step S403: addition label;
Step S404: it is compiled as intermediate code;
Step S405: identification mark;
Step S406: link dynamic library file;
Step S407: operation program.
With reference to the accompanying drawings, to the contents of the present invention by taking JNA frame calls the process of C language dynamic base as an example, using adding
The mode of marking information describes the realization process of this method.
As described in summary of the invention, the present invention in dynamic scheduling system specifically include that distribution mark module (1),
Add mark module (2), function call module (3).
The structure of dynamic scheduling system includes: distribution mark module 201, addition mark module 202 and function under JNA frame
Calling module 203, wherein distribution mark module 201 and addition mark module 202 make functional module and function by mark information
It corresponds to each other, then function call module 203 prevents function tune of the same name according to the corresponding function of mark information dynamic call
The phenomenon that with error.
When using this system, calling process is as shown in figure 4, developer writes java code first, and realizes corresponding dynamic
The JNA interface code in library, then partition functionality module, distributes mark information, and system is corresponding by mark information write-in functions module
Function information in, finally in program compilation process, when system links local shared library by dynamic linker, function
Calling module can confirm that program can be linked to correct function according to the mark information of function, guarantee the correct operation of program.
1, it is mainly characterized by the method by adding mark information to function in dynamic base, avoids Different Dynamic library
In function call of the same name error the problem of.
2, patent improvement is under JNA frame that dynamic base dispatching method design structure includes: distribution mark module 201, adds
Marking module 202 and function call module 203 wherein distributing mark module 201 according to program function division module, and are distributed
Effective mark information;It adds mark module 202 and adds corresponding mark information to the function that each module is called, make of the same name
Function can correspond to below disparate modules;Function call module 203 passes through the label to function in functional module and dynamic base
The comparison of information guarantees the correct operation of program to call correct function.
3, dynamic base dispatching method under a kind of JNA frame is protected.
Value is to simplify different in development process using the method to the function of the same name addition label in disparate modules
Handover process between the developer of module, shortens the development cycle, reduces the debugging and difficulty of test in software later period, increases
The stability of program has very high practicability.
Those of ordinary skill in the art will appreciate that all or part of the steps in the above method can be instructed by program
Related hardware is completed, and described program can store in computer readable storage medium, such as read-only memory, disk or CD
Deng.Optionally, one or more integrated circuits can be used also to realize in all or part of the steps of above-described embodiment.Accordingly
Ground, each module/unit in above-described embodiment can take the form of hardware realization, can also use the shape of software function module
Formula is realized.The present invention is not limited to the combinations of the hardware and software of any particular form.
Certainly, the invention may also have other embodiments, without deviating from the spirit and substance of the present invention, ripe
It knows those skilled in the art and makes various corresponding changes and modifications, but these corresponding changes and change in accordance with the present invention
Shape all should belong to scope of protection of the claims of the invention.
Claims (2)
1. a kind of dispatching method, which is characterized in that the described method includes:
Application program is divided into different functional modules, distributes unique mark information to each functional module;
The mark information is added to function corresponding with the functional module, wherein the function is that functional module will be adjusted
With the function in dynamic base;
The function is called from function library, wherein described that the function is called from function library, comprising:
Function corresponding with the functional module is called according to the mark information;
Wherein, described that function corresponding with the functional module is called according to the mark information, comprising: by the function name of function
It is right with mark information progress, function call is carried out if completely the same, otherwise issues error message.
2. a kind of dispatching device characterized by comprising described device includes:
Mark module is distributed, it is unique to the distribution of each functional module for application program to be divided into different functional modules
Mark information;
Mark module is added, for the mark information to be added to function corresponding with the functional module;
Function call module, for calling the function from function library;
Wherein, function call module, for calling the function from function library, comprising:
Function corresponding with the functional module is called according to the mark information;
The function call module is used to call function corresponding with the functional module according to the mark information, comprising: will
The function name of the function and mark information progress are right, and function call is carried out if completely the same, otherwise issue wrong
False information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510587648.8A CN105204855B (en) | 2015-09-15 | 2015-09-15 | A kind of dispatching method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510587648.8A CN105204855B (en) | 2015-09-15 | 2015-09-15 | A kind of dispatching method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105204855A CN105204855A (en) | 2015-12-30 |
CN105204855B true CN105204855B (en) | 2019-05-28 |
Family
ID=54952561
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510587648.8A Active CN105204855B (en) | 2015-09-15 | 2015-09-15 | A kind of dispatching method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105204855B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1322316A (en) * | 1998-10-09 | 2001-11-14 | 因芬尼昂技术股份公司 | Method for preventing stack manipulations in case of function calls |
CN103853532A (en) * | 2012-11-29 | 2014-06-11 | 国际商业机器公司 | Method and device for calling function |
CN104899045A (en) * | 2015-06-23 | 2015-09-09 | 上海斐讯数据通信技术有限公司 | Universal software coding assistance system and method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8726258B2 (en) * | 2011-04-14 | 2014-05-13 | Phoenix Technologies Ltd. | Supporting multiple hardware components in UEFI |
-
2015
- 2015-09-15 CN CN201510587648.8A patent/CN105204855B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1322316A (en) * | 1998-10-09 | 2001-11-14 | 因芬尼昂技术股份公司 | Method for preventing stack manipulations in case of function calls |
CN103853532A (en) * | 2012-11-29 | 2014-06-11 | 国际商业机器公司 | Method and device for calling function |
CN104899045A (en) * | 2015-06-23 | 2015-09-09 | 上海斐讯数据通信技术有限公司 | Universal software coding assistance system and method |
Non-Patent Citations (1)
Title |
---|
名字空间定义;Stanley B.Lippman 等;《C++Primer中文版》;20020531;第349-352页 |
Also Published As
Publication number | Publication date |
---|---|
CN105204855A (en) | 2015-12-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107291480B (en) | Function calling method and device | |
CN105487864B (en) | The method and apparatus of Code automatic build | |
CN108182068B (en) | The generation method and device, storage medium of part are delivered in deployment based on micro services | |
US9122794B2 (en) | System and method for debugging domain specific languages | |
US8756590B2 (en) | Binding data parallel device source code | |
CN101681294B (en) | Method and system for memory transaction grouping | |
US7107579B2 (en) | Preserving program context when adding probe routine calls for program instrumentation | |
CN106569794A (en) | Application developing device | |
CN107967316A (en) | A kind of method of data synchronization, equipment and computer-readable recording medium | |
CN110275722A (en) | Method, apparatus, equipment and storage medium for upgrade application | |
EP3504617B1 (en) | Hybrid deoptimization mechanism for class hierarchy analysis | |
US10504492B2 (en) | Apparatus and methods for generating dynamic trace data on a GPU | |
US9990194B2 (en) | Preservation of backward compatibility for java card cap files | |
CN110515641A (en) | The update method of server firmware, apparatus and system | |
US9507680B2 (en) | Verification system and method for automated verification of register information for an electronic system | |
CN107273311B (en) | Computing device, method for computing and apparatus for computing | |
CN112630622A (en) | Method and system for pattern compiling and downloading test of ATE (automatic test equipment) | |
CN111142935A (en) | Method, apparatus, computer system, and medium for cross-platform running of applications | |
CN104699523A (en) | Debugging method and system used for application programs developed by hardware platform | |
CN108733589A (en) | The implementation method and device of distributed transaction heat deployment | |
US9606802B2 (en) | Processor system with predicate register, computer system, method for managing predicates and computer program product | |
CN105204855B (en) | A kind of dispatching method and device | |
CN115658140A (en) | SDK packaging method, device, terminal and storage medium | |
KR101556831B1 (en) | Input method of permission for application development and recording medium storing program for executing method of developing android application | |
Shrestha et al. | JVMCSP-Approaching Billions of Processes on a Single-Core JVM |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |