Disclosure of Invention
In view of the above, the embodiment of the invention provides a method and a device for optimizing the starting of an application program, which can avoid the problem of long starting time caused by simultaneous loading of all view controllers in the prior art, reduce the starting time of the application program and promote user experience.
In order to achieve the above object, according to a first aspect of an embodiment of the present invention, there is provided a startup optimization method for an application.
The method for optimizing the starting of the application program comprises the steps of obtaining at least one view controller corresponding to an application program to be started according to an application program starting request, loading and intercepting the at least one view controller, loading and preprocessing the at least one view controller by using a loading authority file corresponding to the application program to be started, and loading page elements corresponding to the at least one view controller according to a loading preprocessing result.
Optionally, the loading interception of the at least one view controller includes invoking a preset code instead of invoking a loading code corresponding to the at least one view controller when the at least one view controller is loaded, so as to complete the loading interception of the at least one view controller.
Optionally, the loading preprocessing of the at least one view controller by using the loading authority file corresponding to the application program to be started includes screening the view controller needing to be loaded in a delayed manner and the view controller needing to be directly loaded from the at least one view controller according to the loading authority file corresponding to the application program to be started, and acquiring the delayed loading time of the view controller needing to be loaded in a delayed manner.
Optionally, the loading the page element corresponding to the at least one view controller according to the loading preprocessing result includes directly calling a loading code corresponding to the view controller to be directly loaded to complete loading of the page element corresponding to the view controller to be directly loaded, and calling a loading code corresponding to the view controller to be delayed loaded according to the delayed loading time of the view controller to be delayed loaded to complete loading of the page element corresponding to the view controller to be delayed loaded.
Optionally, before the loading pretreatment is performed on the at least one view controller by using the loading permission file corresponding to the application program to be started, the method further comprises the steps of loading the loading permission file corresponding to the application program to be started into a memory, and after loading the page element corresponding to the at least one view controller according to the loading pretreatment result, removing the loading permission file corresponding to the application program to be started from the memory.
Optionally, before the loading preprocessing is performed on the at least one view controller by using the loading authority file corresponding to the application program to be started, the method further comprises creating the loading authority file corresponding to the application program to be started in advance.
In order to achieve the above object, according to a second aspect of the embodiments of the present invention, there is provided a start-up optimization apparatus for an application.
The device for optimizing the starting of the application program comprises an acquisition module, a processing module and a loading module, wherein the acquisition module is used for acquiring at least one view controller corresponding to the application program to be started according to an application program starting request, the processing module is used for loading and intercepting the at least one view controller, loading pretreatment is carried out on the at least one view controller by utilizing a loading authority file corresponding to the application program to be started, and the loading module is used for loading page elements corresponding to the at least one view controller according to a loading pretreatment result.
Optionally, the processing module is further configured to call a preset code to replace a loading code corresponding to the at least one view controller when the at least one view controller is loaded, so as to complete loading interception of the at least one view controller.
Optionally, the processing module is further configured to obtain, from the at least one view controller, a view controller to be delayed for loading and a view controller to be directly loaded from the at least one view controller according to a loading permission file corresponding to the application program to be started, and obtain a delayed loading time of the view controller to be delayed for loading.
Optionally, the loading module is further configured to directly call a loading code corresponding to the view controller to be directly loaded to complete loading of a page element corresponding to the view controller to be directly loaded, and call the loading code corresponding to the view controller to be delayed loaded according to the delayed loading time of the view controller to be delayed loaded to complete loading of the page element corresponding to the view controller to be delayed loaded.
Optionally, the processing module is further configured to load the loading right file corresponding to the application program to be started into the memory, and remove the loading right file corresponding to the application program to be started from the memory.
Optionally, the processing module is further configured to create a loading authority file corresponding to the application program to be started in advance.
To achieve the above object, according to a third aspect of the embodiments of the present invention, there is provided an electronic apparatus.
The electronic equipment comprises one or more processors and a storage device, wherein the storage device 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 realize the starting optimization method of the application program.
To achieve the above object, according to a fourth aspect of the embodiments of the present invention, there is provided a computer-readable medium.
A computer readable medium of an embodiment of the present invention has stored thereon a computer program which, when executed by a processor, implements a method for start-up optimization of an application of an embodiment of the present invention.
The embodiment of the invention has the advantages that the method has the advantages that each view controller of the application program to be started is loaded and intercepted, and then each view controller is loaded and preprocessed by the aid of the pre-created loading authority file, so that each view controller can be loaded according to a loading preprocessing result, the effect of time-sharing loading of each view controller is achieved, the problem of long starting time caused by simultaneous loading of all view controllers in the prior art is avoided, the starting time of the application program is shortened, and user experience is improved.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
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.
At present, application program development is more focused on user experience, mainly on using application programs which enable users to smooth flow and on enabling users to quickly start the application programs. The smoothness and smoothness during use depend on many factors, such as network, picture loading, etc., which require a developer to write robust codes, so the starting speed of an application is an important criterion for evaluating whether an application is good or bad, for example, if an application can complete starting within 0.25s, it is important to say that the starting performance of the application is good, and how to optimize the starting speed of the application.
The starting time of the application program refers to the time from when the user clicks on the icon of the application program to when the application program is completely displayed. The factors for determining the starting speed of the application program are the size of the executable file and the optimization of the completion of the whole display of the page after the executable file is loaded. The existing scheme mainly optimizes the executable files, but for the application program, the amount of codes which can be deleted is small, most of service codes are already optimized, and the large amount of service requirements also determine that the executable files of the application program cannot be reduced to an ideal range.
In order to solve the above problems, the embodiments of the present invention provide a method for optimizing the start of an application, which can reduce the start time of the application and give a user a feeling of one second start. Fig. 1 is a schematic diagram of main steps of a start-up optimization method of an application according to an embodiment of the present invention. As shown in fig. 1, the main steps of the method for optimizing the start of the application program according to the embodiment of the present invention may include:
step S101, according to an application program starting request, at least one view controller corresponding to an application program to be started is obtained;
Step S102, loading interception is carried out on at least one view controller, and loading preprocessing is carried out on the at least one view controller by utilizing a loading authority file corresponding to an application program to be started;
step S103, loading at least one page element corresponding to the view controller according to the loading preprocessing result.
In the method for optimizing the starting of the application program in the embodiment of the invention, in the process of receiving the application program starting request, the application program to be started is determined, for example, if a user clicks an icon of a certain application program, the application program to be started can be determined as the application program. After determining the application program to be started, at least one view controller corresponding to the application program to be started can be obtained. The view controller refers to a controller capable of displaying pages, an application program can comprise a plurality of pages, each page is equivalent to a controller, and since the application program is started and is equivalent to the page corresponding to the display application program, the view controller corresponding to the application program can be obtained after the application program to be started is determined.
In the starting method of the application program in the prior art, after the view controller of the application program to be started is acquired, the view controller is directly loaded, so that the situation that a plurality of view controllers need to be loaded simultaneously occurs, but a user opens an application program, and one page of the application program is presented to the user, so that other pages do not need to be loaded for the first time, that is, one view controller of the application program is loaded, and all view controllers of the application program do not need to be loaded. In summary, in the prior art, loading all view controllers corresponding to the application program at the same time increases the starting time of the application program, so in step S102, the acquired at least one view controller corresponding to the application program to be started is loaded and intercepted, and then the loading preprocessing is performed on the at least one view controller by using the loading authority file corresponding to the application program to be started. In the embodiment of the invention, the Hook function can be utilized to intercept and load, the Hook function is called as a Hook function, the Hook program captures the message before the system does not call the function, the Hook function obtains control right first, and the Hook function can process (change) the execution behavior of the function and can forcedly finish the transfer of the message. In short, the program of the system is pulled out to become the code segment executed by the user. In the embodiment of the invention, before loading at least one view controller, the at least one view controller is loaded and intercepted by using the Hook technology, namely, before calling the page loading code of the view controller, the Hook program captures the message, the Hook function can obtain the control right, and the Hook function can process (change) the loading behavior of the view controller, and at this time, the loading preprocessing can be performed on the at least one view controller by using the loading authority file corresponding to the application program to be started. The loading authority file refers to an authority control file of the view controller, and may include loading time of the view controller.
After the view controllers are subjected to loading preprocessing, namely the loading time of each view controller corresponding to the application program to be started is obtained, page elements corresponding to each view controller can be loaded according to the loading time of each view controller, so that the starting of the application program to be started is completed.
For example, for ios system, the code executing process dynamically decides the call of the function through the running time in the running process of the application program, so that the dynamic characteristic of the application program development language can be utilized to dynamically change the corresponding relation (Method Swizzle) between SEL (method number) and IMP (method implementation), thus intercepting the necessary flow of loading the view controller in the starting process of the application program, respectively setting the loading time of the view controller, and carrying out delayed loading on the view controller which is not immediately loaded, namely carrying out delayed display on the page which does not need to be immediately displayed to the user, thereby realizing that only the page which needs to be immediately displayed is loaded in the starting process of the application program, and other background pages are delayed to be loaded, and the starting of the application program can be optimized by the existing code without any modification.
In the method for optimizing the starting of the application program, which is disclosed by the embodiment of the invention, each view controller of the application program to be started is loaded and intercepted by using the Hook technology, and then each view controller is loaded and preprocessed by using the pre-created loading authority file, so that each view controller can be loaded according to the loading preprocessing result, the effect of time-sharing loading of each view controller is achieved, the problem of long starting time caused by simultaneous loading of all view controllers in the prior art is avoided, the starting time of the application program is reduced, and the user experience is improved.
In the method for optimizing the starting of the application program, which is disclosed by the embodiment of the invention, the loading interception of the video controller is an important part. The method for intercepting the loading of the at least one view controller can comprise the steps of obtaining control authority of a life cycle method corresponding to the at least one view controller by using Hook technology so as to complete the intercepting of the loading of the at least one view controller. Each view controller represents a page so that a page has its life cycle, e.g., creation, completion, disappearance, etc. of a view. According to the embodiment of the invention, the control authority of the life cycle method of each view controller can be controlled by using the Hook technology, so that the loading interception of each view controller can be completed.
In the embodiment of the invention, the control authority of the lifecycle method corresponding to the at least one view controller is obtained by using the Hook technology, and the method can comprise the step of calling a preset code to replace a loading code corresponding to the at least one view controller when the at least one view controller is loaded. That is to say, the preset code is used for replacing the loading code corresponding to the at least one view controller, so that when the loading code corresponding to the at least one view controller is called, the preset code is called for replacement. For example, when the Hook technology is used to control the loading of the view controller, the loadView method and the viewDidLoad method are called, so that the correct function is not called when the page corresponding to the view controller is loaded, but the preset code is called, and thus, special processing can be performed on the view controller which does not need to be immediately displayed, namely, loading preprocessing is performed on the view controller.
The loadView method is called when the view controller starts loading, and is mainly used for creating views managed by the controller, but if any other initialization operation is to be performed on the views, the method should be placed in the viewDidLoad method, and the method is not directly called, and only when the view controller requests the corresponding view attribute and cannot acquire the view object (self. View=nil), the method is called to load or create the corresponding view. Typically, during the loading of a view, if the view controller has an associated nib file, the method will load the view directly from the nib file. If the view controller does not have an associated nib file, the method creates a blank object. The viewDidLoad method is called after the view creation is completed and before the screen appears, i.e. the view controller loads its view hierarchy into memory, whether it is loaded from the nib file or using code in the loadView method, and only once in a lifecycle, and can also be used to perform the view controller-related one-time initialization operation, but without adding any initialization information about the view geometry in the method. This is because when viewDidLoad is invoked, the view controller has not yet been shown in the interface, the boundaries of the view have not yet been determined, and if it is made to run on a different device, or in a different place, or rotated, etc., it may not appear in a predetermined location when it is presented on the screen.
In the method for optimizing the starting of the application program, after the video controller is loaded and intercepted, the video controller can be loaded and preprocessed, which is an important part of the method for optimizing the starting of the application program. Therefore, before the loading preprocessing is performed on at least one view controller by using the loading authority file corresponding to the application program to be started, the loading authority file corresponding to the application program to be started can be created in advance. The created loading authority file is used for describing which view controllers need special processing, namely, describing which view controllers need delayed loading, so that which view controllers need immediate loading can be judged according to the loading authority file, that is, pages needing immediate display are directly determined by using the loading authority file after a starting request of an application program to be started is received. In addition, the loading authority file of the embodiment of the invention can be a json file, namely a lightweight data exchange and storage format.
The loading authority file of the embodiment of the invention can record the names of the view controllers needing special processing, namely the names of the view controllers needing delayed loading. In addition, in the embodiment of the invention, the page corresponding to the view controller which needs to be directly loaded can be displayed to the user after the application program is started by default. In general, the first page of the application program needs to be displayed immediately, and other pages can be loaded in a delayed manner, or of course, other pages of the application program need to be displayed immediately, and the first page can be set according to practical situations.
As a further reference embodiment of the present invention, the loading preprocessing for at least one view controller by using the loading authority file corresponding to the application to be started may include screening the view controller needing to be loaded with delay and the view controller needing to be loaded directly from at least one view controller according to the loading authority file corresponding to the application to be started, and obtaining the delay loading time of the view controller needing to be loaded with delay. Considering that not all view controllers need to be loaded in a delayed manner, the names of the view controllers needing to be loaded in a delayed manner are recorded in the loading authority file, so that the loading preprocessing in the embodiment of the invention can be to acquire the view controllers needing to be loaded in a delayed manner in at least one view controller by utilizing the loading authority file, so that the rest view controllers needing to be loaded directly are the view controllers needing to be loaded directly, and the loading time of the view controllers needing to be loaded in a delayed manner is required to be acquired. Assuming that the view controller of the application program a to be started has names of A1, A2, A3 and A4, and the names of A2, A3 and A4 exist in the loading authority file corresponding to a, it is stated that A2, A3 and A4 need to be loaded with delay, A1 can be directly loaded, and the time that A2, A3 and A4 need to be loaded with delay is acquired, for example, A2 is loaded after 0.5s, A3 is loaded after 0.8s, and A4 is loaded after 0.3 s.
In the embodiment of the invention, after loading preprocessing is performed, page elements corresponding to at least one view controller can be loaded according to a loading preprocessing result, and the method is concretely realized by directly calling loading codes corresponding to the view controllers which need to be directly loaded in the at least one view controller to finish loading the page elements corresponding to the view controllers which need to be directly loaded, and calling loading codes corresponding to the view controllers which need to be delayed to finish loading the page elements corresponding to the view controllers which need to be delayed to be loaded according to the delayed loading time of the view controllers which need to be delayed to be loaded.
For the view controllers needing to be directly loaded, loading codes corresponding to the view controllers can be directly loaded, so that loading of page elements can be completed, namely, after a starting request of an application program is received, namely, after a user clicks an icon of the application program, the view controllers needing to be directly loaded can be immediately loaded, and pages corresponding to the view controllers needing to be directly loaded are directly displayed to the user.
For the view controllers needing to be loaded in a delayed manner, loading codes of the view controllers needing to be loaded in a delayed manner can be loaded according to the delayed loading time, so that loading of page elements can be completed, namely, after a starting request of an application program is received, namely, after a user clicks an icon of the application program, the view controllers needing to be loaded in a delayed manner are loaded according to the delayed loading time, and pages corresponding to the view controllers needing to be loaded in a delayed manner can be directly displayed to the user.
For example, in the method after Hook replacement, it is determined whether the current view controller is in the loading authority file, if not, the original loading method viewDidLoad or loadView method is directly called, if so, a delay operation is performed, and after the delay, the main thread is asynchronously returned to call the original method.
It should be noted that, before the loading authority file corresponding to the application program to be started is utilized to perform loading pretreatment on at least one view controller, the method for optimizing the starting of the application program according to the embodiment of the invention further comprises the steps of loading the loading authority file corresponding to the application program to be started into a memory, correspondingly, after loading the page element corresponding to the at least one view controller according to the loading pretreatment result, moving the loading authority file corresponding to the application program to be started out of the memory. After the application program finishes loading, the corresponding loading authority file is moved out of the memory, and can be normally loaded when other view controllers with the same name are created. For example, in the loading authority file, A2 of the view controller of the application program a to be started needs to be removed from the memory after the loading of A2 is completed, so that when the view controller named as A2 is loaded, the view controller can be loaded normally and cannot be loaded in a delayed manner.
Fig. 2 is a schematic diagram of the main flow of a start-up optimization method of an application according to an embodiment of the present invention. As shown in fig. 2, the main flow of the method for optimizing the start of the application program according to the embodiment of the present invention may include:
Step S201, according to an application program starting request, at least one view controller corresponding to an application program to be started is obtained;
step S202, when at least one view controller is loaded, calling a preset code to replace a loading code corresponding to the at least one view controller so as to complete loading interception of the at least one view controller;
step S203, a loading authority file corresponding to the application program to be started is created in advance, and the loading authority file corresponding to the application program to be started is loaded into a memory;
Step S204, screening out a view controller needing to be loaded in a delayed manner and a view controller needing to be loaded directly from at least one view controller according to a loading authority file corresponding to an application program to be started, and acquiring the delayed loading time of the view controller needing to be loaded in a delayed manner;
Step S205, directly calling the loading codes corresponding to the view controllers needing to be directly loaded in at least one view controller, and calling the loading codes corresponding to the view controllers needing to be delayed to be loaded according to the delayed loading time of the view controllers needing to be delayed to finish the loading of page elements corresponding to the view controllers;
step S206, the loading authority files corresponding to the application programs to be started are moved out of the memory.
For ease of understanding, the method of starting the application of the prior art will be described in comparison with the method of starting the application of the present invention, where the page of the application is composed of four parts of home page, category, shopping cart and my.
(1) In the existing starting method of the application program, four pages of a home page, a classification, a shopping cart and my are initialized immediately after being started, a plurality of network requests are available at the same time, and a plurality of data processes are performed after the network returns, so that the starting cannot be completed quickly.
(2) The method for starting the application program comprises the steps of recording the page to be immediately displayed, storing the page by writing files or writing codes (represented by data D), loading display information of the page into a memory in the process of starting the application program, loading and requesting a network for each page (such as a first page, a classification, a shopping cart and My) by a normal process after the application program is started, calling a pre-written code because a Hook is carried out on a life cycle method of the page, judging whether the page is required to be immediately displayed or not through the data D, stopping the process if the page is not required, and carrying out post-processing after delay, thereby achieving the purposes of saving initialization time and accelerating the starting.
(3) FIG. 3 is a loading schematic diagram of a view controller according to an embodiment of the invention. As shown in fig. 3, the Tar Bar view controller manages 4 view controllers in the form of an array, which are respectively a home page, a category, a shopping cart and my, and it can also be seen that the home page is directly displayed to a user and is therefore directly loaded for initialization, at this time, the other three pages are not processed, and after the processing of the home page is completed, the other three pages are processed, that is, the other three pages need to be loaded in a delayed manner, that is, the data stored in the loading authority file is the names of the category, the shopping cart and my corresponding view controllers, and in the Hook method, the recorded category, shopping cart and my corresponding view controllers need to be delayed for waiting, and then data loading is performed.
According to the starting optimization technical scheme of the application program, each view controller of the application program to be started can be loaded and intercepted, and then each view controller is subjected to loading pretreatment by utilizing the pre-established loading authority file, so that each view controller can be loaded according to the loading pretreatment result, the effect of time-sharing loading of each view controller is achieved, the problem of long starting time caused by simultaneous loading of all view controllers in the prior art is avoided, the starting time of the application program is shortened, and user experience is improved.
Fig. 4 is a schematic diagram of main modules of a start-up optimization device of an application according to an embodiment of the present invention. As shown in fig. 4, the main modules of the start-up optimization device of the application program according to the embodiment of the present invention may include an acquisition module 401, a processing module 402, and a loading module 403.
The obtaining module 401 may be configured to obtain at least one view controller corresponding to an application to be started according to an application starting request, the processing module 402 may be configured to load and intercept the at least one view controller, perform loading preprocessing on the at least one view controller by using a loading authority file corresponding to the application to be started, and the loading module 403 may be configured to load a page element corresponding to the at least one view controller according to a loading preprocessing result.
In the embodiment of the present invention, the processing module 402 may be further configured to call a preset code instead of calling a loading code corresponding to the at least one view controller when the at least one view controller performs loading, so as to complete loading interception of the at least one view controller.
In the embodiment of the present invention, the processing module 402 may be further configured to obtain, from at least one view controller, a view controller to be loaded in a delayed manner and a view controller to be loaded directly from the at least one view controller according to a loading permission file corresponding to the application to be started, and obtain a delayed loading time of the view controller to be loaded in a delayed manner.
In the embodiment of the present invention, the loading module 403 may be further configured to directly call a loading code corresponding to a view controller to be directly loaded to complete loading of a page element corresponding to the view controller to be directly loaded, and call a loading code corresponding to a view controller to be delay loaded according to a delay loading time of the view controller to be delay loaded to complete loading of a page element corresponding to the view controller to be delay loaded.
In the embodiment of the present invention, the processing module 402 may be further configured to load the loading right file corresponding to the application to be started into the memory, and remove the loading right file corresponding to the application to be started from the memory.
In the embodiment of the present invention, the processing module 402 may be further configured to pre-create a loading permission file corresponding to the application to be started.
From the above description, it can be seen that the start-up optimization device for an application program according to the embodiment of the present invention can perform loading interception on each view controller of the application program to be started, and then perform loading preprocessing on each view controller by using a pre-created loading authority file, so that each view controller can be loaded according to the loading preprocessing result, the effect of time-sharing loading of each view controller is achieved, the problem of long start-up time caused by simultaneous loading of all view controllers in the prior art is avoided, the start-up time of the application program is reduced, and the user experience is improved.
Fig. 5 illustrates an exemplary system architecture 500 of a launch optimization method of an application or a launch optimization apparatus of an application to which embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used as a medium to provide communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 505 via the network 504 using the terminal devices 501, 502, 503 to receive or send messages or the like. Various communication client applications may be installed on the terminal devices 501, 502, 503, 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).
The terminal devices 501, 502, 503 may be a variety of 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 505 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 the terminal devices 501, 502, 503. 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 method for optimizing the start-up of the application program according to the embodiment of the present invention is generally executed by the server 505, and accordingly, the device for optimizing the start-up of the application program is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, there is illustrated a schematic diagram of a computer system 600 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 6 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Connected to the I/O interface 605 are an input section 606 including a keyboard, a mouse, and the like, an output section 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like, a storage section 608 including a hard disk, and the like, and a communication section 609 including a network interface card such as a LAN card, a modem, and the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts 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 flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 601.
The computer readable medium shown in the present invention 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 a 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 invention, 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, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts 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 invention. In this regard, each block in the flowchart 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 flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, 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, which may be described as a processor comprising an acquisition module, a processing module and a loading module, for example. The names of these modules do not in any way limit the module itself, and for example, the acquisition module may also be described as "a module for acquiring at least one view controller corresponding to an application to be started according to an application start request".
As a further aspect, the invention also provides a computer readable medium which may be comprised in the device 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, and when the one or more programs are executed by the equipment, the equipment comprises at least one view controller corresponding to an application program to be started according to an application program starting request, loading interception is carried out on the at least one view controller, loading preprocessing is carried out on the at least one view controller by utilizing a loading authority file corresponding to the application program to be started, and page elements corresponding to the at least one view controller are loaded according to a loading preprocessing result.
According to the technical scheme provided by the embodiment of the invention, each view controller of the application program to be started can be loaded and intercepted, and then each view controller is loaded and preprocessed by utilizing the pre-created loading authority file, so that each view controller can be loaded according to the loading preprocessing result, the effect of time-sharing loading of each view controller is achieved, the problem of long starting time caused by simultaneous loading of all view controllers in the prior art is avoided, the starting time of the application program is shortened, and the user experience is improved.
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.