Nothing Special   »   [go: up one dir, main page]

CN100487649C - Call method between chip - Google Patents

Call method between chip Download PDF

Info

Publication number
CN100487649C
CN100487649C CN 200510115496 CN200510115496A CN100487649C CN 100487649 C CN100487649 C CN 100487649C CN 200510115496 CN200510115496 CN 200510115496 CN 200510115496 A CN200510115496 A CN 200510115496A CN 100487649 C CN100487649 C CN 100487649C
Authority
CN
China
Prior art keywords
assembly
component
interface
call
function
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
Application number
CN 200510115496
Other languages
Chinese (zh)
Other versions
CN1834918A (en
Inventor
孙华庆
周焱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Office Software Inc
Original Assignee
Beijing Kingsoft Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Software Co Ltd filed Critical Beijing Kingsoft Software Co Ltd
Priority to CN 200510115496 priority Critical patent/CN100487649C/en
Publication of CN1834918A publication Critical patent/CN1834918A/en
Application granted granted Critical
Publication of CN100487649C publication Critical patent/CN100487649C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention relates to an inter-component calling method, comprising: 1) establishing a fixed identification and a component establishing function for each component to establish a component interface; 2) a program is loaded into a preset shared memory and triggers to store the component identifications and the component establishing function into the shared memory; 3) a client component requests to call an object component, and the system finds identification of the object component to call the function to establish a component and returns an object component interface, and the client component implements function call according to the object component interface. The inter-component call does not depend on a specified operating system, thus making the method able to be implemented between operating platforms. And the inter-component call is relatively simple, raising software development efficiency.

Description

A kind of call method between chip
Technical field
The present invention relates to a kind of program excutive method, especially a kind of call method of program process kind inter-module.
Background technology
Application program: executable file (Executable program) is meant in order to finish a certain or a few particular tasks and be developed the computer program that runs on the operating system.Certain form of its match operation system appointment, and be stored with binary form, operating system is responsible for loading and the operation to program.
Early stage program design does not have concept of component, and all functions all concentrate in the executable file.Now, application program is that standard is divided into a plurality of relatively independent assemblies and writes usually with the function.Each assembly is relatively independent, and inter-module is realized mutual calling by interface.When a functional requirement changes,, the code of other assembly is remained unchanged keeping revising the functional module that changes under the constant prerequisite of interface.After each assembly was write and finished, application program can be linked to assembly, the interface of invocation component dynamically when needing the function of assembly.Thereby reduce the size and the start-up time of application program; Simultaneously, this assembly also can be used by a plurality of application programs simultaneously.
In order to reduce the complicacy of software development, improve the reusability of assembly, existing operating system all provides the structure standard of assembly, and we claim that the assembly based on this standard is dynamic link library (DLL, Dynamic Link Library) under Windows; Under Linux, be called shared object file (So:Shared ObjectFile) etc.
With the dynamic link library under the windows operating system is example: after assembly C writes and finishes, can be compiled into a DLL.When operation, have only when the EXE program will be called these DLL assemblies, system just can be loaded into them in the memory headroom.This mode has not only reduced the size of EXE file and to the demand of memory headroom, and these DLL assemblies can be used by a plurality of application programs simultaneously.Simultaneously, in order to form a kind of unified assembly exploitation at windows platform and to call standard, realize the communication of inter-module and calling of inter-module, Microsoft proposes The Component Object Model (COM, Component Object Model) method, but since its call-by mechanism make between assembly and assembly, client and the assembly call realization before need to write a large amount of codes, realize complexity; And, because com component must register in registration table with securing component ID, when calling by searching the registration table charging assembly, yet, have only windows platform to have registration table, thereby the assembly of developing based on COM can not carry out the transplanting of cross operating system.
Summary of the invention
The purpose of this invention is to provide the method that a kind of inter-module calls, this method can not rely on registration table, and realizes simple.
For solving the problems of the technologies described above, the objective of the invention is to be achieved through the following technical solutions: 1) set up the sign of determining and be used to create the function of assembly, and set up component interface for each assembly; 2) program is loaded into the shared drive that presets, and triggering is saved in shared drive with component identification and described function; 3) client component request call target element, the system searching target element identifies to call described function creation assembly, returns the target element interface, and client component is realized funcall according to described interface.
On the said method basis, 1) also comprises in and a plurality of described assemblies are compiled the constituent components collection.
In the said method, 3) behind the described function of system call, return the interface pointer of assembly in, client component obtains the interface of target element according to the interface pointer in the shared drive.2) after program was loaded into internal memory in, the component address that presets in the configuration file of system according to master routine read the assembly of determining under the catalogue, and component interface is added specific shared drive; System preserves the operation of component identification and described function according to the code that presets in the assembly structure function.
Above technical scheme as can be seen, information with assembly when program is loaded into internal memory among the present invention is saved in the internal memory, make realization of the present invention not need to rely on the special setting of operating system, do not rely on distinctive registration table in the Windows system when for example adopting method of the present invention to realize calling of inter-module, therefore calling of inter-module of the present invention do not rely on specific operating system, makes that method of the present invention is can stride operating platform to realize.And, find when in the practical programs exploitation, adopting method of the present invention that realize that with existing dependence particular system the method for component call is compared, calling of inter-module of the present invention is simple relatively, do not need a large amount of coding works, thereby improved the development efficiency of software.
The shared drive that the present invention has utilized system to provide by administering and maintaining specific module information structure in shared drive, thereby makes each assembly visit mutually in described shared drive, makes calling of inter-module convenient simple.
Further, can be compiled into an assembly to a plurality of assemblies among the present invention, facts have proved, among the present invention a plurality of assemblies are compiled into an assembly, in the process of reading assembly, reduce input-output operation, improve assembly and loaded and carry out efficient disk.And, find in the practice, owing to each assembly all can be registered in the internal memory automatically, thereby, under this method, a plurality of assemblies are compiled as an assembly, the dirigibility of debugging and issue is provided to software development.
Description of drawings
Fig. 1 is a preferred embodiment process flow diagram of the present invention;
Fig. 2 is a component call process synoptic diagram of the present invention.
Embodiment
The present invention relates to the method that a kind of inter-module calls.Its core is: after executable program is loaded into internal memory, automatically all component information under the assigned catalogue (function pointer of assembly ID and this assembly of establishment) is loaded in the shared drive of executable program establishment, when calling some assemblies, the information of preserving according to assembly in the internal memory, create component object, thereby realize that assembly function calls.
A below explanation preferred embodiment of the present invention, the principle of this embodiment is: when a process begins, carry out body DLL or EXE and be loaded into internal memory, the principle of utilizing the constructed fuction of the global object of C++ programming language to carry out prior to C Runtime Library (C-Runtime Library), message block in the constructed fuction of certain global object in the handle component (assembly ID, the establishment body of assembly) is stored on the internal memory of process in the operating system, makes any assembly of process and CLIENT PROGRAM can both get access to these message block and create component object according to the establishment body in the message block.When calling an assembly, search the function of in internal memory, preserving that is used to create assembly by assembly ID, again by this function calls is created assembly.After assembly was created, interface that can invocation component was realized specific assembly function.
With reference to Fig. 1, the implementation method of preferred embodiment of the present invention is as follows.
Step 11:, and set up component interface for each assembly is given definite sign ID and is used to create the function of this assembly; Set up shared drive.
Described assembly also is called module, and its feature comprises: be encapsulation property, assembly must be hidden the realization details of its inside to the outside, makes the just interface that can see from outside; Assembly must dynamically be linked to together, needn't recompilate in the time of invoked.Give a unique sign for each assembly among the present invention and be used to create the function of this assembly.Compare with the COM method of prior art mentioned above, the present invention presets unique sign for each assembly, and is not as com component, and its ID is by obtaining after the registration in registration table.
Because assembly hidden its inner details to the outside, so the client just must promptly realize client and communication between components by certain method by certain mechanism will use assembly the time, and this just needs interface.So-called interface is exactly assembly " tie point " external, that service is provided to the external client.Outside client can not see the details of component internal, the just interface that it can be seen, and the client also is the service that comes securing component to provide by interface, and usually, the developer of assembly is responsible for realizing this interface, and the client then obtains service by interface.Client as herein described is meant the program or the assembly that will use some assemblies, that is to say, the client of this paper is a relative component.For each assembly provides an interface, be used for the function call of other assemblies among the present invention.
Set up a shared drive by application programming interfaces (API) application program, be used for the present invention to the management of module information and call.Described shared drive be established as techniques well known.
Step 12: each assembly is compiled, and be saved in designated directory; Also a plurality of assemblies can be compiled into an assembly collection as required, also be about to a plurality of assemblies and be compiled as a DLL or an EXE.
Concrete, each assembly is compiled, and be saved under the designated directory, the address information that identified component is preserved in the configuration file of master routine, the system that makes can arrive the correct following fetch program of catalogue when carrying out described configuration file and move required all component.
Step 13: when certain assembly is loaded into internal memory, triggers component identification and described function are saved in internal memory.
As indicated above, the principle of utilizing the constructed fuction of the global object of C++ programming language to carry out in the present embodiment prior to C Runtime Library (C-Runtime Library), message block in the constructed fuction of certain global object in the handle component (assembly ID, the establishment function of assembly) is stored on the internal memory of process in the operating system.
Each assembly all can provide an entry address, promptly apprizing system read behind this assembly the code that should carry out, described entry address refers generally to the address set to compiler.This address of C++ compiler meeting automatic setting, thus the constructed fuction of global object on this address, called.After assembly was loaded into internal memory, according to the entry address that assembly provides, system can remove to carry out constructed fuction automatically, and the present invention writes code in the constructed fuction of assembly, be used for preserving module information at shared drive.When process began, system was according to the reading assembly under the correct catalogue of the configuration file in the described master routine, so system carry out described constructed fuction with the unique identification of assembly and the function that is used for creating assembly be loaded into internal memory.
When loading the following module information of assigned catalogue, the information of an assembly of every loading will once travel through the operation of this catalogue, carry out input-output operation one time, waste system resource.Thereby, in the above-mentioned steps 12 a plurality of assemblies are compiled into an assembly (assembly collection), and then have reduced input-output operation during charging assembly, improved efficient.After a plurality of assemblies are compiled as an assembly collection, loading this assembly collection information in the process of internal memory, because, a different global object (grand use realizes by C++) is all arranged in each component code, the information of each assembly in this assembly collection is independent the preservation.
Step 14: generating assembly calls, and searches the target element sign and create assembly with call function in internal memory, returns the example of target element.By this example can invocation component each functional interface, realize funcall according to described interface.
When inter-module calls, by the module information of preserving in the shared drive, obtain the function pointer of creating assembly (target element) that be called, after assembly is created, return the component interface pointer, the client obtains the interface of target element by described component interface pointer, and then realizes the funcall of inter-module.
In the prior art, application program is loaded into internal memory after carrying out, and when application program was wanted invocation component, module information can be written in the internal memory.Supposing that application program need call 3 assemblies, is respectively d111, d112, d113, and program can be memory headroom of these three building components, for its writing information.Yet these three memory headrooms all are independently, and are irrelevant mutually, when causing three inter-modules to conduct interviews, realize loaded down with trivial details.
Adopted the mechanism of shared drive among the present invention.In the embodiment of the invention, shared drive of function creation that application program at first provides by system when the application call assembly, can be created a block space for each assembly in this piece shared drive, and each assembly can be visited mutually by component Name.Conducting interviews by component Name is a kind of naming mechanism that system provides for shared drive.
Usually, each assembly can only manage the space of oneself, and other assemblies and application program are all had no right to its management.For example: application call finishes d111, need to discharge this block space at d111 place, and application program haves no right to do this work.This defective causes in the component feature space management, and is very dumb.The present invention has set up unique sign ID for each assembly, by transfer assembly ID, can reach the purpose that inter-module carries out the memory headroom management.
With reference to Fig. 2, further specify the disposal route of component call process.
As shown in the figure, executable program EXE among the figure is made up of assembly 1, assembly 2, assembly 3, assembly 4, assembly 5.Process begins, when EXE is loaded into internal memory, assembly 1 is loaded in the shared drive of application program foundation respectively to assembly 5, the entry address that provides according to assembly, system automatically performs constructed fuction, and the information (unique ID and the function that is used for creating this assembly) of preserving each assembly is to shared drive.After module information is preserved, but the assembly releasing memory space that is loaded.Yet assembly is not the requisite operation of the present invention to the release of memory headroom.
When generating assembly calls, suppose assembly 1 invocation component 3, unique ID 3 according to assembly 3, find the function C oCreate3 () that is used to create assembly 3, after creating assembly 3, return the interface pointer of assembly 3, assembly 1 obtains this interface by the pointer of described assembly 3 interfaces, and passes through the power function of this interface interchange assembly 3.
More than a kind of call method between chip provided by the present invention is described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (5)

1, a kind of call method between chip is characterized in that:
1) sets up the sign of determining for each assembly and be used to create the function of assembly, and set up component interface;
2) program is loaded into the shared drive that presets, and triggering is saved in shared drive with component identification and described function;
3) client component request call target element, the system searching target element identifies to call described function creation assembly, returns the target element interface, and client component is realized funcall according to described interface.
2, call method between chip as claimed in claim 1 is characterized in that:
1) also comprises in and a plurality of described assemblies are compiled the constituent components collection.
3, call method between chip as claimed in claim 1 is characterized in that:
3) behind the described function of system call, return the interface pointer of assembly in, client component obtains the interface of target element according to the interface pointer in the shared drive.
4, call method between chip as claimed in claim 1 is characterized in that:
2) system preserves the operation of component identification and described function according to the code that presets in the assembly structure function in.
5, as claim 1 or 4 described call method between chip, it is characterized in that:
2) after program was loaded into internal memory in, the component address that presets in the configuration file of system according to master routine read the assembly of determining under the catalogue, and component interface is added specific shared drive.
CN 200510115496 2005-11-04 2005-11-04 Call method between chip Active CN100487649C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200510115496 CN100487649C (en) 2005-11-04 2005-11-04 Call method between chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200510115496 CN100487649C (en) 2005-11-04 2005-11-04 Call method between chip

Publications (2)

Publication Number Publication Date
CN1834918A CN1834918A (en) 2006-09-20
CN100487649C true CN100487649C (en) 2009-05-13

Family

ID=37002681

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200510115496 Active CN100487649C (en) 2005-11-04 2005-11-04 Call method between chip

Country Status (1)

Country Link
CN (1) CN100487649C (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8032472B2 (en) * 2007-04-04 2011-10-04 Tuen Solutions Limited Liability Company Intelligent agent for distributed services for mobile devices
CN101132413B (en) * 2007-09-18 2010-10-06 中兴通讯股份有限公司 ActiveX component multiplexing method based on Web application
CN101620536B (en) * 2009-08-17 2012-11-14 用友软件股份有限公司 Method and device for invoking performance function
CN102063332B (en) * 2011-01-12 2013-02-13 中国电子科技集团公司第七研究所 Logical device component of software communication system structure and operating method thereof
CN102999352B (en) * 2012-11-15 2016-08-10 中国科学院声学研究所 A kind of embedded system component loading method
CN104424002B (en) * 2013-09-10 2017-12-12 中国科学院声学研究所 A kind of dynamic load assembly method and system based on Plugin Mechanism
CN103593191A (en) * 2013-11-19 2014-02-19 乐视致新电子科技(天津)有限公司 Method and device for calling application program data
CN103809979B (en) * 2014-02-25 2017-03-29 南京南瑞继保电气有限公司 A kind of interactive software module integrated system and its implementation
CN104268019B (en) * 2014-09-23 2018-04-27 广州猎豹网络科技有限公司 A kind of software running method, device and terminal
CN105022630B (en) * 2015-06-30 2019-01-22 中标软件有限公司 A kind of assembly management system and assembly management method
CN105677393B (en) * 2015-12-30 2019-02-05 中科创达软件股份有限公司 A kind of software packet processing method, apparatus and system
CN107145372A (en) * 2017-05-09 2017-09-08 北京京东尚科信息技术有限公司 information generating method and device
CN108419089B (en) * 2018-02-08 2021-04-27 广州虎牙信息科技有限公司 Component data processing method, device, equipment and storage medium
CN111209056B (en) * 2020-01-02 2021-02-19 北京东土科技股份有限公司 Method and device for loading function, readable storage medium and electronic equipment
CN114461291A (en) * 2020-10-22 2022-05-10 北京国双科技有限公司 Application program component calling method and device, electronic equipment and storage medium
CN113568603B (en) * 2021-09-23 2022-02-15 广州中望龙腾软件股份有限公司 Component object creating and interface method calling method, terminal and storage device

Also Published As

Publication number Publication date
CN1834918A (en) 2006-09-20

Similar Documents

Publication Publication Date Title
CN100487649C (en) Call method between chip
US7131110B2 (en) Method and apparatus for generating a code bridge
US6415435B1 (en) Method and apparatus for determining compatibility of parent classes in an object oriented environment using versioning
CN101421711B (en) Virtual execution system for resource-constrained devices
CN100498699C (en) Sharing objects in runtime systems
US9183007B2 (en) Dynamic determination of application server runtime classloading
US8661410B2 (en) Managed enterprise software components as dynamic services
EP3350696B1 (en) Overriding a migrated method of an updated type
US7246346B2 (en) System and method for persisting dynamically generated code in a directly addressable and executable storage medium
US8141070B2 (en) Bridging class loader name spaces
US10394528B2 (en) Returning a runtime type loaded from an archive in a module system
KR101059633B1 (en) Heap configuration for multitasking virtual machines
CN102257474B (en) Shared value resolution with multiple runtime containers
JP2005063449A (en) Method and apparatus for object-to-object java native interface mapping
US20050071809A1 (en) System and method for serializing objects in a compiled programming language
WO2008054074A1 (en) Terminal device having function of interfacing compilation libraries in heterogeneous languages, method of calling api, and method of creating compile function
JP5401561B2 (en) Application of platform-dependent routines within a virtual mechanism by embedding native code in a class file
US11048489B2 (en) Metadata application constraints within a module system based on modular encapsulation
US20070220531A1 (en) Method and system for shimming COM objects
US7155701B1 (en) System for dynamically constructing an executable computer program
US20070005745A1 (en) Method for consistent and efficient management of program configuration and customizing data
CN114416202B (en) Mobile terminal SDK calling method and system
CN111338638A (en) System and method for realizing automatic generation of communication between embedded software components
CN100428151C (en) C/C++ module hot plug-in and pull-off method of base version in large scale concurrent on-line trade
CN113867776B (en) Method and device for issuing middle-stage application, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: BEIJING KINGSOFT OFFICE SOFTWARE CO., LTD.

Free format text: FORMER OWNER: BEIJING JINSHAN SOFTWARE CO., LTD.

Effective date: 20140312

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 100083 HAIDIAN, BEIJING TO: 100085 HAIDIAN, BEIJING

TR01 Transfer of patent right

Effective date of registration: 20140312

Address after: Kingsoft No. 33 building, 100085 Beijing city Haidian District Xiaoying Road

Patentee after: Beijing Kingsoft WPS Office Co., Ltd.

Address before: 100083 Bai Yan building, 238 middle Fourth Ring Road, Haidian District, Beijing

Patentee before: Beijing Jinshan Software Co., Ltd.

CP01 Change in the name or title of a patent holder

Address after: Kingsoft No. 33 building, 100085 Beijing city Haidian District Xiaoying Road

Patentee after: Beijing Kingsoft office software Limited by Share Ltd

Address before: Kingsoft No. 33 building, 100085 Beijing city Haidian District Xiaoying Road

Patentee before: Beijing Kingsoft WPS Office Co., Ltd.

CP01 Change in the name or title of a patent holder