CN108647056B - Application program preloading method and device, storage medium and terminal - Google Patents

Application program preloading method and device, storage medium and terminal Download PDF

Info

Publication number
CN108647056B
CN108647056B CN201810444100.1A CN201810444100A CN108647056B CN 108647056 B CN108647056 B CN 108647056B CN 201810444100 A CN201810444100 A CN 201810444100A CN 108647056 B CN108647056 B CN 108647056B
Authority
CN
China
Prior art keywords
application
application program
preloading
target application
preloaded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810444100.1A
Other languages
Chinese (zh)
Other versions
CN108647056A (en
Inventor
韩世广
陈岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Jinsheng Communication Technology Co., Ltd.
Original Assignee
Shanghai Jinsheng Communication 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 Shanghai Jinsheng Communication Technology Co ltd filed Critical Shanghai Jinsheng Communication Technology Co ltd
Priority to CN201810444100.1A priority Critical patent/CN108647056B/en
Publication of CN108647056A publication Critical patent/CN108647056A/en
Priority to PCT/CN2019/084790 priority patent/WO2019214477A1/en
Application granted granted Critical
Publication of CN108647056B publication Critical patent/CN108647056B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading

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)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application discloses an application program preloading method, an application program preloading device, a storage medium and a terminal. The method comprises the following steps: detecting that an application preload event is triggered; determining a target application program to be preloaded; and sending a fake focus notification to the target application program, and drawing an application interface corresponding to the target application program based on the fake focus notification, wherein the fake focus is independent from a focus corresponding to foreground application. By adopting the technical scheme, the application interface of the application program to be preloaded can be drawn under the condition that the operation of the foreground application program and the drawing of the interface are not influenced, so that the application program can be preloaded, the preparation work before the application is started can be completed to a greater extent by the preloading mode, and the starting speed of the target application program is increased.

Description

Application program preloading method and device, storage medium and terminal
Technical Field
The embodiment of the application relates to the technical field of application program loading, in particular to an application program preloading method, an application program preloading device, a storage medium and a terminal.
Background
At present, terminals such as smart phones, tablet computers, notebook computers, and smart appliances have become essential electronic devices in people's daily life. With the continuous intellectualization of the terminal equipment, the operating system is loaded in most terminal equipment, so that the terminal equipment can install abundant and various application programs and meet different requirements of users.
With the continuous improvement of the configuration of the terminal device, dozens or even hundreds of application programs can be installed in most terminal devices, and with the increasing abundance of the functions of the application programs, more and more resources are needed to be loaded when the application programs run. When a user selects to start an application program, a terminal loads resources required by the start of the application program, and after the loading is completed, an initial interface of the application program is entered, the whole process usually takes several seconds or even tens of seconds, so that the start efficiency of the application program is low, and improvement is needed urgently.
Disclosure of Invention
The embodiment of the application provides an application program preloading method, an application program preloading device, a storage medium and a terminal, and the application program loading scheme can be optimized.
In a first aspect, an embodiment of the present application provides an application preloading method, including:
detecting that an application preload event is triggered;
determining a target application program to be preloaded;
and sending a fake focus notification to the target application program, and drawing an application interface corresponding to the target application program based on the fake focus notification, wherein the fake focus is independent from a focus corresponding to foreground application.
In a second aspect, an embodiment of the present application provides an application preloading device, including:
the event trigger detection module is used for detecting whether an application preloading event is triggered or not;
the application determination module is used for determining a target application program to be preloaded after detecting that an application preloading event is triggered;
a fake focus notification sending module for sending a fake focus notification to the target application; wherein the fake focus is independent from the focus corresponding to the foreground application;
and the interface drawing module is used for drawing the application interface corresponding to the target application program based on the fake focus notification.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements an application preloading method according to an embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides a terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the application preloading method according to the embodiment of the present application.
According to the application program preloading scheme provided in the embodiment of the application program preloading method, after the application preloading event is triggered, the target application program to be preloaded is determined, the fake focus notification is sent to the target application program, the application interface corresponding to the target application program is drawn based on the fake focus notification, and the fake focus and the focus corresponding to the foreground application are mutually independent. By adopting the technical scheme, the application interface of the application program to be preloaded can be drawn under the condition that the running of the foreground application program and the drawing of the interface are not influenced, so that the preloading of the application program is realized, the preparation work before the application is started can be completed to a greater extent by the preloading mode, and the starting speed of the target application program is increased.
Drawings
Fig. 1 is a schematic flowchart of an application preloading method according to an embodiment of the present application;
FIG. 2 is a diagram illustrating a relative position relationship between a preloaded active window stack and a display area of a display screen according to an embodiment of the present disclosure;
FIG. 3 is a diagram illustrating a relative position relationship between a preloaded active window stack and a display area of a display screen according to an embodiment of the present application;
fig. 4 is a schematic diagram of application interface migration according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating another application preloading method according to an embodiment of the present application;
fig. 6 is a block diagram illustrating an application preloading apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another terminal provided in the embodiment of the present application.
Detailed Description
The technical scheme of the application is further explained by the specific implementation mode in combination with the attached drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Fig. 1 is a flowchart of an application preloading method according to an embodiment of the present application, where the method may be performed by an application preloading device, where the device may be implemented by software and/or hardware, and may be generally integrated in a terminal. As shown in fig. 1, the method includes:
step 101, detecting that an application preloading event is triggered.
For example, the terminal in the embodiment of the present application may include terminal devices such as a mobile phone, a tablet computer, a notebook computer, and an intelligent appliance. The terminal is loaded with an operating system.
For example, the trigger condition of the application preloading event may be set according to an actual situation, and the embodiment of the present application is not particularly limited. For example, an application preloading event may be triggered when detecting that a user's action satisfies a preset condition (e.g., picking up a terminal, inputting a screen unlocking operation, inputting a terminal unlocking operation, or the like); or when detecting that the foreground application program is changed, triggering an application preloading event; or after the prediction process of the preloaded application is finished, an application preloading event can be triggered immediately (or after a preset time length is passed); or may be triggered at timed intervals, etc. After the application preloading event is triggered, the system may detect that the application preloading event is triggered by reading a flag bit or receiving a trigger instruction, and the like, and the specific detection method is not limited in this embodiment of the application.
And step 102, determining a target application program to be preloaded.
For example, the application to be preloaded may be an application that a user may open soon, and may be a fixed application that is set in advance, or an application that is predicted in a certain manner, and the like. The application to be preloaded may comprise one or more. The target application program can be understood as the application program to be preloaded which needs to be preloaded currently. The target application may also include one or more. When only one application program to be preloaded exists, only one corresponding target application program exists; when there are multiple application programs to be preloaded, the target application program may be one (that is, multiple application programs to be preloaded are determined as target application programs one by one and are sequentially subjected to a preloading operation), or multiple (that is, more than 2 application programs to be preloaded are determined as target application programs and are simultaneously subjected to a preloading operation, that is, the preloading processes of the multiple target application programs may be performed in parallel).
Alternatively, a prediction model may be used to predict the application to be preloaded. The prediction model may be a machine learning model, and the algorithm used may include a Recurrent Neural Networks (RNN), a Long Short-Term Memory (LSTM) network, a threshold cycle unit, a simple cycle unit, an auto-encoder, a decision tree, a random forest, a feature mean classification, a classification regression tree, a hidden markov, a K-nearest neighbor (KNN) algorithm, a logistic regression model, a bayesian model, a gaussian model, and a KL divergence (Kullback-Leibler) or the like.
Optionally, in the process that the user uses the terminal, a training sample may be collected, the training sample is adopted to train the preset initial model, and finally, a prediction model for predicting the application program to be preloaded is obtained. For example, the elements contained in the training sample may include a time sequence or an order sequence in which the application was opened; can include the time, place, frequency, etc. that the application was opened; the method can include the running state of the terminal, such as the on-off state of a mobile data network, the connection state of a wireless hotspot, the identity information of the connected wireless hotspot, the currently running application program, the previous foreground application program, the stay time of the current application program in the background, the last time the current application program is switched to the background, the plugging state of an earphone jack, the charging state, the battery power information, the screen display time and the like; and the data collected by sensors integrated in the terminal can be included, such as a motion sensor, a light sensor, a temperature sensor, a humidity sensor and the like.
For example, a suitable sample element may be selected according to the selected machine learning model, the selected machine learning model may be determined according to the selected sample element, and the model and the sample element may be selected according to requirements on prediction accuracy, a preset speed, and the like, which is not limited in the embodiment of the present application.
In the embodiment of the present application, determining the target application program to be preloaded may include determining the target application program to be preloaded according to an output result before the prediction model, or may also include performing prediction by using the prediction model, and determining the target application program to be preloaded according to a current output result of the prediction model.
103, sending a fake focus notification to the target application program, and drawing an application interface corresponding to the target application program based on the fake focus notification, wherein the fake focus is independent from a focus corresponding to foreground application.
The focus in the embodiment of the present application is also referred to as an input focus, and the fake focus is independent from the focus corresponding to the foreground application. Generally, for most current operating systems, a focus is unique, input operations such as touch and the like only take effect on the focus, a system end and an application end are consistent for inputting focus information, and once the system end modifies the input focus information, the system end sends information that the input focus information changes to the application, so that the method ensures that the input focus information of the system end and the application end is consistent. In the embodiment of the application, the purpose that the application end can forge the focus is achieved by separating the mode that the system end and the application end input the focus information. Specifically, in the embodiment of the application, the focus information is forged for the preloaded application, so that the preloaded application has the focus information, and the focus information of the system end is still correct, so that the preloaded application can be drawn normally, and the purpose of full loading is achieved. The focus exists in the system end and the application end, which can be regarded as a server end (server) and a client end (client), the system end records the application with the focus, and the application end stores a flag bit (flag) to identify whether the application has the focus.
In the embodiment of the present application, the specific process of preloading and the loaded resources are not limited, for example, corresponding hardware resources may be allocated to the application program to be preloaded, and relevant data required for starting is loaded based on the allocated hardware resources. The method comprises the following steps of starting an application process, starting an application service, allocating memory, reading file content, acquiring network data, rendering an interface and the like. The embodiment of the present application does not limit the timing of preloading various types of resources, and therefore does not limit the timing of falsifying the input focus. For example, the timing of falsely inputting the focus may be when the window system of the operating system adds a new window and needs to update the focus, and a false focus notification is generated and sent.
In the embodiment of the application, the application interface of the target application program can be drawn in the area outside the display screen, the application interface of the target application program can also be drawn below the foreground application program, and the visible attribute of the application interface in the loading process can be set to be invisible to a user and visible to a system.
According to the application program preloading method provided in the embodiment of the application program preloading method, after the application preloading event is triggered, the target application program to be preloaded is determined, the fake focus notification is sent to the target application program, the application interface corresponding to the target application program is drawn based on the fake focus notification, and the fake focus and the focus corresponding to the foreground application are mutually independent. By adopting the technical scheme, the application interface of the application program to be preloaded can be drawn under the condition that the running of the foreground application program and the drawing of the interface are not influenced, so that the preloading of the application program is realized, the preparation work before the application is started can be completed to a greater extent by the preloading mode, and the starting speed of the target application program is increased.
In some embodiments, the drawing an application interface corresponding to the target application based on the fake focus notification includes: and drawing and displaying an application interface corresponding to the target application program on a pre-built pre-loaded active window stack based on the fake focus notification, wherein the boundary coordinate corresponding to the pre-loaded active window stack is positioned outside the coordinate range of the display screen. The advantage of this arrangement is that the application interface of the application program to be preloaded can be drawn based on the preloaded active window stack created outside the display screen, further avoiding the impact on the foreground application program.
In the embodiment of the present application, the active window may be understood as a separate interface directly providing interaction and operation for a user, and different names may be used in different operating systems to name the interface. For ease of understanding, the following description will be made by taking the Android operating system as an example.
In the Android system, the active window is called Activity. Activity is a component responsible for interacting with a user that provides a screen (which may be understood as a screen interface, rather than a display screen of an entity) for the user to interact to accomplish a task. In an android application, an Activity is usually a separate screen on which controls can be displayed and events of the user can be monitored and processed. In managing Activity, there are two concepts: task Stack and Stack. The Task corresponds to an application program, the Task is used for storing activities, one Task can store one or more activities, and the activities follow the principle of first-in first-out and last-in first-out. And the Stack is used for managing the Task, generally, one Stack manages the Task to which each Activity required to be shown by one screen belongs, and one Stack can manage one or more tasks, and of course, the Stack also follows the basic management principle of the Stack. The screens described herein are not necessarily completely separate display screens, and in the case of "two screens", the two screens may be only two regions of a complete display screen that independently display respective display contents. Of course, if the terminal has two or even more separate display screens, the "two screens" may also be two separate display screens.
In the Android system, multi-window modes are supported, which may include split screen mode, picture-in-picture mode, and free mode (FreeForm). In the multi-window mode, the Stack in which the application is located may have its own size (size), and may include upper, lower, left, and right coordinates in a coordinate system with the upper left corner of the terminal screen as the origin. For example, (a, b, c, d), which generally describes the boundary of a rectangle, the coordinates of the upper left corner and the coordinates of the lower right corner of the rectangle can be used for representation, i.e. the coordinates of the upper left corner of the rectangle are (a, b), and the coordinates of the lower right corner are (c, d), and such a rectangular area corresponds to the size of Stack. The in-application layout in the Stack is based on the size of the Stack, that is, the application interface corresponding to Activity is displayed within the boundary range of the size.
In the multi-window mode, multiple applications may be allowed to be visible, including both system and user visibility and system-only visibility. The system and the user can see the display on the display screen, and the user can see the display; system-only-visible means that the operating system is visible, but not the user, and may be obscured by foreground applications or displayed outside the display screen as the application is intended to implement.
In the embodiment of the application, the application interface of the target application program is preloaded outside the display screen, the preloading can be realized based on a multi-window mechanism of an operating system, and the size corresponding to the application program is set outside the display screen through the multi-window mechanism so as to achieve the purpose of being invisible to a user, so that the display of the display content of the foreground application program on the display screen is not influenced.
Generally, in the multi-window mode, there may be multiple types of stacks, for example, Home Stack represents a Stack displayed by a desktop application, App Stack represents a Stack displayed by a third-party application, and there may be other split-screen stacks, and contents contained in the three types of stacks may be displayed on a display screen, which are collectively referred to as application active window stacks in this embodiment. In the embodiment of the application, a preloaded active window Stack (preloaded Stack) is added to indicate a Stack displayed by a preloaded application, and the boundary coordinates of the preloaded Stack are set to be outside the coordinate range of a display screen, so that an application program to be preloaded can be displayed on the Stack. For the Android system, a Stack special for displaying preloaded applications can be newly built based on a multi-window mechanism of the Android system. In the embodiment of the application, the reason for newly building the Stack is that the newly built preloaded Stack can own size and visibility, so that the purpose of preloading outside a display screen is achieved.
In the embodiment of the application, the creation time of the preloaded Stack is not limited, and the preloaded Stack can be set to be in a resident state by default before the terminal leaves a factory, namely the preloaded Stack exists all the time; the method can also be established when the terminal is started or after the terminal is successfully unlocked; it may also be created after an application preload event is triggered (which may be before the target application is determined), and so on. Optionally, drawing and displaying an application interface corresponding to the target application program on a pre-created preloaded active window stack based on the fake focus notification, including: judging whether a pre-established preloading active window stack exists or not; if not, creating a preloaded active window stack according to a preset rule; drawing and displaying an application interface corresponding to the target application program on the created preloaded active window stack based on the fake focus notification. The method has the advantages that after the target application program to be preloaded is determined, whether the preloading Stack exists or not is judged, if yes, new construction is not needed, and if not, creation is carried out, so that system resources can be saved. It can be understood that, when a plurality of target applications are included, that is, when a plurality of applications need to be continuously preloaded in a short time, the preloaded Stack is already created before the first target application starts to load, and then the preloaded Stack exists before the second target application starts to load, which may not be necessary.
In the embodiment of the application, a specific process of preloading an application interface corresponding to a target application program based on the preloaded Stack is not limited, and for example, the application interface may be drawn and displayed based on the size of the preloaded Stack.
In some embodiments, after the pre-created preloaded active window stack draws and displays an application interface corresponding to the target application program based on the fake focus notification, the method further includes: and when detecting that the preloading time of the target application program reaches the preset time, sending a fake focus notification to other application programs to be preloaded so as to finish drawing of the application interface of the target application program. The method has the advantages that when the preloading of the target application program is completed or the preloading time duration reaches the set time, the application interface drawing can be finished, the fake focus notification is sent to other application programs to be preloaded, and the next application program to be preloaded can obtain the fake focus and draw the application interface. When a fake focus notification is sent to other application programs, the fake focus occupied by the target application program is cancelled, and the phenomenon that too many fake focuses are forged and the stability of the system is affected is prevented.
In some embodiments, the preset duration is greater than or equal to a playing duration of the start advertisement or the start animation corresponding to the target application program. Some application programs usually play some advertisements or animations during the starting process, the playing time of the advertisements or animations usually ranges from 3 seconds to ten seconds, and during the playing of the advertisements or animations, a user may not have any operation and only wait for the completion of the playing, which wastes valuable time of the user. The method and the device have the advantages that the starting advertisement or the starting animation can be played out of the screen before the target application program is started, and when the target application program is started, the main page or other user operable interfaces of the application program can be directly accessed, so that the operable time point of the target application program is further advanced, and the waiting time is reduced.
In some embodiments, said sending a fake focus notification to said target application comprises: and calling a method for changing the window focus of the client side of the active window corresponding to the target application program so as to enable the active window corresponding to the target application program to obtain a fake focus. Specifically, the method for forging the focus may be a method for changing the focus of a window (also referred to as an active window) at a client end of the calling window, so that the window acquires the focus. For an Android operating system, the forged focus notification can be sent based on a Binder mechanism, which is the most common mode of interprocess communication of the Android system and adopts a c/s architecture, namely a client/service architecture.
In some embodiments, after the drawing of the application interface corresponding to the target application based on the fake focus notification, the method further includes: and when an operation instruction of the target application program is received, transferring an application interface corresponding to the target application program contained in the preloading active window stack to the display screen for displaying. The method has the advantages that when the target application program really needs to be started, the drawn application interface is directly migrated to the display screen to be displayed, the application interface can be rapidly switched, and the starting speed is improved.
In some embodiments, the migrating an application interface corresponding to the target application program included in the preloaded active window stack to the display screen for display includes: migrating a task stack corresponding to the target application program contained in the preloading active window stack to the top of an application active window stack; and updating the size information, the configuration information and the visibility of the task stack to realize that the application interface corresponding to the target application program is displayed on the display screen. The advantage that sets up like this lies in, can guarantee the stability of interface migration process, guarantees that the card screen can not appear in the recovery process, the black screen or the migration speed is slow scheduling problem.
For some terminals, especially mobile terminals such as mobile phones and tablet computers, in order to facilitate the use of users, the display modes of the display screen generally include vertical screen display and horizontal screen display, many applications display by default in the vertical screen mode, some applications display by default in the horizontal screen mode (such as some network games), and some applications switch the horizontal and vertical screen display along with the direction in which the user holds the terminal during the use of the terminal. In some embodiments of the present application, a boundary coordinate corresponding to the preloaded active window stack is (H, 0,2H, H), a coordinate system corresponding to the boundary coordinate is a system coordinate, an origin of the system coordinate is an upper left corner of the display screen, and H is a length of a long side of a display area of the display screen. That is, the side corresponding to H is the maximum side of the display area of the display screen, and is the height of the display screen in the vertical screen display and the width of the display screen in the horizontal screen display. This is done to allow for the display of a landscape screen, pre-loaded application landscape displays, and the normal display of some applications. Fig. 2 is a schematic diagram illustrating a relative position relationship between a preloaded active window stack and a display area of a display screen according to an embodiment of the present disclosure. As shown in fig. 2, at this time, the display screen is in a vertical screen mode, the origin of the terminal system coordinates is the left vertex (0,0) of the display screen 201, the width direction of the display screen 201 is the X axis, the height direction is the Y axis, the boundary coordinates corresponding to the preloaded Stack202 are (H, 0,2H, H), H is the screen height, that is, the area in the left solid line rectangular range is the main screen display area, and the area in the right dotted line rectangular range is the preloaded display area. Fig. 3 is a schematic diagram illustrating a relative position relationship between a preloaded active window stack and a display area of a display screen according to an embodiment of the present application. As shown in fig. 3, at this time, the display screen is in a landscape mode, the origin of the terminal system coordinates is the left vertex (0,0) of the display screen 301, the height direction of the display screen 301 is the X axis, the width direction is the Y axis, the boundary coordinates corresponding to the preloaded Stack202 are (H, 0,2H, H), H is the screen height, that is, the area in the left solid line rectangular range is the main screen display area, and the area in the right dotted line rectangular range is the preloaded display area.
The reason why the pre-loaded Stack boundaries are so set is that:
the abscissa of the upper left corner is H, which is an interface for preventing the display screen (also referred to as a main screen) from displaying the preloaded application during the landscape screen, and since the main screen has a landscape mode in addition to the portrait mode, the abscissa of the upper left corner of the rectangular area corresponding to the preloaded Stack is set to the screen height in order to prevent the main screen display area from displaying the local part of the preloaded application during the landscape screen of the main screen.
The ordinate in the upper left corner is 0 in order for the preload application to be able to calculate the status bar height correctly. In order to better design a User Interface (UI), the Android application can customize the top status bar, and if the vertical coordinate corresponding to the upper edge is not equal to 0, the height of the status bar may be wrong.
The abscissa of the lower right corner is 2H (2 times the screen height), that is, the width of the rectangle corresponding to the preloaded Stack is equal to the screen height, so that the size of the preloaded Stack can contain the landscape application at the time of preloading (that is, the application interface is an application program in a landscape display mode).
The ordinate of the lower right corner is H, i.e. the height of the rectangle corresponding to the preloaded Stack is equal to the screen height, so as to preload the size of the Stack and be able to contain the vertical screen application at the time of preloading.
For the reasons described above, the inventors set the size of the preload Stack to (H, 0,2H, H).
In addition, fig. 4 is a schematic application interface migration diagram provided in the embodiment of the present application, as shown in fig. 4, when an operation instruction of a target application program is received, an application interface 401 corresponding to the target application program included in a preloaded active window Stack is migrated to a display screen 201 to be displayed, specifically, a task to which the preloaded application interface belongs is migrated to the top of an application active window Stack, and size information, configuration information, and visibility of the task are updated, so that the application interface can be normally displayed on the display screen.
Fig. 5 is a schematic flowchart of another application preloading method according to an embodiment of the present application, where the method includes the following steps:
step 501, when detecting that an application preloading event is triggered, determining a target application program to be preloaded.
Step 502, a target process corresponding to the target application program is created, and the target process is initialized.
Step 503, creating a task stack corresponding to the target application program in the preloading active window stack.
Step 504, starting an active window corresponding to the target application program in the task stack based on the target process.
And 505, calling a method for changing the window focus of the client of the active window so as to enable the active window to obtain a fake focus.
And step 506, drawing and displaying an application interface corresponding to the target application program based on the fake focus and the active window.
And 507, when the pre-loading duration of the target application program reaches the preset duration, sending a fake focus notification to other application programs to be pre-loaded so as to finish drawing of the application interface of the target application program.
Step 508, when receiving an operation instruction of a target application program, migrating a task stack corresponding to the target application program contained in the preloaded active window stack to the top of an application active window stack.
Specifically, taking an application active window as an App Stack as an example, moving the task to the App Stack may include: this task is removed from the list in the original Stack (i.e., the preloaded Stack) and added at the top in the new Stack (app Stack). Each stack has a list for recording all the tasks contained in the stack; correspondingly, each task will record the stack information of the task at the same time. Since a stack contains attributes such as size, configuration, visibility, and zorder, which may be different from other stacks, the attributes such as zorder of the task may be changed simply by adding the task to the list of the new stack. The top added in the new stack is to make the task visible.
And 509, updating the size information, the configuration information and the visibility of the task stack to display the current application interface corresponding to the target application program on a display screen.
It can be understood that, in the preloading process, the application interface corresponding to the target application program is in the continuous drawing and display updating process, and the timing when the user really starts the target application program is uncertain, and may receive an operation instruction in the preloading process, so that the application interface currently displayed in the preloading Stack may be migrated to the display screen for display. If the user opens the target application program after the preloading is completed, the last application interface when the preloading is completed can be migrated to the display screen to be displayed.
Specifically, the updating of the size information and the configuration information of the task stack is to change the boundary of the application, and may specifically include: actively updating the size and configuration information. The size and configuration of the task cannot be changed immediately only by using the above task migration operation, so that the method for modifying the size and configuration of the task can be actively called, the application state is ensured to be correct, and the application can normally work in the foreground.
Specifically, the update task is visible because, after the size and configuration are updated, the target application may not be visible at this time, a method of updating the visibility of the new stack is invoked, the visible applications are searched from top to bottom, set to visible, and the corresponding window surface is updated to visible. The visible application judgment method may include: is not occluded by other applications on the zorder; is not shielded by the lock screen; the state of the top activity of the application is a non-initializing or non-exiting state.
The application program preloading method provided by the embodiment of the application program preloading method can be used for drawing and displaying the application interface of the application program needing preloading based on the preloading activity window stack established outside the display screen, greatly completing the preparation work before application starting, not influencing the display of the display content of the foreground application program on the display screen, and directly migrating the preloaded application interface to the display screen for displaying when the target application program is really started, so that the starting speed is effectively improved.
Fig. 6 is a block diagram of an application preloading device according to an embodiment of the present disclosure, where the application preloading device may be implemented by software and/or hardware, and is generally integrated in a terminal, and may perform preloading of an application by executing an application preloading method. As shown in fig. 6, the apparatus includes:
an event trigger detection module 601, configured to detect whether an application preloading event is triggered;
the application determining module 602 is configured to determine a target application program to be preloaded after detecting that an application preloading event is triggered;
a fake focus notification sending module 603 configured to send a fake focus notification to the target application; wherein the fake focus is independent from the focus corresponding to the foreground application;
an interface drawing module 604, configured to draw an application interface corresponding to the target application program based on the fake focus notification.
The application program preloading device provided by the embodiment of the application program preloading method and device can be used for drawing the application interface of the application program to be preloaded under the condition that foreground application program operation and interface drawing are not influenced, so that the application program can be preloaded, the preparation work before application starting can be completed to a large extent by the aid of the preloading mode, and the starting speed of the target application program is increased.
Optionally, the drawing an application interface corresponding to the target application program based on the fake focus notification includes:
and drawing and displaying an application interface corresponding to the target application program on a pre-built pre-loaded active window stack based on the fake focus notification, wherein the boundary coordinate corresponding to the pre-loaded active window stack is positioned outside the coordinate range of the display screen.
Optionally, the apparatus further comprises:
and the loading time length detection module is used for sending a fake focus notification to other application programs to be preloaded to finish the drawing of the application interface of the target application program when the preset time length of the target application program is detected to be reached after the application interface corresponding to the target application program is drawn and displayed on a pre-established preloading active window stack based on the fake focus notification.
Optionally, the preset time length is greater than or equal to a playing time length of the starting advertisement or the starting animation corresponding to the target application program.
Optionally, the sending a fake focus notification to the target application includes:
and calling a method for changing the window focus of the client side of the active window corresponding to the target application program so as to enable the active window corresponding to the target application program to obtain a fake focus.
Optionally, the apparatus further comprises:
and the interface migration module is used for migrating the application interface corresponding to the target application program contained in the preloaded active window stack to the display screen for displaying when receiving an operation instruction of the target application program after the drawing of the application interface corresponding to the target application program is performed based on the fake focus notification.
Optionally, the boundary coordinate corresponding to the preloaded active window stack is (H, 0,2H, H), the coordinate system corresponding to the boundary coordinate is a system coordinate, an origin of the system coordinate is an upper left corner of the display screen, and H is a length of a long edge of a display area of the display screen.
Embodiments of the present application also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a method for preloading applications, the method comprising:
detecting that an application preload event is triggered;
determining a target application program to be preloaded;
and sending a fake focus notification to the target application program, and drawing an application interface corresponding to the target application program based on the fake focus notification, wherein the fake focus is independent from a focus corresponding to foreground application.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDRRAM, SRAM, EDORAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium provided in the embodiments of the present application contains computer-executable instructions, and the computer-executable instructions are not limited to the application preloading operation described above, and may also perform related operations in the application preloading method provided in any embodiment of the present application.
The embodiment of the application provides a terminal, and the terminal can be integrated with the application preloading device provided by the embodiment of the application. Fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present application. The terminal 700 may include: the application preloading method comprises a memory 701, a processor 702 and a computer program which is stored on the memory 701 and can be run by the processor 702, wherein the application preloading method is realized when the processor 702 executes the computer program.
The terminal provided by the embodiment of the application can draw the application interface of the application program to be preloaded under the condition that the operation of the foreground application program and the drawing of the interface are not influenced, so that the preloading of the application program is realized, the preparation work before the application is started can be completed to a greater extent by the preloading mode, and the starting speed of the target application program is increased.
Fig. 8 is a schematic structural diagram of another terminal provided in the embodiment of the present application, where the terminal may include: a housing (not shown), a memory 801, a Central Processing Unit (CPU) 802 (also called a processor, hereinafter referred to as CPU), a circuit board (not shown), and a power circuit (not shown). The circuit board is arranged in a space enclosed by the shell; the CPU802 and the memory 801 are provided on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the terminal; the memory 801 is used for storing executable program codes; the CPU802 executes a computer program corresponding to the executable program code stored in the memory 801 by reading the executable program code to realize the steps of:
detecting that an application preload event is triggered;
determining a target application program to be preloaded;
and sending a fake focus notification to the target application program, and drawing an application interface corresponding to the target application program based on the fake focus notification, wherein the fake focus is independent from a focus corresponding to foreground application.
The terminal further comprises: peripheral interface 803, RF (Radio Frequency) circuitry 805, audio circuitry 806, speakers 811, power management chip 808, input/output (I/O) subsystem 809, other input/control devices 810, touch screen 812, other input/control devices 810, and external port 804, which communicate over one or more communication buses or signal lines 807.
It should be understood that the illustrated terminal 800 is merely one example of a terminal and that the terminal 800 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes in detail the terminal for preloading applications provided in this embodiment, where the terminal is a mobile phone as an example.
A memory 801, the memory 801 being accessible by the CPU802, the peripheral interface 803, and the like, the memory 801 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices.
A peripheral interface 803, said peripheral interface 803 allowing input and output peripherals of the device to be connected to the CPU802 and the memory 801.
I/O subsystem 809, which I/O subsystem 809 may connect input and output peripherals on the device, such as touch screen 812 and other input/control devices 810, to peripheral interface 803. The I/O subsystem 809 may include a display controller 8091 and one or more input controllers 8092 for controlling other input/control devices 810. Where one or more input controllers 8092 receive electrical signals from or transmit electrical signals to other input/control devices 810, other input/control devices 810 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is worth noting that the input controller 8092 may be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
A touch screen 812, which touch screen 812 is an input interface and an output interface between the user terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like.
The display controller 8091 in the I/O subsystem 809 receives electrical signals from the touch screen 812 or sends electrical signals to the touch screen 812. The touch screen 812 detects a contact on the touch screen, and the display controller 8091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 812, that is, implements a human-computer interaction, and the user interface object displayed on the touch screen 812 may be an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 805 is mainly used to establish communication between the mobile phone and the wireless network (i.e., the network side), and implement data reception and transmission between the mobile phone and the wireless network. Such as sending and receiving short messages, e-mails, etc. In particular, the RF circuitry 805 receives and transmits RF signals, also referred to as electromagnetic signals, which the RF circuitry 805 converts to or from electrical signals, and communicates with communication networks and other devices over. RF circuitry 805 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC (CODEC) chipset, a Subscriber Identity Module (SIM), and so forth.
The audio circuit 806 is mainly used to receive audio data from the peripheral interface 803, convert the audio data into an electric signal, and transmit the electric signal to the speaker 811.
The speaker 811 is used to convert the voice signal received by the handset from the wireless network through the RF circuit 805 into sound and play the sound to the user.
And the power management chip 808 is used for supplying power and managing power to the hardware connected with the CPU802, the I/O subsystem and the peripheral interface.
The application preloading device, the storage medium and the terminal provided in the above embodiments can execute the application preloading method provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. Technical details that are not described in detail in the above embodiments may be referred to an application preloading method provided in any embodiment of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (9)

1. An application preloading method, comprising:
detecting that an application preload event is triggered;
determining a target application program to be preloaded;
sending a fake focus notification to the target application program, drawing and displaying an application interface corresponding to the target application program on a pre-established pre-loaded active window stack based on the fake focus notification, wherein the fake focus is independent from a focus corresponding to foreground application;
and when detecting that the preloading time of the target application program reaches the preset time, sending a fake focus notification to other application programs to be preloaded so as to finish drawing of the application interface of the target application program.
2. The method of claim 1, comprising:
and the boundary coordinate corresponding to the preloading active window stack is positioned outside the coordinate range of the display screen.
3. The method of claim 1, wherein the preset duration is greater than or equal to a playing duration of a start advertisement or a start animation corresponding to the target application.
4. The method of claim 1, wherein sending a fake focus notification to the target application comprises:
and calling a method for changing the window focus of the client side of the active window corresponding to the target application program so as to enable the active window corresponding to the target application program to obtain a fake focus.
5. The method of claim 2, further comprising, after the drawing an application interface corresponding to the target application on a pre-created pre-loaded active window stack based on the fake focus notification:
and when an operation instruction of the target application program is received, transferring an application interface corresponding to the target application program contained in the preloading active window stack to the display screen for displaying.
6. The method of claim 2, wherein the boundary coordinates corresponding to the preloaded active window stack are (H, 0,2H, H), the coordinate system corresponding to the boundary coordinates is system coordinates, an origin of the system coordinates is an upper left corner of the display screen, and H is a length of a long side of a display area of the display screen.
7. An application preloading device, comprising:
the event trigger detection module is used for detecting whether an application preloading event is triggered or not;
the application determination module is used for determining a target application program to be preloaded after detecting that an application preloading event is triggered;
a fake focus notification sending module for sending a fake focus notification to the target application; wherein the fake focus is independent from the focus corresponding to the foreground application;
the interface drawing module is used for drawing and displaying an application interface corresponding to the target application program on the basis of the fake focus notification in a pre-built pre-loaded active window stack;
and the loading duration detection module is used for sending a fake focus notification to other application programs to be preloaded when detecting that the preloading duration of the target application program reaches the preset duration so as to finish the drawing of the application interface of the target application program.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method for preloading application programs according to any one of claims 1-6.
9. A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the application preloading method according to any of claims 1-6 when executing the computer program.
CN201810444100.1A 2018-05-10 2018-05-10 Application program preloading method and device, storage medium and terminal Active CN108647056B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810444100.1A CN108647056B (en) 2018-05-10 2018-05-10 Application program preloading method and device, storage medium and terminal
PCT/CN2019/084790 WO2019214477A1 (en) 2018-05-10 2019-04-28 Application program pre-loading method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810444100.1A CN108647056B (en) 2018-05-10 2018-05-10 Application program preloading method and device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN108647056A CN108647056A (en) 2018-10-12
CN108647056B true CN108647056B (en) 2020-04-24

Family

ID=63754177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810444100.1A Active CN108647056B (en) 2018-05-10 2018-05-10 Application program preloading method and device, storage medium and terminal

Country Status (2)

Country Link
CN (1) CN108647056B (en)
WO (1) WO2019214477A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108647056B (en) * 2018-05-10 2020-04-24 上海瑾盛通信科技有限公司 Application program preloading method and device, storage medium and terminal
CN108595228B (en) 2018-05-10 2021-03-12 Oppo广东移动通信有限公司 Application program prediction model establishing method and device, storage medium and mobile terminal
CN108595227A (en) 2018-05-10 2018-09-28 Oppo广东移动通信有限公司 Application program preloads method, apparatus, storage medium and mobile terminal
CN108710513B (en) 2018-05-15 2020-07-21 Oppo广东移动通信有限公司 Application program starting method and device, storage medium and terminal
CN108804157A (en) 2018-06-05 2018-11-13 Oppo广东移动通信有限公司 Application program preloads method, apparatus, storage medium and terminal
CN113268286A (en) * 2021-06-09 2021-08-17 深圳市火乐科技发展有限公司 Application starting method and device, projection equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106000A (en) * 2013-01-23 2013-05-15 东莞宇龙通信科技有限公司 Implementing method and communication terminal of multi-focus window
CN103376974A (en) * 2013-06-28 2013-10-30 广州市动景计算机科技有限公司 Window switching method and device
CN104657183A (en) * 2015-03-09 2015-05-27 联想(北京)有限公司 Information processing method, information processing device and electronic equipment
CN105094861A (en) * 2014-05-06 2015-11-25 腾讯科技(深圳)有限公司 Webpage application program loading method, device and system
CN105657522A (en) * 2016-01-05 2016-06-08 深圳市金立通信设备有限公司 Video playing method and terminal
CN108595224A (en) * 2018-04-28 2018-09-28 Oppo广东移动通信有限公司 Application prompts method, apparatus, storage medium and terminal

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7478204B2 (en) * 2004-04-29 2009-01-13 International Business Machines Corporation Efficient sharing of memory between applications running under different operating systems on a shared hardware system
KR20130054076A (en) * 2011-11-16 2013-05-24 삼성전자주식회사 Apparatus having a touch screen pre-loading plurality of applications and method for controlling thereof
CN102841804B (en) * 2012-06-27 2014-12-10 北京三星通信技术研究有限公司 Method and device for processing multiple foreground tasks on screen
CN104298554B (en) * 2013-07-15 2019-01-18 北京三星通信技术研究有限公司 Manage the method and device of multitask application program
US9588897B2 (en) * 2013-07-19 2017-03-07 Samsung Electronics Co., Ltd. Adaptive application caching for mobile devices
CN104461242B (en) * 2014-12-08 2017-12-01 深圳市嘉乐派科技有限公司 A kind of multi-window interface implementation method based on Android operation system
CN108647052B (en) * 2018-04-28 2020-12-01 Oppo广东移动通信有限公司 Application program preloading method and device, storage medium and terminal
CN108647056B (en) * 2018-05-10 2020-04-24 上海瑾盛通信科技有限公司 Application program preloading method and device, storage medium and terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103106000A (en) * 2013-01-23 2013-05-15 东莞宇龙通信科技有限公司 Implementing method and communication terminal of multi-focus window
CN103376974A (en) * 2013-06-28 2013-10-30 广州市动景计算机科技有限公司 Window switching method and device
CN105094861A (en) * 2014-05-06 2015-11-25 腾讯科技(深圳)有限公司 Webpage application program loading method, device and system
CN104657183A (en) * 2015-03-09 2015-05-27 联想(北京)有限公司 Information processing method, information processing device and electronic equipment
CN105657522A (en) * 2016-01-05 2016-06-08 深圳市金立通信设备有限公司 Video playing method and terminal
CN108595224A (en) * 2018-04-28 2018-09-28 Oppo广东移动通信有限公司 Application prompts method, apparatus, storage medium and terminal

Also Published As

Publication number Publication date
CN108647056A (en) 2018-10-12
WO2019214477A1 (en) 2019-11-14

Similar Documents

Publication Publication Date Title
CN108614722B (en) Application program preloading method and device, storage medium and terminal
CN108762843B (en) Application program preloading method and device, storage medium and intelligent terminal
CN108363593B (en) Application program preloading method and device, storage medium and terminal
CN108647052B (en) Application program preloading method and device, storage medium and terminal
CN108647055B (en) Application program preloading method and device, storage medium and terminal
CN108710513B (en) Application program starting method and device, storage medium and terminal
CN108958830B (en) Application program starting method and device, storage medium and terminal
CN108681475B (en) Application program preloading method and device, storage medium and mobile terminal
US11467855B2 (en) Application preloading method and device, storage medium and terminal
CN108595230B (en) Application program preloading method and device, storage medium and terminal
EP3579104B1 (en) Method and apparatus for establishing an application prediction model, storage medium and terminal
CN108829457B (en) Application program prediction model updating method and device, storage medium and terminal
CN108595231B (en) Application program preloading method and device, storage medium and intelligent terminal
CN108595224B (en) Application program prompting method and device, storage medium and terminal
CN108647056B (en) Application program preloading method and device, storage medium and terminal
CN108804153B (en) Application program preloading method and device, storage medium and terminal
CN108776599B (en) Management method and device for preloaded application, storage medium and intelligent terminal
CN108762831B (en) Application program preloading method and device, storage medium and terminal
CN108958828B (en) Application program preloading method and device, storage medium and terminal
CN108920202B (en) Application preloading management method and device, storage medium and intelligent terminal
EP3575963A2 (en) Method for preloading application, storage medium, and terminal
CN108647057B (en) Screen direction setting method and device, storage medium and terminal
CN108762844B (en) Application program preloading method and device, storage medium and terminal
CN108762836B (en) Management method and device for preloaded application, storage medium and intelligent terminal
CN108710512B (en) Application program preloading method and device, storage medium and intelligent terminal

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
TA01 Transfer of patent application right

Effective date of registration: 20190111

Address after: Room 2101, 600 Longhuazhong Road, Xuhui District, Shanghai, 2002

Applicant after: Shanghai Jinsheng Communication Technology Co., Ltd.

Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant before: OPPO Guangdong Mobile Communications Co., Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant