CN112214250B - Application program component loading method and device - Google Patents

Application program component loading method and device Download PDF

Info

Publication number
CN112214250B
CN112214250B CN201910549469.3A CN201910549469A CN112214250B CN 112214250 B CN112214250 B CN 112214250B CN 201910549469 A CN201910549469 A CN 201910549469A CN 112214250 B CN112214250 B CN 112214250B
Authority
CN
China
Prior art keywords
component
loading
components
specific component
application program
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
CN201910549469.3A
Other languages
Chinese (zh)
Other versions
CN112214250A (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 Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke 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 Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201910549469.3A priority Critical patent/CN112214250B/en
Publication of CN112214250A publication Critical patent/CN112214250A/en
Application granted granted Critical
Publication of CN112214250B publication Critical patent/CN112214250B/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/44505Configuring for program initiating, e.g. using registry, configuration files

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 loading method and device of an application program component, and relates to the technical field of computers. One embodiment of the method comprises the following steps: configuring a loading path of a specific component of an application program to be a path different from a default file loading path when the application program is started; and after receiving the operation instruction of the specific component, loading the specific component into a memory according to the configured loading path for operation. The implementation of the implementation can reduce the starting time of the application program and optimize __ TEXT sections of the executable file, so that the problem of the upper limit of the executable file is solved, the original user experience is maintained, the repeated codes and the existing functional service do not need to be deleted in a time-consuming and labor-consuming manner, and the user of the low-version operating system does not need to be abandoned.

Description

Application program component loading method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for loading an application component.
Background
Today, with the rapid development of the mobile internet, a lot of iOS (an operating system) apps (application programs) are developed in increments over several years, and as the amount of traffic and code increases, the __ TEXT section (a machine code section compiled from a program code section stored in an executable file) of an executable file (a file that can be loaded and executed by an operating system) exceeds the upper limit of 60M (mega) in support of ios8.X low-version users. Because of the diversity of functions and services, application components (components are reusable and can interact with other objects) are divided into basic components and service components according to functions and services, each component is copied to an executable file in a static frame (a file format) when linked, and finally an App is formed by each service component, and the more apps with more functions and services are easier to reach the upper limit of the executable file. After the iOS8, a dynamic framework can be used in the App, an executable file cannot be copied when a dynamic library is linked, the system is loaded into a memory when running, and the starting time is influenced when the App is started by loading time.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
the existing scheme cannot realize the following points: the method has the advantages of not affecting the starting time, optimizing __ TEXT sections of executable files, maintaining the original user experience, and eliminating the existing functional service and discarding users of the low-version operating system.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for loading an application component, which can reduce the starting time of an application program, and optimize the __ TEXT section of an executable file, so as to solve the problem of the upper limit of the executable file, maintain the original user experience, and eliminate the need of time-consuming and labor-consuming de-duplication codes and existing functional services, and eliminate the need of discarding users of low-version operating systems.
To achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a loading method of an application component.
A method of loading an application component, comprising: configuring a loading path of a specific component of an application program to be a path different from a default file loading path when the application program is started; and after receiving the operation instruction of the specific component, loading the specific component into a memory according to the configured loading path for operation.
Optionally, the original component set of the application program includes a dynamic library component, and the specific component is a dynamic library component meeting a delayed loading condition in the original component set.
Optionally, the original component set of the application program includes a static library component, and the specific component is a dynamic library component obtained by converting a part of the static library components in the original component set.
Optionally, converting a portion of the static library components in the original set of components into the dynamic library components by: dividing a static library component in the original component set into a basic component, a non-modified service component and a service component to be modified according to component functions; and converting the business component to be modified into the dynamic library component through a script.
Optionally, after receiving an operation instruction for the specific component, loading the specific component into a memory according to a configured loading path for operation, including: judging whether the specific component is loaded for the first time; under the condition that the specific component is loaded for the first time, loading the specific component into a memory according to the configured loading path, if the loading is successful, generating relevant information of successful loading, and operating the specific component; otherwise, generating relevant information of loading failure, and executing an exception handling strategy, wherein the exception handling strategy comprises displaying a preset page or reloading the specific component; judging whether the last loading is successful or not under the condition that the specific component is not loaded for the first time, and if so, operating the specific component according to the related information of the last loading success; otherwise, executing the exception handling policy.
Optionally, the application is an application for an iOS system.
According to another aspect of the embodiment of the invention, a loading device of an application program component is provided.
A loading apparatus for an application component, comprising: the configuration module is used for configuring the loading path of a specific component of the application program to be different from the default file loading path when the application program is started; and the loading module is used for loading the specific component into the memory according to the configured loading path after receiving the operation instruction of the specific component so as to operate.
Optionally, the original component set of the application program includes a dynamic library component, and the specific component is a dynamic library component meeting a delayed loading condition in the original component set.
Optionally, the original component set of the application program includes a static library component, and the specific component is a dynamic library component obtained by converting a part of the static library components in the original component set.
Optionally, the method further comprises a conversion module, configured to convert a part of static library components in the original component set into the dynamic library components by: dividing a static library component in the original component set into a basic component, a non-modified service component and a service component to be modified according to component functions; and converting the business component to be modified into the dynamic library component through a script.
Optionally, the loading module is further configured to: judging whether the specific component is loaded for the first time; under the condition that the specific component is loaded for the first time, loading the specific component into a memory according to the configured loading path, if the loading is successful, generating relevant information of successful loading, and operating the specific component; otherwise, generating relevant information of loading failure, and executing an exception handling strategy, wherein the exception handling strategy comprises displaying a preset page or reloading the specific component; judging whether the last loading is successful or not under the condition that the specific component is not loaded for the first time, and if so, operating the specific component according to the related information of the last loading success; otherwise, executing the exception handling policy.
Optionally, the application is an application for an iOS system.
According to yet another aspect of an embodiment of the present invention, an electronic device is provided.
An electronic device, comprising: one or more processors; and the memory is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the loading method of the application program component provided by the invention.
According to yet another aspect of an embodiment of the present invention, a computer-readable medium is provided.
A computer readable medium having stored thereon a computer program which when executed by a processor implements the method of loading application components provided by the present invention.
One embodiment of the above invention has the following advantages or benefits: the loading path of the specific component of the application program is configured to be different from the default file loading path when the application program is started, after the running instruction of the specific component is received, the specific component is loaded into the memory according to the configured loading path so as to run, and the starting time of the application program can be reduced, wherein the specific component can be a dynamic library component obtained by converting part of static library components in the original component set of the application program, and by converting part of static library components into dynamic library components, the __ TEXT section of an executable file can be optimized, so that the problem of the upper limit of the executable file is solved.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a loading method of an application component according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a comparison of a conventional dynamic library component loading manner with a dynamic library component loading manner according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a frame directory retrofit according to an embodiment of the present invention;
FIG. 4 is a component division schematic diagram according to an embodiment of the invention;
FIG. 5 is a schematic diagram of the main modules of a loading device of an application component according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
Fig. 7 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Those skilled in the art will appreciate that embodiments of the invention may be implemented as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the following forms, namely: complete hardware, complete software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
FIG. 1 is a schematic diagram of the main steps of a loading method of an application component according to an embodiment of the present invention.
As shown in fig. 1, the loading method of the application program component in the embodiment of the invention mainly includes the following steps S101 to S102.
Step S101: the loading path of a particular component of the application is configured to be a different path than the default file loading path at application startup.
As an alternative embodiment, the original set of components of the application may include dynamic library components. The specific component may be a dynamic library component in the original set of components of the application that meets the deferred load condition.
As an alternative embodiment, the original set of components of the application program includes static library components in addition to dynamic library components. In the original component set of the application program, the dynamic library components meeting the delayed loading condition and the dynamic library components obtained by converting part of the static library components can be used as specific components.
As an alternative embodiment, the original set of components of the application may include only static library components. The specific component is a dynamic library component that results from the transformation of a portion of the static library components in the original set of components of the application.
Converting a portion of the static library components in the original set of components of the application into dynamic library components by: dividing a static library component in the original component set into a basic component, a non-modified service component and a service component to be modified according to component functions; and converting the business component to be modified into a dynamic library component through a script. The static library components can be divided according to service requirements and component functions.
In componentized development, components are typically divided into base components and business components. The business components may be static library components or dynamic library components.
The basic components, such as user behavior statistics, exception reporting, etc., and the business components may depend on different basic components according to their respective functions. Business components may not depend on each other. Business components such as home components, order components, merchandise components, and the like.
The embodiment of the invention divides service components, and specifically comprises the following steps:
a. the service component (home page component) used for the first display page is started for the App;
b. The reformable components, except non-reformable components, are left as reformable components in the business components, and the reformable components can be further divided into recommended reformable components and non-recommended reformable components according to business importance, daily access volume, page display level, business coupling and the like. Retrofit components are not recommended such as: important pages with deeper comparison cores or page levels in the e-commerce App, for example, payment service pages may be divided into components that are not recommended to be modified, and such components may not be modified so as to avoid loading anomalies after modification.
The proposed reform component belongs to a service component to be reform, the non-reformable service component belongs to a non-reformable service component, whether the non-proposed reform component reforms the service component according to service requirements, if the non-proposed reform component reforms the service component, the non-proposed reform component belongs to the service component to be reform, otherwise, the non-proposed reform component belongs to the non-reform service component.
In addition, the modified dynamic library component can also be used as the basis for the current component division, for example, the business component with certain functions is modified into a lazy loading dynamic library component, and then the component of the current application program with the same or similar functions is divided into the recommended modification component. The reason or the scene of the loading failure can also be used as the basis for dividing the components, for example, after some components are changed into lazy loading dynamic library components, loading exception occurs, and the components can be divided into components which cannot be changed or are not recommended to be changed. As another example, where certain components are not typically rebuilt in certain business scenarios, such components may be classified as non-rebuilt or non-recommended components.
In the above-mentioned divided service components, if a certain service component to be modified is a dynamic library component, the service component to be modified is a dynamic library component meeting the delayed loading condition.
Step S102: after receiving the running instruction of the specific component, the specific component is loaded into the memory according to the configured loading path so as to run.
Specifically, whether a specific component is loaded for the first time is judged; under the condition that the specific component is loaded for the first time, loading the specific component into the memory according to a configured loading path, if the loading is successful, generating relevant information of successful loading, and running the specific component; otherwise, generating relevant information of loading failure, and executing an exception handling strategy, wherein the exception handling strategy comprises displaying a preset page or reloading a specific component; judging whether the last loading is successful or not under the condition that the specific component is not loaded for the first time, and if so, operating the specific component according to the related information of the last loading success; otherwise, executing the exception handling strategy.
The pseudo code is as follows:
The dynamic library in the pseudo code refers to a specific component, and the dynamic library lazy loading path is the loading path of the configuration of the specific component. By adding buried points, under the condition of successful loading, data acquisition is performed, loading time, a loaded dynamic library and the like are obtained, the acquired data are business data, such as business names, usage scenes and the like, the loaded dynamic library is obtained to obtain the component names of specific components, and relevant information of successful loading is generated according to the business data, the loading time and the component names. In the case of loading failure, data (i.e., service data) is collected, loading time, a loaded dynamic library (component name), failure reasons and the like are obtained, and relevant information of loading failure is generated according to the service data, the component name, the failure reasons, the loading time and the like. The degradation scheme of each service is shown, for example, a last page is returned or a preset H5 page is loaded, or the opportunity for reloading the dynamic library again is given to belong to an exception handling policy.
The information about successful loading and the information about failed loading can be uploaded to a server, and then data analysis is performed by combining the dynamic library file size to determine corresponding coping strategies or provide references for subsequent component loading strategies. The coping strategy can enter an H5 interface or reload a failed page according to the loading failure scene, and a user can select an abnormal processing scheme suitable for the self business scene according to the requirement of the self business scene.
The application (App) of the embodiment of the present invention is an application for iOS systems.
The method and the device can automatically load the files in the default file loading path when the application program is started, and the loading path of the dynamic library component is configured to be different from the default file loading path when the application program is started, so that the embedded dynamic library component is not loaded when the application program is started, but is loaded to the memory according to the configured loading path when the function of the dynamic library component is used for running. The embodiment of the invention changes the loading mode of the existing embedded dynamic library component, and realizes lazy loading (namely delayed loading) of the dynamic library component when the App is started, thereby not increasing the starting time of the App.
For an App using a static library component, such as an App of a low-version operating system, because the static library component uses the same file format (frame file format) as the dynamic library component, and the static library component is transformed into the dynamic library component, the input cost is low.
FIG. 2 is a schematic diagram illustrating a comparison of a conventional dynamic library component loading method and a dynamic library component loading method according to an embodiment of the present invention. The existing loading mode of the dynamic library component is shown in the left side of fig. 2, the dynamic library component (dynamic library for short) is loaded into the memory when the App is started, and the corresponding dynamic library is loaded in the memory when the function of the dynamic library component is used. The loading mode of the dynamic library component in the embodiment of the invention is shown on the right side of fig. 2, and the dynamic library component is not loaded into the memory when the App is started, but is loaded into the memory to run when the function of the dynamic library component is used.
The default access path of the application program loading picture is not only app_name/under the main resource file package, after the loading path of the dynamic library component is modified, the dynamic library is changed into app_name/Frameworks/lazy loading dynamic library/, and the previous picture and other resources cannot be accessed through codes, so that the resource file stored under the original Framework directory is split, the resource picture can be managed continuously by xcassets (an image resource management tool of the iOS) and the original access resource file mode is not modified, and the splitting work is realized by adding the configuration capable of integrating the splitting dynamic library into the visualization tool, so that the manpower investment is reduced. A frame directory modification schematic diagram of the embodiment of the invention is shown in fig. 3, and a modified frame directory is a code part of a dynamic library component, and a resource file is split.
An App can have many components, and the number of the App (App with large code amount and large installation package) can be up to hundreds of components. FIG. 4 is a component division schematic diagram according to an embodiment of the present invention. Cocoapods in FIG. 4 is the most common class library management tool for iOS, and in FIG. 4, remodelable a represents remodelable component a, non-remodelable a represents non-remodelable component a, and the same applies. The component call middle layer is used for uniformly processing lazy loading logic, for example, the non-reformable component A calls the reformable component C through the component call middle layer (called middle layer for short), and processing logic of successful loading and failed loading of the reformable component C is realized in the component call middle layer, and the processing logic of successful loading and failed loading is described in detail above and is not repeated here.
The embodiment of the invention can be embedded into the ipa by using a dynamic library after the iOS platform is in the iOS8, optimize the size of __ TEXT sections of executable files in a lazy loading mode, change the existing dynamic library loading mode and optimize the starting time.
FIG. 5 is a schematic diagram of the main modules of a loading device for application components according to an embodiment of the present invention.
The loading device 500 of the application program component according to the embodiment of the present invention mainly includes: a configuration module 501 and a loading module 502.
A configuration module 501 is configured to configure a loading path of a specific component of an application program to be a different path from a default file loading path at the start of the application program.
As an alternative embodiment, the original set of components of the application may include dynamic library components. The specific component may be a dynamic library component in the original set of components of the application that meets the deferred load condition.
As an alternative embodiment, the original set of components of the application program includes static library components in addition to dynamic library components. In the original component set of the application program, the dynamic library components meeting the delayed loading condition and the dynamic library components obtained by converting part of the static library components can be used as specific components.
As an alternative embodiment, the original set of components of the application may include only static library components. The specific component is a dynamic library component that results from the transformation of a portion of the static library components in the original set of components of the application.
The loading device 500 of the application component may further include a conversion module configured to convert a part of the static library components in the original component set into dynamic library components by: dividing a static library component in an original component set into a basic component, a non-modified service component and a service component to be modified according to component functions; and converting the business component to be modified into a dynamic library component through a script.
And the loading module 502 is used for loading the specific component into the memory according to the configured loading path for operation after receiving the operation instruction of the specific component.
The loading module 503 is specifically configured to: judging whether the specific component is loaded for the first time; under the condition that the specific component is loaded for the first time, loading the specific component into a memory according to the configured loading path, if the loading is successful, generating relevant information of successful loading, and operating the specific component; otherwise, generating relevant information of loading failure, and executing an exception handling strategy, wherein the exception handling strategy comprises displaying a preset page or reloading the specific component; judging whether the last loading is successful or not under the condition that the specific component is not loaded for the first time, and if so, operating the specific component according to the related information of the last loading success; otherwise, executing the exception handling policy.
The application program of the embodiment of the invention is an application program for an iOS system.
In addition, the implementation of the loading device of the application component in the embodiment of the present invention is already described in detail in the loading method of the application component, so the description is not repeated here.
Fig. 6 illustrates an exemplary system architecture 600 of a loading method of an application component or a loading device of an application component to which embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 is used as a medium to provide communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 605 via the network 604 using the terminal devices 601, 602, 603 to receive or send messages, etc. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 601, 602, 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using terminal devices 601, 602, 603. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that, the loading method of the application program component provided in the embodiment of the present invention is generally executed by the server 605, and accordingly, the loading device of the application program component is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, there is illustrated a schematic diagram of a computer system 700 suitable for use in implementing a terminal device or server in accordance with an embodiment of the present application. The terminal device or server shown in fig. 7 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, ROM 702, and RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
In particular, according to the disclosed embodiments of the application, the processes described above with reference to the main step schematic diagrams may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the main step schematic. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 701.
The computer readable medium shown in the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The primary step diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the main step diagrams or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or main step diagrams, and combinations of blocks in the block diagrams or main step diagrams, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes a configuration module and a loading module. The names of these modules do not constitute limitations on the module itself in some cases, and for example, a configuration module may also be described as "a module for configuring a loading path of a specific component of an application program to a path different from a file loading path defaulted at the time of application program startup".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: configuring a loading path of a specific component of an application program to be a path different from a default file loading path when the application program is started; and after receiving the operation instruction of the specific component, loading the specific component into a memory according to the configured loading path for operation.
According to the technical scheme of the embodiment of the invention, the loading path of the specific component of the application program is configured to be different from the default file loading path when the application program is started, after the running instruction of the specific component is received, the specific component is loaded into the memory according to the configured loading path so as to run, so that the starting time of the application program can be reduced, wherein the specific component can be a dynamic library component obtained by converting part of static library components in the original component set of the application program, and the __ TEXT section of an executable file can be optimized by converting part of static library components into the dynamic library component, so that the problem of the upper limit of the executable file is solved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (12)

1. A method for loading an application component, comprising:
Configuring a loading path of a specific component of an application program to be a path different from a default file loading path when the application program is started; the original assembly set of the application program comprises static library assemblies, and the specific assemblies are dynamic library assemblies obtained by converting part of the static library assemblies in the original assembly set;
and after receiving the operation instruction of the specific component, loading the specific component into a memory according to the configured loading path for operation.
2. The method of claim 1, wherein the original set of components of the application program includes dynamic library components, the particular component being a dynamic library component of the original set of components that meets a lazy load condition.
3. The method of claim 1, wherein a portion of the static library components in the original set of components are converted to the dynamic library components by:
dividing a static library component in the original component set into a basic component, a non-modified service component and a service component to be modified according to component functions;
And converting the business component to be modified into the dynamic library component through a script.
4. The method of claim 1, wherein the step of loading the particular component into memory for execution following a configured load path upon receipt of an execution instruction for the particular component comprises:
Judging whether the specific component is loaded for the first time;
under the condition that the specific component is loaded for the first time, loading the specific component into a memory according to the configured loading path, if the loading is successful, generating relevant information of successful loading, and operating the specific component; otherwise, generating relevant information of loading failure, and executing an exception handling strategy, wherein the exception handling strategy comprises displaying a preset page or reloading the specific component;
Judging whether the last loading is successful or not under the condition that the specific component is not loaded for the first time, and if so, operating the specific component according to the related information of the last loading success; otherwise, executing the exception handling policy.
5. The method of claim 1, wherein the application is an application for an iOS system.
6. A loading apparatus for an application component, comprising:
the configuration module is used for configuring the loading path of a specific component of the application program to be different from the default file loading path when the application program is started; the original assembly set of the application program comprises static library assemblies, and the specific assemblies are dynamic library assemblies obtained by converting part of the static library assemblies in the original assembly set;
And the loading module is used for loading the specific component into the memory according to the configured loading path after receiving the operation instruction of the specific component so as to operate.
7. The apparatus of claim 6, wherein the original set of components of the application program comprises dynamic library components, the particular component being a dynamic library component in the original set of components that meets a lazy load condition.
8. The apparatus of claim 6, further comprising a translation module to translate a portion of the static library components in the original set of components into the dynamic library components by:
dividing a static library component in the original component set into a basic component, a non-modified service component and a service component to be modified according to component functions;
And converting the business component to be modified into the dynamic library component through a script.
9. The apparatus of claim 6, wherein the loading module is further to:
Judging whether the specific component is loaded for the first time;
under the condition that the specific component is loaded for the first time, loading the specific component into a memory according to the configured loading path, if the loading is successful, generating relevant information of successful loading, and operating the specific component; otherwise, generating relevant information of loading failure, and executing an exception handling strategy, wherein the exception handling strategy comprises displaying a preset page or reloading the specific component;
Judging whether the last loading is successful or not under the condition that the specific component is not loaded for the first time, and if so, operating the specific component according to the related information of the last loading success; otherwise, executing the exception handling policy.
10. The apparatus of claim 6, wherein the application is an application for an iOS system.
11. An electronic 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 method of any of claims 1-5.
12. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-5.
CN201910549469.3A 2019-06-24 2019-06-24 Application program component loading method and device Active CN112214250B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910549469.3A CN112214250B (en) 2019-06-24 2019-06-24 Application program component loading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910549469.3A CN112214250B (en) 2019-06-24 2019-06-24 Application program component loading method and device

Publications (2)

Publication Number Publication Date
CN112214250A CN112214250A (en) 2021-01-12
CN112214250B true CN112214250B (en) 2024-05-17

Family

ID=74047038

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910549469.3A Active CN112214250B (en) 2019-06-24 2019-06-24 Application program component loading method and device

Country Status (1)

Country Link
CN (1) CN112214250B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051005B (en) * 2021-03-30 2022-11-22 联想(北京)有限公司 Loading method and device
CN113127000B (en) * 2021-04-23 2024-05-28 北京字节跳动网络技术有限公司 Compiling method, compiling device, compiling equipment and compiling storage medium for application program component
CN113703743B (en) * 2021-08-30 2023-12-26 贝壳找房(北京)科技有限公司 Page configuration method and device, page rendering method, client and server

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541598A (en) * 2011-12-26 2012-07-04 深圳联友科技有限公司 Method and system for dynamically loading component
CN103677948A (en) * 2014-01-08 2014-03-26 从兴技术有限公司 Starter and start method
CN104102500A (en) * 2013-04-03 2014-10-15 腾讯科技(深圳)有限公司 Method for starting process of application and computer system
CN104408367A (en) * 2014-11-28 2015-03-11 北京奇虎科技有限公司 Application program configuration method and device
KR101503785B1 (en) * 2013-10-10 2015-03-18 (주)잉카엔트웍스 Method And Apparatus For Protecting Dynamic Library
CN104462880A (en) * 2014-11-28 2015-03-25 北京奇虎科技有限公司 Application program packing configuration method and device
CN105893094A (en) * 2016-03-31 2016-08-24 百度在线网络技术(北京)有限公司 Achieving method and device for application program plug-in
CN108229107A (en) * 2016-12-21 2018-06-29 武汉安天信息技术有限责任公司 A kind of hulling method and container of Android platform application program
CN109299587A (en) * 2018-09-11 2019-02-01 平安科技(深圳)有限公司 Algorithm protection method, device, equipment and storage medium based on go language

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7536683B2 (en) * 1999-01-15 2009-05-19 Adobe Systems Incorporated Method of dynamically appending a library to an actively running program

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541598A (en) * 2011-12-26 2012-07-04 深圳联友科技有限公司 Method and system for dynamically loading component
CN104102500A (en) * 2013-04-03 2014-10-15 腾讯科技(深圳)有限公司 Method for starting process of application and computer system
KR101503785B1 (en) * 2013-10-10 2015-03-18 (주)잉카엔트웍스 Method And Apparatus For Protecting Dynamic Library
CN103677948A (en) * 2014-01-08 2014-03-26 从兴技术有限公司 Starter and start method
CN104408367A (en) * 2014-11-28 2015-03-11 北京奇虎科技有限公司 Application program configuration method and device
CN104462880A (en) * 2014-11-28 2015-03-25 北京奇虎科技有限公司 Application program packing configuration method and device
CN105893094A (en) * 2016-03-31 2016-08-24 百度在线网络技术(北京)有限公司 Achieving method and device for application program plug-in
CN108229107A (en) * 2016-12-21 2018-06-29 武汉安天信息技术有限责任公司 A kind of hulling method and container of Android platform application program
CN109299587A (en) * 2018-09-11 2019-02-01 平安科技(深圳)有限公司 Algorithm protection method, device, equipment and storage medium based on go language

Also Published As

Publication number Publication date
CN112214250A (en) 2021-01-12

Similar Documents

Publication Publication Date Title
CN112214250B (en) Application program component loading method and device
JP2019520624A (en) Page component dynamic layout
CN111580879A (en) Applet running method and device, electronic equipment and computer storage medium
CN103530160A (en) Page loading method and device
CN113076153B (en) Interface calling method and device
CN104572054A (en) Capability calling method and capability calling equipment
CN110888639A (en) Business code compiling and packaging method and device
CN110928571A (en) Business program development method and device
CN105187562A (en) System and method for operating remote file
CN113138768B (en) Application package generation method and device, electronic equipment and readable storage medium
CN107678755B (en) Installation package packaging method and device, electronic equipment and computer readable medium
CN110795328A (en) Interface testing method and device
CN110647327B (en) Method and device for dynamic control of user interface based on card
CN111953718B (en) Page debugging method and device
CN112149392A (en) Rich text editing method and device
CN109408057B (en) Method, device, medium and computing equipment for automatically generating codes
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN113779122B (en) Method and device for exporting data
CN113760274B (en) Front-end assembly logic injection method and device
CN113760487B (en) Service processing method and device
CN114090070A (en) Application program installation package file processing method and electronic equipment
CN110909269B (en) Log reporting method and device
CN115702565A (en) Improved cross component intra prediction mode
CN113760248A (en) Method and device for generating application program
CN111796878A (en) Resource splitting and loading method and device applied to single-page application

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