WO2008113291A1 - Procédé et système pour appeler des fonctions - Google Patents

Procédé et système pour appeler des fonctions Download PDF

Info

Publication number
WO2008113291A1
WO2008113291A1 PCT/CN2008/070491 CN2008070491W WO2008113291A1 WO 2008113291 A1 WO2008113291 A1 WO 2008113291A1 CN 2008070491 W CN2008070491 W CN 2008070491W WO 2008113291 A1 WO2008113291 A1 WO 2008113291A1
Authority
WO
WIPO (PCT)
Prior art keywords
function
call
dynamic library
resource pool
new
Prior art date
Application number
PCT/CN2008/070491
Other languages
English (en)
Chinese (zh)
Inventor
Yu Zhang
Jianbin Li
Zhixian Xu
Original Assignee
Huawei Technologies Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co., Ltd. filed Critical Huawei Technologies Co., Ltd.
Publication of WO2008113291A1 publication Critical patent/WO2008113291A1/fr

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Definitions

  • the invention relates to a method and system for calling a function, which is submitted to the Chinese Patent Office on March 20, 2007, and the application number is 200710086918.2, and the invention is entitled "a method and system for calling a function," the priority of the Chinese patent application. The entire contents thereof are incorporated herein by reference.
  • the present invention relates to the field of information technology, and in particular, to a method and system for calling a function in software development. Background technique
  • libraries files that contain object code for many functions and variables are called "libraries", and libraries are currently divided into static libraries and dynamic libraries.
  • Static library The structure is relatively simple. It is to put all the target code together. When linking, the linker finds the corresponding symbol (function and variable name) according to the symbol table of each target code. If it finds it, it will be inside the function. The symbol that needs to be positioned is positioned, and then the entire block of function code is placed in the executable file, and if it is not found, the error is exited.
  • Dynamic library Its introduction is generated to solve the problem of static library. There are two ways to load it:
  • Programs that use this method do not complete dynamic linking in the first place, but the master program calculates the logical address of the dynamic code until the dynamic library code is actually called.
  • Step 101 Load the main control program.
  • Step 102 Obtain a handle A of the libtest.so dynamic library by using the dlopen() function.
  • Step 103 According to the handle A and the name of the test ( ) function to be called, use the dlsym ( ) function to obtain the handle 8 corresponding to the test ( ) function.
  • Step 104 Execute the test ( ) function according to the handle B. After the execution, call the dlclose ( ) function to close the handle.
  • Embodiments of the present invention provide a method and system for calling a function, so that the user can be The need to control whether to call dynamic library functions and improve runtime performance.
  • a configuration unit configured to configure a function call plan according to a user's needs and save
  • a first loading unit configured to load a function in the function dynamic library into a function resource pool;
  • a function resource pool configured to save a function loaded by the first loading unit;
  • a main control unit configured to invoke the function call plan, and call a function from the function resource pool according to the call plan and execute.
  • An embodiment of the present invention further provides an apparatus for calling a function, including:
  • a first loading unit configured to load a function in the function dynamic library into a function resource pool;
  • a function resource pool configured to save a function loaded by the first loading unit;
  • a main control unit configured to invoke the function call plan, and call a function from the function resource pool according to the call plan and execute.
  • the calling plan since the calling plan is configured by the user, it is possible to control whether to call the dynamic library function according to the user's needs, and how to call and the like, and, since the function is started, the function is in the dynamic library.
  • the functions are loaded into the function resource pool, which avoids the performance overhead of dynamically opening the function dynamic library when the function is called during runtime, thus improving the performance of the runtime.
  • FIG. 1 is a schematic flowchart of a method for calling a function of a dynamic binding of an existing application
  • FIG. 2 is a flow chart showing a calling function according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a configuration function call plan according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart of a secondary function opening function according to an embodiment of the present invention
  • FIG. 5 is a system structure of a call function according to an embodiment of the present invention; schematic diagram. detailed description The invention will be further described in detail below with reference to the drawings and specific embodiments.
  • FIG. 2 is a schematic flowchart diagram of a call function according to an embodiment of the present invention, which specifically includes: Step 201: The function is called by the configuration interface configuration plan and saved. The configuration in this step is performed by the user, so that the calling condition can be set according to the user's needs to control whether to call the dynamic library function, which functions to call, and so on.
  • Step 202 Load the function in the function dynamic library into the function resource pool when the system starts.
  • the function loaded in the function resource pool may exist in the form of a function handle or may exist in other forms, and the existing form is not limited herein.
  • Step 203 Load the main control unit, that is, the main control program, and obtain, by the main control unit, the function call plan configured by the user.
  • Step 204 Call the corresponding function from the function resource pool according to the function call plan and execute.
  • the specific process of the above configuration function call plan can be seen in Figure 3, including:
  • Step 301 configuring a rule expression for indicating when the function dynamic library needs to be called; using the rule expression as a configured function call plan;
  • Step 302 Compile the above expression by using a rule engine
  • Step 303 Generate a compiled string that the rule engine can recognize, and save the compiled string in a database.
  • the database of the saved compiled string and the function dynamic library of the above saved function can be physically an entity, and can logically be two databases.
  • the process of obtaining the function call plan in the above step 203 includes: obtaining a rule engine from the database, compiling the string and executing, and obtaining a function call plan according to the compiled string.
  • the calling plan is configured by the user, it is possible to control whether to call the dynamic library function according to the user's needs, and how to call, etc., and, since the function is loaded into the function resource pool at startup, the functions in the function dynamic library are loaded. , to avoid the performance overhead of dynamically opening the function dynamic library when the function is called during runtime to obtain the function handle, thus improving the performance of the runtime.
  • the embodiment of the present invention further provides a secondary development method of the function, that is, after the system is released, if the user proposes a new functional requirement, the function function may be performed twice through the software development kit (SD).
  • SD software development kit
  • FIG. 4 it is a schematic diagram of a secondary development process of an implementation function according to an embodiment of the present invention. Specifically, in step 401, a new function function is developed according to requirements, and in actual application, the SDK package provided by the developer can be used for development.
  • Step 402 Register basic information of the new function function into the function dynamic library.
  • the basic information of the new function function includes: a function name, a dynamic library name, a dynamic library path, a parameter number of the function, and a parameter type.
  • Step 403 Configure an invocation plan of the new function function in the function call plan. Since the function call plan is configured by the user, it is possible to call a function, how to call it, etc. according to the user's needs. The specific configuration process can be seen in Figure 3, and the description will not be repeated.
  • Step 404 Load the main control unit, that is, the main control program, to obtain the function call plan.
  • Step 405 Call the corresponding function from the function resource pool according to the calling plan and execute.
  • the call to the newly developed function is implemented. Moreover, the call does not require modification of the master unit, ie the master program.
  • the embodiment of the invention also discloses a system for calling a function, comprising:
  • a function dynamic library 510 configured to store a function to be called
  • the configuration unit 550 is configured to configure a function call plan and save; the specific configuration process can be seen in Figure 3 above;
  • a first loading unit 520 configured to load a function in the function dynamic library into the function resource pool at startup;
  • the function resource pool 530 is configured to save the loaded function; the loaded function saved in the function resource pool may exist in the form of a function handle, or may exist in other forms, and the existing form is not limited herein;
  • the main control unit 540 is configured to invoke the function call plan, and call a function from the function resource pool according to the call plan and execute.
  • the system may further include: a development unit 560, configured to configure a new function function, register basic information of the new function function into the function dynamic library, and the new function function is developed according to user requirements.
  • the basic information of the new function function includes: a function name, a dynamic library name, a dynamic library path, a parameter number of the function, and a parameter type.
  • the above system may further include a second loading unit (not shown) for loading the main control unit, that is, the main control program, after the system is started, and then the main control unit performs subsequent processing.
  • a second loading unit (not shown) for loading the main control unit, that is, the main control program, after the system is started, and then the main control unit performs subsequent processing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

L'invention concerne un procédé pour appeler des fonctions, lequel procédé comprend les opérations consistant à : charger les fonctions dans une bibliothèque dynamique de fonctions dans un groupe de ressource de fonctions ; charger une unité de commande maître pour obtenir un programme d'appel de fonction et pour appeler la fonction à partir du groupe de ressource de fonctions et l'exécuter selon le programme d'appel. Un système pour appeler des fonctions comprend : une bibliothèque dynamique de fonctions, une unité de configuration, une unité de commande maître, une unité de chargement et un groupe de ressource de fonctions. Un appareil pour appeler des fonctions comprend : une première unité de chargement, un groupe de ressource de fonctions et une unité de commande maître.
PCT/CN2008/070491 2007-03-20 2008-03-13 Procédé et système pour appeler des fonctions WO2008113291A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200710086918.2 2007-03-20
CNB2007100869182A CN100530108C (zh) 2007-03-20 2007-03-20 一种调用函数的方法及系统

Publications (1)

Publication Number Publication Date
WO2008113291A1 true WO2008113291A1 (fr) 2008-09-25

Family

ID=39765397

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2008/070491 WO2008113291A1 (fr) 2007-03-20 2008-03-13 Procédé et système pour appeler des fonctions

Country Status (2)

Country Link
CN (1) CN100530108C (fr)
WO (1) WO2008113291A1 (fr)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111459489A (zh) * 2020-02-27 2020-07-28 湖南大学 一种动态库自动服务化封装方法、系统及应用
CN114296718A (zh) * 2021-12-28 2022-04-08 珠海豹趣科技有限公司 一种Windows系统组件的设置方法及装置

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101441566B (zh) * 2008-11-18 2012-04-25 腾讯科技(深圳)有限公司 一种在嵌入式平台上动态链接程序的方法
CN101714075B (zh) * 2009-12-17 2012-12-19 深圳市万兴软件有限公司 函数调用方法和装置
CN101706737B (zh) * 2009-12-18 2012-10-03 湖南大学 软硬件协同函数库的构造方法
CN103927191B (zh) * 2013-01-11 2017-05-24 北京阿里巴巴云计算技术有限公司 函数调用的资源配置方法和装置
CN105677550A (zh) * 2015-12-29 2016-06-15 广州华多网络科技有限公司 一种基于Linux系统的性能采集分析的方法、装置及系统
CN107357553A (zh) * 2017-07-11 2017-11-17 郑州云海信息技术有限公司 一种数据采集管理方法及装置
CN110362356B (zh) * 2018-04-09 2022-06-24 腾讯科技(深圳)有限公司 函数数据处理方法、装置、计算机设备和存储介质
CN109739576B (zh) * 2018-12-29 2022-03-25 杭州迪普科技股份有限公司 配置概览命令执行方法、装置、计算机设备及其存储介质
CN113176912A (zh) * 2021-05-24 2021-07-27 中国工商银行股份有限公司 前端运行时函数异步加载方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040226031A1 (en) * 1999-01-15 2004-11-11 Zimmerman Daniel R. Method of dynamically appending a library to an actively running program
JP2006113935A (ja) * 2004-10-18 2006-04-27 Hitachi Ltd ダイナミックリンクライブラリ呼び出しコード生成方法、プログラム、および、装置
US20070169068A1 (en) * 2005-12-15 2007-07-19 Kabushiki Kaisha Toshiba Function calling method for computer system, computer system, and library

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040226031A1 (en) * 1999-01-15 2004-11-11 Zimmerman Daniel R. Method of dynamically appending a library to an actively running program
JP2006113935A (ja) * 2004-10-18 2006-04-27 Hitachi Ltd ダイナミックリンクライブラリ呼び出しコード生成方法、プログラム、および、装置
US20070169068A1 (en) * 2005-12-15 2007-07-19 Kabushiki Kaisha Toshiba Function calling method for computer system, computer system, and library

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111459489A (zh) * 2020-02-27 2020-07-28 湖南大学 一种动态库自动服务化封装方法、系统及应用
CN111459489B (zh) * 2020-02-27 2023-09-26 湖南大学 一种动态库自动服务化封装方法、系统及应用
CN114296718A (zh) * 2021-12-28 2022-04-08 珠海豹趣科技有限公司 一种Windows系统组件的设置方法及装置

Also Published As

Publication number Publication date
CN100530108C (zh) 2009-08-19
CN101271402A (zh) 2008-09-24

Similar Documents

Publication Publication Date Title
WO2008113291A1 (fr) Procédé et système pour appeler des fonctions
US11853774B2 (en) Dynamically loaded plugin architecture
RU2443012C2 (ru) Конфигурация изолированных расширений и драйверов устройств
US20190129733A1 (en) Android dynamic framework and a method thereof
US6834391B2 (en) Method and apparatus for automated native code isolation
GB2439443A (en) Handling exceptions during translation including binding to native code
Gregersen et al. Dynamic update of Java applications—balancing change flexibility vs programming transparency
JP2016509714A (ja) ハードウェア・デバイス用ソフトウェア・インターフェース
US7987457B2 (en) Targeted patching for native generation images
EP2941694A1 (fr) Structure de pilotes de dispositif basée sur la capacité
KR101083271B1 (ko) 액티브엑스 컨트롤 변환 시스템 및 방법
Jezek et al. Magic with Dynamo--Flexible Cross-Component Linking for Java with Invokedynamic
Bertin et al. Compilation and virtualization in the HiPEAC vision
Lupu et al. Nephele: Extending Virtualization Environments for Cloning Unikernel-Based VMs
RU2521265C2 (ru) Система и способ автоматической обработки системных ошибок программного обеспечения
RU2718235C1 (ru) Архитектура операционной системы для обеспечения поддержки поколений микроядер
Harris An extensible virtual machine architecture
US20230074580A1 (en) Runtime-tailored security policies for applications
Wawersich et al. The use of java in the context of autosar 4.0
CN118132170A (zh) 异构处理器动态适配方法、装置以及系统
Ogel et al. Towards active applications: the virtual virtual machine approach
Rommel Multiverse: Compiler Assisted Dynamic Variability Management in the Linux kernel
Larus et al. Using the singularity research development kit
Sputh et al. Safe Virtual Machine for C in less than 3 KiBytes
Österberg et al. Rethinking software updating: Concepts for improved updatability

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 08715227

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 08715227

Country of ref document: EP

Kind code of ref document: A1