[go: up one dir, main page]

CN111596970A - Dynamic library delay loading method, device, equipment and storage medium - Google Patents

Dynamic library delay loading method, device, equipment and storage medium Download PDF

Info

Publication number
CN111596970A
CN111596970A CN202010396710.6A CN202010396710A CN111596970A CN 111596970 A CN111596970 A CN 111596970A CN 202010396710 A CN202010396710 A CN 202010396710A CN 111596970 A CN111596970 A CN 111596970A
Authority
CN
China
Prior art keywords
dynamic library
application program
loading
information
class
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.)
Granted
Application number
CN202010396710.6A
Other languages
Chinese (zh)
Other versions
CN111596970B (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.)
Bigo Technology Pte Ltd
Original Assignee
Guangzhou Baiguoyuan Information Technology 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 Guangzhou Baiguoyuan Information Technology Co Ltd filed Critical Guangzhou Baiguoyuan Information Technology Co Ltd
Priority to CN202010396710.6A priority Critical patent/CN111596970B/en
Publication of CN111596970A publication Critical patent/CN111596970A/en
Application granted granted Critical
Publication of CN111596970B publication Critical patent/CN111596970B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/44505Configuring for program initiating, e.g. using registry, configuration files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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

The invention discloses a method, a device, equipment and a storage medium for delayed loading of a dynamic library, wherein the method comprises the following steps: compiling based on a preset dynamic library agent and starting an application program; and after the application program is started, loading the corresponding dynamic library through the preset dynamic library agent. According to the embodiment of the invention, the dynamic library is replaced by the preset dynamic library proxy for compiling, so that the compiling speed is increased, the starting time of the application program is reduced, the code scale of the application program is reduced by the preset dynamic library proxy, the service code of the application program does not need to be modified, the load of the application program terminal is reduced, and the user experience can be improved.

Description

Dynamic library delay loading method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computer application, in particular to a method, a device, equipment and a storage medium for delayed loading of a dynamic library.
Background
With the development of wireless mobile technology, application software is widely used, the functions of the application software are increased, however, the development scale is increased correspondingly with the functions, and a dynamic library is used for isolating different modules in the development process of the iOS application software, so that the problem of cross-module symbol conflict is solved. The dynamic library executes the link operation while running, and the dynamic library of the iOS application software executes the link operation by default when the application software is started, which seriously affects the starting speed of the application software.
Currently, in order to increase the starting speed of the application software, the linking operation of the dynamic library needs to be delayed until the application software is started, and therefore the dynamic library needs to be removed from the compiled linked list and called in a reflection manner. However, the application software uses reflective calling, which seriously increases the scale of the service code, causes difficulty in updating the version of the application software, and seriously affects the development process of the application software, and the increase of the scale of the application software code causes a large amount of occupied storage space of the user terminal, and the application software needs to occupy more memory when being started, which seriously affects the processing performance of the user terminal.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for delayed loading of a dynamic library, which are used for realizing the delayed loading of the dynamic library, improving the starting speed of application software, reducing the code scale of an application program, reducing the performance consumption of the application program on terminal equipment and improving the user experience.
In a first aspect, an embodiment of the present invention provides a method for delayed loading of a dynamic library, where the method includes:
compiling based on a preset dynamic library agent and starting an application program;
and after the application program is started, loading the corresponding dynamic library through the preset dynamic library agent.
In a second aspect, an embodiment of the present invention provides a dynamic library deferred loading apparatus, including:
the compiling module is used for compiling based on a preset dynamic library agent and starting an application program;
and the calling module is used for loading the corresponding dynamic library through the preset dynamic library proxy after the application program is started.
In a third aspect, an embodiment of the present invention provides a computer device, where the computer device includes:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method of dynamic library deferred loading as in any one of the embodiments of the invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the dynamic library deferred loading method according to any one of the embodiments of the present invention.
According to the embodiment of the invention, the compiling processing is carried out through the preset dynamic library proxy, the application program is started after the compiling processing, the corresponding dynamic library is loaded through the preset dynamic library proxy after the application program is started, the dynamic library is loaded after the application program is started, the compiling processing is carried out through the dynamic library proxy, the service code is not required to be modified, the research and development efficiency is improved, the time delay of the compiling process is reduced, and the starting speed of the application program is improved.
Drawings
Fig. 1 is a flowchart of a method for delayed loading of a dynamic library according to an embodiment of the present invention;
fig. 2 is a flowchart of a dynamic library deferred loading method according to a second embodiment of the present invention;
fig. 3 is an exemplary diagram of a dynamic library delay loading method according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a dynamic library delay loading apparatus according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be noted that, for convenience of description, only a part of the structures related to the present invention, not all of the structures, are shown in the drawings, and furthermore, embodiments of the present invention and features of the embodiments may be combined with each other without conflict.
In the current development process of the iOS application software, in order to improve the starting speed of an application program, a dynamic library is often delayed and loaded, in the related art, the delayed and loaded dynamic library is realized based on reflection calling, the dynamic library calling which can be originally completed through one row of codes needs at least 3 rows of codes when reflection calling is used, and the delayed and loaded dynamic library cannot be realized through reflection calling in the application program with a larger code scale. The embodiment of the invention realizes the delayed loading of the dynamic library by presetting the dynamic library agent, solves the problem of the increase of a code module caused by the delayed loading of the dynamic library, improves the starting speed of the application program, reduces the load of a terminal bearing the application program and can improve the user experience.
Example one
Fig. 1 is a flowchart of a dynamic library deferred loading method according to an embodiment of the present invention, where the embodiment is applicable to a situation of dynamic library deferred loading in an application program, and the method may be executed by a dynamic library deferred loading apparatus, where the apparatus may be implemented in a hardware and/or software manner, and referring to fig. 1, the method generally specifically includes the following steps:
step 101, compiling processing is carried out based on a preset dynamic library agent, and an application program is started.
The preset dynamic library agent may be an agent function or an agent class that replaces the dynamic library to be linked in the compiling process, the preset dynamic library agent may correspond to the dynamic library, and each preset dynamic library corresponds to a dynamic library that needs to be loaded with a delay. The compiling process may be a process of converting the application program from a programming language into a machine language recognized and understood by the terminal device, and the compiling process includes preprocessing, compiling, assembling, linking and the like, wherein the linking process of the dynamic library may occur after the application program is started. The application program acquires functions or classes in the dynamic library through links, the application program generally loads the dynamic library according to needs after being started, the dynamic library does not need to be copied to the application program in the compiling process, however, the iOS application program does not support the dynamic library, the links of all library functions need to be added to a compiling link list in the compiling process, the compiling process is completed by replacing the dynamic library with a preset dynamic library proxy for linking, and the loading process of the dynamic library is delayed until the application program is started.
In the embodiment of the application, the compiling process is realized by the preset dynamic library agent, the preset dynamic library agent comprises a function header, and the compiling process can be completed by the grammar and semantic verification of an application program during the compiling process. And after the application program is determined to be compiled, starting the application program, running a binary code of the application program, and rendering a home page of the application program.
And 102, loading a corresponding dynamic library through the preset dynamic library agent after the application program is started.
The dynamic library is specifically a compiled binary code, the dynamic library is dynamically loaded after the application program is started, the symbols in the dynamic library are normally used by the application program after the dynamic library is dynamically loaded, and the dynamic library cannot be copied into the application program in the compiling process, so that theoretically one part exists in the dynamic library, the dynamic library is loaded by different application programs through linking, and the same dynamic library can be used by different application programs.
Specifically, after the application program is started, when the class or the function of the dynamic library is called, the dynamic library is loaded to the application program, different preset dynamic library agents correspond to different dynamic libraries, and the dynamic library is loaded to the application program memory by using the preset dynamic library agents. When loading the dynamic library, the symbol of the dynamic library is mainly resolved, so that the terminal equipment bearing the application program can identify the specific meaning of the code symbol in the dynamic library. Because the symbols in different libraries have conflict, the same symbol has different meanings in different libraries, and the dynamic library is loaded to the application program, so that the meaning of the symbol in the application program is the same as that of the dynamic library, and the application program calls the class or the function in the dynamic library.
According to the embodiment of the invention, the compiling processing is carried out and the application program is started through the preset dynamic library, the corresponding dynamic library is loaded through the preset dynamic library proxy after the application program is started, the delayed loading of the dynamic library in the application program is realized, the compiling time of the application program is reduced, the starting speed of the application program is improved, the service code is not required to be modified, the problem of the increase of the scale of the application program code caused by the delayed loading of the dynamic library is solved, the occupied space of the code is reduced, the performance consumption of the terminal equipment bearing the application program is reduced, and the development efficiency of the application program can be improved.
Further, on the basis of the above embodiment of the invention, the method further includes:
acquiring a dynamic library in the application program, and creating a preset dynamic library agent according to the dynamic library; the preset dynamic library proxy at least comprises a proxy class and a calling class, wherein the proxy class is used for acting the dynamic library to perform compiling processing, and the calling class is used for loading the dynamic library to an application program.
In order to further balance the running speed and the starting speed of the application program, a part of the dynamic libraries in the application program can be subjected to delayed loading, and other dynamic libraries in the application program are still loaded during compiling processing. The preset dynamic library proxy comprises a proxy class and a call class, the proxy class can be a class used for performing a compiling process on the proxy dynamic library in the preset dynamic library proxy, and a function header serving as a compiling entry in the proxy class can be similar to or identical to a function header serving as a compiling entry in the dynamic library. And the calling class is used for loading the class function in the dynamic library to the application program after the application program is started, so that the symbolic resolution is realized. The proxy class is the same as the class function in the dynamic library and can be represented by the beginning of the same character, and the proxy class is used for compiling verification through the application program in the compiling process. The calling class can comprise a binding method, and a class function in a dynamic library corresponding to the preset proxy dynamic library can be loaded to an application program memory, so that a symbol in the application program can be correctly identified by the terminal equipment.
In the embodiment of the invention, the preset dynamic library agent is created by selecting the dynamic library of the application program, all the dynamic libraries of the application program can be selected to create the preset dynamic library, and only the preset dynamic library which is loaded in a delayed manner can be selected to create the dynamic library. The method comprises the steps of obtaining a class function in a dynamic library, creating the same agent class in a preset dynamic library agent according to the class function, wherein the agent class is the same as a function body of the class function in the dynamic library, and function names are different. For example, the function name of the proxy class may add an identifier character prefix on the basis of the function name of the corresponding dynamic library class function, so as to distinguish the proxy class. The preset dynamic library proxy can create a corresponding calling class corresponding to the class function in the dynamic library, and each calling class can comprise a binding method for calling the class function in the corresponding dynamic library.
Example two
Fig. 2 is a flowchart of a dynamic library deferred loading method according to a second embodiment of the present invention, which is embodied based on the second embodiment of the present invention, and the embodiment of the present invention uses a template to create preset dynamic library proxies corresponding to a dynamic library in batch, and performs compilation processing based on a call entry of the dynamic library proxies, referring to fig. 2, the dynamic library deferred loading method according to the second embodiment of the present invention includes the following steps:
step 201, obtaining a dynamic library including delayed loading declaration information, and extracting attribute information in a header file of the dynamic library.
The delayed loading declaration information is used for representing information loaded by the dynamic library after the application program is started, the delayed loading declaration information is specifically header file information of the dynamic library and comprises library name information, function name information and the like of the delayed loading dynamic library, and the application program determines whether to use a delayed loading mode to load the dynamic library or not through the delayed loading declaration information. The delayed loading declaration information is stored in the project file where the application program is located, and can be obtained through character matching. The header file comprises function declaration information, macro definition information, class name information and the like of the dynamic library, the attribute information comprises class name information, parent type information, method information, attribute declaration and the like defined by the dynamic library function in the header file, and the attribute information is used for determining the function body structure of the dynamic library function.
Specifically, delayed loading declaration information may be extracted from a header file of a project file of the application program, where the delayed loading declaration information is used to mark a dynamic library loaded after the application program is started. And acquiring the dynamic library for delayed loading through the delayed loading statement information, and extracting the class name information from the header file of the dynamic library. Illustratively, scanning is performed in a header file of a dynamic library including deferred loading declaration information, a character string @ interface can be found out in a character string matching mode, class name information behind the character string is read, and parent type information, method information, attribute declaration information and the like between the class name information and the character string @ end are read. Further, the class name information may be stored in list 1, and the parent type information, method information, and attribute declaration information may be stored in list 2.
Step 202, filling the attribute information into an agent template and a calling template to generate a preset dynamic library agent corresponding to the dynamic library.
The agent template is used for generating an agent class, the agent template comprises a function body used for compiling, and key information such as class name information in the agent template is represented in a universal identifier or a vacant mode. Correspondingly, the calling class template comprises a function body of the calling class, and is used for loading the functions or methods in the dynamic library, and the parent type information and/or the method attribute information in the calling class template are represented in a universal identifier or a vacant mode. For example, the class name information in the proxy class template is denoted by _ ClassName, the parent class information in the call class template is denoted by _ parenntclass, and the method attribute information is denoted by// method define.
Specifically, class name information, parent type information, method attribute information, and the like in the attribute information may be respectively filled in the proxy class template and the call class template, and for example, type information may be used to replace _ ClassName in the proxy class template, parent class information may be used to replace _ parenntclass in the call class template, and// method define in the call template may be replaced by method attribute information. It can be understood that due to the different writing manners of the proxy class template and the call class template, different parameters in the attribute information can be filled in different positions of the proxy class module and the call class module.
And 203, replacing the call entrance of the dynamic library with the call entrance of the preset dynamic library proxy through macro definition.
Wherein the macro definition represents a process of directly defining one character string in the application program as another character string, for example, # define ABC _ ClassName, which may be the replacement of the character string ABC with the character string _ ClassName. The call entry may be a code string obtained during compiling, and may specifically be function header information of a class function, the call entry of the dynamic library is specifically function header information of a class function in the dynamic library, and the call entry of the preset dynamic library agent is specifically function header information of an agent class in the preset dynamic library agent.
In the embodiment of the invention, when compiling, the calling entry of the dynamic library can be replaced by the calling entry of the preset dynamic library proxy in a macro definition mode, the function header information of the class function of the dynamic library can be replaced by the function header information of the proxy class in the preset dynamic library proxy, the proxy class replaces the class function in the dynamic library to compile during compiling, the entry information of the dynamic library is replaced based on the macro definition without modifying the service code, the delayed loading of the dynamic library in the service code is realized, and the starting speed of the application program corresponding to the service code is improved.
And 204, finishing compiling according to the calling entrance of the preset dynamic library proxy and starting an application program.
Specifically, the function body of the proxy class can be acquired through a preset call entry of the dynamic library proxy, and the proxy class completes verification of the compiling process, so that the compiling speed is increased. Fig. 3 is an exemplary diagram of a dynamic library deferred loading method according to a second embodiment of the present invention, and referring to fig. 3, when a service code is compiled, a call entry of a dynamic library is replaced by a call entry of a preset dynamic library proxy through a macro definition, and a class call entry of the dynamic library can be replaced by a call entry of a preset dynamic library proxy class through the macro definition during compilation.
And step 205, monitoring the dynamic library loading information of the application program after the application program is started.
The dynamic library loading information may be call information of the dynamic library, and specifically includes function declaration information, macro definition information, and the like.
In the embodiment of the present invention, after the application program is started, in order to implement a service function, a dynamic library function needs to be called, and the application program monitors macro definition information and/or function declaration information and the like in an engineering file to obtain dynamic library loading information.
And step 206, searching the calling class in the preset dynamic library agent according to the dynamic library loading information.
The calling class can be a class method for loading the dynamic library, the calling class and the dynamic library are in a corresponding relation, and different calling classes correspond to different dynamic libraries.
Specifically, the dynamic library loading information having the corresponding relationship and the call class in the preset dynamic library proxy may have the same identification information, where the identification information includes a suffix name or an identification number. The dynamic library loading information and the call class have a corresponding relationship, which means that the same dynamic library class function is corresponding, for example, the dynamic library loading information is used for requesting the call class function a, the call class is used for loading the class function a, and the dynamic loading information and the call class have a corresponding relationship. And searching the calling classes with the same suffix name or identification number in a preset dynamic library agent through the dynamic library loading information.
And step 207, loading the character definition of the dynamic library according to the calling class.
The character definition may be the meaning of the character in the dynamic library, and since the same character in different dynamic libraries has different meanings, the application program needs to determine the meaning of the character in the dynamic library when using the character in the dynamic library.
Specifically, the calling class loads the character definitions of the dynamic libraries to the application program memory, the application program executes the functions in the dynamic libraries according to the character definitions, the service codes are normally executed, the character definitions of the dynamic libraries are loaded to the program memory through the calling class, the symbol isolation among the dynamic libraries is realized, the character utilization rate is improved, and the team cooperation efficiency in the dynamic library development process is improved.
The embodiment of the invention generates a preset dynamic library proxy by acquiring a dynamic library with delayed loading declaration information, extracting the attribute information in a dynamic library header file, respectively filling the attribute information into a proxy class template and a calling class template, replacing a calling inlet of the dynamic library with the calling inlet of the preset dynamic library proxy through macro definition, completing compiling processing and starting an application program by the preset dynamic library proxy, monitoring the dynamic library loading information of the application program, searching a corresponding calling class based on the dynamic library loading information, loading the character definition of the dynamic library by the calling class, realizing the delayed loading of the dynamic library, executing the compiling processing through the preset dynamic library proxy, reducing the loading time of the dynamic library when the application is started, replacing the calling inlet of the dynamic library by the macro definition without modifying service codes, reducing the code scale of the application program, and reducing the load of a terminal device bearing the application program, the research and development efficiency of the application program can be improved.
Further, on the basis of the above embodiment of the present invention, the extracting attribute information of the header file of the dynamic library includes:
and searching at least one target keyword in the header file, and acquiring at least one of class name information, parent type information, method information and attribute declaration information as attribute information according to the target keyword.
The target keyword can be a character string for acquiring the attribute information, and since the character strings such as @ interface and @ end exist around the attribute information in the header file, the character strings which often appear around the attribute information can be used as the target keyword.
Specifically, the target keyword may be matched in the header file in a character matching manner, and attribute information around the target keyword is acquired, where the attribute information includes class name information, parent type information, method attribute declaration information, and the like. For example, scanning a header file of a dynamic library to be processed, finding out a target keyword @ interface for each header file in a character matching mode, reading class name information behind the target keyword, storing the class name information into a list 1 for subsequently generating an agent class, and then intercepting parent type information, method information, attribute declaration information and the like between the class name information and another target keyword @ end and storing the parent type information, the method information, the attribute declaration information and the like in a list 2.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a dynamic library deferred loading apparatus provided in a third embodiment of the present invention, which is capable of executing a dynamic library deferred loading method provided in any embodiment of the present invention, and functional modules and beneficial effects corresponding to the specific execution method. The device can be implemented by software and/or hardware, and specifically comprises: a compiling module 301 and a calling module 302.
And the compiling module 301 is configured to perform compiling processing based on a preset dynamic library agent and start an application program.
And the calling module 302 is configured to load the corresponding dynamic library through the preset dynamic library proxy after the application program is started.
According to the embodiment of the invention, the compiling module is used for compiling and starting the application program based on the preset dynamic library, the calling module is used for loading the corresponding dynamic library through the preset dynamic library proxy after the application program is started, so that the delayed loading of the dynamic library in the application program is realized, the compiling time of the application program is reduced, the starting speed of the application program is improved, the problem of the increase of the code scale of the application program caused by the delayed loading of the dynamic library is solved, the occupied space of the code is reduced, the performance consumption of the terminal equipment for bearing the application program is reduced, the service code of the application program does not need to be modified, and the research and development efficiency of the application program can.
Example four
Fig. 5 is a schematic structural diagram of a computer apparatus according to a fourth embodiment of the present invention, as shown in fig. 5, the computer apparatus includes a processor 40, a memory 41, an input device 42, and an output device 43; the number of processors 40 in the computer device may be one or more, and one processor 40 is taken as an example in fig. 5; the processor 40, the memory 41, the input device 42 and the output device 43 in the computer apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 5.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for delayed loading of a dynamic library, the method including:
compiling based on a preset dynamic library agent and starting an application program;
and after the application program is started, loading the corresponding dynamic library through the preset dynamic library agent.
Of course, the embodiments of the present invention provide a storage medium containing computer-readable instructions, whose computer-executable instructions are not limited to the operations of the method described above, but may also perform related operations in the dynamic library deferred loading method provided in any embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for delayed loading of a dynamic library, the method comprising:
compiling based on a preset dynamic library agent and starting an application program;
and after the application program is started, loading the corresponding dynamic library through the preset dynamic library agent.
2. The method of claim 1, further comprising:
acquiring a dynamic library in the application program, and creating a preset dynamic library agent according to the dynamic library;
the preset dynamic library proxy at least comprises a proxy class and a calling class, wherein the proxy class is used for acting the dynamic library to perform compiling processing, and the calling class is used for loading the dynamic library to an application program.
3. The method of claim 2, wherein the creating a corresponding preset dynamic library agent from the dynamic library comprises:
acquiring a dynamic library comprising delayed loading statement information, and extracting attribute information in a header file of the dynamic library;
and filling the attribute information into an agent template and a calling template to generate a preset dynamic library agent corresponding to the dynamic library.
4. The method of claim 2, wherein the compiling process based on the preset dynamic library agent comprises:
replacing the call entrance of the dynamic library with the call entrance of the preset dynamic library proxy through macro definition;
and finishing compiling processing according to the calling entry of the preset dynamic library proxy and starting the application program.
5. The method according to claim 4, wherein loading the corresponding dynamic library through the preset dynamic library agent after the application program is started comprises:
after the application program is started, monitoring dynamic library loading information of the application program;
searching for a calling class in the preset dynamic library proxy according to the dynamic library loading information;
and loading the character definition of the dynamic library according to the calling class.
6. The method according to any of claims 1-5, wherein the call classes in the pre-defined dynamic library agent are registered in the same array and/or have the same key.
7. The method of claim 3, wherein the extracting attribute information of the header file of the dynamic library comprises:
and searching at least one target keyword in the header file, and acquiring at least one of class name information, parent type information, method information and attribute declaration information as attribute information according to the target keyword.
8. An apparatus for dynamic library deferred loading, the apparatus comprising:
the compiling module is used for compiling based on a preset dynamic library agent and starting an application program;
and the calling module is used for loading the corresponding dynamic library through the preset dynamic library proxy after the application program is started.
9. A computer device, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the dynamic library deferred loading method of any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method for dynamic library deferred loading as claimed in any one of claims 1 to 7.
CN202010396710.6A 2020-05-12 2020-05-12 Method, device, equipment and storage medium for dynamic library delay loading Active CN111596970B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010396710.6A CN111596970B (en) 2020-05-12 2020-05-12 Method, device, equipment and storage medium for dynamic library delay loading

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010396710.6A CN111596970B (en) 2020-05-12 2020-05-12 Method, device, equipment and storage medium for dynamic library delay loading

Publications (2)

Publication Number Publication Date
CN111596970A true CN111596970A (en) 2020-08-28
CN111596970B CN111596970B (en) 2023-04-28

Family

ID=72182326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010396710.6A Active CN111596970B (en) 2020-05-12 2020-05-12 Method, device, equipment and storage medium for dynamic library delay loading

Country Status (1)

Country Link
CN (1) CN111596970B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114237609A (en) * 2021-11-08 2022-03-25 北京基调网络股份有限公司 Method and system for dynamically adapting and loading precompiled Nginx module
CN114528037A (en) * 2021-12-31 2022-05-24 北京达佳互联信息技术有限公司 Application starting method and device, electronic equipment and storage medium
CN115878219A (en) * 2022-12-14 2023-03-31 广州博冠信息科技有限公司 Dynamic library loading method, device, storage medium and electronic equipment
CN116225446A (en) * 2022-12-30 2023-06-06 潍柴动力股份有限公司 Embedded code compiling method, device and computer-readable storage medium thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6442752B1 (en) * 1999-08-26 2002-08-27 Unisys Corporation Method, apparatus, and computer program product for replacing a dynamic link library (dll) of a first computing environment with a dll of a second computing environment that can be invoked from the first computing environment in a transparent manner
US6665735B1 (en) * 1997-10-06 2003-12-16 Kabushiki Kaisha Toshiba Method of changing a dynamic link library function efficiently and a computer system for executing the same
CN102402455A (en) * 2010-09-14 2012-04-04 北大方正集团有限公司 Method and device for calling dynamic link library
CN108121594A (en) * 2016-11-29 2018-06-05 阿里巴巴集团控股有限公司 A kind of process management method and device
CN108133126A (en) * 2017-12-04 2018-06-08 北京奇虎科技有限公司 A kind of reinforcement means and device of Android application

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6665735B1 (en) * 1997-10-06 2003-12-16 Kabushiki Kaisha Toshiba Method of changing a dynamic link library function efficiently and a computer system for executing the same
US6442752B1 (en) * 1999-08-26 2002-08-27 Unisys Corporation Method, apparatus, and computer program product for replacing a dynamic link library (dll) of a first computing environment with a dll of a second computing environment that can be invoked from the first computing environment in a transparent manner
CN102402455A (en) * 2010-09-14 2012-04-04 北大方正集团有限公司 Method and device for calling dynamic link library
CN108121594A (en) * 2016-11-29 2018-06-05 阿里巴巴集团控股有限公司 A kind of process management method and device
CN108133126A (en) * 2017-12-04 2018-06-08 北京奇虎科技有限公司 A kind of reinforcement means and device of Android application

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨杰: "论动态链接库的延迟加载", 《南通工学院学报(自然科学版)》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114237609A (en) * 2021-11-08 2022-03-25 北京基调网络股份有限公司 Method and system for dynamically adapting and loading precompiled Nginx module
CN114237609B (en) * 2021-11-08 2022-11-22 北京基调网络股份有限公司 Method and system for dynamically adapting and loading precompiled Nginx module
CN114528037A (en) * 2021-12-31 2022-05-24 北京达佳互联信息技术有限公司 Application starting method and device, electronic equipment and storage medium
CN114528037B (en) * 2021-12-31 2024-03-12 北京达佳互联信息技术有限公司 Application starting method and device, electronic equipment and storage medium
CN115878219A (en) * 2022-12-14 2023-03-31 广州博冠信息科技有限公司 Dynamic library loading method, device, storage medium and electronic equipment
CN116225446A (en) * 2022-12-30 2023-06-06 潍柴动力股份有限公司 Embedded code compiling method, device and computer-readable storage medium thereof
CN116225446B (en) * 2022-12-30 2025-09-19 潍柴动力股份有限公司 Compiling method and device of embedded code and computer readable storage medium thereof

Also Published As

Publication number Publication date
CN111596970B (en) 2023-04-28

Similar Documents

Publication Publication Date Title
CN111596970B (en) Method, device, equipment and storage medium for dynamic library delay loading
US20210034356A1 (en) Code Hot-Update Method and Device, Storage Medium, Processor, and Terminal
CN111679852B (en) Detection method and device for conflict dependency library
CN109597618B (en) Program development method, program development device, computer device, and storage medium
CN111427583A (en) Component compiling method and device, electronic equipment and computer readable storage medium
CN110109671B (en) Webpack label size and style conversion method and device
CN115705194B (en) Code processing method and corresponding device under hardware memory sequence architecture
CN109656567B (en) Dynamic method and system for heterogeneous service data processing logic
CN110457013B (en) Program component configuration device and method
CN114327477A (en) Intelligent contract execution method and device, electronic device and storage medium
US20040123308A1 (en) Hybird of implicit and explicit linkage of windows dynamic link labraries
CN117762423A (en) Java intelligent contract compiling method and device, storage medium and electronic equipment
CN112650502A (en) Batch processing task processing method and device, computer equipment and storage medium
CN111061486B (en) Android application program increment method
CN114443052B (en) A dynamic specialization method and device for IL instruction runtime
CN111399842A (en) Code compiling method and device
CN118409758B (en) Method, apparatus, medium and program product for compiling a kernel function
CN114911541A (en) Configuration information processing method and device, electronic equipment and storage medium
CN110018831B (en) Program processing method, program processing apparatus, and computer-readable storage medium
JP2009258796A (en) Program development device and program development method
CN115373689A (en) Compiling optimization method, device, equipment and medium based on LLVM
CN114489859A (en) Script code execution method and device, storage medium and equipment
CN115421782A (en) SDK compatible method applied to iOS terminal, storage device and intelligent terminal
CN115061678A (en) Code compiling method and client based on browser proxy service
CN113050948A (en) Dynamic library optimization method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231010

Address after: 31a, 15th floor, building 30, maple commercial city, bangrang Road, Brazil

Patentee after: Baiguoyuan Technology (Singapore) Co.,Ltd.

Address before: 5-13 / F, West Tower, building C, 274 Xingtai Road, Shiqiao street, Panyu District, Guangzhou, Guangdong 510000

Patentee before: GUANGZHOU BAIGUOYUAN INFORMATION TECHNOLOGY Co.,Ltd.