CN114528037B - Application starting method and device, electronic equipment and storage medium - Google Patents

Application starting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114528037B
CN114528037B CN202111661690.1A CN202111661690A CN114528037B CN 114528037 B CN114528037 B CN 114528037B CN 202111661690 A CN202111661690 A CN 202111661690A CN 114528037 B CN114528037 B CN 114528037B
Authority
CN
China
Prior art keywords
dynamic library
codes
execution file
business
main execution
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
CN202111661690.1A
Other languages
Chinese (zh)
Other versions
CN114528037A (en
Inventor
周学运
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202111661690.1A priority Critical patent/CN114528037B/en
Publication of CN114528037A publication Critical patent/CN114528037A/en
Application granted granted Critical
Publication of CN114528037B publication Critical patent/CN114528037B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

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

Abstract

The disclosure relates to an application starting method, an application starting device, an electronic device and a storage medium, wherein the method comprises the following steps: when a starting instruction of an application program is detected, a current main execution file corresponding to the application program is determined, codes in the current main execution file are loaded, the application program is started, the codes in the current main execution file comprise codes of a basic dynamic library, the basic dynamic library is a dynamic library which is relied on when a historical main execution file is loaded, and the historical main execution file is a file before the current main execution file is modified. According to the method and the device for the application program starting, the code of the basic dynamic library on which the main execution file depends is integrated into the main execution file, so that the problem of excessive time consumption caused by extra operation of the system when the application program is started can be avoided, and the problem of slow application program starting is further relieved.

Description

Application starting method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of internet, and in particular relates to an application starting method, an application starting device, electronic equipment and a storage medium.
Background
Since the main execution file of the application program and the dynamic libraries corresponding to other events in the application program may generally depend on the same dynamic libraries, loading of the dynamic libraries corresponding to other events is inevitably performed when the application program is started, so that a great deal of time is consumed when the application program is started.
Disclosure of Invention
The disclosure provides an application starting method, an application starting device, electronic equipment and a storage medium, and the technical scheme of the disclosure is as follows:
according to a first aspect of an embodiment of the present disclosure, there is provided an application starting method, including:
when a starting instruction of an application program is detected, determining a current main execution file corresponding to the application program;
loading codes in the current main execution file and starting an application program;
the codes in the current main execution file comprise codes of a basic dynamic library; the basic dynamic library is a dynamic library which is relied on when the history main execution file is loaded; the history main execution file is a file before the current main execution file is modified.
In some possible embodiments, the method further comprises:
when a starting instruction of a business event in an application program is detected, determining a business dynamic library corresponding to the business event;
if the basic dynamic library is a dynamic library which is depended on when the business dynamic library is loaded, calling the basic dynamic library;
loading a business dynamic library based on the codes of the basic dynamic library and the codes of the business dynamic library;
a business event is initiated.
In some possible embodiments, when detecting a start instruction of an application program, before determining a current main execution file corresponding to the application program, the method further includes:
Determining a basic dynamic library which is depended on when the historical main execution file is loaded;
and integrating codes in the basic dynamic library into the historical main execution file to obtain the current main execution file.
In some possible embodiments, after integrating the code in the base dynamic library into the main execution file, further comprising:
and deleting the basic dynamic library.
In some possible embodiments, the method further comprises:
storing codes in the current main execution file into a memory;
when a starting instruction of a business event in an application program is detected, determining a business dynamic library corresponding to the business event;
if the basic dynamic library is a dynamic library which is depended on when the business dynamic library is loaded, inquiring codes in the memory in a dynamic inquiring mode to obtain codes of the basic dynamic library;
loading a business dynamic library based on the codes of the basic dynamic library and the codes of the business dynamic library;
a business event is initiated.
In some possible embodiments, if the basic dynamic library is a dynamic library that is relied upon when the service dynamic library is loaded, the code in the memory is queried in a dynamic query manner to obtain the code of the basic dynamic library, the service dynamic library is loaded based on the code of the basic dynamic library and the code of the service dynamic library, and the starting service event includes:
Compiling based on codes in the service dynamic library to obtain a program package corresponding to the service event;
if the basic dynamic library is a dynamic library which is depended on when the business dynamic library is loaded, inquiring codes in the memory in a dynamic inquiring mode to obtain codes of the basic dynamic library;
code starting program packages based on the basic dynamic library;
a business event is initiated.
In some possible embodiments, saving code in the current main execution file to memory includes:
determining a preset deleting mode of codes in a current main execution file;
deleting preset codes in the codes of the current main execution file based on a preset deleting mode, and reserving codes in a basic dynamic library in the codes of the current main execution file;
and saving codes in a basic dynamic library in the codes of the current main execution file into a memory.
According to a second aspect of the embodiments of the present disclosure, there is provided an application starting apparatus, including:
the file determining module is configured to execute the current main execution file corresponding to the application program when the starting instruction of the application program is detected;
the starting module is configured to load codes in the current main execution file and start an application program;
The codes in the current main execution file comprise codes of a basic dynamic library; the basic dynamic library is a dynamic library which is relied on when the history main execution file is loaded; the history main execution file is a file before the current main execution file is modified.
In some possible embodiments, the apparatus further comprises:
the service dynamic library determining module is configured to determine a service dynamic library corresponding to a service event when a starting instruction of the service event in the application program is detected;
the calling module is configured to execute the dynamic library which is depended on when the basic dynamic library is the business dynamic library to be loaded, and call the basic dynamic library;
a loading module configured to execute code loading business dynamic library based on the basic dynamic library and code loading business dynamic library of the business dynamic library;
and the starting module is configured to execute a starting business event.
In some possible embodiments, the apparatus further comprises:
the basic dynamic library determining module is configured to execute the basic dynamic library which is depended on when the history main execution file is loaded;
and the integration module is configured to integrate codes in the basic dynamic library into the historical main execution file to obtain the current main execution file.
In some possible embodiments, the apparatus further comprises:
And the deleting module is configured to execute the deleting basic dynamic library.
In some possible embodiments, the apparatus further comprises:
the storage module is configured to store codes in the current main execution file into the memory;
the service dynamic library determining module is configured to determine a service dynamic library corresponding to a service event when a starting instruction of the service event in the application program is detected;
the code acquisition module is configured to execute the dynamic library which is dependent when the basic dynamic library is the business dynamic library, and the codes in the memory are inquired in a dynamic inquiry mode to obtain the codes of the basic dynamic library;
a loading module configured to execute code loading business dynamic library based on the basic dynamic library and code loading business dynamic library of the business dynamic library;
and the starting module is configured to execute a starting business event.
In some possible embodiments, the apparatus further comprises:
the compiling module is configured to execute compiling based on codes in the service dynamic library to obtain a program package corresponding to the service event;
the code acquisition module is configured to execute the dynamic library which is dependent when the basic dynamic library is the business dynamic library, and the codes in the memory are inquired in a dynamic inquiry mode to obtain the codes of the basic dynamic library;
A launch module configured to execute a code launch package based on the underlying dynamic library; a business event is initiated.
In some possible embodiments, the save module is configured to perform:
determining a preset deleting mode of codes in a current main execution file;
deleting preset codes in the codes of the current main execution file based on a preset deleting mode, and reserving codes in a basic dynamic library in the codes of the current main execution file;
and saving codes in a basic dynamic library in the codes of the current main execution file into a memory.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement the method as in any of the first aspects above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method of any one of the first aspects of embodiments of the present disclosure.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program stored in a readable storage medium, the computer program being read from the readable storage medium by at least one processor of the computer device and executed, such that the computer device performs the method of any one of the first aspects of embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
when a starting instruction of an application program is detected, a current main execution file corresponding to the application program is determined, codes in the current main execution file are loaded, the application program is started, the codes in the current main execution file comprise codes of a basic dynamic library, the basic dynamic library is a dynamic library which is relied on when a historical main execution file is loaded, and the historical main execution file is a file before the current main execution file is modified. According to the method and the device for the application program starting, codes of the basic dynamic library on which the main execution file depends are integrated into the main execution file, so that the problem of excessive time consumption caused by extra operation of a system when the application program is started can be avoided, and the problem of slow application program starting is further relieved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a schematic diagram of an application environment shown in accordance with an exemplary embodiment;
FIG. 2 is a flowchart illustrating an application launch method according to an example embodiment;
FIG. 3 is a flow chart illustrating a start business event according to an exemplary embodiment;
FIG. 4 is a flow chart illustrating a start business event according to an exemplary embodiment;
FIG. 5 is a flow chart illustrating a cropping code according to an example embodiment;
FIG. 6 is a block diagram of an application launching device, according to an example embodiment;
FIG. 7 is a block diagram illustrating an electronic device for application launch according to an example embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar first objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
All data about the user in this application are data after the user is authorized.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an application environment of an application starting method according to an exemplary embodiment, and as shown in fig. 1, the application environment may include a client 01, and a main execution file 011 and a service dynamic library 012 located in a certain application program of the client 01.
In some possible embodiments, the client 01 described above may include, but is not limited to, a smart phone, a desktop computer, a tablet computer, a notebook computer, a smart speaker, a digital assistant, an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a smart wearable device, and the like. Or may be software running on the client, such as an application, applet, etc. Alternatively, the operating system running on the client may include, but is not limited to, an android system, an IOS system, linux, windows, unix, and the like.
In some possible embodiments, when a start instruction of an application program is detected, determining a current main execution file corresponding to the application program, loading codes in the current main execution file, and starting the application program, where the codes in the current main execution file include codes of a basic dynamic library, the basic dynamic library is a dynamic library relied on when a historical main execution file is loaded, and the historical main execution file is a file before the current main execution file is modified.
Fig. 2 is a flowchart illustrating an application starting method according to an exemplary embodiment, and as shown in fig. 2, the application starting method may be applied to a client, and may also be applied to other node devices, including the following steps:
in step S201, when a start instruction of an application is detected, a current main execution file corresponding to the application is determined.
In this embodiment of the present application, the current main execution file is the main execution file of the application program. And each application program has its corresponding main execution file. The main execution file is the main entrance of the application program, and when the system runs, codes in the main execution file are loaded, an entrance function is found, and subsequent logic is executed. Wherein, the code can also be called a symbol, and the symbol can be related content such as class, method, variable and the like.
In this embodiment, the application in step S201 may be an application in the IOS system, an application in the android system, or an application in a system such as windows, lunix, unix. Here, the type of system to which the application belongs is not limited.
In some alternative embodiments, some system vendors set maximum capacity limits for content in a single executable file for an application. For example, if the content in a single executable file exceeds 60 megabytes, it cannot be applied. To solve this problem, the application may be tuned to a structure of multiple dynamic libraries. Further, to reduce code coupling between services, more dynamic libraries can be split. Thus, after splitting, the main execution file usually becomes empty, and only the main () method and the dependency relationship of the dynamic library are reserved, so that the running of the application program is ensured. Thus, the code architecture of the application program is improved, and the work efficiency of partial developers can be improved.
However, as the amount of business code increases, the number of dynamic libraries increases, which causes some degradation in time consuming application program start-up. In this regard, the embodiment of the present application may determine a dynamic library that is not needed in the startup stage, and in the running process of an application program, call an interface provided by the dynamic library through a componentized framework, and load the corresponding dynamic library as required.
For example, assume that an application has a main execution file (main execution file No. 0) and 5 dynamic libraries, where the 5 dynamic libraries include 3 basic dynamic libraries, i.e. No. 1, no. 2, and No. 3, and further include service dynamic libraries corresponding to different service events of the application in No. 4 and No. 5. And the 3 basic dynamic libraries 1, 2 and 3 are the dynamic libraries on which the main execution file is loaded, and the 3 basic dynamic libraries 1, 2 and 3 are the dynamic libraries on which the business dynamic libraries 4 and 5 are loaded.
Thus, when the client detects the starting instruction of the application program, the main execution file corresponding to the application program is determined to be the No. 0 main execution file. When the system loads the main execution file, since the 3 basic dynamic libraries of No. 1, no. 2 and No. 3 are the dynamic libraries on which the main execution file is dependent when being loaded, the code which is loaded into the 3 basic dynamic libraries is inevitably needed. However, loading these 3 underlying dynamic libraries when the main execution file is started is very time consuming.
In the embodiments of the present application, this is time consuming because the system may generate additional operations. Alternatively, the additional operation may be to link the dynamic library, and the system will make the rebase and bind of the additional symbol, i.e. redefine the offset of the symbol, which necessarily results in more time consumption, so that the user feels that the application is being started too slowly during the starting of the application.
In step S203, the code in the current main execution file is loaded, and the application program is started, where the code in the current main execution file includes the code of the basic dynamic library; the basic dynamic library is a dynamic library which is relied on when the history main execution file is loaded; the history main execution file is a file before the current main execution file is modified.
In the embodiment of the application, in order to avoid the time-consuming problem caused by loading codes in 3 basic dynamics, the client may modify the previous main execution file. In order to distinguish from the modified master executives, it is referred to herein as a historic master executives.
In some possible embodiments, the client may obtain a modification instruction, where the modification instruction includes identification information of the historical main execution file and identification information of the dependent basic dynamic library (such as identification information of 3 basic dynamic libraries including No. 1, no. 2 and No. 3), and the modification instruction is used to instruct the client to integrate the code in the basic dynamic library into the historical main execution file, so as to obtain a new main execution file, that is, a current main execution file.
Correspondingly, after the client acquires the modification instruction, the history main execution file can be determined according to the identification information of the history main execution file, and the base dynamic library on which the history main execution file depends when being loaded can be determined according to the identification information of the base dynamic library. The client may then integrate the code in the underlying dynamic library into the historical master executions to obtain the current master executions.
In an alternative embodiment, the client may still maintain the base dynamic library after integrating the code in the base dynamic library into the history master execution file.
FIG. 3 is a flow chart illustrating a start business event, as shown in FIG. 3, according to an exemplary embodiment, including:
in step S301, when a start instruction of a service event in an application program is detected, a service dynamic library corresponding to the service event is determined.
In the embodiment of the application, when the client detects the starting instruction of the service event in the application program, the service dynamic library corresponding to the service event can be determined.
Continuing to explain based on the above example, when the client detects the start instruction of the service event corresponding to the service dynamic library No. 4, it may be determined that the service dynamic library corresponding to the service event is No. 4. Alternatively, the service event may be any service event in the application program, such as a creation event (including file creation, picture creation, etc.), such as a download event (including picture download, document download), a page start event, etc.
In step S303, if the basic dynamic library is a dynamic library that is dependent upon when the business dynamic library is loaded, the basic dynamic library is called.
Alternatively, assume that the 3 underlying dynamic libraries # 1, # 2, and # 3 may be a common kernel of the dynamic library # 4 and the current master execution file. At this time, the basic dynamic library (3 basic dynamic libraries of No. 1, no. 2 and No. 3) is the dynamic library which is relied on when the business dynamic library is loaded, and the basic dynamic library can be called.
In step S305, the business dynamic library is loaded based on the code of the base dynamic library and the code of the business dynamic library.
In the embodiment of the application, the client can load the service dynamic library based on the codes of the basic dynamic library and the codes of the service dynamic library.
In step S307, a business event is initiated.
For example, when the client detects a start instruction of a download service event in the application, a service dynamic library (e.g., service dynamic library No. 4) corresponding to the download service event may be determined. Because of the above description, the 3 basic dynamic libraries No. 1, no. 2, and No. 3 are also dynamic libraries that are relied upon when the business dynamic library No. 4 is loaded. Therefore, the client can call 3 basic dynamic libraries, load the service dynamic libraries based on the codes of the 3 basic dynamic libraries and the codes of the service dynamic libraries, and start downloading the service event.
Although the above manner can make the basic dynamic library on which the business dynamic library depends still exist, the code of the basic dynamic library can be found when the business dynamic library is loaded. However, the above formula can make a code of a basic dynamic library exist in the current main execution file while maintaining the business dynamic library. Therefore, a plurality of codes of the basic dynamic library exist in the application program product, the memory of the client is wasted, and the actual requirement is not met.
In an alternative embodiment, the client may delete the base dynamic library after integrating the code in the base dynamic library into the history master execution file.
FIG. 4 is a flow chart illustrating an initiate business event, after being applied to delete a base dynamic library, as shown in FIG. 4, comprising:
in step S401, the code in the current main execution file is saved to the memory.
In an alternative embodiment, after the client starts the application with code in the current main execution file (including code in the base dynamic library), the code in the current main execution file may be saved to memory.
Optionally, the memory is a local memory in the client.
In some possible embodiments, some systems do not save all code in the current master execution file to memory after the process of launching the application with the current master execution file. Instead, to reduce the size of the artifact, all code in the current main execution file may be trimmed off based on the specified settings.
Specifically, the compiling and starting process of the application program may include obtaining all codes in the current main execution file, that is, obtaining source codes, then generating intermediate codes based on the source codes, then generating different executable files according to the intermediate codes, then packaging the different executable files and resources to obtain a program package of the application program, and further starting the application program according to the program package.
However, to reduce the size of the artifacts, the client's system may trim all code in the current main execution code stored in memory when generating different executable files from the intermediate code. This results in that when a business event is initiated, no code is found that is already integrated into the current main execution file that is originally in the underlying dynamic library. Therefore, when the client needs to cut the code in the current main execution file, the code cutting can be performed based on a new mode so as to ensure that when a business event is started, the code which is originally in the basic dynamic library and can be integrated into the current main execution file is ensured.
FIG. 5 is a flow chart illustrating a method of cropping code, after application to deleting a base dynamic library, as shown in FIG. 5, comprising:
in step S501, a preset deletion mode of codes in the current main execution file is determined.
Optionally, when the client needs to cut the codes in the current main execution file, the preset deleting mode of the codes in the current main execution file can be determined, that is, the preset deleting mode which does not cut all the codes can be determined.
In step S503, the preset code in the code of the current main execution file is deleted based on the preset deletion mode, and the code in the basic dynamic library in the code of the current main execution file is reserved.
Therefore, the client can delete the preset codes in the codes of the current main execution file based on the preset deleting mode, namely the codes in the history main execution file, and the codes originally in the basic dynamic library in the codes of the current main execution file are reserved.
In step S505, the code in the base dynamic library in the code of the current main execution file is saved to the memory.
Optionally, if the code in the current main execution file is not stored in the memory at this time, after the code originally belonging to the history main execution file is cut, the code originally belonging to the basic dynamic library in the code of the current main execution file may be stored in the memory.
Optionally, if before the code clipping step, the client already stores all the codes of the current main execution file in the memory, and after clipping the codes based on the preset deletion mode, the client may leave the codes in the code of the previous main execution file that originally belong to the basic dynamic library.
Therefore, the client can reserve the codes which need to be used continuously in the memory, namely the codes originally belonging to the basic dynamic library, so that the business dynamic library can find the codes in the basic dynamic library which the business dynamic library depends on in a dynamic query mode smoothly in running, and the loading of business events is carried out.
However, in the actual process, in the above embodiment, after the preset deletion mode is used, there may still be some codes that are originally in the basic dynamic library that may be cut out.
By analysis, the code originally in the underlying dynamic library is code that is global in the application, while the code in the historical master execution file is non-global. Based on this, the embodiment of the present application may take the deletion manner in the foregoing embodiment as the first manner, and before clipping, an identification manner may be added, and after the client identifies that a certain code is a global code, an identification that cannot be clipped may be marked, so when deleting by the preset deletion manner, the code that is marked as cannot be clipped may not be clipped.
Therefore, the client can reserve the codes which need to be used continuously in the memory, namely the codes originally belonging to the basic dynamic library, so that the business dynamic library can find the codes in the basic dynamic library which the business dynamic library depends on in a dynamic query mode smoothly in running, and the loading of business events is carried out.
In step S403, when a start instruction of a service event in the application program is detected, a service dynamic library corresponding to the service event is determined.
In the embodiment of the application, when the client detects the starting instruction of the service event in the application program, the service dynamic library corresponding to the service event can be determined.
Continuing to explain based on the above example, when the client detects the start instruction of the service event corresponding to the service dynamic library No. 4, it may be determined that the service dynamic library corresponding to the service event is No. 4. Alternatively, the service event may be any service event in the application program, such as a creation event (including file creation, picture creation, etc.), such as a download event (including picture download, document download), a page start event, etc.
In step S405, if the basic dynamic library is a dynamic library that is relied upon when the service dynamic library is loaded, the code in the memory is queried in a dynamic query manner, so as to obtain the code of the basic dynamic library.
Alternatively, assume that the 3 underlying dynamic libraries # 1, # 2, and # 3 may be a common kernel of the dynamic library # 4 and the current master execution file. At this time, the basic dynamic library (3 basic dynamic libraries of No. 1, no. 2 and No. 3) is the dynamic library which is relied on when the business dynamic library is loaded, and the codes in the memory can be queried in a dynamic query mode to obtain the codes of the basic dynamic library.
In step S407, the business dynamic library is loaded based on the code of the base dynamic library and the code of the business dynamic library.
In the embodiment of the application, the client can load the service dynamic library based on the codes of the basic dynamic library and the codes of the service dynamic library.
In step S409, a business event is initiated.
In the embodiment of the application, after the code in the memory is queried in a dynamic query mode to obtain the code of the basic dynamic library, the client side compiles the code in the basic dynamic library to obtain the program package corresponding to the service event, and can ignore the problem that the code of the basic dynamic library cannot be found, and compiles the code in the basic dynamic library directly based on the code in the service dynamic library to obtain the program package corresponding to the service event. Then, the client can query the codes in the memory in a dynamic query mode to obtain codes of the basic dynamic library, and start a program package based on the codes of the basic dynamic library so as to start a business event.
In summary, by integrating the code of the basic dynamic library on which the main execution file depends into the main execution file, the problem of excessive time consumption caused by extra operation of the system when the application program is started can be avoided, and the problem of slow starting of the application program is further relieved.
And secondly, integrating codes of the basic dynamic library on which the main execution file depends into the main execution file, deleting the codes of the original basic dynamic library can ensure that the codes of a plurality of basic dynamic libraries do not exist in an application program product, and saving the memory of a client.
Fig. 6 is a block diagram of an application launching device, according to an example embodiment. Referring to fig. 6, the apparatus includes a file determination module 601 and a start module 602.
The file determining module 601 is configured to execute a current main execution file corresponding to the application program when a start instruction of the application program is detected;
the starting module 602 is configured to load codes in the current main execution file and start an application program;
the codes in the current main execution file comprise codes of a basic dynamic library; the basic dynamic library is a dynamic library which is relied on when the history main execution file is loaded; the history main execution file is a file before the current main execution file is modified.
In some possible embodiments, the apparatus further comprises:
the service dynamic library determining module is configured to determine a service dynamic library corresponding to a service event when a starting instruction of the service event in the application program is detected;
the calling module is configured to execute the dynamic library which is depended on when the basic dynamic library is the business dynamic library to be loaded, and call the basic dynamic library;
a loading module configured to execute code loading business dynamic library based on the basic dynamic library and code loading business dynamic library of the business dynamic library;
and the starting module is configured to execute a starting business event.
In some possible embodiments, the apparatus further comprises:
the basic dynamic library determining module is configured to execute the basic dynamic library which is depended on when the history main execution file is loaded;
and the integration module is configured to integrate codes in the basic dynamic library into the historical main execution file to obtain the current main execution file.
In some possible embodiments, the apparatus further comprises:
and the deleting module is configured to execute the deleting basic dynamic library.
In some possible embodiments, the apparatus further comprises:
the storage module is configured to store codes in the current main execution file into the memory;
The service dynamic library determining module is configured to determine a service dynamic library corresponding to a service event when a starting instruction of the service event in the application program is detected;
the code acquisition module is configured to execute the dynamic library which is dependent when the basic dynamic library is the business dynamic library, and the codes in the memory are inquired in a dynamic inquiry mode to obtain the codes of the basic dynamic library;
a loading module configured to execute code loading business dynamic library based on the basic dynamic library and code loading business dynamic library of the business dynamic library;
and the starting module is configured to execute a starting business event.
In some possible embodiments, the apparatus further comprises:
the compiling module is configured to execute compiling based on codes in the service dynamic library to obtain a program package corresponding to the service event;
the code acquisition module is configured to execute the dynamic library which is dependent when the basic dynamic library is the business dynamic library, and the codes in the memory are inquired in a dynamic inquiry mode to obtain the codes of the basic dynamic library;
a launch module configured to execute a code launch package based on the underlying dynamic library; a business event is initiated.
In some possible embodiments, the save module is configured to perform:
Determining a preset deleting mode of codes in a current main execution file;
deleting preset codes in the codes of the current main execution file based on a preset deleting mode, and reserving codes in a basic dynamic library in the codes of the current main execution file;
and saving codes in a basic dynamic library in the codes of the current main execution file into a memory.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 7 is a block diagram illustrating an apparatus 700 for application launching, according to an example embodiment. For example, apparatus 700 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 7, an apparatus 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and a communication component 716.
The processing component 702 generally controls overall operation of the apparatus 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 702 can include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
Memory 704 is configured to store various types of data to support operations at device 700. Examples of such data include instructions for any application or method operating on the apparatus 700, contact data, phonebook data, messages, pictures, videos, and the like. The memory 704 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 706 provides power to the various components of the device 700. The power components 706 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 700.
The multimedia component 708 includes a screen between the device 700 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front-facing camera and/or a rear-facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 700 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 710 is configured to output and/or input audio signals. For example, the audio component 710 includes a Microphone (MIC) configured to receive external audio signals when the device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 704 or transmitted via the communication component 716. In some embodiments, the audio component 710 further includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 714 includes one or more sensors for providing status assessment of various aspects of the apparatus 700. For example, the sensor assembly 714 may detect an on/off state of the device 700, a relative positioning of the components, such as a display and keypad of the apparatus 700, a change in position of the apparatus 700 or one component of the apparatus 700, the presence or absence of user contact with the apparatus 700, an orientation or acceleration/deceleration of the apparatus 700, and a change in temperature of the apparatus 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate communication between the apparatus 700 and other devices in a wired or wireless manner. The apparatus 700 may access a wireless network based on a communication standard, such as WiFi, an operator network (e.g., 2G, 3G, 4G, or 5G), or a combination thereof. In one exemplary embodiment, the communication component 716 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a storage medium is also provided, such as a memory 704 including instructions executable by the processor 720 of the apparatus 700 to perform the above-described method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

Claims (17)

1. An application launch method, comprising:
when a starting instruction of an application program is detected, determining a current main execution file corresponding to the application program;
loading codes in the current main execution file and starting the application program;
the codes in the current main execution file comprise codes of a basic dynamic library; the basic dynamic library is a dynamic library which is dependent when a history main execution file is loaded, and the basic dynamic library is a dynamic library which is dependent when a business dynamic library corresponding to a part of business events in the application program is loaded when the part of business events in the application program are started; the history main execution file is a file before the current main execution file is modified.
2. The application launch method of claim 1, wherein the method further comprises:
when a starting instruction of a business event in the application program is detected, determining a business dynamic library corresponding to the business event;
if the basic dynamic library is a dynamic library which is dependent when the business dynamic library is loaded, calling the basic dynamic library;
loading the business dynamic library based on the codes of the basic dynamic library and the codes of the business dynamic library;
And starting the business event.
3. The application starting method according to claim 1, wherein when detecting a start instruction of an application program, before determining a current main execution file corresponding to the application program, the method further comprises:
determining the basic dynamic library which is relied on when the history main execution file is loaded;
and integrating codes in the basic dynamic library into the historical main execution file to obtain the current main execution file.
4. The application launch method of claim 3 wherein after integrating the code in the base dynamic library into the master execution file, further comprising:
and deleting the basic dynamic library.
5. The application launch method of claim 4, wherein the method further comprises:
storing codes in the current main execution file into a memory;
when a starting instruction of a business event in the application program is detected, determining a business dynamic library corresponding to the business event;
if the basic dynamic library is a dynamic library which is relied on when the business dynamic library is loaded, inquiring codes in the memory in a dynamic inquiry mode to obtain codes of the basic dynamic library;
Loading the business dynamic library based on the codes of the basic dynamic library and the codes of the business dynamic library;
and starting the business event.
6. The application starting method according to claim 5, wherein if the basic dynamic library is a dynamic library that is dependent on when the service dynamic library is loaded, the code in the memory is queried in a dynamic query manner to obtain the code of the basic dynamic library, the service dynamic library is loaded based on the code of the basic dynamic library and the code of the service dynamic library, and starting the service event includes:
compiling based on codes in the service dynamic library to obtain a program package corresponding to the service event;
if the basic dynamic library is a dynamic library which is relied on when the business dynamic library is loaded, inquiring codes in the memory in the dynamic inquiry mode to obtain codes of the basic dynamic library;
starting the program package based on codes of the basic dynamic library;
and starting the business event.
7. The method for starting an application according to claim 5, wherein storing the code in the current main execution file in the memory comprises:
Determining a preset deleting mode of codes in the current main execution file;
deleting preset codes in the codes of the current main execution file based on the preset deleting mode, and reserving codes in the basic dynamic library in the codes of the current main execution file;
and saving codes in the basic dynamic library in the codes of the current main execution file into the memory.
8. An application starting apparatus, comprising:
the file determining module is configured to execute a current main execution file corresponding to the application program when a starting instruction of the application program is detected;
the starting module is configured to load codes in the current main execution file and start the application program;
the codes in the current main execution file comprise codes of a basic dynamic library; the basic dynamic library is a dynamic library which is dependent when a history main execution file is loaded, and the basic dynamic library is a dynamic library which is dependent when a business dynamic library corresponding to a part of business events in the application program is loaded when the part of business events in the application program are started; the history main execution file is a file before the current main execution file is modified.
9. The application launch apparatus of claim 8 wherein the apparatus further comprises:
the business dynamic library determining module is configured to execute a business dynamic library corresponding to a business event when a starting instruction of the business event in the application program is detected;
the calling module is configured to execute a dynamic library which is dependent when the basic dynamic library is loaded for the business dynamic library, and call the basic dynamic library;
a loading module configured to execute loading of the business dynamic library based on the code of the base dynamic library and the code of the business dynamic library;
the initiation module is configured to perform initiation of the business event.
10. The application launch apparatus of claim 8 wherein the apparatus further comprises:
a base dynamic library determination module configured to perform determining the base dynamic library upon which the historic master execution file is dependent upon being loaded;
and the integration module is configured to integrate codes in the basic dynamic library into the historical main execution file to obtain the current main execution file.
11. The application launch apparatus of claim 10 wherein the apparatus further comprises:
And the deleting module is configured to delete the basic dynamic library.
12. The application launch apparatus of claim 11 wherein the apparatus further comprises:
the saving module is configured to save the codes in the current main execution file into a memory;
the business dynamic library determining module is configured to execute a business dynamic library corresponding to a business event when a starting instruction of the business event in the application program is detected;
the code acquisition module is configured to execute a dynamic library which is dependent when the basic dynamic library is loaded for the business dynamic library, and inquire codes in the memory in a dynamic inquiry mode to obtain codes of the basic dynamic library;
a loading module configured to execute loading of the business dynamic library based on the code of the base dynamic library and the code of the business dynamic library;
the initiation module is configured to perform initiation of the business event.
13. The application launch apparatus of claim 12 wherein the apparatus further comprises:
the compiling module is configured to execute compiling based on codes in the service dynamic library to obtain a program package corresponding to the service event;
The code acquisition module is configured to execute a dynamic library which is dependent when the basic dynamic library is the business dynamic library and inquires codes in the memory in a dynamic inquiry mode to obtain codes of the basic dynamic library;
the starting module is configured to execute code based on the basic dynamic library to start the program package; and starting the business event.
14. The application launch apparatus of claim 12 wherein the save module is configured to perform:
determining a preset deleting mode of codes in the current main execution file;
deleting preset codes in the codes of the current main execution file based on the preset deleting mode, and reserving codes in the basic dynamic library in the codes of the current main execution file;
and saving codes in the basic dynamic library in the codes of the current main execution file into the memory.
15. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the application launch method of any one of claims 1 to 7.
16. A computer readable storage medium, characterized in that instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the application starting method of any one of claims 1 to 7.
17. A computer program product, characterized in that the computer program product comprises a computer program stored in a readable storage medium, from which at least one processor of a computer device reads and executes the computer program, causing the computer device to perform the application launch method according to any one of claims 1 to 7.
CN202111661690.1A 2021-12-31 2021-12-31 Application starting method and device, electronic equipment and storage medium Active CN114528037B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111661690.1A CN114528037B (en) 2021-12-31 2021-12-31 Application starting method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111661690.1A CN114528037B (en) 2021-12-31 2021-12-31 Application starting method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114528037A CN114528037A (en) 2022-05-24
CN114528037B true CN114528037B (en) 2024-03-12

Family

ID=81621789

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111661690.1A Active CN114528037B (en) 2021-12-31 2021-12-31 Application starting method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114528037B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6141698A (en) * 1997-01-29 2000-10-31 Network Commerce Inc. Method and system for injecting new code into existing application code
CN103460217A (en) * 2011-01-14 2013-12-18 威步系统股份公司 Method for protecting an application program and related computer program product
CN108446144A (en) * 2018-03-12 2018-08-24 武汉斗鱼网络科技有限公司 A kind of application program launching method, device, terminal and storage medium
CN109445856A (en) * 2018-09-17 2019-03-08 深圳点猫科技有限公司 A kind of method and electronic equipment of the acceleration application starting based on educational system
CN111596970A (en) * 2020-05-12 2020-08-28 广州市百果园信息技术有限公司 Dynamic library delay loading method, device, equipment and storage medium
CN112559067A (en) * 2020-12-08 2021-03-26 浪潮商用机器有限公司 Dynamic library loading method and related device
CN113204377A (en) * 2020-01-31 2021-08-03 华为技术有限公司 Method and device for loading dynamic link library

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6141698A (en) * 1997-01-29 2000-10-31 Network Commerce Inc. Method and system for injecting new code into existing application code
CN103460217A (en) * 2011-01-14 2013-12-18 威步系统股份公司 Method for protecting an application program and related computer program product
CN108446144A (en) * 2018-03-12 2018-08-24 武汉斗鱼网络科技有限公司 A kind of application program launching method, device, terminal and storage medium
CN109445856A (en) * 2018-09-17 2019-03-08 深圳点猫科技有限公司 A kind of method and electronic equipment of the acceleration application starting based on educational system
CN113204377A (en) * 2020-01-31 2021-08-03 华为技术有限公司 Method and device for loading dynamic link library
CN111596970A (en) * 2020-05-12 2020-08-28 广州市百果园信息技术有限公司 Dynamic library delay loading method, device, equipment and storage medium
CN112559067A (en) * 2020-12-08 2021-03-26 浪潮商用机器有限公司 Dynamic library loading method and related device

Also Published As

Publication number Publication date
CN114528037A (en) 2022-05-24

Similar Documents

Publication Publication Date Title
CN112003893B (en) Resource downloading method and device
CN109947722B (en) Data compression method and device for application program and computer readable storage medium
CN107506496B (en) Defragmentation method, defragmentation device and computer-readable storage medium
CN114528037B (en) Application starting method and device, electronic equipment and storage medium
CN115098177B (en) Display card drive switching method and device and readable storage medium
CN113448642B (en) System file access method and device and electronic equipment
CN110457084B (en) Loading method and device
CN116126320B (en) Data processing method and device, electronic equipment and storage medium
CN112860625A (en) Data acquisition method, data storage method, device, equipment and storage medium
CN111090463A (en) Resource identification method and device and computer storage medium
CN113946346B (en) Data processing method and device, electronic equipment and storage medium
EP4068082B1 (en) Information processing method and apparatus, terminal device, and storage medium
CN111596949B (en) Method and device for developing application program
CN111625251B (en) Method and device for processing application instance
CN113934452B (en) Data processing method and device, electronic equipment and storage medium
CN107463414B (en) Application installation method and device
CN110659081B (en) File processing method and device for program object and electronic equipment
CN114020504B (en) Data processing method and device, electronic equipment and storage medium
CN112988173A (en) Method, apparatus and medium for processing system partition application
CN113467853B (en) Data processing method, apparatus, device, storage medium, and program product
CN110990073B (en) Method and device for verifying customization requirements of application program
CN108205452B (en) Software execution control method and device
CN116483436A (en) Data processing method and device, electronic equipment and storage medium
CN115658092A (en) Application program management method, device, equipment and storage medium
CN114115862A (en) Data processing method and device, electronic 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