[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN110633137A - Method and device for starting installation package of application program and electronic equipment - Google Patents

Method and device for starting installation package of application program and electronic equipment Download PDF

Info

Publication number
CN110633137A
CN110633137A CN201910802397.9A CN201910802397A CN110633137A CN 110633137 A CN110633137 A CN 110633137A CN 201910802397 A CN201910802397 A CN 201910802397A CN 110633137 A CN110633137 A CN 110633137A
Authority
CN
China
Prior art keywords
thread
user interface
starting
installation package
state
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.)
Withdrawn
Application number
CN201910802397.9A
Other languages
Chinese (zh)
Inventor
徐志克
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Anyun Century Technology Co Ltd
Original Assignee
Beijing Anyun Century Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Anyun Century Technology Co Ltd filed Critical Beijing Anyun Century Technology Co Ltd
Priority to CN201910802397.9A priority Critical patent/CN110633137A/en
Publication of CN110633137A publication Critical patent/CN110633137A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution

Landscapes

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

Abstract

The embodiment of the invention discloses an installation package starting method and device of an application program and electronic equipment, and relates to the technical field of application program development. The method can actively switch the default code compiling threads which are started simultaneously from the running state to the pause state when the user interface thread is started, so that the code compiling thread is ensured not to occupy the time slice resources of the user interface thread in the central processing unit when the user interface thread is started, the time slice resources in the central processing unit can be fully used when the user interface thread is started, the starting speed of the user interface thread is improved, and the time spent by the android system from starting the application program to presenting the user interface of the application program is effectively reduced.

Description

Method and device for starting installation package of application program and electronic equipment
Technical Field
The invention relates to the technical field of application program development, in particular to an installation package starting method and device of an application program and electronic equipment.
Background
With the development of science and technology, the popularization rate of electronic products is more and more extensive. The Android system (Android) is commonly applied to various electronic products as an operating system of common electronic products. Various applications in electronic products provide a great deal of convenience for people's lives. But the android system takes a long time from launching an application to presenting the User Interface (UI) of the application.
Disclosure of Invention
In view of the above problems, the present invention is proposed to provide an installation package starting method, apparatus and electronic device for an application program, which overcome the above problems or at least partially solve the above problems.
The first aspect of the present invention provides an installation package starting method for an application program, including:
receiving a starting instruction input by a user; the starting instruction is an instruction for starting an installation package of an application program, and the installation package comprises a user interface thread and a code compiling thread;
starting the user interface thread according to the starting instruction, and switching the code compiling thread from an operating state to a pause state;
judging whether the starting of the user interface thread is finished or not;
and if the user interface thread is started completely, switching the code compiling thread from the pause state to the running state.
In an alternative mode, the switching the code compiling thread from the running state to the suspended state includes:
calling a first target method in a setting interface of the virtual machine;
switching the code compilation thread from the running state to the paused state using the first target method.
In an alternative form, the switching the code compiling thread from the running state to the paused state using the first target method includes:
and adopting jit: (scope JITSuspend sjs ═ new scope JITSuspend () method to switch the code compiling thread from the running state to the pause state.
In an alternative mode, the switching the code compiling thread from the suspended state to the running state includes:
calling a second target method in the setting interface;
switching the code compiling thread from the suspended state to the running state by adopting the second target method;
in an alternative form, the switching the code compiling thread from the suspended state to the running state using the second target method includes:
and switching the code compiling thread from the pause state to the running state by adopting a delete sjs method.
In an optional manner, determining whether the user interface thread is started completely includes:
judging whether the occupancy rate of the central processing unit is greater than a set value or not;
and judging that the starting of the user interface thread is finished when the occupancy rate is lower than the set value.
In an alternative mode, the switching the code compiling thread from the suspended state to the running state includes:
acquiring a historical operation record of the user for the application program;
acquiring the priority of each functional module in the user interface according to the historical operation record; wherein the user interface is generated upon completion of the user interface thread launch;
and compiling codes of each functional module according to the priority.
In an optional manner, the obtaining the priority of each function module in the user interface according to the historical operation record includes:
and obtaining the priority of each functional module according to the use frequency of the user to each functional module.
In an optional manner, the compiling the code of each functional module according to the priority includes:
and compiling the codes of the functional modules according to the priority from high to low.
In a second aspect of the present invention, an installation package starting apparatus for an application program is provided, including:
the starting instruction receiving module is used for receiving a starting instruction input by a user; the starting instruction is an instruction for starting an installation package of an application program, and the installation package comprises a user interface thread and a code compiling thread;
the code compiling thread suspending module is used for starting the user interface thread according to the starting instruction and switching the code compiling thread from an operating state to a suspending state;
the code compiling thread recovery module is used for judging whether the user interface thread is started completely;
and if the user interface thread is started completely, switching the code compiling thread from the pause state to the running state.
In an alternative, the code compiling thread pausing module is configured to:
calling a first target method in a setting interface of the virtual machine;
switching the code compilation thread from the running state to the paused state using the first target method.
In an alternative, the code compiling thread pausing module is configured to:
and adopting jit: (scope JITSuspend sjs ═ new scope JITSuspend () method to switch the code compiling thread from the running state to the pause state.
In an optional manner, the code compiling thread resuming module is configured to:
calling a second target method in the setting interface;
switching the code compiling thread from the suspended state to the running state by adopting the second target method;
in an optional manner, the code compiling thread resuming module is configured to:
and switching the code compiling thread from the pause state to the running state by adopting a delete sjs method.
In an optional manner, the code compiling thread resuming module is configured to:
judging whether the occupancy rate of the central processing unit is greater than a set value or not;
and judging that the starting of the user interface thread is finished when the occupancy rate is lower than the set value.
In an optional manner, the code compiling thread resuming module is configured to:
acquiring a historical operation record of the user for the application program;
acquiring the priority of each functional module in the user interface according to the historical operation record; wherein the user interface is generated upon completion of the user interface thread launch;
and compiling codes of each functional module according to the priority.
In an optional manner, the code compiling thread resuming module is configured to:
and obtaining the priority of each functional module according to the use frequency of the user to each functional module.
In an optional manner, the code compiling thread resuming module is configured to:
and compiling the codes of the functional modules according to the priority from high to low.
In a third aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the steps of the installation package starting method described above.
In a fourth aspect of the present invention, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the installation package starting method described above are implemented.
The technical scheme provided in the embodiment of the application at least has the following technical effects or advantages:
in the scheme, when the user interface thread is started, the default code compiling thread started at the same time can be actively switched into the pause state from the running state, so that the code compiling thread is ensured not to occupy the time slice resource of the user interface thread in the central processing unit when the user interface thread is started, the time slice resource of the central processing unit can be fully used by the user interface thread when the user interface thread is started, the starting speed of the user interface thread is improved, and the time spent by the android system from starting the application program to presenting the user interface of the application program is effectively reduced.
Further, when the user interface thread is started completely, the code compiling thread can be switched from the pause state to the running state, and normal use of the application program can be ensured. And compiling the codes of each functional module in the user interface according to the sequence of the priority from high to low, so that the starting efficiency of the code compiling thread can be improved, and the limitation of the application program function caused by starting the user interface thread preferentially is avoided.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating an installation package starting method for an application according to an embodiment of the present invention.
FIG. 2 is a diagram illustrating a common installation package launch thread provided according to one embodiment of the invention.
FIG. 3 is a diagram illustrating an installation package launch thread provided according to one embodiment of the invention.
FIG. 4 illustrates a schematic diagram of a user interface of an application provided in accordance with one embodiment of the present invention.
Fig. 5 is a functional block diagram of an installation package starting apparatus of an application provided according to an embodiment of the present invention.
Icon:
20-installation package starting device of application program; 21-starting an instruction receiving module; 22-code compilation thread pause module; 23-code compilation thread pause module.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the invention provides an installation package starting method and device of an application program and electronic equipment, which are used for solving the technical problem that the existing time from starting the application program to presenting a user interface of the application program is long.
In order to solve the technical problems, an installation package starting method, an installation package starting device and electronic equipment of an application program provided by the embodiment of the invention have the following general ideas:
receiving a starting instruction input by a user, wherein the starting instruction is an instruction for starting an installation package of an application program, and the installation package comprises a user interface thread and a code compiling thread; starting a user interface thread according to the starting instruction, and switching the code compiling thread from an operating state to a pause state; judging whether the starting of the user interface thread is finished or not; and if the user interface thread is started completely, switching the code compiling thread from the pause state to the running state. When the user interface thread is started, the default code compiling thread started at the same time can be actively switched from the running state to the pause state, so that the code compiling thread is ensured not to occupy the time slice resource of the user interface thread in the central processing unit when the user interface thread is started, the time slice resource of the central processing unit can be fully used by the user interface thread when the user interface thread is started, the starting speed of the user interface thread is increased, and the time spent by the android system from starting the application program to presenting the user interface of the application program is effectively reduced.
In order to better understand the technical solutions of the present invention, the following detailed descriptions of the technical solutions of the present invention are provided with the accompanying drawings and the specific embodiments, and it should be understood that the specific features in the embodiments and the examples of the present invention are the detailed descriptions of the technical solutions of the present invention, and are not limitations of the technical solutions of the present invention, and the technical features in the embodiments and the examples of the present invention may be combined with each other without conflict.
As an alternative embodiment, fig. 1 is a flowchart of an installation package starting method of an application according to an embodiment of the present invention, where the method includes the following steps:
and S21, receiving a starting instruction input by a user, wherein the starting instruction is an instruction for starting an installation package of the application program, and the installation package comprises a user interface thread and a code compiling thread.
And S22, according to the starting instruction, starting the user interface thread and switching the code compiling thread from the running state to the pause state.
And S23, judging whether the user interface thread is finished, and if the user interface thread is started, switching the code compiling thread from a pause state to a running state.
It is to be understood that the execution subject of the above steps is an application program, and the application program is installed in the electronic device, so the execution subject of the above steps may also be the electronic device. For convenience of the following description, the above steps are described with the application as the execution subject.
For an application with an operating system of the android system, the inventor finds that it takes a long time for an installation package of the application to be launched from the beginning until a user interface is presented. The inventor analyzes this phenomenon, and specifically, as shown in fig. 2, by analyzing the source code of the installation package starting process, it is found that, when an installation package of a common application is started, two threads are started by default at the same time: 1) user interface thread, 2) code compilation thread. The user interface thread is used for displaying a user interface of the application program, for example, displaying a function module on the user interface of the application program. And the code compiling thread is used for compiling the external input instruction into an operation instruction which can be recognized by the android system, for example, the code compiling thread can compile an action instruction of touching a screen of the electronic device by a user into an operation instruction which can be recognized by the android system.
Further, the inventor finds that the above two threads can temporarily use the time slice resources of the central processing unit when being started, but the code compiling threads belong to the calculation-intensive operation, so that a large amount of time slice resources of the central processing unit can be occupied, in this case, the time slice resources allocated to the user interface thread by the central processing unit are relatively small, so that the time from starting to finishing starting of the user interface thread is long, a period of black screen or white screen can appear when the application program is started, the use efficiency and the user experience of the application program are seriously affected, and when the user needs to immediately start the application program in some emergency situations, the common installation package starting method is difficult to enable the user interface of the application program to be rapidly displayed in front of the user.
Based on the above analysis, the inventor found that, in order to improve the starting efficiency of the user interface thread and reduce the time consumption from the start to the completion of the user interface thread, the time slice resources occupied by the code compiling thread need to be allocated to the user interface thread, and since the code compiling thread is started by default when the installation package is started and the application program does not have the right to control the code compiling thread, the right to control the code compiling thread can be added to the application program by the method shown in fig. 1, so that the application program can actively switch the default code compiling thread started at the same time from the running state to the suspended state when the installation package is started, thereby ensuring that the code compiling thread does not occupy the time slice resources of the user interface thread in the central processing unit when the user interface thread is started, and enabling the user interface thread to fully use the time slice resources in the central processing unit when the user interface thread is started, therefore, the starting speed of the user interface thread is improved, and the time spent by the application program from starting to presenting the user interface is effectively reduced.
In S21, the start instruction is an instruction input by the user to start an application program, and the start application program may be understood as an installation package of the start application program, where in this embodiment of the present invention, the installation package includes a user interface thread and a code compiling thread.
When the application program receives a starting instruction input by a user, the installation package can be started.
In the embodiment of the present invention, the start instruction may be a finger touch instruction or a voice instruction, for example, an application icon on an interface of the electronic device may be touched by a finger to input the start instruction. For another example, a voice command of "please open the application a" may also be input through a microphone of the electronic device, and the type of the start command is not limited in the embodiment of the present invention.
In S22, when the application program receives the start instruction, the start of the installation package is started. Specifically, a user interface thread in the installation package is started, and the code compiling thread is switched from a running state to a suspended state. It is to be understood that, during the common boot process of the installation package, the user interface thread and the code compiling thread are started by default at the same time, and in S22, the application program may suspend the boot of the code compiling thread, specifically, switching the code compiling thread from the running state to the suspended state may be understood as that the application program prohibits the start of the code compiling thread when receiving a boot instruction, may be understood as that the application program prevents the boot of the code compiling thread when the code compiling thread is ready to be started, and may be understood as that the application program suspends the code compiling thread for a short time after the boot.
In a specific implementation process, switching a code compiling thread from a running state to a suspended state may specifically include the following steps:
s221, calling a first target method in a setting interface of the virtual machine.
S222, the code compiling thread is switched from the running state to the pause state by adopting a first target method.
In the android system, the code compiling thread is started by default when the installation package is started, so that the application program does not have the authority to directly control the starting or the pausing of the code compiling thread. Therefore, the permission for directly controlling the starting or the pause of the code compiling thread can be distributed to the application program, so that the application program can call the first target method from the set interface, and the code compiling thread is switched from the running state to the pause state by adopting the first target method, so that the time slice resources in the central processing unit are released, the time slice resources of the central processing unit can be fully used by the user interface thread, and the starting speed of the user interface thread is improved.
In the embodiment of the present invention, the first target method may be jit: "scope JITSuspend". sjs: "new scope JITSuspend ()" method, wherein scope JITSuspend is a class for suspension and recovery provided by the virtual machine.
As shown in FIG. 3, in the specific implementation process, the application program calls a setting interface of the virtual machine to obtain jit the scope JITSuspend sjs ═ new scope JITSuspend () method in a reflection mode, and the code compiling thread is switched from the running state to the pause state by adopting the method, so that the user interface thread can fully use the time slice resources of the central processing unit when being started, the starting speed of the user interface thread is improved, and the time from the starting to the displaying of the user interface of the application program is reduced.
In S23, when the user interface thread is started, the application program calls the setting interface of the virtual machine again, and reflects and acquires the second target method in the setting interface, and switches the code compiling thread from the suspended state to the running state by using the second target method.
Referring to FIG. 3, assuming the start time of the user interface thread is 15:00:00, at this time 15:00:00, the application program suspends the code compiling thread by using jit: "scope JITSuspend sjs:" new ScopedJITSuspend () ".
Assuming that the time when the user interface thread is started to be finished is 15:00:01, the application program adopts the second target method to recover the code compiling thread at the time of 15:00: 01. In a specific implementation, the second target method may be the deletesjs method.
It should be understood that the specific methods of the first target method and the second target method may also include other cases as long as the first target method is ensured to be capable of realizing the suspension of the code compiling thread, and the second target method is ensured to be capable of realizing the recovery of the code compiling thread.
In S23, determining whether the user interface thread is completed specifically includes the following steps:
s231, judging whether the occupancy rate of the central processing unit is greater than a set value.
And S232, if the occupancy rate is less than or equal to the set value, judging that the starting of the user interface thread is finished.
S233, if the occupancy rate is larger than the set value, the user interface thread is judged not to be started completely.
In S231, the occupancy rate is the occupancy rate of the time slice resources of the central processing unit, and the set value is used to represent the proportion of the android system occupying the time slice resources of the central processing unit.
Specifically, when the installation package of the application program is started, the application program interacts with the android system, the android system occupies the time slice resources of the central processing unit, and in this case, the set value can represent the occupancy rate of the android system to the time slice resources of the central processing unit. In specific implementation, the set value may be 20% or other values, and it should be understood that the selection of the set value is related to the version of the android system and the model of the central processing unit, and is not limited herein.
In S232, assuming that the android system starts only the user interface thread, 20% of the time slice resources of the central processing unit are allocated to the android system, and 80% are allocated to the user interface thread, then the setting value may be 20%. Specifically, if the user interface thread is started up, the central processing unit releases 80% of the time slice resources, in which case the occupancy rate of the central processing unit is 20%, in which case the user interface thread is started up.
In S233, if the user interface thread is not started, the user interface thread and the android system may occupy the time slice resource of the central processing unit at the same time, in which case, the occupancy rate of the time slice resource of the central processing unit may be greater than 20% of the set value, and therefore, if the occupancy rate is greater than the set value, it is determined that the user interface thread is not started.
It can be understood that, the method for judging whether the user interface thread is started and completed through the occupancy rate of the central processing unit can take the occupancy rate of the android system to the time slice resources of the central processing unit into consideration, so that whether the user interface thread is started and completed can be accurately determined, and an accurate data basis is provided for the subsequent recovery code compiling thread.
In S23, when the application switches the code compiling thread from the suspended state to the running state, the code compiling thread starts to start. Furthermore, the code compiling thread is started after the user interface thread is started, so that the code compiling efficiency is improved, and a user can use the application program based on the user interface quickly.
In a specific implementation process, switching a code compiling thread from a pause state to a running state specifically comprises the following steps:
and S234, acquiring the historical operation record of the user aiming at the application program.
And S235, acquiring the priority of each functional module in the user interface according to the historical operation records.
And S236, compiling codes of each functional module according to the priority.
In S234, the application program obtains the historical operation records of the user for the application program. In the embodiment of the present invention, the historical operation record may be understood as the frequency of use of the function module on the user interface by the user, please refer to fig. 4 in combination, where the user interface includes 4 function modules of "buddy list", "matching game", "shop" and "consultation".
The method includes acquiring a historical operation record of a user for an application program, and acquiring a historical operation record of the user for the application program in a preset time period, for example, acquiring a historical operation record of the user for the application program in a week, or acquiring a historical operation record of the user for the application program in three days, where the preset time period is not limited.
For another example, the historical operating records of the application program in three days by the user are obtained as follows:
click the 'friend list' 4 times;
click on the "matching game" 24 times;
click on store 2 times;
click "consult" 1 time.
It can be understood that, through the above historical operation records, the use frequency of 4 function modules of the application program within three days can be determined by the user.
In S235, acquiring the priority of each function module in the user interface according to the historical operation record, specifically including: and obtaining the priority of each functional module according to the use frequency of each functional module by the user.
Taking the example in S234 for explanation, the priority of each functional module is obtained as:
"match game" > "buddy list" > "store" > "consultation".
By the priority, the user has the highest frequency of using the module of the 'matching game' in the application program, so that the priority of the module of the 'matching game' is the highest.
In S236, compiling the code of each functional module according to the priority includes: and compiling the codes of each functional module according to the priority from high to low.
By way of example in S234, code compiling is performed on each function module in the order of priority from high to low, and code compiling is performed on the "matching game" module first, so that when the user interface is displayed, if the user clicks the "matching game" module, the application program can respond quickly, and the problem that the user interface can only be displayed and cannot be used in time is avoided. After the application program responds to an operation instruction of clicking the 'matching game' module by a user based on the completed code compiling, the code compiling can be continuously carried out on the 'friend list' module, the 'shop' module and the 'consultation' module at the background, and the game matching and the game process can not be influenced.
It can be understood that the method can provide the permission for suspending and resuming the code compiling thread for the application program through the setting interface of the virtual machine, so that the default started code compiling thread can be suspended when the application program starts the installation package, the time slice resource of the central processing unit can be fully used by the user interface thread, the starting speed of the user interface thread is improved, and the user interface can be rapidly displayed. In addition, after the user interface is started, the application program can also compile codes of the functional modules in sequence according to the use frequency of the functional modules on the user interface, so that the response speed of the common functional modules on the user interface is effectively improved, the application program can not only quickly display the user interface, but also improve the efficiency of code compilation, and the user can use the functional modules on the user interface in time.
As an alternative embodiment, fig. 5 shows a block diagram of an installation package starting apparatus 20 of an application according to an embodiment of the present invention, where the installation package starting apparatus 20 of an application includes:
a starting instruction receiving module 21, configured to receive a starting instruction input by a user; the starting instruction is an instruction for starting an installation package of an application program, and the installation package comprises a user interface thread and a code compiling thread;
a code compiling thread pause module 22, configured to start the user interface thread according to the start instruction, and switch the code compiling thread from an operating state to a pause state;
a code compiling thread recovery module 23, configured to determine whether the user interface thread is started completely;
and if the user interface thread is started completely, switching the code compiling thread from the pause state to the running state.
In an alternative manner, the code compiling thread suspending module 22 is configured to:
calling a first target method in a setting interface of the virtual machine;
switching the code compilation thread from the running state to the paused state using the first target method.
In an alternative manner, the code compiling thread suspending module 22 is configured to:
and adopting jit: (scope JITSuspend sjs ═ new scope JITSuspend () method to switch the code compiling thread from the running state to the pause state.
In an alternative manner, the code compiling thread recovering module 23 is configured to:
calling a second target method in the setting interface;
switching the code compiling thread from the suspended state to the running state by adopting the second target method;
in an alternative manner, the code compiling thread recovering module 23 is configured to:
and switching the code compiling thread from the pause state to the running state by adopting a delete sjs method.
In an alternative manner, the code compiling thread recovering module 23 is configured to:
judging whether the occupancy rate of the central processing unit is greater than a set value or not;
and judging that the starting of the user interface thread is finished when the occupancy rate is lower than the set value.
In an alternative manner, the code compiling thread recovering module 23 is configured to:
acquiring a historical operation record of the user for the application program;
acquiring the priority of each functional module in the user interface according to the historical operation record; wherein the user interface is generated upon completion of the user interface thread launch;
and compiling codes of each functional module according to the priority.
In an alternative manner, the code compiling thread recovering module 23 is configured to:
and obtaining the priority of each functional module according to the use frequency of the user to each functional module.
In an alternative manner, the code compiling thread recovering module 23 is configured to:
and compiling the codes of the functional modules according to the priority from high to low.
Based on the same inventive concept as in the previous embodiments, embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of any of the methods described above.
Based on the same inventive concept as in the previous embodiments, an embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the steps of any one of the methods when executing the program.
The technical scheme provided in the embodiment of the application at least has the following technical effects or advantages:
when the user interface thread is started, the default code compiling thread started at the same time can be actively switched from the running state to the pause state, so that the code compiling thread is ensured not to occupy the time slice resource of the user interface thread in the central processing unit when the user interface thread is started, the time slice resource of the central processing unit can be fully used by the user interface thread when the user interface thread is started, the starting speed of the user interface thread is increased, and the time spent by the android system from starting the application program to presenting the user interface of the application program is effectively reduced. Furthermore, after the user interface is started, the application program can also compile codes of the functional modules in sequence according to the use frequency of the functional modules on the user interface, so that the response speed of the common functional modules on the user interface is effectively improved, the application program can not only quickly display the user interface, but also improve the efficiency of code compilation, the user can use the functional modules on the user interface in time, and the limitation of the functions of the application program caused by preferentially starting the user interface thread is avoided.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of a gateway, proxy server, system according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses:
a1, a method for starting an installation package of an application program, comprising:
receiving a starting instruction input by a user; the starting instruction is an instruction for starting an installation package of an application program, and the installation package comprises a user interface thread and a code compiling thread;
starting the user interface thread according to the starting instruction, and switching the code compiling thread from an operating state to a pause state;
judging whether the starting of the user interface thread is finished or not;
and if the user interface thread is started completely, switching the code compiling thread from the pause state to the running state.
A2, the installation package launching method of claim A1, wherein the switching the code compilation thread from a running state to a paused state comprises:
calling a first target method in a setting interface of the virtual machine;
switching the code compilation thread from the running state to the paused state using the first target method.
A3, the installation package launching method of claim A2, wherein said employing the first target method to switch the code compilation thread from the running state to the paused state comprises:
and adopting jit: (scope JITSuspend sjs ═ new scope JITSuspend () method to switch the code compiling thread from the running state to the pause state.
A4, the installation package launching method of claim A3, wherein the switching the code compilation thread from the paused state to the running state comprises:
calling a second target method in the setting interface;
switching the code compiling thread from the suspended state to the running state by adopting the second target method;
a5, the installation package launching method of claim A4, wherein said switching the code compilation thread from the paused state to the running state using the second target method comprises:
and switching the code compiling thread from the pause state to the running state by adopting a delete sjs method.
A6, the installation package launching method of claim a1, wherein determining whether the user interface thread is launched completely comprises:
judging whether the occupancy rate of the central processing unit is greater than a set value or not;
and judging that the starting of the user interface thread is finished when the occupancy rate is lower than the set value.
A7, the installation package launching method of claim A1, wherein the switching the code compilation thread from the paused state to the running state comprises:
acquiring a historical operation record of the user for the application program;
acquiring the priority of each functional module in the user interface according to the historical operation record; wherein the user interface is generated upon completion of the user interface thread launch;
and compiling codes of each functional module according to the priority.
A8, the installation package starting method according to claim A7, wherein the obtaining the priority of each function module in the user interface according to the historical operation records comprises:
and obtaining the priority of each functional module according to the use frequency of the user to each functional module.
A9, the installation package launching method as claimed in claim a7, wherein the compiling code of each functional module according to the priority comprises:
and compiling the codes of the functional modules according to the priority from high to low.
B10, an installation package starting apparatus for an application program, comprising:
the starting instruction receiving module is used for receiving a starting instruction input by a user; the starting instruction is an instruction for starting an installation package of an application program, and the installation package comprises a user interface thread and a code compiling thread;
the code compiling thread suspending module is used for starting the user interface thread according to the starting instruction and switching the code compiling thread from an operating state to a suspending state;
the code compiling thread recovery module is used for judging whether the user interface thread is started completely;
and if the user interface thread is started completely, switching the code compiling thread from the pause state to the running state.
B11, the installation package startup device of claim B10 wherein the code compilation thread pause module is configured to:
calling a first target method in a setting interface of the virtual machine;
switching the code compilation thread from the running state to the paused state using the first target method.
B12, the installation package startup device of claim B11 wherein the code compilation thread pause module is configured to:
and adopting jit: (scope JITSuspend sjs ═ new scope JITSuspend () method to switch the code compiling thread from the running state to the pause state.
B13, the installation package startup device of claim B12 wherein the code compiling thread resuming module is configured to:
calling a second target method in the setting interface;
switching the code compiling thread from the suspended state to the running state by adopting the second target method;
b14, the installation package startup device of claim B13 wherein the code compiling thread resuming module is configured to:
and switching the code compiling thread from the pause state to the running state by adopting a delete sjs method.
B15, the installation package startup device of claim B10 wherein the code compiling thread resuming module is configured to:
judging whether the occupancy rate of the central processing unit is greater than a set value or not;
and judging that the starting of the user interface thread is finished when the occupancy rate is lower than the set value.
B16, the installation package startup device of claim B10 wherein the code compiling thread resuming module is configured to:
acquiring a historical operation record of the user for the application program;
acquiring the priority of each functional module in the user interface according to the historical operation record; wherein the user interface is generated upon completion of the user interface thread launch;
and compiling codes of each functional module according to the priority.
B17, the installation package startup device of claim B16 wherein the code compiling thread resuming module is configured to:
and obtaining the priority of each functional module according to the use frequency of the user to each functional module.
B18, the installation package startup device of claim B16 wherein the code compiling thread resuming module is configured to:
and compiling the codes of the functional modules according to the priority from high to low.
C19, a computer-readable storage medium, having stored thereon a computer program for implementing the steps of the installation package startup method of any one of claims a1-a9 when being executed by a processor.
D20, an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the installation package startup method of any one of claims a1-a9 when executing the program.

Claims (10)

1. An installation package starting method of an application program is characterized by comprising the following steps:
receiving a starting instruction input by a user; the starting instruction is an instruction for starting an installation package of an application program, and the installation package comprises a user interface thread and a code compiling thread;
starting the user interface thread according to the starting instruction, and switching the code compiling thread from an operating state to a pause state;
judging whether the starting of the user interface thread is finished or not;
and if the user interface thread is started completely, switching the code compiling thread from the pause state to the running state.
2. The installation package starting method of claim 1, wherein said switching the code compilation thread from a running state to a paused state comprises:
calling a first target method in a setting interface of the virtual machine;
switching the code compilation thread from the running state to the paused state using the first target method.
3. The installation package startup method of claim 2, wherein said switching the code compilation thread from the running state to the paused state using the first target method comprises:
and adopting jit: (scope JITSuspend sjs ═ new scope JITSuspend () method to switch the code compiling thread from the running state to the pause state.
4. The installation package startup method of claim 3, wherein said switching the code compilation thread from the suspended state to the running state comprises:
calling a second target method in the setting interface;
switching the code compilation thread from the paused state to the running state using the second target method.
5. The installation package startup method of claim 4, wherein said switching the code compilation thread from the suspended state to the running state using the second target method comprises:
and switching the code compiling thread from the pause state to the running state by adopting a delete sjs method.
6. The installation package startup method of claim 1, wherein said switching the code compilation thread from the suspended state to the running state comprises:
acquiring a historical operation record of the user for the application program;
acquiring the priority of each functional module in the user interface according to the historical operation record; wherein the user interface is generated upon completion of the user interface thread launch;
and compiling codes of each functional module according to the priority.
7. The installation package starting method according to claim 6, wherein said code compiling for each of said functional modules according to said priority comprises:
and compiling the codes of the functional modules according to the priority from high to low.
8. An installation package starting apparatus for an application program, comprising:
the starting instruction receiving module is used for receiving a starting instruction input by a user; the starting instruction is an instruction for starting an installation package of an application program, and the installation package comprises a user interface thread and a code compiling thread;
the code compiling thread suspending module is used for starting the user interface thread according to the starting instruction and switching the code compiling thread from an operating state to a suspending state;
the code compiling thread recovery module is used for judging whether the user interface thread is started completely;
and if the user interface thread is started completely, switching the code compiling thread from the pause state to the running state.
9. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of the installation package startup method of any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the installation package startup method of any one of claims 1 to 7 when executing the program.
CN201910802397.9A 2019-08-28 2019-08-28 Method and device for starting installation package of application program and electronic equipment Withdrawn CN110633137A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910802397.9A CN110633137A (en) 2019-08-28 2019-08-28 Method and device for starting installation package of application program and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910802397.9A CN110633137A (en) 2019-08-28 2019-08-28 Method and device for starting installation package of application program and electronic equipment

Publications (1)

Publication Number Publication Date
CN110633137A true CN110633137A (en) 2019-12-31

Family

ID=68969443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910802397.9A Withdrawn CN110633137A (en) 2019-08-28 2019-08-28 Method and device for starting installation package of application program and electronic equipment

Country Status (1)

Country Link
CN (1) CN110633137A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024087840A1 (en) * 2022-10-26 2024-05-02 荣耀终端有限公司 Resource management and control method and apparatus, chip, electronic device, and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024087840A1 (en) * 2022-10-26 2024-05-02 荣耀终端有限公司 Resource management and control method and apparatus, chip, electronic device, and medium

Similar Documents

Publication Publication Date Title
WO2020108085A1 (en) Resource allocation method and apparatus, terminal, and storage medium
US10445132B2 (en) Method and apparatus for switching applications
CN106201566B (en) Benefit wins the hot upgrade method of big special software and equipment
CN110968415B (en) Scheduling method and device of multi-core processor and terminal
WO2018103550A1 (en) Application program page processing method and apparatus
TWI573075B (en) Persistent and resilient worker processes
WO2018028055A1 (en) Method and apparatus for running android application program on windows system
CN103677922A (en) Method and device for starting application software
CN107329750A (en) The recognition methods of advertisement page, jump method and mobile terminal in application program
CN105573778B (en) Application program starting method and terminal
CN109491731B (en) Control method and device for suspension button and storage medium
CN111880879B (en) Playing method, device, equipment and storage medium of dynamic wallpaper
CN112084488A (en) Application authority management method, device and system
CN111209080A (en) Transparent transmission method for graphic processor
CN106445696B (en) Multi-process interactive processing method and system
CN109582453A (en) The method, apparatus and electronic equipment of coordinated scheduling between multisystem
CN110633137A (en) Method and device for starting installation package of application program and electronic equipment
US20220083416A1 (en) Multi-thread exit method and mobile terminal
CN107357608B (en) Method, device and system for automatically installing operating system
US7984446B1 (en) Method and system for multitasking BIOS initialization tasks
CN113535341A (en) Method and device for realizing inter-CPU (central processing unit) core interrupt communication under Linux
CN103049286B (en) Operating system optimization recommend method and device
US20220206561A1 (en) Application control method and electronic device
CN108647086B (en) Application switching method and device in android system
EP3848800B1 (en) Method and apparatus for displaying message box, terminal 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
WW01 Invention patent application withdrawn after publication

Application publication date: 20191231

WW01 Invention patent application withdrawn after publication