CN111596970B - Method, device, equipment and storage medium for dynamic library delay loading - Google Patents

Method, device, equipment and storage medium for dynamic library delay loading Download PDF

Info

Publication number
CN111596970B
CN111596970B CN202010396710.6A CN202010396710A CN111596970B CN 111596970 B CN111596970 B CN 111596970B CN 202010396710 A CN202010396710 A CN 202010396710A CN 111596970 B CN111596970 B CN 111596970B
Authority
CN
China
Prior art keywords
dynamic library
agent
application program
loading
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.)
Active
Application number
CN202010396710.6A
Other languages
Chinese (zh)
Other versions
CN111596970A (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 Singapore 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; 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/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 loading a dynamic library in a delayed manner, wherein the method comprises the following steps: compiling based on a preset dynamic library agent and starting an application program; and loading the corresponding dynamic library through the preset dynamic library agent after the application program is started. According to the embodiment of the invention, the dynamic library is replaced by the preset dynamic library agent to carry out compiling, so that the compiling speed is improved, the starting time of the application program is reduced, the code scale of the application program is reduced by the preset dynamic library agent, the service code of the application program is not required to be modified, the load for bearing the application program terminal is reduced, and the user experience can be improved.

Description

Method, device, equipment and storage medium for dynamic library delay loading
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 loading a dynamic library in a delayed manner.
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 correspondingly increased along with the functions, different modules are isolated by using a dynamic library in the development process of the iOS application software, and the problem of cross-module symbol conflict is solved. The dynamic library executes the linking operation when running, while the dynamic library of the iOS application software executes the linking operation when the application software is started by default, thereby seriously affecting the starting speed of the application software.
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, so that the dynamic library needs to be removed from the compiled link list and called in a reflection mode. However, the application software uses the reflection call, so that the scale of the service code is seriously increased, the version updating of the application software is difficult, the development process of the application software is seriously influenced, the storage space of the user terminal is greatly occupied due to the increase of the scale of the application software code, more memory is required to be occupied when the application software is started, and the processing performance of the user terminal is seriously influenced.
Disclosure of Invention
The invention provides a method, a device, equipment and a storage medium for loading a dynamic library in a delayed manner, so that the delayed loading of the dynamic library is realized, the starting speed of application software is improved, the code scale of an application program is reduced, the performance consumption of the application program on terminal equipment is reduced, and the user experience is improved.
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 loading the corresponding dynamic library through the preset dynamic library agent after the application program is started.
In a second aspect, an embodiment of the present invention provides a dynamic library delayed 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 agent after the application program is started.
In a third aspect, an embodiment of the present invention provides a computer apparatus, including:
one or more processors;
a memory for storing one or more programs;
the 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 as described in any one of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a dynamic library deferred loading method according to any 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 agent, the application program is started after the compiling processing, the corresponding dynamic library is loaded through the preset dynamic library agent after the application program is started, the loading of the dynamic library after the application program is started is realized, the compiling processing is carried out through the dynamic library agent, 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 dynamic library deferred loading according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a method for dynamic library deferred loading according to a second embodiment of the present invention;
FIG. 3 is a diagram illustrating a method for dynamically loading a library delay according to a second embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a dynamic library delay loading device 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 invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings, and furthermore, embodiments of the present invention and features in 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, the dynamic library is usually subjected to delayed loading, the delayed loading of the dynamic library in the related technology is realized based on reflection calling, the dynamic library calling which can be finished by one line of codes originally is realized, at least 3 lines of codes are needed when the reflection calling is used, and the delayed loading of the dynamic library cannot be realized by the reflection calling in the application program with larger code scale. According to the embodiment of the invention, the delay loading of the dynamic library is realized through the preset dynamic library agent, the problem of code module enlargement caused by the delay loading of the dynamic library is solved, the starting speed of the application program is improved, the load of the terminal carrying the application program is reduced, and the user experience is improved.
Example 1
Fig. 1 is a flowchart of a method for dynamic library delay loading according to an embodiment of the present invention, where the method may be applied to a case of dynamic library delay loading in an application, and the method may be performed by a dynamic library delay loading device, and the device may be implemented in hardware and/or software, and referring to fig. 1, and generally includes the following steps:
and step 101, compiling based on a preset dynamic library agent and starting an application program.
The preset dynamic library agent can be an agent function or an agent class for replacing a dynamic library to link in the compiling process, and can correspond to the dynamic library, and each preset dynamic library corresponds to a dynamic library needing to be subjected to delay loading. 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 obtains the functions or classes in the dynamic library through the links, the application program generally loads the dynamic library according to the needs after the application program is 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 agent to carry out the links, 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 through a preset dynamic library agent, the preset dynamic library agent comprises a function head, and the compiling process can be completed through grammar and semantic verification of an application program during the compiling process. After the compiling processing of the application program is determined, the application program is started, the binary code of the application program is operated, and the top page of the application program is rendered.
Step 102, loading the 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, symbols in the dynamic library are normally used by the application program after the dynamic loading, and as the dynamic library cannot be copied into the application program in the compiling process, in theory, one part of the dynamic library exists, different application programs realize the loading of the dynamic library through links, and different application programs can use the same dynamic library.
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 preset dynamic library agents are used for loading the dynamic library to the application program memory. 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 conflicts, the same symbols have different meanings in different libraries, and the symbols in the application program have the same meanings as the dynamic libraries by loading the dynamic libraries into the application program, so that the application program can call the classes or functions in the dynamic libraries.
According to the embodiment of the invention, the compiling processing is carried out through the preset dynamic library, and the application program is started, and after the application program is started, the corresponding dynamic library is loaded through the preset dynamic library agent, so that the delay 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 that the scale of the application program is increased due to the delay loading of the dynamic library is solved, the occupied space of the code is reduced, the performance consumption for bearing the application program terminal equipment is reduced, and the development efficiency of the application program can be improved.
Further, on the basis of the embodiment of the invention, the method further comprises the following steps:
acquiring a dynamic library in the application program, and creating a preset dynamic library agent according to the dynamic library; the preset dynamic library agent at least comprises an agent class and a calling class, wherein the agent class is used for acting on the dynamic library to carry out compiling processing, and the calling class is used for loading the dynamic library to an application program.
The dynamic libraries may be dynamic libraries that need to be loaded in a delayed manner, so that 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 may be loaded in a delayed manner, and other dynamic libraries in the application program may still be loaded during the compiling process. The preset dynamic library agent comprises an agent class and a calling class, wherein the agent class can be a class used for carrying out compiling processing on the agent dynamic library in the preset dynamic library agent, and the function head serving as a compiling inlet in the agent class can be similar to or the same as the function head serving as the compiling inlet in the dynamic library. The calling class is used for loading class functions in the dynamic library to the application program after the application program is started, so that symbol resolution is realized. The proxy class is the same as class functions in the dynamic library, and can be represented by the same character head, and is used for passing the compiling verification of the application program in the compiling process. The calling class can comprise a binding method, and class functions in a dynamic library corresponding to the preset agent dynamic library can be loaded into the application program memory, so that symbols 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 libraries of the application program, so that 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. Class functions in the dynamic library are obtained, the same proxy class is created in a preset dynamic library proxy according to the class functions, the proxy class is identical to the function body of the class functions in the dynamic library, and the function names are different. For example, the function name of the proxy class can be added with an identification character prefix based on the function name of the corresponding dynamic library class function, so that the proxy class can be distinguished. The preset dynamic library agent can create corresponding calling classes corresponding to class functions in the dynamic library, and each calling class can comprise a binding method for calling the class functions in the corresponding dynamic library.
Example two
Fig. 2 is a flowchart of a method for deferred loading of a dynamic library according to a second embodiment of the present invention, where the embodiment of the present invention is based on the embodiment of the present invention, and a template is used to create a preset dynamic library agent corresponding to a dynamic library in batch, and compile the dynamic library agent based on a call entry of the dynamic library agent, and referring to fig. 2, the method for deferred loading of a dynamic library according to the embodiment of the present invention includes the following steps:
step 201, a dynamic library including delay loading declaration information is obtained, and attribute information in a header file of the dynamic library is extracted.
The delayed loading declaration information is used for representing information of loading the dynamic library after the application program is started, and 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 load the dynamic library in a delayed loading mode through the delayed loading declaration information. The delayed loading declaration information is stored in an engineering file where the application program is located and can be obtained through character matching. The header file comprises function statement information, macro definition information, class name information and the like of the dynamic library, the attribute information comprises class name information, father type information, method information, attribute statement and the like of the dynamic library function definition in the header file, and the attribute information is used for determining the function body structure of the dynamic library function.
Specifically, delay loading declaration information can be extracted from a header file of an engineering file of an application program, wherein the delay loading declaration information is used for marking a dynamic library loaded after the application program is started. And acquiring a dynamic library for delay loading through delay loading statement information, and extracting class name information from a header file of the dynamic library. Illustratively, scanning is performed in a header file of a dynamic library including delay loading declaration information, a character string @ interface can be found by a character string matching mode, class name information behind the character string is read, and father type information, method information, attribute declaration information and the like between the class name information and the character string @ end are read. Further, class name information may be stored in list 1, and parent type information, method information, and attribute declaration information may be stored in list 2.
And 202, filling the attribute information into an agent class template and calling the class template to generate a preset dynamic library agent corresponding to the dynamic library.
The agent class template is used for generating agent classes, the agent class template comprises a function body used for compiling, and key information such as class name information in the agent class template is represented in a universal identifier or blank mode. Correspondingly, the calling class template comprises a function body of the calling class and is used for loading functions or methods in the dynamic library, and father type information and/or method attribute information in the calling class template are represented in a general identifier or a vacant mode. For example, class name information in the proxy class template is represented by_ClassName, parent type information in the call class template is represented by_ParentClass, and method attribute information is represented using// method definition.
Specifically, class name information, parent type information, method attribute information, and the like in the attribute information may be respectively filled into the proxy class template and the call class template, for example, _class name in the proxy class template may be replaced with the type information, and_Parentclass in the call class template may be replaced with the parent class information, and// method definition in the call template may be replaced with the method attribute information. It can be appreciated that, due to the different writing modes of the proxy class template and the call class template, different parameters in the attribute information can be filled into different positions of the proxy class module and the call class module.
And 203, replacing the call entry of the dynamic library with the call entry of the preset dynamic library agent through macro definition.
Where the macro definition indicates a process of directly defining one string in the application as another string, for example, # definition abc_classname, may be to replace string ABC with string_classname. The call entry may be a code string obtained during compiling processing, and may be specifically 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 call entry of the dynamic library can be replaced by the call entry of the preset dynamic library agent in a macro definition mode, the function head information of the class function of the dynamic library can be replaced by the function head information of the proxy class in the preset dynamic library agent, 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, the service code is not required to be modified, 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, completing compiling processing according to the call entry of the preset dynamic library agent, and starting an application program.
Specifically, the function body of the proxy class can be obtained through a call inlet of a preset dynamic library proxy, and verification of the compiling process is completed by the proxy class, so that the compiling speed is improved. Fig. 3 is an exemplary diagram of a method for deferred loading of a dynamic library according to a second embodiment of the present invention, referring to fig. 3, in which a service code is compiled, a call entry of a dynamic library is replaced by a call entry of a preset dynamic library agent 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 agent class through the macro definition during compiling.
Step 205, after the application program is started, monitoring the dynamic library loading information of the application program.
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 invention, in order to realize the service function after the application program is started, a dynamic library function is required to be called, the application program monitors macro definition information and/or function statement information and the like in the engineering file to acquire dynamic library loading information, and it can be understood that the dynamic library loading information and the dynamic library have a corresponding relation, and when the function statement information and/or macro definition information in the dynamic library loading information belong to functions or macro definitions in the dynamic library, the dynamic loading information and the dynamic library have a corresponding relation.
And step 206, searching for a 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 corresponding relation, and different calling classes correspond to different dynamic libraries.
Specifically, the dynamic library loading information with the corresponding relation and the call class in the preset dynamic library agent can have the same identification information, and the identification information comprises a suffix name or an identification number. The corresponding relation between the dynamic library loading information and the calling class refers to the corresponding same dynamic library class function, for example, the dynamic library loading information is used for requesting to call class function a, the calling class is used for loading class function a, and the dynamic loading information and the calling class have the corresponding relation. And searching the call class with the same suffix name or identification number in a preset dynamic library agent through the dynamic library loading information.
Step 207, loading character definition of the dynamic library according to the calling class.
Wherein the character definition may be the meaning of a character in a dynamic library, 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 into the application program memory, the application program executes the functions in the dynamic libraries according to the character definitions, the business codes realize normal execution, the character definitions of the dynamic libraries are loaded into the program memory through the calling class, symbol isolation among the dynamic libraries is realized, the character utilization rate is improved, and the team cooperation efficiency in the development process of the dynamic libraries is improved.
According to the embodiment of the invention, the attribute information in the dynamic library header file is extracted by acquiring the dynamic library with the delay loading statement information, the attribute information is respectively filled into the proxy class template and the call class template to generate the preset dynamic library proxy, the call entry of the dynamic library is replaced by the preset dynamic library proxy call entry through macro definition, the preset dynamic library proxy finishes compiling processing and starts the application program, the dynamic library loading information of the application program is monitored, the corresponding call class is searched based on the dynamic library loading information, the character definition of the call class loading dynamic library is used for realizing the delay loading of the dynamic library, the compiling processing is executed through the preset dynamic library proxy, the loading time of the dynamic library when the application is started is reduced, the macro definition is used for replacing the dynamic library call entry, the service code is not required to be modified, the code scale of the application program is reduced, the load of terminal equipment for bearing the application program is reduced, and the research and development efficiency of the application program is 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, father type information, method information and attribute statement information as attribute information according to the target keyword.
The target keyword may be a string for obtaining attribute information, and since strings such as @ interface and @ end exist around the attribute information in the header file, the string frequently appearing around the attribute information may be used as the target keyword.
Specifically, a target keyword can be matched in the header file in a character matching mode, and attribute information around the target keyword is acquired, wherein the attribute information comprises class name information, father type information, method attribute statement information and the like. For example, the header files of the dynamic library to be processed are scanned, a character matching mode is used for each header file to find out the target keyword @ interface, class name information behind the target keyword is read, the class name information is stored in a list 1 for later generation of proxy classes, and then father type information, method information, attribute declaration information and the like between the class name information and another target keyword @ end are intercepted and stored in the list 2.
Example III
Fig. 4 is a schematic structural diagram of a dynamic library delay loading device according to a third embodiment of the present invention, where the dynamic library delay loading method according to any embodiment of the present invention may be implemented, and the functional modules and beneficial effects corresponding to the implementation method are specifically implemented. The apparatus may be implemented by software and/or hardware, and specifically includes: a compiling module 301 and a calling module 302.
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 a corresponding dynamic library through the preset dynamic library agent 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, and the calling module is used for loading the corresponding dynamic library through the preset dynamic library agent after the application program is started, so that the delay 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 that the scale of the application program code is increased due to the delay loading of the dynamic library is solved, the occupied space of the code is reduced, the performance consumption for bearing the terminal equipment of the application program is reduced, the service code of the application program is not required to be modified, and the research and development efficiency of the application program can be improved.
Example IV
Fig. 5 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention, and as shown in fig. 5, the computer device 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, one processor 40 being taken as an example in fig. 5; the processor 40, the memory 41, the input means 42 and the output means 43 in the computer device may be connected by a bus or by other means, in fig. 5 by way of example.
Example five
A fifth embodiment of the present invention also provides a computer-readable storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a dynamic library delayed loading method, the method comprising:
compiling based on a preset dynamic library agent and starting an application program;
and loading the corresponding dynamic library through the preset dynamic library agent after the application program is started.
Of course, the embodiment of the present invention provides a computer-readable storage medium, where the computer-executable instructions are not limited to the method operations described above, but may also perform the related operations in the dynamic library delayed loading method provided in any embodiment of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (8)

1. A method for dynamic library deferred loading, the method comprising:
acquiring a dynamic library in an application program, and creating a preset dynamic library agent according to the dynamic library; the preset dynamic library agent at least comprises an agent class and a calling class, wherein the agent class is used for acting on the dynamic library to carry out compiling processing, and the calling class is used for loading the dynamic library to an application program;
the creating a corresponding preset dynamic library agent according to the dynamic library comprises the following steps: acquiring a dynamic library comprising delay loading statement information, and extracting attribute information in a header file of the dynamic library; filling the attribute information into an agent class template and calling the class template to generate a preset dynamic library agent corresponding to the dynamic library;
compiling based on a preset dynamic library agent and starting an application program;
and loading the corresponding dynamic library through the preset dynamic library agent after the application program is started.
2. The method of claim 1, wherein the compiling process based on the preset dynamic library agent comprises:
replacing the call entry of the dynamic library with the call entry of the preset dynamic library agent through macro definition;
and completing compiling processing according to the call entry of the preset dynamic library agent, and starting the application program.
3. The method according to claim 2, wherein loading the corresponding dynamic library by the preset dynamic library agent after the application is started, comprises:
after the application program is started, monitoring the dynamic library loading information of the application program;
searching a calling class in the preset dynamic library agent according to the dynamic library loading information;
and loading character definitions of the dynamic library according to the calling class.
4. A method according to any of claims 1-3, wherein the call classes in the pre-defined dynamic library agent are registered in the same array and/or have the same key.
5. The method according to claim 1, wherein 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, father type information, method information and attribute statement information as attribute information according to the target keyword.
6. A dynamic library delayed loading apparatus, the apparatus comprising:
the agent module is used for acquiring a dynamic library in the application program and creating a preset dynamic library agent according to the dynamic library; the preset dynamic library agent at least comprises an agent class and a calling class, wherein the agent class is used for acting on the dynamic library to carry out compiling processing, and the calling class is used for loading the dynamic library to an application program;
the creating a corresponding preset dynamic library agent according to the dynamic library comprises the following steps: acquiring a dynamic library comprising delay loading statement information, and extracting attribute information in a header file of the dynamic library; filling the attribute information into an agent class template and calling the class template to generate a preset dynamic library agent corresponding to the dynamic library;
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 agent after the application program is started.
7. A computer device, comprising:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the dynamic library delayed loading method of any of claims 1-5.
8. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a dynamic library delayed loading method according to any of claims 1-5.
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 CN111596970A (en) 2020-08-28
CN111596970B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114237609B (en) * 2021-11-08 2022-11-22 北京基调网络股份有限公司 Method and system for dynamically adapting and loading precompiled Nginx module
CN114528037B (en) * 2021-12-31 2024-03-12 北京达佳互联信息技术有限公司 Application starting method and device, electronic equipment and storage medium

Citations (2)

* 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
CN108121594A (en) * 2016-11-29 2018-06-05 阿里巴巴集团控股有限公司 A kind of process management method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11110194A (en) * 1997-10-06 1999-04-23 Toshiba Corp Connection method to external library function and recording medium in which the connection method is recorded and programmed
CN102402455A (en) * 2010-09-14 2012-04-04 北大方正集团有限公司 Method and device for calling dynamic link library (DLL)
CN108133126B (en) * 2017-12-04 2021-04-06 北京奇虎科技有限公司 Android application reinforcing method and device

Patent Citations (2)

* 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
CN108121594A (en) * 2016-11-29 2018-06-05 阿里巴巴集团控股有限公司 A kind of process management method and device

Also Published As

Publication number Publication date
CN111596970A (en) 2020-08-28

Similar Documents

Publication Publication Date Title
CN108491199B (en) Method and terminal for automatically generating interface
CN109597618B (en) Program development method, program development device, computer device, and storage medium
CN101706725A (en) Method and system for loading and debugging relocatable program
CN111596970B (en) Method, device, equipment and storage medium for dynamic library delay loading
KR102156371B1 (en) Method for providing embedded software development tools for supporting embedded software development environment based on native building and apparatus thereof
CN111427583A (en) Component compiling method and device, electronic equipment and computer readable storage medium
CN112540862A (en) Interface document data generation method, device, equipment and storage medium
CN110109671B (en) Webpack label size and style conversion method and device
US20100095283A1 (en) Migration Apparatus Which Convert Application Program of Mainframe System into Application Program of Open System and Method for Thereof
CN110688096A (en) Method, device, medium and electronic equipment for constructing application program containing plug-in
CN115525534A (en) Test case generation method and platform based on swagger interface test
CN111061486B (en) Android application program increment method
CN110780863A (en) Cross-platform development method, device, equipment and medium of storage system
CN111158777A (en) Component calling method and device and computer readable storage medium
CN112328241B (en) Method and device for creating Android library module dependency relationship in application program development
CN114706586A (en) Code compiling method, code running method, code compiling device, code running device, computer equipment and storage medium
CN109857380B (en) Workflow file compiling method and device
CN113050948A (en) Dynamic library optimization method, device, equipment and storage medium
CN112579156A (en) Processing system, processing method, processing device and processing equipment of business event
CN112711435A (en) Version updating method, version updating device, electronic equipment and storage medium
CN111796832A (en) Hot patch file generation method, device, equipment and storage medium
CN111399842A (en) Code compiling method and device
CN111488144A (en) Data processing method and equipment
CN112988260B (en) Application cold start optimization method and device, computer equipment and storage medium
WO2023036075A1 (en) Program call stack creation method, and stack backtrace method and apparatus

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.