CN109375961A - Application program launching optimization method, device, computer equipment and storage medium - Google Patents
Application program launching optimization method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN109375961A CN109375961A CN201811207987.9A CN201811207987A CN109375961A CN 109375961 A CN109375961 A CN 109375961A CN 201811207987 A CN201811207987 A CN 201811207987A CN 109375961 A CN109375961 A CN 109375961A
- Authority
- CN
- China
- Prior art keywords
- function
- application program
- annexable
- default class
- classification
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 139
- 238000005457 optimization Methods 0.000 title claims abstract description 37
- 230000006870 function Effects 0.000 claims description 240
- 238000004590 computer program Methods 0.000 claims description 16
- 238000005516 engineering process Methods 0.000 description 31
- 238000010586 diagram Methods 0.000 description 12
- 230000008569 process Effects 0.000 description 7
- 230000000694 effects Effects 0.000 description 6
- 230000008859 change Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000007792 addition Methods 0.000 description 2
- 210000004556 brain Anatomy 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000001934 delay Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/48—Indexing scheme relating to G06F9/48
- G06F2209/482—Application
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/48—Indexing scheme relating to G06F9/48
- G06F2209/484—Precedence
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 application program launching optimization method, device, equipment and storage mediums, the application program defines a default class, default class is associated with multiple classifications, this method comprises: obtaining the first function in multiple classifications, wherein, there is first function in each classification, the first function before application program launching principal function for being invoked automatically load;It whether there is annexable first function according in the first function in the acquired multiple classifications of preset rules judgement;If it exists, it obtains the source code of each annexable first function and deletes annexable first function from the classification corresponding to it;Merge the source code and using combined source code as the source code of the second function of default class;Judge whether to meet preset trigger condition;And if meet preset trigger condition, automatic call loads the second function.Implement the problem of this programme can solve application program launching overlong time.
Description
Technical field
The present invention relates to the mobile application development technique field IOS more particularly to a kind of application program launching optimization methods, dress
It sets, computer equipment and storage medium.
Background technique
Currently, can be (public by apple to IOS system in the way of hook, hook in similar windows system when project operation
Take charge of the Mobile operating system of exploitation) method or the method for third party library be replaced, and then the purpose of implementation method replacement.It is existing
Have in technology, project is the purpose registering new replacement method in load () function and being replaced with implementation method.However, a large amount of
The starting time that will cause application program using load () function is elongated, because of the method replacement being written in load () function
Just be called load before application program launching main () function, largely will result in application using load () function
The starting overlong time of program occupies many time overheads of application program, greatly reduces the experience effect of user.
Summary of the invention
The embodiment of the invention provides a kind of application program launching optimization method, device, computer equipment and computers can
Read storage medium, it is intended to shorten the starting time of application program, the starting of optimization application greatly improves the experience effect of user
Fruit.
In a first aspect, the embodiment of the invention provides a kind of application program launching optimization method, the application program definition
One default class, the default class are associated with multiple classifications, which comprises obtain the first letter in the multiple classification
Number, wherein there is first function in each classification, the first function is used for before application program launching principal function
It is invoked automatically load;It is annexable according to whether there is in the first function in the acquired multiple classifications of preset rules judgement
First function;Annexable first function if it exists, the source code of each annexable first function of acquisition simultaneously will be annexable
First function is deleted from the classification corresponding to it;Merge the source code and using combined source code as the default class
Second function source code;Judge whether to meet preset trigger condition;And if meet preset trigger condition, it is automatic call plus
Carry the second function.
Second aspect, the embodiment of the invention also provides a kind of application program launchings to optimize device comprising for executing
The unit of the method for above-mentioned first aspect.
The third aspect, the embodiment of the invention also provides a kind of computer equipment, the computer equipment includes memory
And processor, computer program is stored on the memory, the processor is realized above-mentioned when executing the computer program
The method of first aspect.
Fourth aspect, it is described computer-readable to deposit the embodiment of the invention also provides a kind of computer readable storage medium
Storage media is stored with computer program, and the computer program can realize the side of above-mentioned first aspect when being executed by a processor
Method.
The embodiment of the invention provides a kind of application program launching optimization method, device, computer equipment and computers can
Read storage medium.The embodiment of the present invention can effectively overcome utilizes load () function implementation method replacement technology in the prior art
And the problem of leading to application program launching overlong time.Method of the class in load () function is replaced skill by the embodiment of the present invention
Art is changed to realize in initialize () function, delays the calling opportunity of the method replacement technology of class, utilize this delay
The mode of load advantageously reduces the waiting time of starting application program, optimizes the experience effect of user.
Detailed description of the invention
Technical solution in order to illustrate the embodiments of the present invention more clearly, below will be to needed in embodiment description
Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, general for this field
For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of application program launching optimization method provided in an embodiment of the present invention;
Fig. 2 is a kind of sub-process schematic diagram of application program launching optimization method provided in an embodiment of the present invention;
Fig. 3 is a kind of another sub-process schematic diagram of application program launching optimization method provided in an embodiment of the present invention;
Fig. 4 is the schematic block diagram that a kind of application program launching provided in an embodiment of the present invention optimizes device;
Fig. 5 is the schematic of the first judging unit that a kind of application program launching provided in an embodiment of the present invention optimizes device
Block diagram;
Fig. 6 is the schematic of the condition judgment unit that a kind of application program launching provided in an embodiment of the present invention optimizes device
Block diagram;And
Fig. 7 is a kind of schematic block diagram of computer equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, shall fall within the protection scope of the present invention.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction
Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded
Body, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this description of the invention merely for the sake of description specific embodiment
And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on
Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in description of the invention and the appended claims is
Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
Referring to Fig. 1, it is a kind of schematic flow of application program launching optimization method provided in an embodiment of the present invention
Figure.The application program launching optimization method is applied in an application program of IOS system, and it is default that the application program defines one
Class, the default class are associated with multiple classifications, and the default class is former class.As shown in Figure 1, this method may include step S110 extremely
S160。
First function in S110, the multiple classification of acquisition, wherein there is first function in each classification,
The first function before application program launching principal function for being invoked automatically load.
Wherein, the first function is load () function, there is load () function in each classification.Specifically,
The multiple classification is the method that multiple additions of the default class extend, and a default class defined in acquisition is extended multiple
Load () function in classification (Category), the classification of each extension exist and its unique corresponding load () function, institute
It states load () function and completes load and then implementation method replacement (Method before application program launching principal function
Swizzling) the purpose of technology.Wherein, the Method Swizzling technology refers to changing an already present selection
The corresponding process realized of device (Selector).
Specifically, in the case where the specific implementation source code of none class, think a method or for change system class
The realization of one method of three-party library can use Method Swizzling technology, pass through Method Swizzling technology
The replacement of the method for system class or the method for third party library may be implemented.Wherein, Method Swizzling technology is by system
The IMP of the method for the method or third party library of class is substituted for the IMP of customized method in extension classification.Specifically, expanding C
Object-Oriented Programming Language (Objective-C) in, each class has a method list (Dispatch Table), the party
The mapping that method list is used to store the name of selector corresponding to each method (Selector) and each method is realized is closed
System, specifically, this method list are used to store the name of selector corresponding to each method and a pair of with each method one
Implementation (IMP) pointer answered, the IMP pointer are function pointer, the first address realized for pointing method.Its
In, a method to be called, is to send message to an object in fact, the unique foundation for searching the message is the name of selector,
The name and the message are one-to-one relationship, in system operation (Run time), by searching for corresponding to the message
IMP corresponding to the selector is revised as the IMP, Jin Erke of extension classification (Category) customized method by selector
To change the corresponding process realized of an already present selector.
Currently, Method Swizzling technology is only realized in load () function, i.e., it can be real using load () function
Existing Method Swizzling technology and the method for increasing system class, since load () function is in starting application program master
Completion is just loaded before function automatically, therefore, after application program launching, the system class in the method list of former class
The IMP of some method or the method for third party library is substituted for the IMP of extension classification (Category) customized method automatically, and
The IMP of the customizing method is also substituted for the IMP of some method of system class, and then the dynamic exchange of implementation method.For example, if
It needs to obtain relevant parameter generated when user accesses some function of application by touching click mode, then needs to system
It touches class and increases by an extension classification for having this function that gets parms, and be by this using Method Swizzling technology
The corresponding process realized of method that system touches class is substituted for the corresponding process realized of the customized method of the extension classification, i.e., ought connect
When receiving user and accessing the service request of the function, which determines that this method is corresponding by inquiring corresponding method list
IMP, and at this point, IMP corresponding to this method has been replaced with and has this function that gets parms in this method list
Classification IMP, and the IMP of the classification of this function that gets parms be substituted for method corresponding to the service request realization
The exchange of the IMP of method may be implemented in IMP by Method-Swizzling technology, and then the service request can be allowed first
It calls and realizes and get parms method corresponding to the classification of this function, the method for recalling it finally and should executing realization, i.e.,
Really the service request is realized in response.It therefore, can (Run at runtime when Objective-C calls a method
Time) pass through the selector in the method list of change system class or third party library to the mapping relations between final function to realize
The replacement of this method, and the process of this implementation method replacement technology is completed in load () function at present.
S120, according in the first function in the acquired multiple classifications of preset rules judgement with the presence or absence of annexable the
One function.
Specifically, annexable by whether there is in the first function in the acquired multiple classifications of preset rules judgement
First function.Wherein, in one embodiment, the preset rules can be when the first function of the multiple classification is common point
When managing the first function of the affairs under same business scenario, determine that this first is judged as annexable first function;In another reality
It applies in example, the preset rules may be according to the business correlation of the multiple classification by business correlation in multiple classifications
The first function of stronger classification is determined as annexable first function, for example, when the business between classification A and classification B is related
Property be up to 85% or more, then the first function of the first function of classification A and classification B are determined as annexable first function;?
First function in other embodiments, such as in the present embodiment, in multiple classifications acquired according to preset rules judgement
In with the presence or absence of annexable first function be that associated with the acquired multiple classifications default class of judgement whether there is second
Function, wherein the second function is used to call load with implementation method replacement technology automatically when meeting preset trigger condition
Purpose, and whether the second function is used to execute and realizes specific affairs, if associated with acquired multiple classifications default
Class realizes specific affairs there are second function and for executing, then determines that annexable first function is not present.
S130, if it exists annexable first function obtain the source code of each annexable first function and can close
And first function deleted from the classification corresponding to it.
Specifically, the source code of load () function is taken out one by one out of there are the classification of annexable first function, and will
Annexable load () function is deleted in the classification corresponding to it.
S140, merge the source code and using combined source code as the source generation of the second function of the default class
Code.
Specifically, the second function be initialize () function, initialize () function only former class or its
It is called before first method of subclass is called.Since current Method Swizzling technology is real in load () function
It now completes, will largely be called when multiple classifications for realizing Method Swizzling technology are cited income purpose
Load () function, however, since load () function is just invoked automatically load before application program launching main () function
Realize, in actual application, should for realizing Method Swizzling technology multiple classifications may not need by
It calls, but load () function of multiple classification will be invoked automatically before application program launching main () function
At.A large amount of call is needed to load load () function when multiple classifications are cited income mesh, to substantially prolong application program
The starting time, and be just invoked automatically before application program launching the classification of load user may be not in subsequent applications
It needs to use, causes the expense of unnecessary starting time.Therefore, Method Swizzling technology is placed on initialize
It realizes and completes in () function, initialize () function is adjusted before other first method of former class or its extension class is called
With, i.e., received when application program is run user to the call request of some class when just call and load automatically, be not take up and answer
Start the time with program, saves the starting time of application program.
It should be noted that when the Method Swizzling technology of multiple classifications is placed on corresponding initialize () letter
Realize that, when executing the multiple classifications of realization, the initialize () function for the classification that the latter is realized can cover when completing in number
Initialize () function of the classification of previous realization finally only carries out initialize () function of a classification, usually
Initialize () function of the last one classification in file resource list can be only executed, therefore, it is necessary to elder generations according to preset rules
Whether can merge in first function in the acquired multiple classifications of judgement, if can merge, merge the source code simultaneously
Using combined source code as the source code of initialize () function of the default class, this is, one is had to after merging
Initialize () function of a classification, the initialize () function is used for can be by certainly when meeting preset trigger condition
It is dynamic to call load with the purpose of implementation method replacement technology.By by the Method Swizzling technology of multiple classifications from load
Merge to be put into initialize () function of a classification after taking out in () function and realize completion, multiple classes also may be implemented
The purpose of method for distinguishing replacement, initialize () function is before other first method of former class or its extension class is called
Call, i.e., received when application program is run user to the call request of some class when just call and load automatically, be not take up
The application program launching time can effectively save the starting time of application program.
S150, judge whether to meet preset trigger condition.
Specifically, since parent can be called when initialize () function is not implemented in the subclass of default class
Initialize () function, and parent can also call the initialize () function of itself, will cause initialize ()
The repetition of function is called, therefore, it is necessary to which preset trigger condition is arranged to prevent the repetition of initialize () function from calling, i.e.,
When there is the request for calling the default class, need to judge whether the current called class realized is the default class itself,
If so, just the call request is realized in response.
If S160, meeting preset trigger condition, automatic call loads the second function.
In the above-described embodiments, this programme realizes system class method or the method for third party library in load () function
Method replacement technology is changed to realize in initialize () function, delays the calling opportunity of the method replacement technology of class, benefit
The waiting time for advantageously reducing starting application program with the mode of this delay loading, optimize the experience effect of user, i.e., will
Method replacement is realized takes out from load () function in multiple classifications, is placed in initialize () function and realizes after merging
It completes, since initialize () function calls before other first method of former class or its extension class is called, that is, exists
APP received when running user to the call request of some class when just call and load automatically, when being not take up application program launching
Between, the starting time of application program is greatly reduced, so as to the start-up course of optimization application.
Referring to Fig. 2, it is a kind of sub-process signal of application program launching optimization method provided in an embodiment of the present invention
Figure, as shown in Fig. 2, being according in the first function in multiple classifications acquired in preset rules judgement in the step S120
It is no that there are the step of annexable first function to specifically include following steps S121-S124.
It whether there is second function in S121, judgement default class associated with acquired multiple classifications.
Specifically, when initialize () function since multiple classifications will be present, the latter realizes initialize ()
The classification of function can cover initialize () function that previous classification is realized, finally only carry out in a classification
Initialize () function usually can only execute initialize () function of the last one classification in file resource list, because
This, needs to judge with the presence or absence of second function in former class corresponding to acquired multiple classifications, because, when acquired multiple
There are initialize () functions in former class corresponding to classification, if multiple class method for distinguishing replacement technologies of the acquisition are closed
And and be put into initialize () function and realize, then initialize () function that multiple classification is realized can cover
Initialize () function of its corresponding former class.
If in S122, default class associated with acquired multiple classifications, there are second functions, judge second letter
Whether number is for executing affairs.
Specifically, described there are needing to judge when initialize () function when the associated default class of multiple classifications
Whether initialize () function is used to execute specific affairs, if not it is pre- can then to override this for executing specific affairs
If initialize () function of class.
If S123, the second function are for executing affairs, determining acquired multiple classifications, there is no annexable
First function.
Specifically, if the associated default class of multiple classifications is realized specifically there are initialize () function and for executing
Affairs, multiple classification cannot be using initialize () functions come the purpose of implementation method replacement technology, can only be in load
Implementation method replacement technology in () function.
If S124, the second function are not used in execution affairs, determine that there are annexable for acquired multiple classifications
First function.
Referring to Fig. 3, it is a kind of another sub-process of application program launching optimization method provided in an embodiment of the present invention
Schematic diagram, as shown in figure 3, judging whether that the step of meeting preset trigger condition specifically includes following step in the step S150
Rapid S151-S154.
S151, the request from the user for calling the default class is received.
Whether S152, the current called class realized of judgement are the default class itself.
Specifically, the default class is that former class can call father when initialize () function is not implemented in the subclass of former class
Class initialize () function, and parent can also call the initialize () function of itself, will cause initialize
The repetition of () function is called, and therefore, the repetition of initialize method is called in order to prevent, i.e. the needs when there is call request
Whether judgement carries out call request class before deserving is the default class itself utilizes if so, just responding the call request
Initialize () function implementation method replacement technology.
If S153, described default class itself, then determine to meet preset trigger condition.
S154, if not the default class itself, then determine to be unsatisfactory for preset trigger condition.
Referring to Fig. 4, it is a kind of schematic frame of application program launching optimization device 300 provided in an embodiment of the present invention
Figure.As shown in figure 4, application program launching optimization device 300 corresponds to application program launching optimization method shown in FIG. 1.It should
Application program launching optimization device 300 includes the unit for executing above-mentioned application program launching optimization method, the application program
Starts optimization device 300 can be configured in desktop computer, tablet computer, hand-held electric using IOS system as control system
In the terminals such as brain.Specifically, referring to Fig. 4, application program launching optimization device 300 includes function acquiring unit 301, first
Judging unit 302, Code obtaining unit 303, condition judgment unit 305, condition judgment unit 305 and calling loading unit
306。
The function acquiring unit 301 is used to obtain the first function in the multiple classification, wherein each classification
Inside there is first function, the first function before application program launching principal function for being invoked automatically load.
Specifically, the first function is load () function, there is load () function in each classification, described
Load () function completes load and then implementation method replacement (Method Swizzling) before application program launching principal function
The purpose of technology.
First judging unit 302 is used for according in the first function in the acquired multiple classifications of preset rules judgement
With the presence or absence of annexable first function.
The Code obtaining unit 303 obtains each annexable first letter for annexable first function if it exists
Several source codes simultaneously deletes annexable first function from the classification corresponding to it.
Specifically, the preset rules can be when the first function of the multiple classification is to be jointly processed by same business field
When the first function of the affairs under scape, determine that this first is judged as annexable first function;In another embodiment, described pre-
If rule or according to the business correlation of the multiple classification by the stronger classification of business correlation in multiple classifications
First function is determined as annexable first function;In other embodiments, described according to preset rules such as in the present embodiment
Judge in the first function in acquired multiple classifications with the presence or absence of annexable first function to be judgement and acquired more
A associated default class of classification whether there is second function, wherein the second function, which is used to work as, meets preset trigger condition
Shi Zidong calls load with the purpose of implementation method replacement technology, and whether the second function is used to execute realization affairs, if with
The associated default class of acquired multiple classifications realizes affairs there are second function and for executing, and determines that there is no combinable
First function.
The condition judgment unit 305 is for merging the source code and using combined source code as the default class
Second function source code.
Specifically, the second function is initialize () function, initialize () function only in default class or
It is called before first method of its subclass is called.
The condition judgment unit 305 is for judging whether to meet preset trigger condition.
Specifically, in one embodiment, the preset trigger condition is to need to judge the current tune when there is call request
It whether is class itself with the class of realization, if so, just responding the call request.
If the calling loading unit 306, for meeting preset trigger condition, automatic call loads the second function.
In the above-described embodiments, the embodiment of the present invention is by changing method replacement technology of the system class in load () function
To be realized in initialize () function, the calling opportunity of the method replacement technology of class is delayed, this delay loading is utilized
Mode advantageously reduce starting application program waiting time, optimize the experience effect of user.
Referring to Fig. 5, it is a kind of first judgement of application program launching optimization device 300 provided in an embodiment of the present invention
The schematic block diagram of unit 302, first judging unit 302 include function judging unit 3021, affairs judging unit 3022,
First judging unit 3023 and the second judging unit 3024.
The function judging unit 3021 is for judging whether deposit in default class associated with acquired multiple classifications
In second function.
If the affairs judging unit 3022 is for there are second in default class associated with acquired multiple classifications
Function, judges whether the second function is used to execute affairs.
If first judging unit 3023 for the second function for executing affairs, determine acquired multiple
Annexable first function is not present in classification.
If second judging unit 3024 is not used in execution affairs for the second function, determine acquired more
There are annexable first functions for a classification.
Referring to Fig. 6, it is a kind of condition judgement of application program launching optimization device 300 provided in an embodiment of the present invention
The schematic block diagram of unit 305, the condition judgment unit 305 include receiving unit 3051, second judgment unit 3052, third
Judging unit 3053 and the 4th judging unit 3054.
The receiving unit 3051 is used to receive the request from the user for calling the default class.
The second judgment unit 3052 is used to judge currently whether the called class realized to be the default class itself.
If the third judging unit 3053 is used for the default class itself, then determine to meet preset trigger condition.
4th judging unit 3054 is used for if not the default class itself, then determine to be unsatisfactory for default triggering item
Part.
It should be noted that it is apparent to those skilled in the art that, above-mentioned application program launching optimization
The specific implementation process and effect of device 300 and each unit can refer to the corresponding description in preceding method embodiment, in order to
What is described is convenienct and succinct, and details are not described herein.
Above-mentioned apparatus can be implemented as a kind of form of computer program, which can be as shown in Figure 7
It is run in computer equipment.
Referring to Fig. 7, it is a kind of schematic block diagram of computer equipment provided in an embodiment of the present invention.The computer is set
Standby 600 can be terminal, be also possible to server, wherein terminal can be smart phone, plate electricity configured with IOS system
The electronic equipments such as brain, laptop, desktop computer and personal digital assistant.Server can be independent server, can also
To be server cluster that multiple servers form.
Refering to Fig. 7, which includes processor 602, memory and the net connected by system bus 601
Network interface 605, wherein memory may include non-volatile memory medium 603 and built-in storage 604.
The non-volatile memory medium 603 can storage program area 6031 and computer program 6032.The computer program
6032 include program instruction, which is performed, and processor 602 may make to execute a kind of application program launching optimization side
Method.
The processor 602 is for providing calculating and control ability, to support the operation of entire computer equipment 600.
The built-in storage 604 provides environment for the operation of the computer program 6032 in non-volatile memory medium 603, should
When computer program 6032 is executed by processor 602, processor 602 may make to execute a kind of application program launching optimization method.
The network interface 605 is used to carry out network communication with other equipment.It will be understood by those skilled in the art that in Fig. 7
The structure shown, only the block diagram of part-structure relevant to application scheme, does not constitute and is applied to application scheme
The restriction of computer equipment 600 thereon, specific computer equipment 600 may include more more or fewer than as shown in the figure
Component perhaps combines certain components or with different component layouts.
Wherein, the processor 602 is for running computer program 6032 stored in memory, to realize following step
It is rapid:
In one embodiment, for processor 602 when realizing the application program launching optimization method, the application program is fixed
Justice one default class, the default class are associated with multiple classifications, are implemented as follows step: obtaining the in the multiple classification
One function, wherein there is first function in each classification, the first function is used in application program launching principal function
It is invoked automatically load before;It whether there is and can close according in the first function in the acquired multiple classifications of preset rules judgement
And first function;Annexable first function if it exists obtains the source code of each annexable first function and can close
And first function deleted from the classification corresponding to it;Merge the source code and using combined source code as described pre-
If the source code of the second function of class;Judge whether to meet preset trigger condition;And if meet preset trigger condition, it is automatic to adjust
With the load second function.
In one embodiment, processor 602 is being realized in multiple classifications acquired according to preset rules judgement
When whether there is the step of annexable first function in first function, be implemented as follows step: judgement with it is acquired more
It whether there is second function in a associated default class of classification;If default class memory associated with acquired multiple classifications
In second function, judge whether the second function is used to execute affairs;If the second function determines for executing affairs
Annexable first function is not present in acquired multiple classifications;And if the second function is not used in execution affairs, sentences
There are annexable first functions for fixed acquired multiple classifications.
In one embodiment, when processor 602 judges whether the step for meeting preset trigger condition described in the realization, specifically
It realizes following steps: receiving the request from the user for calling the default class;The current called class realized of judgement whether be
The default class itself;If the default class itself, then determine to meet preset trigger condition;And the if not default class
Itself, then determine to be unsatisfactory for preset trigger condition.
It should be appreciated that in embodiments of the present invention, processor 602 can be central processing unit (Central
Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital
Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit,
ASIC), ready-made programmable gate array (Field-Programmable GateArray, FPGA) or other programmable logic devices
Part, discrete gate or transistor logic, discrete hardware components etc..Wherein, general processor can be microprocessor or
The processor is also possible to any conventional processor etc..
Those of ordinary skill in the art will appreciate that be realize above-described embodiment method in all or part of the process,
It is that relevant hardware can be instructed to complete by computer program.The computer program includes program instruction, computer journey
Sequence can be stored in a storage medium, which is storage medium.The program instruction by the computer system at least
One processor executes, to realize the process step of the embodiment of the above method.
Therefore, the present invention also provides a kind of computer readable storage mediums.The computer-readable recording medium storage has meter
Calculation machine program, wherein computer program includes program instruction.The program instruction executes processor when being executed by processor as above
The application program launching optimization method.
The storage medium can be USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), magnetic disk
Or the various storage mediums that can store program code such as CD.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware
With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This
A little functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Specially
Industry technical staff can use different methods to achieve the described function each specific application, but this realization is not
It is considered as beyond the scope of this invention.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it
Its mode is realized.For example, the apparatus embodiments described above are merely exemplary.For example, the division of each unit, only
Only a kind of logical function partition, there may be another division manner in actual implementation.Such as multiple units or components can be tied
Another system is closed or is desirably integrated into, or some features can be ignored or not executed.
The steps in the embodiment of the present invention can be sequentially adjusted, merged and deleted according to actual needs.This hair
Unit in bright embodiment device can be combined, divided and deleted according to actual needs.In addition, in each implementation of the present invention
Each functional unit in example can integrate in one processing unit, is also possible to each unit and physically exists alone, can also be with
It is that two or more units are integrated in one unit.
If the integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product,
It can store in one storage medium.Based on this understanding, technical solution of the present invention is substantially in other words to existing skill
The all or part of part or the technical solution that art contributes can be embodied in the form of software products, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a
People's computer, terminal or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or replace
It changes, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with right
It is required that protection scope subject to.
Claims (10)
1. a kind of application program launching optimization method, the application program defines a default class, and the default class is associated with more
A classification characterized by comprising
Obtain the first function in the multiple classification, wherein there is first function, first letter in each classification
Number before application program launching principal function for being invoked automatically load;
It whether there is annexable first function according in the first function in the acquired multiple classifications of preset rules judgement;
Annexable first function if it exists obtains the source code of each annexable first function and by annexable first letter
Number is deleted from the classification corresponding to it;
Merge the source code and using combined source code as the source code of the second function of the default class;
Judge whether to meet preset trigger condition;And
If meeting preset trigger condition, automatic call loads the second function.
2. application program launching optimization method according to claim 1, which is characterized in that described to be judged according to preset rules
It whether there is annexable first function in first function in acquired multiple classifications, comprising:
Judge to whether there is second function in default class associated with acquired multiple classifications;
If in default class associated with acquired multiple classifications, there are second functions, judge whether the second function is used for
Execute affairs;
If the second function is for executing affairs, determining acquired multiple classifications, there is no annexable first functions;
And
If the second function is not used in execution affairs, determine that there are annexable first functions for acquired multiple classifications.
3. application program launching optimization method according to claim 1, which is characterized in that described to judge whether that satisfaction is default
Trigger condition, comprising:
Receive the request from the user for calling the default class;
Whether the current called class realized of judgement is the default class itself;
If the default class itself, then determine to meet preset trigger condition;And
If not the default class itself, then determine to be unsatisfactory for preset trigger condition.
4. application program launching optimization method according to claim 1, which is characterized in that the first function is load ()
Function.
5. application program launching optimization method according to claim 1, which is characterized in that the second function is
Initialize () function.
6. a kind of application program launching optimizes device, the application program defines a default class, and the default class is associated with more
A classification characterized by comprising
Function acquiring unit, for obtaining the first function in the multiple classification, wherein have the in each classification
One function, the first function before application program launching principal function for being invoked automatically load;
First judging unit, for according in the first function in the acquired multiple classifications of preset rules judgement with the presence or absence of can
Combined first function;
Code obtaining unit obtains the source code of each annexable first function for annexable first function if it exists
And annexable first function is deleted from the classification corresponding to it;
Combining unit, for merging the source code and using combined source code as the source of the second function of the default class
Code;
Condition judgment unit meets preset trigger condition for judging whether;And
Loading unit is called, if automatic call loads the second function for meeting preset trigger condition.
7. application program launching according to claim 6 optimizes device, which is characterized in that the first judging unit packet
It includes:
Function judging unit, for judging in default class associated with acquired multiple classifications with the presence or absence of second function;
Affairs judging unit, if judging institute for there are second functions in default class associated with acquired multiple classifications
State whether second function is used to execute affairs;
First judging unit, if determining that acquired multiple classifications are not present for executing affairs for the second function
Annexable first function;And
Second judging unit determines that acquired multiple classifications exist if being not used in execution affairs for the second function
Annexable first function.
8. application program launching according to claim 6 optimizes device, which is characterized in that the condition judgment unit packet
It includes:
Receiving unit, for receiving the request from the user for calling the default class;
Second judgment unit, for judging currently whether the called class realized is the default class itself;
Third judging unit then determines to meet preset trigger condition if being used for the default class itself;And
4th judging unit is used for if not the default class itself, then determine to be unsatisfactory for preset trigger condition.
9. a kind of computer equipment, which is characterized in that the computer equipment includes memory and processor, on the memory
It is stored with computer program, the processor is realized as described in any one of claim 1-5 when executing the computer program
Application program launching optimization method.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey
Sequence, the computer program can realize application program launching as described in any one in claim 1-5 when being executed by a processor
Optimization method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811207987.9A CN109375961A (en) | 2018-10-17 | 2018-10-17 | Application program launching optimization method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811207987.9A CN109375961A (en) | 2018-10-17 | 2018-10-17 | Application program launching optimization method, device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109375961A true CN109375961A (en) | 2019-02-22 |
Family
ID=65400485
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811207987.9A Pending CN109375961A (en) | 2018-10-17 | 2018-10-17 | Application program launching optimization method, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109375961A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110333935A (en) * | 2019-06-05 | 2019-10-15 | 阿里巴巴集团控股有限公司 | Transactions requests processing method and processing device |
CN111078308A (en) * | 2019-10-18 | 2020-04-28 | 北京奇艺世纪科技有限公司 | Automatic class loading method and device, electronic equipment and storage medium |
CN111475235A (en) * | 2020-04-13 | 2020-07-31 | 北京字节跳动网络技术有限公司 | Acceleration method, device and equipment for function computation cold start and storage medium |
CN113626033A (en) * | 2021-10-13 | 2021-11-09 | 广州市玄武无线科技股份有限公司 | Mobile terminal interface modification method and device, computer terminal equipment and medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20070045745A (en) * | 2005-10-28 | 2007-05-02 | 삼성전자주식회사 | Apparatus and method for multi-loading |
CN1968154A (en) * | 2006-09-15 | 2007-05-23 | 华为技术有限公司 | System and method for service expansion using plug |
JP2012252536A (en) * | 2011-06-03 | 2012-12-20 | Mitsubishi Electric Corp | Information processing device and method for starting the same |
US20140366045A1 (en) * | 2013-06-07 | 2014-12-11 | Microsoft Corporation | Dynamic management of composable api sets |
CN104216738A (en) * | 2014-08-20 | 2014-12-17 | 北京奇艺世纪科技有限公司 | Operation method and operation device of application program |
CN107861766A (en) * | 2017-06-26 | 2018-03-30 | 平安普惠企业管理有限公司 | Using startup method, apparatus and computer-readable recording medium |
-
2018
- 2018-10-17 CN CN201811207987.9A patent/CN109375961A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20070045745A (en) * | 2005-10-28 | 2007-05-02 | 삼성전자주식회사 | Apparatus and method for multi-loading |
CN1968154A (en) * | 2006-09-15 | 2007-05-23 | 华为技术有限公司 | System and method for service expansion using plug |
JP2012252536A (en) * | 2011-06-03 | 2012-12-20 | Mitsubishi Electric Corp | Information processing device and method for starting the same |
US20140366045A1 (en) * | 2013-06-07 | 2014-12-11 | Microsoft Corporation | Dynamic management of composable api sets |
CN104216738A (en) * | 2014-08-20 | 2014-12-17 | 北京奇艺世纪科技有限公司 | Operation method and operation device of application program |
CN107861766A (en) * | 2017-06-26 | 2018-03-30 | 平安普惠企业管理有限公司 | Using startup method, apparatus and computer-readable recording medium |
Non-Patent Citations (3)
Title |
---|
SHEEPCA: ""前方Swizzling事故多发,请小心慎行", pages 1 - 7, Retrieved from the Internet <URL:https://www.jianshu.com/p/ba7c86b27427> * |
伯陽: "App启动速度优化", pages 1 - 6, Retrieved from the Internet <URL:https://www.jianshu.com/p/1bd25f0dbed1> * |
王巍 (@ONEVCAT): "SWIZZLE", pages 1 - 5, Retrieved from the Internet <URL:https://swifter.tips/swizzle/> * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110333935A (en) * | 2019-06-05 | 2019-10-15 | 阿里巴巴集团控股有限公司 | Transactions requests processing method and processing device |
CN110333935B (en) * | 2019-06-05 | 2022-12-02 | 创新先进技术有限公司 | Transaction request processing method and device |
CN111078308A (en) * | 2019-10-18 | 2020-04-28 | 北京奇艺世纪科技有限公司 | Automatic class loading method and device, electronic equipment and storage medium |
CN111078308B (en) * | 2019-10-18 | 2023-12-15 | 北京奇艺世纪科技有限公司 | Automatic class loading method and device, electronic equipment and storage medium |
CN111475235A (en) * | 2020-04-13 | 2020-07-31 | 北京字节跳动网络技术有限公司 | Acceleration method, device and equipment for function computation cold start and storage medium |
CN111475235B (en) * | 2020-04-13 | 2023-09-12 | 北京字节跳动网络技术有限公司 | Acceleration method, device, equipment and storage medium for function calculation cold start |
CN113626033A (en) * | 2021-10-13 | 2021-11-09 | 广州市玄武无线科技股份有限公司 | Mobile terminal interface modification method and device, computer terminal equipment and medium |
CN113626033B (en) * | 2021-10-13 | 2022-03-29 | 广州市玄武无线科技股份有限公司 | Mobile terminal interface modification method and device, computer terminal equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112000348B (en) | Control method, device and computer equipment for service gray level release | |
CN109375961A (en) | Application program launching optimization method, device, computer equipment and storage medium | |
CN107832100B (en) | APK plug-in loading method and terminal thereof | |
CN108345977B (en) | Service processing method and device | |
CN109104336A (en) | Service request processing method, device, computer equipment and storage medium | |
AU2019256257B2 (en) | Processor core scheduling method and apparatus, terminal, and storage medium | |
CN109840115A (en) | RecyclerView paging loading method and device in a kind of android system | |
CN106331065A (en) | Proxy application for host system with service container and system | |
JP7161560B2 (en) | Artificial intelligence development platform management method, device, medium | |
CN114615340B (en) | Request processing method and device, computer equipment and storage device | |
CN108304274A (en) | A kind of method of information exchange, server and computer-readable medium | |
CN109597798A (en) | Network file delet method, device, computer equipment and storage medium | |
CN109614271A (en) | Control method, device, equipment and the storage medium of multiple company-data consistency | |
CN111158807A (en) | Data access method and device based on cloud virtual machine | |
CN111078398A (en) | GPU (graphics processing Unit) distribution method, equipment and storage medium | |
US11822961B2 (en) | Method and apparatus for data processing, server and storage medium | |
CN110347546B (en) | Dynamic adjustment method, device, medium and electronic equipment for monitoring task | |
CN108984238B (en) | Gesture processing method and device of application program and electronic equipment | |
US10325217B2 (en) | Generating state predictive metrics based on Markov chain model from application operational state sequences | |
CN116841728A (en) | Cluster resource scheduling method and device, electronic equipment and storage medium | |
CN109995931B (en) | Method and device for realizing automatic calling | |
CN108563578A (en) | SDK compatibility detection method, device, equipment and readable storage medium | |
CN110019372A (en) | Data monitoring method, device, server and storage medium | |
CN109871226B (en) | Configuration method, device and medium of downloader and electronic equipment | |
CN108809763B (en) | Network performance parameter acquisition method, terminal device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |