WO2019218885A1 - Application program pre-loading method and apparatus, and storage medium and intelligent terminal - Google Patents

Application program pre-loading method and apparatus, and storage medium and intelligent terminal Download PDF

Info

Publication number
WO2019218885A1
WO2019218885A1 PCT/CN2019/085662 CN2019085662W WO2019218885A1 WO 2019218885 A1 WO2019218885 A1 WO 2019218885A1 CN 2019085662 W CN2019085662 W CN 2019085662W WO 2019218885 A1 WO2019218885 A1 WO 2019218885A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
preloaded
stack
preloading
event
Prior art date
Application number
PCT/CN2019/085662
Other languages
French (fr)
Chinese (zh)
Inventor
黄粟
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2019218885A1 publication Critical patent/WO2019218885A1/en

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/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • 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/44594Unloading

Definitions

  • the embodiment of the present application relates to an application loading technology, for example, to an application preload management method and device, a storage medium, and an intelligent terminal.
  • terminals such as smart phones, tablets, notebook computers, and smart home appliances have become indispensable electronic devices in people's daily lives.
  • terminal devices As terminal devices continue to be intelligent, most terminal devices are loaded with an operating system, enabling the terminal devices to install a wide variety of applications to meet different user needs.
  • the terminal loads the resources required for the application to start. After the pre-loading is completed, the initial interface of the application is entered, and the whole process usually takes several seconds or even ten seconds. The startup of the application is less efficient and needs to be improved.
  • the embodiment of the present application provides an application preload management method and device, a storage medium, and an intelligent terminal, which can optimize an application loading scheme in the related technology, and improve the accuracy of the preloading operation.
  • an embodiment of the present application provides an application preloading method, including:
  • the background process that performs the preload operation is frozen, and the application is started according to the open event;
  • the application is closed, and the background process is thawed, and the preloading operation is continued.
  • an embodiment of the present application further provides an application preloading apparatus, where the apparatus includes:
  • An event detection module configured to acquire an application open event when a preload operation is performed on a preloaded application in the background
  • a process freeze module configured to freeze a background process that performs the preloading operation when the open event is triggered by an application notification, and open the application according to the open event;
  • the operation obtaining module is configured to acquire a user operation in a preset time interval
  • the process defrosting module is configured to: if the user operation triggers a shutdown event of the application, close the application, and thaw the background process, and continue to perform the preloading operation.
  • the embodiment of the present application provides a computer readable storage medium, where a computer program is stored, and when the program is executed by the processor, the application preloading method is implemented as described in the embodiment of the present application.
  • an embodiment of the present application provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable by the processor, where the processor executes the computer program to implement an embodiment of the present application.
  • the application preloading method.
  • An embodiment of the present application provides an application preloading scheme, which is configured to acquire an application startup event when the preloading application performs a preloading operation in the background, and freezes the background of executing the preloading operation when the opening event is triggered by the application notification.
  • the process starts the application according to the open event; acquires a user operation within a preset time interval, and if the user operation includes a shutdown indication of the application, closes the application, and thaws the background process to continue the preload operation.
  • FIG. 1 is a flowchart of an application preloading method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a relative position relationship between a preloaded active window stack and a display screen display area according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a relative positional relationship between a preloaded active window stack and a display screen display area 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 of another application preloading method according to an embodiment of the present disclosure.
  • FIG. 6 is a structural block diagram of an application preloading apparatus according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present disclosure.
  • FIG. 8 is a structural block diagram of a smart phone according to an embodiment of the present application.
  • the application notification is usually displayed in the form of a pop-up box, and the user clicks the pop-up box to run the application to notify the corresponding application. It may happen that after the video application is opened, the user initiates WeChat due to a false notification of the application notification of WeChat. If the application is preloading in the background at this time, in order to guarantee the startup speed of WeChat, the application preloading is usually stopped, and the application to be preloaded is re-predicted. In this case, the true intention of the user may not open WeChat, then the above application re-prediction and stop applying the pre-loading operation may be a misoperation, and does not meet the user's true intention of use.
  • the embodiment of the present application provides an application preloading scheme, which can effectively avoid the situation that the application preloading and the application prediction are interfered by the user accidentally starting other applications.
  • FIG. 1 is a flowchart of an application preloading method according to an embodiment of the present application.
  • the method may be implemented by an application preloading device, where the device may be implemented by software and/or hardware, and may be integrated into an intelligent terminal. Inside. As shown in FIG. 1, the method includes: Step 110 to Step 140.
  • step 110 an open event of the application is obtained when a preload operation is performed on the preloaded application in the background.
  • the smart terminal in the embodiment of the present application may include a terminal device such as a mobile phone, a tablet computer, a notebook computer, and a smart home appliance.
  • the operating system is loaded in the terminal.
  • the operating system can be Android, iOS, BlackBerry OS or windows mobile.
  • the pre-loading operation may be an operation of pre-loading an application interface, launching an advertisement, and starting an animation, etc., before the application is started.
  • the pre-loading operation may be an operation of pre-loading an application interface, launching an advertisement, and starting an animation, etc., before the application is started.
  • determining that the application to be preloaded based on the pre-created preloading active window stack preloading the application interface corresponding to the target application, launching the advertisement, and starting the animation, etc.
  • the boundary coordinates corresponding to the preloaded active window stack are outside the coordinate range of the display screen.
  • the resources that need to be pre-loaded are not limited to the foregoing startup resources, and may be other resources, such as application service startup, memory allocation, file content reading, and network data acquisition, which are not specifically limited in this embodiment.
  • the triggering condition of the application pre-loading event may be set according to the actual situation, which is not specifically limited in this embodiment.
  • the application preloading event may be triggered when it is detected that the user's action satisfies a preset condition (such as picking up the terminal, inputting a screen unlocking operation, or inputting a terminal unlocking operation, etc.); or when detecting that the foreground application is changed, The application preload event is triggered; or the application preload event can be triggered immediately (or after a preset duration) after the pre-loading application's prediction process ends; or it can be triggered at regular intervals.
  • a preset condition such as picking up the terminal, inputting a screen unlocking operation, or inputting a terminal unlocking operation, etc.
  • the application to be preloaded can be understood as an application that the user may open soon, and may be a fixed application that is preset or an application that is predicted in a certain manner.
  • the application to be preloaded may include one or more.
  • the target application can be understood as the application to be preloaded that currently needs to be preloaded.
  • the target application can also include one or more.
  • the target application can be one (ie, multiple pre-loaded applications are determined as target applications one by one, and preloaded one by one), or multiple (two will be)
  • the above pre-loaded application is determined to be the target application, and the pre-loading operation is performed at the same time, that is, the pre-loading process of the plurality of target applications may be performed in parallel).
  • the active window can be understood as an independent interface that provides interaction and operation directly to the user, and different nouns may be used to name the interface in different operating systems.
  • pre-loading the application interface of the target application outside the display screen may be implemented based on a multi-window mechanism of the operating system, and the size corresponding to the application is set outside the display screen through the multi-window mechanism to achieve The purpose of the user's invisibility is such that it does not affect the display of the foreground application's display content on the display screen.
  • the open event can be an event that triggers the application to run.
  • the open event can be triggered by a user operation, such as the user clicking an application icon, or the user inputting a preset gesture, etc., and can also be triggered by an application notification.
  • the application notification may be a notification or an advertisement of a cloud line client application pushing a message.
  • an operation of detecting an open event of the application is triggered, that is, during the execution of the preloading operation, the open event of the application is monitored, and the detected event is detected.
  • the trigger body of the open event is determined.
  • the application may be an application to be preloaded, an application that has been loaded, or an application that is not preloaded.
  • Trigger bodies include, but are not limited to, application notifications, touch screens, sensors (including infrared sensors, ultrasonic sensors, acceleration sensors, and cameras).
  • the triggering body is an application notification, determining that the opening event is triggered by an application notification; if the triggering body is a touch screen or a sensor, determining that the opening event is triggered by a user operation.
  • the application notification is a system function of Android, and the notification notification subsystem can be used to determine whether the application notification is operated, and if so, jump to the application corresponding to the application notification.
  • step 120 when the open event is triggered by the application notification, the background process executing the preload operation is frozen, and the application is started according to the open event.
  • the background process is a process that performs a preload operation of the application.
  • the background process is a target process corresponding to the target application, and the active window corresponding to the target application is started in the preset task stack based on the target process, and the application corresponding to the target application is drawn and displayed based on the activated active window.
  • the interface, wherein the preset task stack may be a task stack corresponding to the target application created in advance in the preload activity window.
  • the background process that freezes the preloading operation may suspend the background process, so that the background process no longer performs any operations.
  • the background process that is performing the preload operation of the target application is suspended to suspend the preload operation performed by the background process, and the open event is started in response to the open event. Open the application corresponding to the event.
  • the starting application as the recovery starting point may also be determined according to the preloaded completed application; the starting application is stored in association The identification information and the process identifier of the background process, and freeze the background process.
  • step 130 a user operation within a preset time interval is obtained.
  • the preset time interval may be set by the user according to actual needs, or may be the system default time. For example, pre-collecting a set number of user groups for operation information of the application, extracting target operation information that the user opens the application to close the application for less than a preset time, and analyzing the target operation information to determine that the user is most likely to open an application by mistake. How long after the application is closed, the preset time interval is determined based on the analysis result, and is pre-configured before the smart terminal leaves the factory.
  • the user operation may refer to the operation of closing the application triggered by the application notification, including but not limited to inputting a touch operation for the application triggered by the application notification by the touch screen input, and inputting the preset shutdown.
  • User actions can trigger the application's shutdown time.
  • step 140 if the user operation triggers a shutdown event of the application, the application is closed, and the background process is thawed, and the pre-loading operation is continued.
  • thawing background process may be to restore the background process that has just been frozen, so that the background process continues to execute the preloading operation of the application.
  • the application initiated by the application notification is closed in response to the shutdown event.
  • a preloading operation is performed on the remaining applications to be preloaded by the background process.
  • the application interface corresponding to the target application is preloaded based on the pre-created preload active window stack by the background process, wherein the target application may be A remaining preloaded application including a starting application; the boundary coordinates corresponding to the preloaded active window stack are outside the coordinate range of the display screen.
  • the remaining target applications are applications that are not preloaded in the preloaded application. When these applications become applications that need to be preloaded at present, they can be marked as target applications.
  • the advantage of this design is that the application interface of the application that needs to be preloaded can be preloaded based on the preloaded active window stack created outside the display screen, and the preloading method can complete the preparation work before the application is started to a large extent. Improves the startup speed of the target application without affecting the display of the foreground application's display on the display screen.
  • the active window is called Activity.
  • An Activity is a component responsible for interacting with a user, providing a screen (which can be understood as a screen interface rather than a physical display screen) for the user to interact with a task.
  • an android application an Activity is usually a separate screen that can display some controls and listen and handle user events.
  • Task task stack
  • Stack active window stack
  • Task corresponds to an application
  • Task is used to store Activity
  • a Task can store one or more Activity, and these activities follow the principle of "advanced, last in, first out”.
  • Stack is used to manage the Task.
  • a Stack manages the Tasks to which each Activity needs to be displayed on a screen.
  • a Stack can manage one or more Tasks.
  • Stack also follows the basic management principles of the stack.
  • the screen described here is not necessarily a completely separate display. Taking "two screens" as an example, these two screens may be just two areas in a complete display that independently display their respective display contents. Of course, if the terminal has two or even more than two independent displays, the "two screens" can also be two separate displays.
  • multi-window mode is supported, which can include split screen mode, picture in picture mode, and free mode (FreeForm).
  • the Stack on which the application resides can have its own size, which can include the top, bottom, left, and right coordinates in the coordinate system with the top left corner of the terminal screen as the origin.
  • (a, b, c, d) generally describes the boundary of a rectangle, which can be represented by the coordinates of the upper left corner of the rectangle and the coordinates of the lower right corner, that is, the coordinates of the upper left corner of the rectangle are (a, b), right.
  • the lower corner coordinates are (c, d), and such a rectangular area corresponds to the size of the Stack.
  • the in-app layout in the Stack is based on the size of the Stack, which means that the application interface corresponding to the Activity is displayed within the bounds of the size.
  • multiple applications can be allowed to be visible, both system and user visible and only system visible. Both the system and the user are visible to display on the display screen, and the user can see; only the system visible means that the operating system is visible, and the user is invisible, may be blocked by the application of the foreground or as implemented in the application. Display off-screen display.
  • the multi-window mode there may be multiple types of stacks, such as the Home Stack indicating the stack displayed by the desktop application, the App Stack indicating the Stack displayed by the third-party application, and other split screen stacks, etc., in the above three stacks.
  • the included content can be displayed on the display screen, which is collectively referred to as an application active window stack in the embodiment of the present application.
  • a preloaded active window stack (preloaded stack) is added, which is used to represent the stack displayed by the preloaded application, and the boundary coordinates of the preloaded stack are set outside the coordinate range of the display screen, and are to be preloaded.
  • the application can be displayed on the Stack.
  • a new stack dedicated to displaying preloaded applications can be created based on the multi-window mechanism of the Android system.
  • the new stack is created because the newly created preloaded stack can have its own size and visibility, thereby achieving pre-loading on the display screen.
  • the creation time of the preloaded stack is not limited, and the preloaded stack is in the resident state by default, that is, the preloaded stack is always present; or the terminal is successfully unlocked when the terminal is powered on or the terminal is successfully unlocked.
  • Post-create can also be created after the application preload event is triggered (can be determined before the target application is determined).
  • the specific process of the application interface corresponding to the preloading of the target application is not limited.
  • the application interface may be drawn and displayed based on the size of the preloaded stack.
  • the opening event of the application is acquired, and when the opening event is triggered by the application notification, the background process of executing the preloading operation is frozen, and is started according to the The event starts the application; the user operation in the preset time interval is obtained, and if the user operation includes the closing instruction of the application, the application is closed, and the background process is thawed to continue the pre-loading operation.
  • the pre-creating pre-loaded active window stack preloading target application corresponding application interface may include: creating a task stack corresponding to the target application in a pre-created preloaded active window stack; And launching, according to the background process, an active window corresponding to the target application in the task stack; and drawing and displaying an application interface corresponding to the target application based on the activated active window.
  • the advantage of this setting is that the application interface of the target application can be drawn and displayed based on the preloaded active window stack outside the screen coordinate range, without interfering with the operation and display of the foreground application, ensuring system stability and effectively improving The speed at which the target application starts.
  • the creation process of the target process can also include the initialization process of the target process.
  • the preloading of other resources may be involved, such as application service startup, memory allocation, file content reading, and network data acquisition.
  • the preloading process of other resources is not limited in this embodiment.
  • the method further includes: transmitting a forged focus notification to the target application, and maintaining a continuous rendering of the application interface corresponding to the target application and displaying an update for a preset time period based on the forged focus notification.
  • the advantage of this setup is that it can complete the drawing and display of the application interface when the target application gets the focus and the system is visible, and improves the completion of the preload without affecting the focus of the foreground application.
  • the focus in the embodiment of the present application is also referred to as an input focus, and the forged focus is independent of the focus corresponding to the foreground application.
  • the focus is unique. For example, the input operation such as touch is only effective for the focus.
  • the system side and the application end are consistent, and once the system side modifies the input focus information, Sending information that the input focus information changes to the application, so as to ensure that the input information of the system end and the application end are consistent.
  • the purpose of forging the focus on the application end is achieved by separating the manner in which the system side and the application end input the focus information.
  • the pre-loading application forgees the focus notification, so that the preloaded application has the focus information, and the focus information of the system is still correct, so that the processing can enable the preloading application to draw normally, and achieve the purpose of full loading.
  • the focus exists on the system side and the application side. It can be regarded as the server (server) and the client (client).
  • the system side records the application with the focus, and the application saves the flag (flag) to identify whether it has focus.
  • the timing of forging the input focus may be that when the window system of Android adds a window and needs to update the focus, a fake focus notification is generated and sent.
  • the method of forging the focus may be a method of calling the client side of the window to change the focus of the window, so that the window acquires the focus.
  • the sending of the forged focus notification may be performed based on the Binder mechanism, which is the most common way of inter-process communication of the Android system, adopting the c/s architecture, that is, the client/service architecture.
  • the preset time period may be designed according to actual conditions, for example, may be within a fixed duration range after starting preloading, or may be a period from the start of preloading to the completion of preloading.
  • the length of the preset time period includes a play duration in which the advertisement is launched or the animation is activated in the target application.
  • Some applications usually play some advertisements or animations during the startup process.
  • the duration of the advertisement or animation is usually from 3 seconds to ten seconds.
  • the user may not be able to perform any operations. Can wait for the playback to complete, wasting the user's valuable time.
  • the advantage of the setting of the embodiment of the present application is that the startup advertisement or the startup animation can be played out of the screen before the target application is started, and when the target application is started, the main page of the application or other user can be directly operated. Interface to further advance the target time point of the target application and reduce waiting time.
  • the method further includes: when the running instruction of the target application is received, the preloading active window
  • the application interface corresponding to the target application included in the stack is migrated to the display screen for display.
  • the migrating the application interface corresponding to the target application included in the preloaded active window stack to the display screen for display comprises: including the preloaded active window stack
  • the task stack corresponding to the target application is migrated to the top of the application active window stack; the size information, the configuration information, and the visibility of the task stack are updated, so that the application interface corresponding to the target application is implemented on the display screen. display.
  • the display mode of the display screen usually includes vertical screen display and horizontal screen display, and many applications are displayed by vertical screen by default, and some are displayed by default.
  • the application defaults to display in landscape mode (such as some online games).
  • some applications also switch between horizontal and vertical display as the user holds the direction of the terminal.
  • 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
  • the origin of the system coordinates is In the upper left corner of the display screen
  • H is the length of the long side of the display area of the display screen.
  • FIG. 2 is a schematic diagram of a relative position relationship between a preloaded active window stack and a display screen display area according to an embodiment of the present application. As shown in FIG. 2, the display screen is in the vertical screen mode, and 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, and the height direction is the Y axis.
  • the boundary coordinates of the loaded Stack 202 are (H, 0, 2H, H), H is the screen height, that is, the area within the solid line rectangle on the left side is the main screen display area, and the area within the rectangular area of the right dashed line is the preloaded display area.
  • FIG. 3 is a schematic diagram of a relative positional relationship between a preloaded active window stack and a display screen display area according to an embodiment of the present application. As shown in FIG. 3, the display screen is in the horizontal screen mode, and 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, and the width direction is the Y axis.
  • the boundary coordinates of the loaded Stack 202 are (H, 0, 2H, H), H is the screen height, that is, the area within the solid line rectangle on the left side is the main screen display area, and the area within the rectangular area of the right dashed line is the preloaded display area.
  • the horizontal coordinate of the upper left corner is H, which is to prevent the display screen (also called the main screen) from being displayed to the interface of the preloaded application when the horizontal screen is used, because the main screen has the horizontal screen mode and the horizontal screen mode when the main screen is horizontal screen.
  • the horizontal coordinate of the upper left corner of the rectangular area corresponding to the preloaded stack is set to the screen height.
  • the ordinate of the upper left corner is 0, in order to preload the application to correctly calculate the status bar height.
  • the Android application will customize the top status bar. If the corresponding ordinate of the upper side is not equal to 0, the height of the status bar may be wrong.
  • the inventor sets the size of the preloaded stack to (H, 0, 2H, H).
  • FIG. 4 is a schematic diagram of application interface migration according to an embodiment of the present application.
  • an application corresponding to the target application included in the stack of the active window is preloaded.
  • the interface 401 is migrated to the display screen 201 for display.
  • the task to which the preloaded application interface belongs is migrated to the top of the application active window Stack, and the size information, configuration information, and visibility of the task are updated, thereby applying the interface. Can be displayed normally on the display screen.
  • FIG. 5 is a flowchart of another application preloading method according to an embodiment of the present disclosure, where the method includes: Step 501 to Step 512.
  • step 501 it is detected that an application preload event is triggered.
  • step 502 it is determined that the application is to be preloaded.
  • the predictive model can be used to predict the preloaded application.
  • the prediction model may be a machine learning model, and the algorithms used may include Recurrent neural networks (RNN), Long Short-Term Memory (LSTM) networks, threshold loop units, simple loop units, and automatic coding. , decision tree, random forest, feature mean classification, classification regression tree, hidden Markov, K-Nearest Neighbor (KNN) algorithm, logistic regression model, Bayesian model, Gaussian model, and KL divergence (Kullback) –Leibler divergence) and so on.
  • RNN Recurrent neural networks
  • LSTM Long Short-Term Memory
  • KNN K-Nearest Neighbor
  • KNN K-Nearest Neighbor
  • logistic regression model Bayesian model
  • Gaussian model Gaussian model
  • KL divergence Kullback
  • the training sample is collected, and the preset initial model is trained by using the training sample, and finally the prediction model for predicting the application to be preloaded is obtained.
  • the elements included in the training sample may include a time series or sequence of sequences in which the application is opened; may include the time, location, and frequency of the application being opened; may include the operating state of the terminal, such as a switch of the mobile data network Status, connection status of the wireless hotspot, identity information of the connected wireless hotspot, currently running application, previous foreground application, duration of the current application staying in the background, time when the current application was last switched to the background, The plug-in status, charging status, battery level information, and screen display duration of the headphone jack, etc.; can also include data collected by sensors integrated in the terminal, such as motion sensors, light sensors, temperature sensors, and humidity sensors.
  • the appropriate sample elements can be selected according to the selected machine learning model, and the selected machine learning model can be determined according to the selected sample elements, and can also be combined with the requirements for prediction accuracy and preset speed.
  • the selection of the model and the sample elements and the like are not limited in the embodiment of the present application.
  • determining that the application to be preloaded may include determining an application to be preloaded according to an output result before the prediction model, or including using the prediction model to perform prediction, and determining a current output result of the prediction model to be preloaded into the application.
  • step 503 it is determined whether there is a pre-created preloaded active window stack. If not, step 504 is performed; if yes, step 505 is performed.
  • the preloaded stack is created before the first target application starts loading, then the first Before the two target applications start loading, the preloaded stack exists, and it is not necessary to make the above judgment.
  • step 504 a preloaded active window stack is created in accordance with a preset rule.
  • step 505 is continued.
  • step 505 a target process corresponding to the target application is created and the target process is initialized.
  • step 506 a task stack corresponding to the target application is created in the preloaded active window stack.
  • step 507 an active window corresponding to the target application is started in the task stack based on the target process, and a forged focus notification is sent to the target application.
  • step 508 the focus flag corresponding to the update target application is notified according to the forged focus, and the application interface corresponding to the display target application is continuously drawn and updated based on the activated active window within the preset time period.
  • step 509 an open event of the application is obtained.
  • detecting an open event of the application determining, when the open event is detected, a triggering body of the open event; if the triggering body is an application notification, determining that the open event is triggered by an application notification;
  • the triggering body is a touch screen or a sensor, and it is determined that the opening event is triggered by a user operation.
  • step 510 when the open event is triggered by the application notification, the background process executing the preload operation is frozen, and the application is started according to the open event.
  • the background process herein can be regarded as a target process, and the background process is used to start an active window corresponding to the target application in the task stack.
  • the application identifier of the application corresponding to the open event is obtained, and it is determined according to the application identifier whether it is a preloaded application. If the application to be opened is not a preloaded application, the application is opened according to the application loading scheme in the related art. If the application to be opened is an application that has completed preloading, the task stack corresponding to the target application included in the preloaded active window stack is migrated to the top of the application active window stack.
  • moving the task to the App Stack may include: deleting the task from the list in the original stack (ie, preloading the Stack), in the new stack ( Add this task at the top of the App Stack).
  • Each stack has a list for recording all the tasks contained in the stack; correspondingly, each task will also record the stack information of the task. Because the stack contains attributes such as size, configuration, visibility, and zorder that may be different from other stacks, simply adding the task to the list of new stacks can change the attributes of the task's zorder. The top of the new stack is added to make the task visible.
  • the size information, configuration information, and visibility of the task stack are updated to enable the current application interface corresponding to the target application to be displayed on the display screen.
  • the application interface corresponding to the target application is in the process of continuous drawing and display updating, and the timing of the user actually starting the target application is uncertain, and may be in the pre-loading process.
  • the application interface currently displayed in the preloaded stack can be migrated to the display screen for display. If the user opens the target application after the preloading is completed, the last application interface when the preloading is completed can be migrated to the display screen for display.
  • updating the size information and the configuration information of the task stack is to change the boundary of the application, and specifically includes: actively updating the size and configuration information. Only using the above task migration operation can not change the size and configuration of the task immediately, so you can call the method of modifying the task size and configuration to ensure that the application is in the correct state and can work normally in the foreground.
  • the update task is visible because, after updating the size and configuration, the target application may not be visible at this time, calling the method of updating the new stack visibility, and the application visible from the top to the bottom is set to be visible. And update the corresponding window surface to be visible.
  • the visible application judging method may include: no occlusion by other applications on the zorder; no occlusion by the lock screen; the state of the top activity of the application is non-initializing or non-exiting.
  • step 511 a user operation within a preset time interval is acquired.
  • step 512 if the user operation triggers a shutdown event of the application, the application is closed, and the background process is thawed, and the pre-loading operation is continued.
  • the application to be loaded is predicted to be Application A, Application B, Application C, Application D, and Application F, respectively. Assume that the preloading is performed in the order of A, B, C, D, and F.
  • the application C is preloaded with the application C, the open event of the application X is obtained, and the background process c corresponding to the application C is frozen.
  • Application C is the starting application (used to identify the starting point of the preloading operation after the background process is thawed), the identification information of the application C and the process identifier of the background process c are suspended, and the preloading operation is suspended.
  • the operation of loading the application X is performed in response to the open event.
  • step 506 that is, in advance.
  • the task stack corresponding to the application C is created in the preloaded active window stack (this step is an optional execution step. If the task stack created in the stack of the preloaded active window is not deleted after the application c is frozen, this step may not be performed)
  • the active window corresponding to the application C is started in the task stack based on the background process c, and the application interface corresponding to the application C is drawn and displayed based on the activated active window.
  • the system sends a forged focus notification to the application C, and based on the forged focus notification, keeps the continuous drawing of the application interface corresponding to the application C and the display update within a preset time period.
  • the application D is targeted to the application, and the process returns to step 505.
  • the application F is the target application, and the process returns to step 505.
  • the application preloading method provided by the embodiment of the present application may identify whether the detected application opening event is triggered by the user during the preloading process of the application, and if not, determine that the application is turned on incorrectly, and does not trigger the preloading application. Predicting the operation, and continuing to preload the remaining preloaded applications, improves the accuracy of the preloading operation, and when the error is turned on, the preloading efficiency can be improved without starting the preloading operation.
  • FIG. 6 is a structural block diagram of an application preloading apparatus according to an embodiment of the present disclosure.
  • the apparatus may be implemented by software and/or hardware, and is generally integrated in a terminal, and may be implemented by executing an application preloading method. load.
  • the apparatus includes an event detection module 610, a process freeze module 620, an operation acquisition module 630, and a process defrosting module 640.
  • the event detection module 610 is configured to acquire an open event of the application when the preloading operation is performed on the preloaded application in the background.
  • the process freeze module 620 is configured to freeze the background process that executes the preload operation when the open event is triggered by the application notification, and start the application according to the open event.
  • the operation obtaining module 630 is configured to acquire a user operation within a preset time interval.
  • the process defrosting module 640 is configured to: if the user operation triggers a shutdown event of the application, close the application, and thaw the background process, and continue to perform the preloading operation.
  • the application preloading apparatus acquires an opening event of the application when the preloading operation is performed on the preloading application in the background, and freezes the background process of executing the preloading operation when the opening event is triggered by the application notification. And opening the application according to the open event; obtaining a user operation in the preset time interval, if the user operation includes the closing instruction of the application, closing the application, and unfreezing the background process to continue the preloading operation.
  • the event detection module 610 is further configured to:
  • determining that the opening event is triggered by an application notification If the triggering body is an application notification, determining that the opening event is triggered by an application notification;
  • the trigger body is a touch screen or a sensor, it is determined that the open event is triggered by a user operation.
  • the process freeze module 620 is further configured to:
  • Correlation stores the identification information of the originating application and the process identifier of the background process, and freezes the background process.
  • the process defrosting module 640 includes:
  • the process unfreeze submodule is configured to thaw the background process corresponding to the process identifier
  • Preloading the sub-module set to use the starting application as a starting point for restoring the pre-loading operation, and performing a pre-loading operation on the remaining pre-loaded applications by the background process.
  • the preload submodule is further configured to:
  • the application interface corresponding to the target application is preloaded based on the pre-created preloaded active window stack, wherein the boundary coordinates corresponding to the preloaded active window stack are outside the coordinate range of the display screen.
  • the preload submodule is further configured to:
  • An application interface corresponding to the target application is drawn and displayed based on the activated activity window.
  • the method further includes:
  • An interface drawing module is configured to send a forged focus notification to the target application, and keep the continuous drawing and display update of the application interface corresponding to the target application within a preset time period based on the forged focus notification, where The length of the preset time period includes the playing duration of starting the advertisement or starting the animation in the target application.
  • the apparatus further comprises:
  • An interface migration module configured to: after preloading an application interface corresponding to the target application based on a pre-created preloaded active window stack, when the running instruction of the target application is received, stacking the preloaded active window The application interface corresponding to the target application included in the target is migrated to the display screen for display.
  • the migrating the application interface corresponding to the target application included in the preloaded active window stack to the display screen for display including:
  • the size information, the configuration information, and the visibility of the task stack are updated, so that an application interface corresponding to the target application is displayed on the display screen.
  • the boundary coordinates of the preloaded active window stack are (H, 0, 2H, H), the coordinate system corresponding to the boundary coordinates is system coordinates, and the origin of the system coordinates is the display.
  • H is the length of the long side of the display area of the display screen.
  • the embodiment of the present application further provides a storage medium including computer executable instructions for executing an application preloading method when executed by a computer processor, the method comprising:
  • the background process that performs the preload operation is frozen, and the application is started according to the open event;
  • the application is closed, and the background process is thawed, and the preloading operation is continued.
  • Storage media any of a variety of types of memory devices or storage devices.
  • the term "storage medium” is intended to include: a mounting medium such as a CD-ROM, a floppy disk or a tape device; a computer system memory or a random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.
  • Non-volatile memory such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, and the like.
  • the storage medium may also include other types of memory or a combination thereof.
  • 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, the second computer system being coupled to the first computer system via a network, such as the Internet.
  • the second computer system can provide program instructions to the first computer for execution.
  • the term "storage medium" can include two or more storage media that can reside in different locations (eg, in different computer systems connected through a network).
  • a storage medium may store program instructions (eg, embodied as a computer program) executable by one or more processors.
  • the storage medium containing the computer executable instructions provided by the embodiment of the present application is not limited to the application preloading operation as described above, and may also execute the application provided by any embodiment of the present application. Related operations in the preload method.
  • the embodiment of the present application provides an intelligent terminal, which has an operating system, and the application preloading device provided by the embodiment of the present application can be integrated into the smart terminal.
  • the smart terminal can be a smart phone, a PAD (tablet), a handheld game machine, a notebook computer, and a smart home appliance.
  • FIG. 7 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present disclosure. As shown in FIG. 7, the smart terminal includes a memory 710 and a processor 720.
  • the memory 710 is configured to store a computer program, a resource of a preloaded application, identification information of an associated application that is stored and a process identifier of a background process, and a preset time interval, etc.; the processor 720 reads and executes A computer program stored in the memory 710.
  • the processor 720 when executing the computer program, implements the steps of: acquiring an open event of the application when the preloading operation is performed on the preloaded application in the background; and freezing the execution when the open event is triggered by the application notification Determining a background process of the preloading operation, and opening the application according to the opening event; acquiring a user operation in a preset time interval; and closing the application if the user operation triggers a closing event of the application And thawing the background process and continuing to perform the preloading operation.
  • FIG. 8 is a structural block diagram of a smart phone according to an embodiment of the present application.
  • the smart phone may include: a memory 801, a central processing unit (CPU) 802 (also referred to as a processor, hereinafter referred to as a CPU), a peripheral interface 803, and a radio frequency (RF) circuit.
  • CPU central processing unit
  • RF radio frequency
  • the illustrated smart phone 800 is merely one example of a smart terminal, and that the smart phone 800 can have more or fewer components than those shown in the figures, and two or more components can be combined. Or it can have different component configurations.
  • the various components shown in the figures can 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 smart phone integrated with the application preloading device provided in this embodiment is described in detail below.
  • the memory 801 can be accessed by the CPU 802, the peripheral interface 803, etc., and the memory 801 can include a high speed random access memory, and can also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices.
  • the computer program is stored in the memory 801, and the resources of the preloaded application, the identification information of the associated initial application stored, the process identifier of the background process, a preset time interval, and the like may also be stored.
  • Peripheral interface 803, which can connect the input and output peripherals of the device to CPU 802 and memory 801.
  • the I/O subsystem 809 can 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 can include a display controller 8091 and one or more input controllers 8092 for controlling other input/control devices 810.
  • one or more input controllers 8092 receive electrical signals from other input/control devices 810 or transmit electrical signals to other input/control devices 810, and other input/control devices 810 may include physical buttons (press buttons, rocker buttons, etc.) ), dial, slide switch, joystick, click wheel.
  • the input controller 8092 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
  • the touch screen 812 is an input interface and an output interface between the user terminal and the user, and displays the visual output to the user.
  • the visual output may include graphics, text, icons, videos, and the like.
  • Display controller 8091 in I/O subsystem 809 receives an electrical signal from touch screen 812 or an electrical signal to touch screen 812.
  • the touch screen 812 detects the contact on the touch screen, and the display controller 8091 converts the detected contact into an interaction with the user interface object displayed on the touch screen 812, that is, realizes human-computer interaction, and the user interface object displayed on the touch screen 812 may be running.
  • the icon of the game, the icon of the network to the corresponding network, and the like.
  • the device may also include a light mouse, which is a touch sensitive surface that does not display a visual output, or an extension of a touch sensitive surface formed by the touch screen.
  • the RF circuit 805 is mainly configured to establish communication between the mobile phone and the wireless network (ie, the network side), and implement data reception and transmission between the mobile phone and the wireless network. For example, sending and receiving short messages, emails, and the like. Specifically, the RF circuit 805 receives and transmits an RF signal, which is also referred to as an electromagnetic signal, and the RF circuit 805 converts the electrical signal into an electromagnetic signal or converts the electromagnetic signal into an electrical signal, and through the electromagnetic signal and communication network and other devices Communicate.
  • an RF signal which is also referred to as an electromagnetic signal
  • 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 CODER-DECoder (CODEC) chipset, Subscriber Identity Module (SIM), etc.
  • CDDEC codec CODER-DECoder
  • the audio circuit 806 is primarily configured to receive audio data from the peripheral interface 803, convert the audio data into an electrical signal, and transmit the electrical signal to the speaker 811.
  • the speaker 811 is arranged to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 805 to sound and play the sound to the user.
  • the power management chip 808 is configured to provide power and power management for the hardware connected to the CPU 802, the I/O subsystem, and the peripheral interface.
  • the intelligent terminal provided by the embodiment of the present invention can effectively prevent the user from accidentally starting other applications and interfere with the application preloading and application prediction, thereby improving the accuracy of the preloading operation.
  • the application preloading device, the storage medium, and the smart terminal provided in the foregoing embodiments may perform the application preloading method provided by any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method.
  • the application preloading method provided by any embodiment of the present application.

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

Disclosed are an application pre-loading management method and apparatus, and a storage medium and an intelligent terminal. The method comprises: when a background performs a pre-loading operation on an application program to be pre-loaded, acquiring a start event of the application program; when the start event is triggered by an application notification, freezing a background process executing the pre-loading operation, and starting the application program according to the start event; acquiring a user operation in a pre-set time interval; and if the user operation triggers a shutdown event of the application program, closing the application program, freezing the background process, and continuing the execution of the pre-loading operation.

Description

应用程序预加载方法以及装置、存储介质及智能终端Application preloading method and device, storage medium and intelligent terminal
本申请要求在2018年05月15日提交中国专利局、申请号为201810463397.6的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 20181046339, the entire disclosure of which is hereby incorporated by reference.
技术领域Technical field
本申请实施例涉及应用程序加载技术,例如涉及一种应用预加载管理方法以及装置、存储介质及智能终端。The embodiment of the present application relates to an application loading technology, for example, to an application preload management method and device, a storage medium, and an intelligent terminal.
背景技术Background technique
目前,诸如智能手机、平板电脑、笔记本电脑以及智能家电等终端已成为人们日常生活中必不可少的电子设备。随着终端设备不断地智能化,多数终端设备中都装载有操作***,使得终端设备能够安装丰富多样的应用程序,满足用户不同的需求。At present, terminals such as smart phones, tablets, notebook computers, and smart home appliances have become indispensable electronic devices in people's daily lives. As terminal devices continue to be intelligent, most terminal devices are loaded with an operating system, enabling the terminal devices to install a wide variety of applications to meet different user needs.
随着终端设备的配置不断提升,多数终端设备中可以安装几十甚至上百个应用程序,而随着应用程序的功能日益丰富,应用程序运行时所需加载的资源也越来越多。当用户选择启动一个应用程序时,终端会对该应用程序启动所需的资源进行加载,待预加载完毕后,进入应用程序的初始界面,整个过程通常要花费数秒甚至十几秒的时间,导致应用程序的启动效率较低,亟需改进。As the configuration of terminal devices continues to increase, dozens or even hundreds of applications can be installed in most terminal devices, and as the functions of the applications become more and more abundant, the resources required for the applications to run are also increased. When the user chooses to start an application, the terminal loads the resources required for the application to start. After the pre-loading is completed, the initial interface of the application is entered, and the whole process usually takes several seconds or even ten seconds. The startup of the application is less efficient and needs to be improved.
发明内容Summary of the invention
本申请实施例提供一种应用预加载管理方法以及装置、存储介质及智能终端,可以优化相关技术中的应用加载方案,提高预加载操作的准确率。The embodiment of the present application provides an application preload management method and device, a storage medium, and an intelligent terminal, which can optimize an application loading scheme in the related technology, and improve the accuracy of the preloading operation.
第一方面,本申请实施例提供了一种应用程序预加载方法,包括:In a first aspect, an embodiment of the present application provides an application preloading method, including:
在后台对待预加载应用程序执行预加载操作时,获取应用程序的开启事件;Get the application's open event when performing a preload operation on the preloaded application in the background;
在所述开启事件由应用通知触发时,冻结执行所述预加载操作的后台进程,并根据所述开启事件开启所述应用程序;When the open event is triggered by the application notification, the background process that performs the preload operation is frozen, and the application is started according to the open event;
获取预设时间区间内的用户操作;Obtain user operations within a preset time interval;
若所述用户操作触发所述应用程序的关闭事件,则关闭所述应用程序,并解冻所述后台进程,继续执行所述预加载操作。If the user operation triggers a shutdown event of the application, the application is closed, and the background process is thawed, and the preloading operation is continued.
第二方面,本申请实施例还提供了一种应用程序预加载装置,该装置包括:In a second aspect, an embodiment of the present application further provides an application preloading apparatus, where the apparatus includes:
事件检测模块,设置为在后台对待预加载应用程序执行预加载操作时,获取应用程序的 开启事件;An event detection module, configured to acquire an application open event when a preload operation is performed on a preloaded application in the background;
进程冻结模块,设置为在所述开启事件由应用通知触发时,冻结执行所述预加载操作的后台进程,并根据所述开启事件开启所述应用程序;a process freeze module, configured to freeze a background process that performs the preloading operation when the open event is triggered by an application notification, and open the application according to the open event;
操作获取模块,设置为获取预设时间区间内的用户操作;The operation obtaining module is configured to acquire a user operation in a preset time interval;
进程解冻模块,设置为若所述用户操作触发所述应用程序的关闭事件,则关闭所述应用程序,并解冻所述后台进程,继续执行所述预加载操作。The process defrosting module is configured to: if the user operation triggers a shutdown event of the application, close the application, and thaw the background process, and continue to perform the preloading operation.
第三方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本申请实施例所述的应用程序预加载方法。In a third aspect, the embodiment of the present application provides a computer readable storage medium, where a computer program is stored, and when the program is executed by the processor, the application preloading method is implemented as described in the 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 in the memory and executable by the processor, where the processor executes the computer program to implement an embodiment of the present application. The application preloading method.
本申请实施例提供一种应用程序预加载方案,在后台对待预加载应用程序执行预加载操作时,获取应用程序的开启事件,在该开启事件由应用通知触发时,冻结执行预加载操作的后台进程,并根据开启事件开启该应用程序;获取预设时间区间内的用户操作,若用户操作包括所述应用程序的关闭指示,则关闭该应用程序,并解冻后台进程继续执行预加载操作。通过上述技术方案,可以有效的避免用户误启动其它应用而干扰应用预加载及应用预测,提高预加载操作的准确率。An embodiment of the present application provides an application preloading scheme, which is configured to acquire an application startup event when the preloading application performs a preloading operation in the background, and freezes the background of executing the preloading operation when the opening event is triggered by the application notification. The process starts the application according to the open event; acquires a user operation within a preset time interval, and if the user operation includes a shutdown indication of the application, closes the application, and thaws the background process to continue the preload operation. Through the above technical solution, the user can be effectively prevented from accidentally starting other applications and interfere with the application preloading and application prediction, thereby improving the accuracy of the preloading operation.
附图概述BRIEF abstract
图1为本申请实施例提供的一种应用程序预加载方法的流程图;FIG. 1 is a flowchart of an application preloading method according to an embodiment of the present application;
图2为本申请实施例提供的一种预加载活动窗口堆栈与显示屏幕显示区域的相对位置关系示意图;2 is a schematic diagram of a relative position relationship between a preloaded active window stack and a display screen display area according to an embodiment of the present application;
图3为本申请实施例提供的又一种预加载活动窗口堆栈与显示屏幕显示区域的相对位置关系示意图;FIG. 3 is a schematic diagram of a relative positional relationship between a preloaded active window stack and a display screen display area according to an embodiment of the present application;
图4为本申请实施例提供的一种应用界面迁移示意图;FIG. 4 is a schematic diagram of application interface migration according to an embodiment of the present application;
图5为本申请实施例提供的另一种应用程序预加载方法的流程图;FIG. 5 is a flowchart of another application preloading method according to an embodiment of the present disclosure;
图6为本申请实施例提供的一种应用程序预加载装置的结构框图;FIG. 6 is a structural block diagram of an application preloading apparatus according to an embodiment of the present application;
图7为本申请实施例提供的一种智能终端的结构示意图;FIG. 7 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present disclosure;
图8为本申请实施例提供的一种智能手机的结构框图。FIG. 8 is a structural block diagram of a smart phone according to an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting. In addition, it should be noted that, for the convenience of description, only some but not all of the structures related to the present application are shown in the drawings.
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as a process or method depicted as a flowchart. Although the flowcharts describe the various steps as a sequential process, many of the steps can be implemented in parallel, concurrently, or concurrently. In addition, the order of the steps can be rearranged. The process may be terminated when its operation is completed, but may also have additional steps not included in the figures. The processing may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
在用户使用智能终端的过程中,应用通知通常会以弹出框的形式显示,用户点击弹出框可以运行该应用通知对应的应用程序。可能出现用户在打开视频应用后,因误触微信的应用通知而启动微信。若此时正在后台进行应用预加载,则为了保证微信的启动速度,通常会停止应用预加载,并重新预测待预加载应用程序。这种情况下,可能用户的真实意愿并不是打开微信,那么,上述应用重预测以及停止应用预加载操作可能是误操作,并不符合用户真实的使用意图。In the process of the user using the smart terminal, the application notification is usually displayed in the form of a pop-up box, and the user clicks the pop-up box to run the application to notify the corresponding application. It may happen that after the video application is opened, the user initiates WeChat due to a false notification of the application notification of WeChat. If the application is preloading in the background at this time, in order to guarantee the startup speed of WeChat, the application preloading is usually stopped, and the application to be preloaded is re-predicted. In this case, the true intention of the user may not open WeChat, then the above application re-prediction and stop applying the pre-loading operation may be a misoperation, and does not meet the user's true intention of use.
本申请实施例提供一种应用程序预加载方案,可以有效的避免因用户误启动其它应用而干扰应用预加载及应用预测的情况。The embodiment of the present application provides an application preloading scheme, which can effectively avoid the situation that the application preloading and the application prediction are interfered by the user accidentally starting other applications.
图1为本申请实施例提供的一种应用程序预加载方法的流程图,该方法可以由应用程序预加载装置来执行,其中,该装置可由软件和/或硬件实现,一般可集成在智能终端内。如图1所示,该方法包括:步骤110至步骤140。FIG. 1 is a flowchart of an application preloading method according to an embodiment of the present application. The method may be implemented by an application preloading device, where the device may be implemented by software and/or hardware, and may be integrated into an intelligent terminal. Inside. As shown in FIG. 1, the method includes: Step 110 to Step 140.
在步骤110中,在后台对待预加载应用程序执行预加载操作时,获取应用程序的开启事件。In step 110, an open event of the application is obtained when a preload operation is performed on the preloaded application in the background.
需要说明的是,本申请实施例中的智能终端可包括手机、平板电脑、笔记本电脑以及智能家电等终端设备。终端中装载有操作***。操作***可以是Android、iOS、BlackBerry OS或windows mobile等。It should be noted that the smart terminal in the embodiment of the present application may include a terminal device such as a mobile phone, a tablet computer, a notebook computer, and a smart home appliance. The operating system is loaded in the terminal. The operating system can be Android, iOS, BlackBerry OS or windows mobile.
需要说明的是,预加载操作可以是在应用程序启动之前预先加载应用界面、启动广告和启动动画等启动资源的操作。示例性的,在检测到应用预加载事件被触发后,确定待预加载应用程序,基于预先创建的预加载活动窗口堆栈预加载目标应用程序对应的应用界面、启动广告及启动动画等启动资源,其中,所述预加载活动窗口堆栈对应的边界坐标位于显示屏幕的坐标范围之外。需要说明的是,需要预加载的资源并不限于上述启动资源,还可以是其它资源,如应用服务启动、内存分配、文件内容读取及网络数据获取等,本申请实施例不作具体限定。It should be noted that the pre-loading operation may be an operation of pre-loading an application interface, launching an advertisement, and starting an animation, etc., before the application is started. Exemplarily, after detecting that the application preloading event is triggered, determining that the application to be preloaded, based on the pre-created preloading active window stack preloading the application interface corresponding to the target application, launching the advertisement, and starting the animation, etc. The boundary coordinates corresponding to the preloaded active window stack are outside the coordinate range of the display screen. It should be noted that the resources that need to be pre-loaded are not limited to the foregoing startup resources, and may be other resources, such as application service startup, memory allocation, file content reading, and network data acquisition, which are not specifically limited in this embodiment.
需要说明的是,应用预加载事件的触发条件可以根据实际情况设置,本申请实施例不作具体限定。例如,可以在检测到用户的动作满足预设条件(如拿起终端、输入屏幕解锁操作或输入终端解锁操作等)时,触发应用预加载事件;或者可以在检测到前台应用程序发生变更时,触发应用预加载事件;或者可以在预加载应用的预测流程结束后,立即(或经过预设时长后)触发应用预加载事件;或者可以定时间隔触发等等。It should be noted that the triggering condition of the application pre-loading event may be set according to the actual situation, which is not specifically limited in this embodiment. For example, the application preloading event may be triggered when it is detected that the user's action satisfies a preset condition (such as picking up the terminal, inputting a screen unlocking operation, or inputting a terminal unlocking operation, etc.); or when detecting that the foreground application is changed, The application preload event is triggered; or the application preload event can be triggered immediately (or after a preset duration) after the pre-loading application's prediction process ends; or it can be triggered at regular intervals.
需要说明的是,待预加载应用程序可以理解为用户可能即将打开的应用程序,可以是预先设置好的固定的应用程序,也可以是采用一定的方式预测出来的应用程序等。待预加载应用程序可以包括一个或多个。目标应用程序可以理解为当前需要进行预加载操作的待预加载应用程序。目标应用程序也可以包括一个或多个。当待预加载应用程序有多个时,目标应用程序可以为一个(即将多个待预加载应用程序逐一确定为目标应用程序,并依次进行预加载操作),也可以为多个(即将2个以上待预加载应用程序确定为目标应用程序,并同时进行预加载操作,也就是说多个目标应用程序的预加载过程可以是并行进行的)。It should be noted that the application to be preloaded can be understood as an application that the user may open soon, and may be a fixed application that is preset or an application that is predicted in a certain manner. The application to be preloaded may include one or more. The target application can be understood as the application to be preloaded that currently needs to be preloaded. The target application can also include one or more. When there are multiple applications to be preloaded, the target application can be one (ie, multiple pre-loaded applications are determined as target applications one by one, and preloaded one by one), or multiple (two will be) The above pre-loaded application is determined to be the target application, and the pre-loading operation is performed at the same time, that is, the pre-loading process of the plurality of target applications may be performed in parallel).
需要说明的是,活动窗口可理解为一个独立的直接面向用户提供交互和操作的界面,在不同的操作***中可能采用不同的名词来命名该界面。本申请实施例中,在显示屏幕外对目标应用程序的应用界面进行预加载,可以基于操作***的多窗口机制来实现,通过多窗口机制将应用程序对应的size设在显示屏幕外而达到对用户不可见的目的,从而不会影响到前台应用程序的显示内容在显示屏幕上的显示。It should be noted that the active window can be understood as an independent interface that provides interaction and operation directly to the user, and different nouns may be used to name the interface in different operating systems. In the embodiment of the present application, pre-loading the application interface of the target application outside the display screen may be implemented based on a multi-window mechanism of the operating system, and the size corresponding to the application is set outside the display screen through the multi-window mechanism to achieve The purpose of the user's invisibility is such that it does not affect the display of the foreground application's display content on the display screen.
需要说明的是,开启事件可以是触发应用程序运行的事件。开启事件可以由用户操作触发,如用户点击应用图标,或者用户输入预设手势等,还可以由应用通知触发。其中,应用通知可以是云端线客户端应用推送消息的通知或广告等。It should be noted that the open event can be an event that triggers the application to run. The open event can be triggered by a user operation, such as the user clicking an application icon, or the user inputting a preset gesture, etc., and can also be triggered by an application notification. The application notification may be a notification or an advertisement of a cloud line client application pushing a message.
示例性的,在后台对待预加载应用程序执行预加载操作时,触发执行检测应用程序的开启事件的操作,也就是说,在预加载操作执行期间,监听应用程序的开启事件,在检测到所述开启事件时,确定所述开启事件的触发主体。其中,应用程序可以是待预加载应用程序,也可以是已加载完成的应用程序,还可以是未预加载的应用程序。触发主体包括但不限于应用通知、触摸屏、传感器(包括红外传感器、超声波传感器、加速度传感器及摄像头)。若所述触发主体是应用通知,则确定所述开启事件由应用通知触发;若所述触发主体是触摸屏或传感器,则确定所述开启事件由用户操作触发。需要说明的是,应用通知是Android的***功能,可以通过监听通知子***,确定应用通知是否***作,若是,则跳转至应用通知对应的应用。Exemplarily, when a preloading operation is performed on a preloaded application in the background, an operation of detecting an open event of the application is triggered, that is, during the execution of the preloading operation, the open event of the application is monitored, and the detected event is detected. When the event is turned on, the trigger body of the open event is determined. The application may be an application to be preloaded, an application that has been loaded, or an application that is not preloaded. Trigger bodies include, but are not limited to, application notifications, touch screens, sensors (including infrared sensors, ultrasonic sensors, acceleration sensors, and cameras). If the triggering body is an application notification, determining that the opening event is triggered by an application notification; if the triggering body is a touch screen or a sensor, determining that the opening event is triggered by a user operation. It should be noted that the application notification is a system function of Android, and the notification notification subsystem can be used to determine whether the application notification is operated, and if so, jump to the application corresponding to the application notification.
在步骤120中,在所述开启事件由应用通知触发时,冻结执行所述预加载操作的后台进程,并根据所述开启事件开启所述应用程序。In step 120, when the open event is triggered by the application notification, the background process executing the preload operation is frozen, and the application is started according to the open event.
需要说明的是,后台进程为执行应用程序的预加载操作的进程。例如,后台进程为目标应用程序对应的目标进程,可以基于该目标进程在预设任务栈中启动该目标应用程序对应的活动窗口,基于所启动的活动窗口绘制并显示该目标应用程序对应的应用界面,其中,预设任务堆栈可以是预先在预加载活动窗口中创建的目标应用程序对应的任务栈。It should be noted that the background process is a process that performs a preload operation of the application. For example, the background process is a target process corresponding to the target application, and the active window corresponding to the target application is started in the preset task stack based on the target process, and the application corresponding to the target application is drawn and displayed based on the activated active window. The interface, wherein the preset task stack may be a task stack corresponding to the target application created in advance in the preload activity window.
需要说明的是,冻结执行预加载操作的后台进程可以是暂停后台进程,使该后台进程不再执行任何操作。It should be noted that the background process that freezes the preloading operation may suspend the background process, so that the background process no longer performs any operations.
在本申请实施例中,若开启事件由应用通知触发,则挂起正在执行目标应用程序的预加载操作的后台进程,以暂停由后台进程执行的预加载操作,并响应该开启事件,开启该开启事件对应的应用程序。在一实施例中,在挂起正在执行目标应用程序的预加载操作的后台进程之前,还可以根据预加载完成的应用程序确定作为恢复起点的起始应用程序;关联存储所述起始应用程序的标识信息以及所述后台进程的进程标识,并冻结所述后台进程。这样设计的好处在于,可以在后台进程解冻后仅对剩余的待加载的应用程序执行应用预加载操作,避免重复加载已经预加载完成的资源。In the embodiment of the present application, if the open event is triggered by the application notification, the background process that is performing the preload operation of the target application is suspended to suspend the preload operation performed by the background process, and the open event is started in response to the open event. Open the application corresponding to the event. In an embodiment, before starting the background process that is executing the preloading operation of the target application, the starting application as the recovery starting point may also be determined according to the preloaded completed application; the starting application is stored in association The identification information and the process identifier of the background process, and freeze the background process. The advantage of this design is that the application preloading operation can be performed only on the remaining applications to be loaded after the background process is thawed, so as to avoid repeatedly loading the resources that have been preloaded.
在步骤130中,获取预设时间区间内的用户操作。In step 130, a user operation within a preset time interval is obtained.
需要说明的是,预设时间区间可以由用户根据实际需要自行设定,也可以是***默认时间。例如,预先采集设定数量的用户群体针对应用程序的操作信息,提取用户打开应用至关闭该应用的时间小于预设时间的目标操作信息,分析该目标操作信息确定用户最可能在误开启一个应用后多长时间关闭该应用,基于分析结果确定预设时间区间,并在智能终端出厂前预先进行配置。It should be noted that the preset time interval may be set by the user according to actual needs, or may be the system default time. For example, pre-collecting a set number of user groups for operation information of the application, extracting target operation information that the user opens the application to close the application for less than a preset time, and analyzing the target operation information to determine that the user is most likely to open an application by mistake. How long after the application is closed, the preset time interval is determined based on the analysis result, and is pre-configured before the smart terminal leaves the factory.
在本申请实施例中,用户操作可以是指关闭由应用通知触发启动的应用程序的操作,包括但不限于通过触摸屏输入针对该由应用通知触发启动的应用程序的触摸操作,输入预设的关闭该由应用通知触发启动的应用程序的手势。用户操作可以触发应用程序的关闭时间。In the embodiment of the present application, the user operation may refer to the operation of closing the application triggered by the application notification, including but not limited to inputting a touch operation for the application triggered by the application notification by the touch screen input, and inputting the preset shutdown. The gesture of the application that triggered the launch by the application notification. User actions can trigger the application's shutdown time.
在步骤140中,若所述用户操作触发所述应用程序的关闭事件,则关闭所述应用程序,并解冻所述后台进程,继续执行所述预加载操作。In step 140, if the user operation triggers a shutdown event of the application, the application is closed, and the background process is thawed, and the pre-loading operation is continued.
需要说明的是,解冻后台进程可以是恢复刚才冻结的后台进程,使后台进程继续执行应用程序的预加载操作。It should be noted that the thawing background process may be to restore the background process that has just been frozen, so that the background process continues to execute the preloading operation of the application.
本申请实施例中,若确定用户操作代表关闭该由应用通知启动的应用程序,则响应于关闭事件,关闭该由应用通知启动的应用程序。查询预先存储的作为恢复起点的目标应用程序的标识信息以及所述后台进程的进程标识,确定待解冻的后台进程的进程标识,解冻所述进程标识对应的后台进程;以所述起始应用程序作为恢复预加载操作的起点,通过所述后台进程对剩余的待预加载应用程序执行预加载操作。In the embodiment of the present application, if it is determined that the user operation representative closes the application initiated by the application notification, the application initiated by the application notification is closed in response to the shutdown event. Querying the pre-stored identification information of the target application as the recovery starting point and the process identifier of the background process, determining the process identifier of the background process to be thawed, and unfreezing the background process corresponding to the process identifier; As a starting point for restoring the preloading operation, a preloading operation is performed on the remaining applications to be preloaded by the background process.
在一实施例中,在解冻所述进程标识对应的后台进程后,通过所述后台进程,基于预先创建的预加载活动窗口堆栈预加载目标应用程序对应的应用界面,其中,目标应用程序可以是包括起始应用程序在内的剩余预加载应用程序;所述预加载活动窗口堆栈对应的边界坐标位于显示屏幕的坐标范围之外。需要说明的是,剩余的目标应用程序是待预加载应用程序中未被预加载的应用程序,当这些应用程序成为当前需要预加载的应用程序时,可以将其标记为目标应用程序。这样设计的好处在于可以基于在显示屏幕外面创建的预加载活动窗口堆栈对需要进行预加载的应用程序的应用界面进行预加载,该预加载方式能够较大程度地完成应用启动前的准备工作,提升目标应用程序的启动速度,且不会影响到前台应用程序的显示内容在显示屏幕上的显示。In an embodiment, after the background process corresponding to the process identifier is thawed, the application interface corresponding to the target application is preloaded based on the pre-created preload active window stack by the background process, wherein the target application may be A remaining preloaded application including a starting application; the boundary coordinates corresponding to the preloaded active window stack are outside the coordinate range of the display screen. It should be noted that the remaining target applications are applications that are not preloaded in the preloaded application. When these applications become applications that need to be preloaded at present, they can be marked as target applications. The advantage of this design is that the application interface of the application that needs to be preloaded can be preloaded based on the preloaded active window stack created outside the display screen, and the preloading method can complete the preparation work before the application is started to a large extent. Improves the startup speed of the target application without affecting the display of the foreground application's display on the display screen.
为了便于理解,下面以安卓(Android)操作***为例进行下面的说明。For ease of understanding, the following is an example of an Android operating system.
在Android***中,活动窗口被称为Activity。Activity是一个负责与用户交互的组件,其提供一个屏幕(可以理解为屏幕界面,而非实体的显示屏幕),以供用户交互完成某项任务。在一个android应用程序中,一个Activity通常就是一个单独的屏幕,它上面可以显示一些控件也可以监听并处理用户的事件。在对Activity进行管理中,有这样两个概念:Task(任务栈)和Stack(活动窗口堆栈)。Task对应一个应用程序,Task用于存放Activity,一个Task中可以存放一个或多个Activity,且这些Activity遵循“先进后出,后进先出”的原则。而Stack又用于对Task进行管理,通常,一个Stack对一个屏幕所需展示的各Activity所属的Task进行管理,一个Stack可以管理一个或多个Task,当然,Stack也同样遵循堆栈的基本管理原则。这里所述的屏幕并不一定是完整独立的显示屏,以“两个屏幕”为例,这两个屏幕可能只是一个完整显示屏中两个独立显示各自显示内容的区域。当然,如果终端具备两个甚至是两个以上的独立显示屏,则“两个屏幕”也可以是两个独立的显示屏。In the Android system, the active window is called Activity. An Activity is a component responsible for interacting with a user, providing a screen (which can be understood as a screen interface rather than a physical display screen) for the user to interact with a task. In an android application, an Activity is usually a separate screen that can display some controls and listen and handle user events. In the management of the Activity, there are two concepts: Task (task stack) and Stack (active window stack). Task corresponds to an application, Task is used to store Activity, and a Task can store one or more Activity, and these activities follow the principle of "advanced, last in, first out". Stack is used to manage the Task. Usually, a Stack manages the Tasks to which each Activity needs to be displayed on a screen. A Stack can manage one or more Tasks. Of course, Stack also follows the basic management principles of the stack. . The screen described here is not necessarily a completely separate display. Taking "two screens" as an example, these two screens may be just two areas in a complete display that independently display their respective display contents. Of course, if the terminal has two or even more than two independent displays, the "two screens" can also be two separate displays.
在Android***中,支持多窗口模式,可包括分屏模式、画中画模式以及自由模式(FreeForm)。在多窗口模式下,应用程序所在的Stack可以有自己的尺寸(size),可以包括以终端屏幕左上角为原点的坐标系中的上下左右坐标。例如,(a,b,c,d),一般描述的是一个矩形的边界,可采用矩形左上角的坐标和右下角的坐标进行表示,即矩形的左上角坐标为(a,b),右下角坐标为(c,d),这样的矩形区域就对应Stack的size。Stack中的应用内布局是以Stack的size为准的,也就是说Activity对应的应用界面是在size的边界范围内进行显示的。In the Android system, multi-window mode is supported, which can include split screen mode, picture in picture mode, and free mode (FreeForm). In multi-window mode, the Stack on which the application resides can have its own size, which can include the top, bottom, left, and right coordinates in the coordinate system with the top left corner of the terminal screen as the origin. For example, (a, b, c, d), generally describes the boundary of a rectangle, which can be represented by the coordinates of the upper left corner of the rectangle and the coordinates of the lower right corner, that is, the coordinates of the upper left corner of the rectangle are (a, b), right. The lower corner coordinates are (c, d), and such a rectangular area corresponds to the size of the Stack. The in-app layout in the Stack is based on the size of the Stack, which means that the application interface corresponding to the Activity is displayed within the bounds of the size.
在多窗口模式下,可以允许多个应用程序处于可见状态,包括***和用户均可见和仅***可见。***和用户均可见指的是在显示屏幕上进行显示,且用户能够看到;仅***可见指的是操作***可见,而用户不可见,可能被前台的应用遮挡或者如本申请所要实现的在显示 屏幕外显示。In multi-window mode, multiple applications can be allowed to be visible, both system and user visible and only system visible. Both the system and the user are visible to display on the display screen, and the user can see; only the system visible means that the operating system is visible, and the user is invisible, may be blocked by the application of the foreground or as implemented in the application. Display off-screen display.
一般的,多窗口模式下,可以存在多种类型的Stack,如Home Stack表示桌面应用显示的Stack,App Stack表示第三方应用显示的Stack,还可以有其他分屏Stack等,上述三种Stack中包含的内容可在显示屏幕上显示,本申请实施例中统称为应用活动窗口堆栈。本申请实施例中,新增了预加载活动窗口堆栈(预加载Stack),用于表示预加载应用显示的Stack,并设置预加载Stack的边界坐标位于显示屏幕的坐标范围之外,待预加载应用程序可以显示在该Stack。对于Android***来说,可以基于Android***的多窗口机制,新建一个专门用于显示预加载应用的Stack。本申请实施例中,新建Stack是因为可以让新建的预加载Stack拥有自己的size以及可见性,从而实现在显示屏幕外预加载的目的。Generally, in the multi-window mode, there may be multiple types of stacks, such as the Home Stack indicating the stack displayed by the desktop application, the App Stack indicating the Stack displayed by the third-party application, and other split screen stacks, etc., in the above three stacks. The included content can be displayed on the display screen, which is collectively referred to as an application active window stack in the embodiment of the present application. In the embodiment of the present application, a preloaded active window stack (preloaded stack) is added, which is used to represent the stack displayed by the preloaded application, and the boundary coordinates of the preloaded stack are set outside the coordinate range of the display screen, and are to be preloaded. The application can be displayed on the Stack. For the Android system, a new stack dedicated to displaying preloaded applications can be created based on the multi-window mechanism of the Android system. In the embodiment of the present application, the new stack is created because the newly created preloaded stack can have its own size and visibility, thereby achieving pre-loading on the display screen.
本申请实施例中,对预加载Stack的创建时机不做限定,可以是在终端出厂前默认设置预加载Stack处于常驻状态,即预加载Stack一直存在;也可以在终端开机时或终端解锁成功后创建;还可以在应用预加载事件被触发后(可以在确定目标应用程序之前)创建等等。In the embodiment of the present application, the creation time of the preloaded stack is not limited, and the preloaded stack is in the resident state by default, that is, the preloaded stack is always present; or the terminal is successfully unlocked when the terminal is powered on or the terminal is successfully unlocked. Post-create; can also be created after the application preload event is triggered (can be determined before the target application is determined).
本申请实施例中,对基于预加载Stack预加载目标应用程序对应的应用界面的具体过程不做限定,例如可以基于预加载Stack的size进行应用界面的绘制并显示等。In the embodiment of the present application, the specific process of the application interface corresponding to the preloading of the target application is not limited. For example, the application interface may be drawn and displayed based on the size of the preloaded stack.
本申请实施例的技术方案,在后台对待预加载应用程序执行预加载操作时,获取应用程序的开启事件,在该开启事件由应用通知触发时,冻结执行预加载操作的后台进程,并根据开启事件开启该应用程序;获取预设时间区间内的用户操作,若用户操作包括所述应用程序的关闭指示,则关闭该应用程序,并解冻后台进程继续执行预加载操作。通过上述技术方案,可以有效的避免用户误启动其它应用而干扰应用预加载及应用预测,提高预加载操作的准确率。In the technical solution of the embodiment of the present application, when the preloading operation is performed on the preloading application in the background, the opening event of the application is acquired, and when the opening event is triggered by the application notification, the background process of executing the preloading operation is frozen, and is started according to the The event starts the application; the user operation in the preset time interval is obtained, and if the user operation includes the closing instruction of the application, the application is closed, and the background process is thawed to continue the pre-loading operation. Through the above technical solution, the user can be effectively prevented from accidentally starting other applications and interfere with the application preloading and application prediction, thereby improving the accuracy of the preloading operation.
在一些实施例中,所述基于预先创建的预加载活动窗口堆栈预加载目标应用程序对应的应用界面可以包括:在预先创建的预加载活动窗口堆栈中创建所述目标应用程序对应的任务栈;基于所述后台进程在所述任务栈中启动所述目标应用程序对应的活动窗口;基于所启动的活动窗口绘制并显示所述目标应用程序对应的应用界面。这样设置的好处在于,能够基于屏幕坐标范围之外的预加载活动窗口堆栈对目标应用程序的应用界面进行绘制并显示,不会干扰前台应用程序的运行及显示,保证***稳定性,同时有效提高目标应用程序启动时的速度。在创建目标进程的同时,还可包括目标进程的初始化过程。在上述步骤的执行过程中,还可能涉及其他资源的预加载,如应用服务启动、内存分配、文件内容读取及网络数据获取等,本申请实施例对其他资源的预加载过程不做限定。In some embodiments, the pre-creating pre-loaded active window stack preloading target application corresponding application interface may include: creating a task stack corresponding to the target application in a pre-created preloaded active window stack; And launching, according to the background process, an active window corresponding to the target application in the task stack; and drawing and displaying an application interface corresponding to the target application based on the activated active window. The advantage of this setting is that the application interface of the target application can be drawn and displayed based on the preloaded active window stack outside the screen coordinate range, without interfering with the operation and display of the foreground application, ensuring system stability and effectively improving The speed at which the target application starts. The creation process of the target process can also include the initialization process of the target process. During the execution of the foregoing steps, the preloading of other resources may be involved, such as application service startup, memory allocation, file content reading, and network data acquisition. The preloading process of other resources is not limited in this embodiment.
在一些实施例中,还包括:向所述目标应用程序发送伪造焦点通知,并基于所述伪造焦点通知在预设时间段内保持所述目标应用程序对应的应用界面的持续绘制以及显示更新。这 样设置的好处在于,能够在目标应用程序获得焦点并对***可见的情况下完成应用界面的绘制及显示,提高预加载的完成度,且不对前台应用的焦点产生影响。本申请实施例中的焦点又称为输入焦点,伪造焦点与前台应用对应的焦点相互独立。一般的,对于目前的Android***来说,焦点是唯一的,例如触摸等输入操作只对焦点生效,对于输入焦点信息,***端和应用端是一致的,***端一旦修改输入焦点信息,就会向应用发送输入焦点信息发生变化的信息,以此方法保证***端和应用端输入焦点信息一致。本申请实施例中,通过分离***端和应用端输入焦点信息的方式,实现应用端可伪造焦点的目的。在一实施例中,对预加载应用伪造焦点通知,使预加载应用具有焦点信息,而***端的焦点信息仍然是正确的,这样处理可以使得预加载应用能够正常绘制,达到全部加载的目的。焦点存在于***端和应用端,可认为是服务端(server)和客户端(client),***端记录拥有焦点的应用,应用端保存标志位(flag)标识自己是否有焦点。伪造输入焦点的时机可以是当Android的窗口***新增窗口,需要更新焦点时,生成伪造焦点通知并进行发送。伪造焦点的方法可以是调用窗口的client端的改变窗口焦点的方法,使得该窗口获取焦点。在一实施例中,可基于Binder机制进行伪造焦点通知的发送,Binder机制是Android***的进程间通信的最常用的方式,采用c/s架构,即客户/服务架构。In some embodiments, the method further includes: transmitting a forged focus notification to the target application, and maintaining a continuous rendering of the application interface corresponding to the target application and displaying an update for a preset time period based on the forged focus notification. The advantage of this setup is that it can complete the drawing and display of the application interface when the target application gets the focus and the system is visible, and improves the completion of the preload without affecting the focus of the foreground application. The focus in the embodiment of the present application is also referred to as an input focus, and the forged focus is independent of the focus corresponding to the foreground application. Generally, for the current Android system, the focus is unique. For example, the input operation such as touch is only effective for the focus. For the input focus information, the system side and the application end are consistent, and once the system side modifies the input focus information, Sending information that the input focus information changes to the application, so as to ensure that the input information of the system end and the application end are consistent. In the embodiment of the present application, the purpose of forging the focus on the application end is achieved by separating the manner in which the system side and the application end input the focus information. In an embodiment, the pre-loading application forgees the focus notification, so that the preloaded application has the focus information, and the focus information of the system is still correct, so that the processing can enable the preloading application to draw normally, and achieve the purpose of full loading. The focus exists on the system side and the application side. It can be regarded as the server (server) and the client (client). The system side records the application with the focus, and the application saves the flag (flag) to identify whether it has focus. The timing of forging the input focus may be that when the window system of Android adds a window and needs to update the focus, a fake focus notification is generated and sent. The method of forging the focus may be a method of calling the client side of the window to change the focus of the window, so that the window acquires the focus. In an embodiment, the sending of the forged focus notification may be performed based on the Binder mechanism, which is the most common way of inter-process communication of the Android system, adopting the c/s architecture, that is, the client/service architecture.
本申请实施例中,预设时间段可根据实际情况设计,例如可以是开始预加载后的固定时长范围内,也可以是开始预加载到完成预加载的时段等。在一些实施例中,所述预设时间段的长度包括所述目标应用程序中启动广告或启动动画的播放时长。一些应用程序在启动的过程中,通常会播放一些广告或动画,广告或动画的播放时长通常为3秒至十几秒不等,在播放广告或动画期间,用户可能没办法进行任何操作,只能等待播放完毕,浪费用户的宝贵时间。本申请实施例这样设置的好处在于,能够在目标应用程序启动之前,在屏幕外播放完启动广告或启动动画,当目标应用程序启动时,可直接进入应用程序的主页面或其他用户可操作的界面,从而将目标应用程序的可操作时间点进一步提前,减少等待时间。In the embodiment of the present application, the preset time period may be designed according to actual conditions, for example, may be within a fixed duration range after starting preloading, or may be a period from the start of preloading to the completion of preloading. In some embodiments, the length of the preset time period includes a play duration in which the advertisement is launched or the animation is activated in the target application. Some applications usually play some advertisements or animations during the startup process. The duration of the advertisement or animation is usually from 3 seconds to ten seconds. During the advertisement or animation, the user may not be able to perform any operations. Can wait for the playback to complete, wasting the user's valuable time. The advantage of the setting of the embodiment of the present application is that the startup advertisement or the startup animation can be played out of the screen before the target application is started, and when the target application is started, the main page of the application or other user can be directly operated. Interface to further advance the target time point of the target application and reduce waiting time.
在一些实施例中,在基于预先创建的预加载活动窗口堆栈预加载目标应用程序对应的应用界面之后,还包括:在接收到所述目标应用程序的运行指令时,将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的应用界面迁移至所述显示屏幕进行显示。这样设置的好处在于,在目标应用程序真正需要启动的时候,直接将已经绘制好的应用界面迁移到显示屏幕进行显示,能够达到应用界面的快速切换,提高启动速度。In some embodiments, after preloading the application interface corresponding to the target application based on the pre-created preloaded active window stack, the method further includes: when the running instruction of the target application is received, the preloading active window The application interface corresponding to the target application included in the stack is migrated to the display screen for display. The advantage of this setting is that when the target application really needs to be started, the already-drawn application interface is directly migrated to the display screen for display, which can achieve fast switching of the application interface and improve the startup speed.
在一些实施例中,所述将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的应用界面迁移至所述显示屏幕进行显示,包括:将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的任务栈迁移至应用活动窗口堆栈的顶部;更新所述任务栈的尺寸信息、配置 信息和可见性,以实现所述目标应用程序对应的应用界面在所述显示屏幕进行显示。这样设置的好处在于,能够保证界面迁移过程的稳定性,保证恢复过程不会出现卡屏、黑屏或迁移速度慢等问题。In some embodiments, the migrating the application interface corresponding to the target application included in the preloaded active window stack to the display screen for display comprises: including the preloaded active window stack The task stack corresponding to the target application is migrated to the top of the application active window stack; the size information, the configuration information, and the visibility of the task stack are updated, so that the application interface corresponding to the target application is implemented on the display screen. display. The advantage of this setting is that the stability of the interface migration process can be ensured, and the recovery process does not cause problems such as a card screen, a black screen, or a slow migration speed.
对于一些终端来说,尤其是手机及平板电脑等移动终端,为了方便用户的使用,显示屏幕的显示方式通常包括竖屏显示和横屏显示,许多应用程序默认采用竖屏方式进行显示,而有些应用程序默认采用横屏方式进行显示(如一些网络游戏),在终端的使用过程中,有些应用程序还会随着用户握持终端的方向而进行横竖屏显示的切换。在本申请的一些实施例中,所述预加载活动窗口堆栈对应的边界坐标为(H,0,2H,H),所述边界坐标对应的坐标系为***坐标,所述***坐标的原点为所述显示屏幕的左上角,H为所述显示屏幕的显示区域的长边长度。也就是说,H对应的边是显示屏幕的显示区域的最大边,在竖屏显示时为显示屏幕的高,在横屏显示时为显示屏幕的宽。这样设置的目的是考虑到显示屏幕横屏、预加载应用横屏显示,以及一些应用程序的正常显示。图2为本申请实施例提供的一种预加载活动窗口堆栈与显示屏幕显示区域的相对位置关系示意图。如图2所示,此时显示屏幕为竖屏方式,终端***坐标的原点为显示屏幕201的左顶点(0,0),显示屏幕201的宽度方向为X轴,高度方向为Y轴,预加载Stack202对应的边界坐标为(H,0,2H,H),H为屏幕高,即左边实线矩形范围内的区域为主屏幕显示区域,右边虚线矩形范围内的区域为预加载显示区域。图3为本申请实施例提供的又一种预加载活动窗口堆栈与显示屏幕显示区域的相对位置关系示意图。如图3所示,此时显示屏幕为横屏方式,终端***坐标的原点为显示屏幕301的左顶点(0,0),显示屏幕301的高度方向为X轴,宽度方向为Y轴,预加载Stack202对应的边界坐标为(H,0,2H,H),H为屏幕高,即左边实线矩形范围内的区域为主屏幕显示区域,右边虚线矩形范围内的区域为预加载显示区域。For some terminals, especially mobile terminals such as mobile phones and tablet computers, in order to facilitate the user's use, the display mode of the display screen usually includes vertical screen display and horizontal screen display, and many applications are displayed by vertical screen by default, and some are displayed by default. The application defaults to display in landscape mode (such as some online games). During the use of the terminal, some applications also switch between horizontal and vertical display as the user holds the direction of the terminal. In some embodiments of the present application, 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, and the origin of the system coordinates is In the upper left corner of the display screen, H is the length of the long side of the display area of the display screen. That is to say, the edge corresponding to H is the largest side of the display area of the display screen, which is the height of the display screen when the vertical screen is displayed, and the width of the display screen when the horizontal screen is displayed. The purpose of this setting is to take into account the horizontal screen of the display screen, the horizontal display of the preloaded application, and the normal display of some applications. FIG. 2 is a schematic diagram of a relative position relationship between a preloaded active window stack and a display screen display area according to an embodiment of the present application. As shown in FIG. 2, the display screen is in the vertical screen mode, and 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, and the height direction is the Y axis. The boundary coordinates of the loaded Stack 202 are (H, 0, 2H, H), H is the screen height, that is, the area within the solid line rectangle on the left side is the main screen display area, and the area within the rectangular area of the right dashed line is the preloaded display area. FIG. 3 is a schematic diagram of a relative positional relationship between a preloaded active window stack and a display screen display area according to an embodiment of the present application. As shown in FIG. 3, the display screen is in the horizontal screen mode, and 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, and the width direction is the Y axis. The boundary coordinates of the loaded Stack 202 are (H, 0, 2H, H), H is the screen height, that is, the area within the solid line rectangle on the left side is the main screen display area, and the area within the rectangular area of the right dashed line is the preloaded display area.
预加载Stack各个边界如此设置的原因在于:The reason for pre-loading the various boundaries of the Stack is this:
左上角的横坐标为H,是为了防止横屏时显示屏幕(也可称为主屏幕)显示到预加载应用的界面,因为主屏幕除了竖屏模式,还有横屏模式,当主屏幕横屏的时候,为了防止主屏幕显示区域显示了预加载的应用的局部,所以将预加载Stack对应的矩形区域的左上角横坐标设为屏幕高。The horizontal coordinate of the upper left corner is H, which is to prevent the display screen (also called the main screen) from being displayed to the interface of the preloaded application when the horizontal screen is used, because the main screen has the horizontal screen mode and the horizontal screen mode when the main screen is horizontal screen. In order to prevent the main screen display area from displaying the part of the preloaded application, the horizontal coordinate of the upper left corner of the rectangular area corresponding to the preloaded stack is set to the screen height.
左上角的纵坐标为0,是为了预加载应用能够正确计算状态栏高度。Android应用为了更好的设计用户界面(User Interface,UI),会自定义顶部状态栏,如果上边对应的纵坐标不等于0,那么状态栏的高度可能会错误。The ordinate of the upper left corner is 0, in order to preload the application to correctly calculate the status bar height. In order to better design the user interface (UI), the Android application will customize the top status bar. If the corresponding ordinate of the upper side is not equal to 0, the height of the status bar may be wrong.
右下角的横坐标为2H(2倍屏幕高),即预加载Stack对应的矩形的宽=屏幕高,是为了预加载Stack的size能够包含预加载时候的横屏应用(即应用界面为横屏显示方式的应用程 序)。The horizontal coordinate of the lower right corner is 2H (2 times the screen height), that is, the width of the rectangle corresponding to the preloaded stack = the screen height, in order to preload the size of the stack to include the horizontal screen application at the time of preloading (ie, the application interface is a horizontal screen) Display mode application).
右下角的纵坐标为H,即预加载Stack对应的矩形的高=屏幕高,是为了预加载Stack的size能够包含预加载时候的竖屏应用。The ordinate of the lower right corner is H, that is, the height of the rectangle corresponding to the preloaded stack = the height of the screen, in order to preload the size of the stack to include the vertical screen application at the time of preloading.
基于上述的原因,发明人将预加载Stack的size设置为(H,0,2H,H)。For the above reasons, the inventor sets the size of the preloaded stack to (H, 0, 2H, H).
此外,图4为本申请实施例提供的一种应用界面迁移示意图,如图4所示,在接收到目标应用程序的运行指令时,将预加载活动窗口堆栈中包含的目标应用程序对应的应用界面401迁移至显示屏幕201进行显示,在一实施例中,将预加载应用界面所属的task迁移至应用活动窗口Stack的顶部,并更新该task的尺寸信息、配置信息和可见性,从而应用界面能够在显示屏幕上正常显示。In addition, FIG. 4 is a schematic diagram of application interface migration according to an embodiment of the present application. As shown in FIG. 4, when receiving a running instruction of a target application, an application corresponding to the target application included in the stack of the active window is preloaded. The interface 401 is migrated to the display screen 201 for display. In an embodiment, the task to which the preloaded application interface belongs is migrated to the top of the application active window Stack, and the size information, configuration information, and visibility of the task are updated, thereby applying the interface. Can be displayed normally on the display screen.
图5为本申请实施例提供的另一种应用程序预加载方法的流程图,该方法包括:步骤501至步骤512。FIG. 5 is a flowchart of another application preloading method according to an embodiment of the present disclosure, where the method includes: Step 501 to Step 512.
在步骤501中,检测到应用预加载事件被触发。In step 501, it is detected that an application preload event is triggered.
在步骤502中,确定待预加载应用程序。In step 502, it is determined that the application is to be preloaded.
需要说明的是,可采用预测模型对待预加载应用程序进行预测。该预测模型可以是机器学习模型,所采用的算法可以包括循环神经网络(Recurrent neural networks,RNN)、长短期记忆(Long Short-Term Memory,LSTM)网络、门限循环单元、简单循环单元、自动编码器、决策树、随机森林、特征均值分类、分类回归树、隐马尔科夫、K最近邻(k-NearestNeighbor,KNN)算法、逻辑回归模型、贝叶斯模型、高斯模型以及KL散度(Kullback–Leibler divergence)等等。It should be noted that the predictive model can be used to predict the preloaded application. The prediction model may be a machine learning model, and the algorithms used may include Recurrent neural networks (RNN), Long Short-Term Memory (LSTM) networks, threshold loop units, simple loop units, and automatic coding. , decision tree, random forest, feature mean classification, classification regression tree, hidden Markov, K-Nearest Neighbor (KNN) algorithm, logistic regression model, Bayesian model, Gaussian model, and KL divergence (Kullback) –Leibler divergence) and so on.
在一实施例中,可在用户使用终端的过程中,采集训练样本,采用训练样本对预设初始模型进行训练,最终得到用于预测待预加载应用程序的预测模型。示例性的,训练样本中包含的元素可包括应用程序被打开的时间序列或次序序列;可包括应用程序被打开的时间、地点以及频次等;可包括终端的运行状态,如移动数据网络的开关状态、无线热点的连接状态、所连接的无线热点的身份信息、当前运行的应用程序、上一个前景应用程序、当前应用程序在后台停留的时长、当前应用程序最近一次被切换至后台的时间、耳机插孔的插拔状态、充电状态、电池电量信息以及屏幕显示时长等等;还可包括终端中集成的传感器采集到的数据,如运动传感器、光线传感器、温度传感器以及湿度传感器等等。In an embodiment, during the process of using the terminal by the user, the training sample is collected, and the preset initial model is trained by using the training sample, and finally the prediction model for predicting the application to be preloaded is obtained. Illustratively, the elements included in the training sample may include a time series or sequence of sequences in which the application is opened; may include the time, location, and frequency of the application being opened; may include the operating state of the terminal, such as a switch of the mobile data network Status, connection status of the wireless hotspot, identity information of the connected wireless hotspot, currently running application, previous foreground application, duration of the current application staying in the background, time when the current application was last switched to the background, The plug-in status, charging status, battery level information, and screen display duration of the headphone jack, etc.; can also include data collected by sensors integrated in the terminal, such as motion sensors, light sensors, temperature sensors, and humidity sensors.
示例性的,可根据所选用的机器学习模型选择合适的样本元素,也可根据所选的样本元素确定所选用的机器学习模型,还可结合对预测准确度以及预设速度等方面的需求进行模型及样本元素的选择等,本申请实施例不做限定。Illustratively, the appropriate sample elements can be selected according to the selected machine learning model, and the selected machine learning model can be determined according to the selected sample elements, and can also be combined with the requirements for prediction accuracy and preset speed. The selection of the model and the sample elements and the like are not limited in the embodiment of the present application.
本申请实施例中,确定待预加载应用程序可以包括根据预测模型之前的输出结果确定待 预加载应用程序,也可以包括利用预测模型进行预测,将预测模型的当前输出结果确定待预加载应用程序。In the embodiment of the present application, determining that the application to be preloaded may include determining an application to be preloaded according to an output result before the prediction model, or including using the prediction model to perform prediction, and determining a current output result of the prediction model to be preloaded into the application. .
在步骤503中,判断是否存在预先创建的预加载活动窗口堆栈,若否,则执行步骤504;若是,则执行步骤505。In step 503, it is determined whether there is a pre-created preloaded active window stack. If not, step 504 is performed; if yes, step 505 is performed.
本申请实施例中,在确定待预加载的目标应用程序之后,判断预加载Stack是否存在,若存在,则无需新建,若不存在,则进行创建,可以节省***资源。可以理解的是,当目标应用程序包含多个时,也即需要在短时间内连续预加载多个应用程序时,在第一个目标应用程序开始加载前,预加载Stack已创建完毕,那么第二个目标应用程序开始加载前,预加载Stack是存在的,可以不必进行上述判断。In the embodiment of the present application, after determining the target application to be preloaded, it is determined whether the preloaded stack exists. If it exists, no new configuration is needed, and if it does not exist, the creation is performed, and system resources can be saved. Understandably, when the target application contains more than one, that is, when multiple applications need to be preloaded continuously in a short time, the preloaded stack is created before the first target application starts loading, then the first Before the two target applications start loading, the preloaded stack exists, and it is not necessary to make the above judgment.
在步骤504中,按照预设规则创建预加载活动窗口堆栈。In step 504, a preloaded active window stack is created in accordance with a preset rule.
需要说明的是,步骤504执行完成后,继续执行步骤505。It should be noted that after the execution of step 504 is completed, step 505 is continued.
在步骤505中,创建目标应用程序对应的目标进程,并对目标进程进行初始化。In step 505, a target process corresponding to the target application is created and the target process is initialized.
在步骤506中,在预加载活动窗口堆栈中创建目标应用程序对应的任务栈。In step 506, a task stack corresponding to the target application is created in the preloaded active window stack.
在步骤507中,基于所述目标进程在所述任务栈中启动所述目标应用程序对应的活动窗口,并向目标应用程序发送伪造焦点通知。In step 507, an active window corresponding to the target application is started in the task stack based on the target process, and a forged focus notification is sent to the target application.
在步骤508中,根据所述伪造焦点通知更新目标应用程序对应的焦点标志位,在预设时段内基于所启动的活动窗口持续绘制并更新显示目标应用程序对应的应用界面。In step 508, the focus flag corresponding to the update target application is notified according to the forged focus, and the application interface corresponding to the display target application is continuously drawn and updated based on the activated active window within the preset time period.
在步骤509中,获取应用程序的开启事件。In step 509, an open event of the application is obtained.
示例性的,检测应用程序的开启事件;在检测到所述开启事件时,确定所述开启事件的触发主体;若所述触发主体是应用通知,则确定所述开启事件由应用通知触发;若所述触发主体是触摸屏或传感器,则确定所述开启事件由用户操作触发。Exemplarily, detecting an open event of the application; determining, when the open event is detected, a triggering body of the open event; if the triggering body is an application notification, determining that the open event is triggered by an application notification; The triggering body is a touch screen or a sensor, and it is determined that the opening event is triggered by a user operation.
在步骤510中,在所述开启事件由应用通知触发时,冻结执行所述预加载操作的后台进程,并根据所述开启事件开启所述应用程序。In step 510, when the open event is triggered by the application notification, the background process executing the preload operation is frozen, and the application is started according to the open event.
需要说明的是,此处的后台进程可以认为是目标进程,该后台进程用于在所述任务栈中启动所述目标应用程序对应的活动窗口。It should be noted that the background process herein can be regarded as a target process, and the background process is used to start an active window corresponding to the target application in the task stack.
本申请实施例中,获取开启事件对应的应用程序的应用标识,根据应用标识判断其是否为预加载应用程序。若待开启的应用程序不是预加载应用程序,则依照相关技术中的应用加载方案开启应用程序。若待开启的应用程序是已完成预加载的应用程序,则将所述预加载活动窗口堆栈中包含的目标应用程序对应的任务栈迁移至应用活动窗口堆栈的顶部。In this embodiment, the application identifier of the application corresponding to the open event is obtained, and it is determined according to the application identifier whether it is a preloaded application. If the application to be opened is not a preloaded application, the application is opened according to the application loading scheme in the related art. If the application to be opened is an application that has completed preloading, the task stack corresponding to the target application included in the preloaded active window stack is migrated to the top of the application active window stack.
在一实施例中,以应用活动窗口为App Stack为例,将task移动到App Stack,可包括:从原stack(即预加载Stack)中的list(列表)中删除此task,在新stack(App Stack)中顶部 添加此task。每个stack都有一个list,用以记录stack包含的所有task;对应地,每个task同时会记录本task所在的stack信息。因为stack包含相对其他stack可能不同的size、configuration(配置信息)、可见性和zorder等属性,所以仅仅将task添加到新stack的list中就可以改变task的zorder等属性。添加在新stack中的顶部是为了使该task是可见的。In an embodiment, taking the application activity window as an App Stack as an example, moving the task to the App Stack may include: deleting the task from the list in the original stack (ie, preloading the Stack), in the new stack ( Add this task at the top of the App Stack). Each stack has a list for recording all the tasks contained in the stack; correspondingly, each task will also record the stack information of the task. Because the stack contains attributes such as size, configuration, visibility, and zorder that may be different from other stacks, simply adding the task to the list of new stacks can change the attributes of the task's zorder. The top of the new stack is added to make the task visible.
更新任务栈的尺寸信息、配置信息和可见性,以实现目标应用程序对应的当前应用界面在显示屏幕进行显示。The size information, configuration information, and visibility of the task stack are updated to enable the current application interface corresponding to the target application to be displayed on the display screen.
可以理解的是,在预加载过程中,目标应用程序对应的应用界面处于持续的绘制及显示更新过程中,而用户真正启动目标应用程序的时机是不确定的,可能在预加载过程中就会接收到运行指令,那么可将当前在预加载Stack中显示的应用界面迁移到显示屏幕中进行显示。若用户在预加载完成之后,打开目标应用程序,那么可将预加载完成时的最后一个应用界面迁移到显示屏幕中进行显示。It can be understood that during the pre-loading process, the application interface corresponding to the target application is in the process of continuous drawing and display updating, and the timing of the user actually starting the target application is uncertain, and may be in the pre-loading process. Upon receiving the run command, the application interface currently displayed in the preloaded stack can be migrated to the display screen for display. If the user opens the target application after the preloading is completed, the last application interface when the preloading is completed can be migrated to the display screen for display.
在一实施例中,更新任务栈的尺寸信息、配置信息是为了改变应用的边界,具体可包括:主动更新size和configuration信息。仅仅使用上面的task迁移操作无法立即改变task的size和configuration,所以可主动调用修改task size和configuration的方法,保证该应用状态正确,可以正常地在前台工作。In an embodiment, updating the size information and the configuration information of the task stack is to change the boundary of the application, and specifically includes: actively updating the size and configuration information. Only using the above task migration operation can not change the size and configuration of the task immediately, so you can call the method of modifying the task size and configuration to ensure that the application is in the correct state and can work normally in the foreground.
在一实施例中,更新task可见是因为,在更新了size和configuration后,此时目标应用可能还不可见,调用更新新stack可见性的方法,由顶部至底部搜索可见的应用,设置为可见,并更新对应的窗口surface可见。其中,可见的应用判断方法可包括:在zorder上未被其他应用遮挡;未被锁屏遮挡;应用的顶部activity的状态是非正在初始化或者非退出状态。In an embodiment, the update task is visible because, after updating the size and configuration, the target application may not be visible at this time, calling the method of updating the new stack visibility, and the application visible from the top to the bottom is set to be visible. And update the corresponding window surface to be visible. The visible application judging method may include: no occlusion by other applications on the zorder; no occlusion by the lock screen; the state of the top activity of the application is non-initializing or non-exiting.
在步骤511中,获取预设时间区间内的用户操作。In step 511, a user operation within a preset time interval is acquired.
在步骤512中,若所述用户操作触发所述应用程序的关闭事件,则关闭所述应用程序,并解冻所述后台进程,继续执行所述预加载操作。In step 512, if the user operation triggers a shutdown event of the application, the application is closed, and the background process is thawed, and the pre-loading operation is continued.
需要说明的是,若预测得到待加载应用程序分别为应用A、应用B、应用C、应用D及应用F。假设按照A、B、C、D及F的顺序进行预加载,在以应用C为目标应用程序进行预加载操作时,获取到应用X的开启事件,则冻结应用C对应的后台进程c,以应用C为起始应用程序(用于标识后台进程解冻后的预加载操作起点),关联应用C的标识信息及后台进程c的进程标识,暂停预加载操作。响应于开启事件执行加载应用X的操作。若在预设时间区间内又检测到用户关闭应用X的操作,则触发应用X的关闭事件,响应于该关闭事件关闭应用X,并解冻后台进程c,返回执行步骤506,即在预先创建的预加载活动窗口堆栈中创建应用C对应的任务栈(本步骤为可选执行步骤,如果在冻结应用c后,预加载活动窗口堆栈中已创建的任务栈不被删除,则可不执行本步骤),基于后台进程c在所述任务栈中启动应 用C对应的活动窗口,基于所启动的活动窗口绘制并显示应用C对应的应用界面。***向应用C发送伪造焦点通知,并基于所述伪造焦点通知在预设时间段内保持应用C对应的应用界面的持续绘制以及显示更新。在预加载完成应用C后,以应用D为目标应用程序,返回执行步骤505。相似的,在预加载完成应用D后,以应用F为目标应用程序,返回执行步骤505。It should be noted that if the application to be loaded is predicted to be Application A, Application B, Application C, Application D, and Application F, respectively. Assume that the preloading is performed in the order of A, B, C, D, and F. When the application C is preloaded with the application C, the open event of the application X is obtained, and the background process c corresponding to the application C is frozen. Application C is the starting application (used to identify the starting point of the preloading operation after the background process is thawed), the identification information of the application C and the process identifier of the background process c are suspended, and the preloading operation is suspended. The operation of loading the application X is performed in response to the open event. If the operation of closing the application X is detected in the preset time interval, the shutdown event of the application X is triggered, the application X is closed in response to the shutdown event, and the background process c is thawed, and the process returns to step 506, that is, in advance. The task stack corresponding to the application C is created in the preloaded active window stack (this step is an optional execution step. If the task stack created in the stack of the preloaded active window is not deleted after the application c is frozen, this step may not be performed) The active window corresponding to the application C is started in the task stack based on the background process c, and the application interface corresponding to the application C is drawn and displayed based on the activated active window. The system sends a forged focus notification to the application C, and based on the forged focus notification, keeps the continuous drawing of the application interface corresponding to the application C and the display update within a preset time period. After the application C is preloaded, the application D is targeted to the application, and the process returns to step 505. Similarly, after the application D is preloaded, the application F is the target application, and the process returns to step 505.
本申请实施例提供的应用程序预加载方法,可以在应用程序的预加载过程中,鉴别检测到的应用开启事件是否由用户触发,若否,则判定为误开启,不触发预加载应用程序的预测操作,且继续预加载剩余的待预加载应用程序,提升了预加载操作的准确率,且在出现误开启时,不用重头开始执行预加载操作,可以提高预加载效率。The application preloading method provided by the embodiment of the present application may identify whether the detected application opening event is triggered by the user during the preloading process of the application, and if not, determine that the application is turned on incorrectly, and does not trigger the preloading application. Predicting the operation, and continuing to preload the remaining preloaded applications, improves the accuracy of the preloading operation, and when the error is turned on, the preloading efficiency can be improved without starting the preloading operation.
图6为本申请实施例提供的一种应用程序预加载装置的结构框图,该装置可由软件和/或硬件实现,一般集成在终端中,可通过执行应用程序预加载方法来进行应用程序的预加载。如图6所示,该装置包括:事件检测模块610、进程冻结模块620、操作获取模块630和进程解冻模块640。FIG. 6 is a structural block diagram of an application preloading apparatus according to an embodiment of the present disclosure. The apparatus may be implemented by software and/or hardware, and is generally integrated in a terminal, and may be implemented by executing an application preloading method. load. As shown in FIG. 6, the apparatus includes an event detection module 610, a process freeze module 620, an operation acquisition module 630, and a process defrosting module 640.
事件检测模块610,设置为在后台对待预加载应用程序执行预加载操作时,获取应用程序的开启事件。The event detection module 610 is configured to acquire an open event of the application when the preloading operation is performed on the preloaded application in the background.
进程冻结模块620,设置为在所述开启事件由应用通知触发时,冻结执行所述预加载操作的后台进程,并根据所述开启事件开启所述应用程序。The process freeze module 620 is configured to freeze the background process that executes the preload operation when the open event is triggered by the application notification, and start the application according to the open event.
操作获取模块630,设置为获取预设时间区间内的用户操作。The operation obtaining module 630 is configured to acquire a user operation within a preset time interval.
进程解冻模块640,设置为若所述用户操作触发所述应用程序的关闭事件,则关闭所述应用程序,并解冻所述后台进程,继续执行所述预加载操作。The process defrosting module 640 is configured to: if the user operation triggers a shutdown event of the application, close the application, and thaw the background process, and continue to perform the preloading operation.
本申请实施例提供的应用程序预加载装置,在后台对待预加载应用程序执行预加载操作时,获取应用程序的开启事件,在该开启事件由应用通知触发时,冻结执行预加载操作的后台进程,并根据开启事件开启该应用程序;获取预设时间区间内的用户操作,若用户操作包括所述应用程序的关闭指示,则关闭该应用程序,并解冻后台进程继续执行预加载操作。通过上述技术方案,可以有效的避免用户误启动其它应用而干扰应用预加载及应用预测,提高预加载操作的准确率。The application preloading apparatus provided by the embodiment of the present application acquires an opening event of the application when the preloading operation is performed on the preloading application in the background, and freezes the background process of executing the preloading operation when the opening event is triggered by the application notification. And opening the application according to the open event; obtaining a user operation in the preset time interval, if the user operation includes the closing instruction of the application, closing the application, and unfreezing the background process to continue the preloading operation. Through the above technical solution, the user can be effectively prevented from accidentally starting other applications and interfere with the application preloading and application prediction, thereby improving the accuracy of the preloading operation.
在一实施例中,事件检测模块610还设置为:In an embodiment, the event detection module 610 is further configured to:
检测应用程序的开启事件;Detecting the open event of the application;
在检测到所述开启事件时,确定所述开启事件的触发主体;Determining a triggering body of the opening event when the opening event is detected;
若所述触发主体是应用通知,则确定所述开启事件由应用通知触发;If the triggering body is an application notification, determining that the opening event is triggered by an application notification;
若所述触发主体是触摸屏或传感器,则确定所述开启事件由用户操作触发。If the trigger body is a touch screen or a sensor, it is determined that the open event is triggered by a user operation.
在一实施例中,进程冻结模块620还设置为:In an embodiment, the process freeze module 620 is further configured to:
根据预加载完成的应用程序确定作为恢复起点的起始应用程序;Determine the starting application as the recovery starting point based on the preloaded application;
关联存储所述起始应用程序的标识信息以及所述后台进程的进程标识,并冻结所述后台进程。Correlation stores the identification information of the originating application and the process identifier of the background process, and freezes the background process.
在一实施例中,进程解冻模块640包括:In an embodiment, the process defrosting module 640 includes:
进程解冻子模块,设置为解冻所述进程标识对应的后台进程;The process unfreeze submodule is configured to thaw the background process corresponding to the process identifier;
预加载子模块,设置为以所述起始应用程序作为恢复预加载操作的起点,通过所述后台进程对剩余的待预加载应用程序执行预加载操作。Preloading the sub-module, set to use the starting application as a starting point for restoring the pre-loading operation, and performing a pre-loading operation on the remaining pre-loaded applications by the background process.
在一实施例中,预加载子模块还设置为:In an embodiment, the preload submodule is further configured to:
通过所述后台进程,基于预先创建的预加载活动窗口堆栈预加载目标应用程序对应的应用界面,其中,所述预加载活动窗口堆栈对应的边界坐标位于显示屏幕的坐标范围之外。And the application interface corresponding to the target application is preloaded based on the pre-created preloaded active window stack, wherein the boundary coordinates corresponding to the preloaded active window stack are outside the coordinate range of the display screen.
在一实施例中,预加载子模块还设置为:In an embodiment, the preload submodule is further configured to:
在预先创建的预加载活动窗口堆栈中创建所述目标应用程序对应的任务栈;Creating a task stack corresponding to the target application in a pre-created preloaded active window stack;
基于所述后台进程在所述任务栈中启动所述目标应用程序对应的活动窗口;And launching, according to the background process, an active window corresponding to the target application in the task stack;
基于所启动的活动窗口绘制并显示所述目标应用程序对应的应用界面。An application interface corresponding to the target application is drawn and displayed based on the activated activity window.
在一实施例中,还包括:In an embodiment, the method further includes:
界面绘制模块,设置为向所述目标应用程序发送伪造焦点通知,并基于所述伪造焦点通知在预设时间段内保持所述目标应用程序对应的应用界面的持续绘制以及显示更新,其中,所述预设时间段的长度包括所述目标应用程序中启动广告或启动动画的播放时长。An interface drawing module is configured to send a forged focus notification to the target application, and keep the continuous drawing and display update of the application interface corresponding to the target application within a preset time period based on the forged focus notification, where The length of the preset time period includes the playing duration of starting the advertisement or starting the animation in the target application.
在一实施例中,该装置还包括:In an embodiment, the apparatus further comprises:
界面迁移模块,设置为在基于预先创建的预加载活动窗口堆栈预加载所述目标应用程序对应的应用界面之后,在接收到所述目标应用程序的运行指令时,将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的应用界面迁移至所述显示屏幕进行显示。An interface migration module, configured to: after preloading an application interface corresponding to the target application based on a pre-created preloaded active window stack, when the running instruction of the target application is received, stacking the preloaded active window The application interface corresponding to the target application included in the target is migrated to the display screen for display.
在一实施例中,所述将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的应用界面迁移至所述显示屏幕进行显示,包括:In an embodiment, the migrating the application interface corresponding to the target application included in the preloaded active window stack to the display screen for display, including:
将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的任务栈迁移至应用活动窗口堆栈的顶部;Migrating the task stack corresponding to the target application included in the preloaded active window stack to the top of the application active window stack;
更新所述任务栈的尺寸信息、配置信息和可见性,以实现所述目标应用程序对应的应用界面在所述显示屏幕进行显示。The size information, the configuration information, and the visibility of the task stack are updated, so that an application interface corresponding to the target application is displayed on the display screen.
在一实施例中,所述预加载活动窗口堆栈对应的边界坐标为(H,0,2H,H),所述边界坐标对应的坐标系为***坐标,所述***坐标的原点为所述显示屏幕的左上角,H为所述显示屏幕的显示区域的长边长度。In an embodiment, the boundary coordinates of the preloaded active window stack are (H, 0, 2H, H), the coordinate system corresponding to the boundary coordinates is system coordinates, and the origin of the system coordinates is the display. In the upper left corner of the screen, H is the length of the long side of the display area of the display screen.
本申请实施例还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行应用程序预加载方法,该方法包括:The embodiment of the present application further provides a storage medium including computer executable instructions for executing an application preloading method when executed by a computer processor, the method comprising:
在后台对待预加载应用程序执行预加载操作时,获取应用程序的开启事件;Get the application's open event when performing a preload operation on the preloaded application in the background;
在所述开启事件由应用通知触发时,冻结执行所述预加载操作的后台进程,并根据所述开启事件开启所述应用程序;When the open event is triggered by the application notification, the background process that performs the preload operation is frozen, and the application is started according to the open event;
获取预设时间区间内的用户操作;Obtain user operations within a preset time interval;
若所述用户操作触发所述应用程序的关闭事件,则关闭所述应用程序,并解冻所述后台进程,继续执行所述预加载操作。If the user operation triggers a shutdown event of the application, the application is closed, and the background process is thawed, and the preloading operation is continued.
存储介质——任何的各种类型的存储器设备或存储设备。术语“存储介质”旨在包括:安装介质,例如CD-ROM、软盘或磁带装置;计算机***存储器或随机存取存储器,诸如DRAM、DDR RAM、SRAM、EDO RAM,兰巴斯(Rambus)RAM等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储器或其组合。另外,存储介质可以位于程序在其中被执行的第一计算机***中,或者可以位于不同的第二计算机***中,第二计算机***通过网络(诸如因特网)连接到第一计算机***。第二计算机***可以提供程序指令给第一计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机***中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如具体实现为计算机程序)。Storage media - any of a variety of types of memory devices or storage devices. The term "storage medium" is intended to include: a mounting medium such as a CD-ROM, a floppy disk or a tape device; a computer system memory or a random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc. Non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, and the like. The storage medium may also include other types of memory or a combination thereof. Additionally, 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, the second computer system being coupled to the first computer system via a network, such as the Internet. The second computer system can provide program instructions to the first computer for execution. The term "storage medium" can include two or more storage media that can reside in different locations (eg, in different computer systems connected through a network). A storage medium may store program instructions (eg, embodied as a computer program) executable by one or more processors.
当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的应用程序预加载操作,还可以执行本申请任意实施例所提供的应用程序预加载方法中的相关操作。Of course, the storage medium containing the computer executable instructions provided by the embodiment of the present application is not limited to the application preloading operation as described above, and may also execute the application provided by any embodiment of the present application. Related operations in the preload method.
本申请实施例提供了一种智能终端,该智能终端内具有操作***,该智能终端中可集成本申请实施例提供的应用程序预加载装置。其中,智能终端可以为智能手机、PAD(平板电脑)、掌上游戏机、笔记本电脑以及智能家电等。图7为本申请实施例提供的一种智能终端的结构示意图。如图7所示,该智能终端包括存储器710及处理器720。所述存储器710,设置为存储计算机程序、预加载应用程序的资源、关联存储的起始应用程序的标识信息和后台进程的进程标识以及预设时间区间等;所述处理器720读取并执行所述存储器710中存储的计算机程序。所述处理器720在执行所述计算机程序时实现以下步骤:在后台对待预加载应用程序执行预加载操作时,获取应用程序的开启事件;在所述开启事件由应用通知触发时,冻结执行所述预加载操作的后台进程,并根据所述开启事件开启所述应用程序;获取预设时间区间内的用户操作;若所述用户操作触发所述应用程序的关闭事件,则关闭所述应用程序,并解 冻所述后台进程,继续执行所述预加载操作。The embodiment of the present application provides an intelligent terminal, which has an operating system, and the application preloading device provided by the embodiment of the present application can be integrated into the smart terminal. Among them, the smart terminal can be a smart phone, a PAD (tablet), a handheld game machine, a notebook computer, and a smart home appliance. FIG. 7 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present disclosure. As shown in FIG. 7, the smart terminal includes a memory 710 and a processor 720. The memory 710 is configured to store a computer program, a resource of a preloaded application, identification information of an associated application that is stored and a process identifier of a background process, and a preset time interval, etc.; the processor 720 reads and executes A computer program stored in the memory 710. The processor 720, when executing the computer program, implements the steps of: acquiring an open event of the application when the preloading operation is performed on the preloaded application in the background; and freezing the execution when the open event is triggered by the application notification Determining a background process of the preloading operation, and opening the application according to the opening event; acquiring a user operation in a preset time interval; and closing the application if the user operation triggers a closing event of the application And thawing the background process and continuing to perform the preloading operation.
上述示例中列举的存储器及处理器均为智能终端的部分元器件,所述智能终端还可以包括其它元器件。以智能手机为例,说明上述智能终端可能的结构。图8为本申请实施例提供的一种智能手机的结构框图。如图8所示,该智能手机可以包括:存储器801、中央处理器(Central Processing Unit,CPU)802(又称处理器,以下简称CPU)、外设接口803、射频(Radio Frequency,RF)电路805、音频电路806、扬声器811、触摸屏812、电源管理芯片808、输入/输出(I/O)子***809、其他输入/控制设备810以及外部端口804,这些部件通过一个或多个通信总线或信号线807来通信。The memory and processor listed in the above examples are all components of the smart terminal, and the smart terminal may further include other components. Taking a smart phone as an example, the possible structure of the above intelligent terminal will be described. FIG. 8 is a structural block diagram of a smart phone according to an embodiment of the present application. As shown in FIG. 8 , the smart phone may include: a memory 801, a central processing unit (CPU) 802 (also referred to as a processor, hereinafter referred to as a CPU), a peripheral interface 803, and a radio frequency (RF) circuit. 805, audio circuit 806, speaker 811, touch screen 812, power management chip 808, input/output (I/O) subsystem 809, other input/control devices 810, and external port 804, through one or more communication buses or Signal line 807 is in communication.
应该理解的是,图示智能手机800仅仅是智能终端的一个范例,并且智能手机800可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that the illustrated smart phone 800 is merely one example of a smart terminal, and that the smart phone 800 can have more or fewer components than those shown in the figures, and two or more components can be combined. Or it can have different component configurations. The various components shown in the figures can 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 smart phone integrated with the application preloading device provided in this embodiment is described in detail below.
存储器801,所述存储器801可以被CPU802、外设接口803等访问,所述存储器801可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。在存储器801中存储计算机程序,还可以存储预加载应用程序的资源、关联存储的起始应用程序的标识信息和后台进程的进程标识以及预设时间区间等。The memory 801 can be accessed by the CPU 802, the peripheral interface 803, etc., and the memory 801 can include a high speed random access memory, and can also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices. Or other volatile solid-state storage devices. The computer program is stored in the memory 801, and the resources of the preloaded application, the identification information of the associated initial application stored, the process identifier of the background process, a preset time interval, and the like may also be stored.
外设接口803,所述外设接口803可以将设备的输入和输出外设连接到CPU802和存储器801。 Peripheral interface 803, which can connect the input and output peripherals of the device to CPU 802 and memory 801.
I/O子***809,所述I/O子***809可以将设备上的输入输出外设,例如触摸屏812和其他输入/控制设备810,连接到外设接口803。I/O子***809可以包括显示控制器8091和用于控制其他输入/控制设备810的一个或多个输入控制器8092。其中,一个或多个输入控制器8092从其他输入/控制设备810接收电信号或者向其他输入/控制设备810发送电信号,其他输入/控制设备810可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器8092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。I/O subsystem 809, which can 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 can include a display controller 8091 and one or more input controllers 8092 for controlling other input/control devices 810. Wherein, one or more input controllers 8092 receive electrical signals from other input/control devices 810 or transmit electrical signals to other input/control devices 810, and other input/control devices 810 may include physical buttons (press buttons, rocker buttons, etc.) ), dial, slide switch, joystick, click wheel. It is worth noting that the input controller 8092 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
触摸屏812,所述触摸屏812是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。The touch screen 812 is an input interface and an output interface between the user terminal and the user, and displays the visual output to the user. The visual output may include graphics, text, icons, videos, and the like.
I/O子***809中的显示控制器8091从触摸屏812接收电信号或者向触摸屏812发送电信号。触摸屏812检测触摸屏上的接触,显示控制器8091将检测到的接触转换为与显示在触 摸屏812上的用户界面对象的交互,即实现人机交互,显示在触摸屏812上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。 Display controller 8091 in I/O subsystem 809 receives an electrical signal from touch screen 812 or an electrical signal to touch screen 812. The touch screen 812 detects the contact on the touch screen, and the display controller 8091 converts the detected contact into an interaction with the user interface object displayed on the touch screen 812, that is, realizes human-computer interaction, and the user interface object displayed on the touch screen 812 may be running. The icon of the game, the icon of the network to the corresponding network, and the like. It is worth noting that the device may also include a light mouse, which is a touch sensitive surface that does not display a visual output, or an extension of a touch sensitive surface formed by the touch screen.
RF电路805,主要设置为建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。具体地,RF电路805接收并发送RF信号,RF信号也称为电磁信号,RF电路805将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路805可以包括用于执行这些功能的已知电路,其包括但不限于天线***、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、编译码器(COder-DECoder,CODEC)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。The RF circuit 805 is mainly configured to establish communication between the mobile phone and the wireless network (ie, the network side), and implement data reception and transmission between the mobile phone and the wireless network. For example, sending and receiving short messages, emails, and the like. Specifically, the RF circuit 805 receives and transmits an RF signal, which is also referred to as an electromagnetic signal, and the RF circuit 805 converts the electrical signal into an electromagnetic signal or converts the electromagnetic signal into an electrical signal, and through the electromagnetic signal and communication network and other devices Communicate. 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 CODER-DECoder (CODEC) chipset, Subscriber Identity Module (SIM), etc.
音频电路806,主要设置为从外设接口803接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器811。The audio circuit 806 is primarily configured to receive audio data from the peripheral interface 803, convert the audio data into an electrical signal, and transmit the electrical signal to the speaker 811.
扬声器811,设置为将手机通过RF电路805从无线网络接收的语音信号,还原为声音并向用户播放该声音。The speaker 811 is arranged to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 805 to sound and play the sound to the user.
电源管理芯片808,设置为为CPU802、I/O子***及外设接口所连接的硬件进行供电及电源管理。The power management chip 808 is configured to provide power and power management for the hardware connected to the CPU 802, the I/O subsystem, and the peripheral interface.
本申请实施例提供的智能终端,可以有效的避免用户误启动其它应用而干扰应用预加载及应用预测,提高预加载操作的准确率。The intelligent terminal provided by the embodiment of the present invention can effectively prevent the user from accidentally starting other applications and interfere with the application preloading and application prediction, thereby improving the accuracy of the preloading operation.
上述实施例中提供的应用程序预加载装置、存储介质及智能终端可执行本申请任意实施例所提供的应用程序预加载方法,具备执行该方法相应的功能模块和有益效果。未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的应用程序预加载方法。The application preloading device, the storage medium, and the smart terminal provided in the foregoing embodiments may perform the application preloading method provided by any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details that are not described in detail in the above embodiments, reference may be made to the application preloading method provided by any embodiment of the present application.

Claims (20)

  1. 一种应用程序预加载方法,包括:An application preloading method, including:
    在后台对待预加载应用程序执行预加载操作时,获取应用程序的开启事件;Get the application's open event when performing a preload operation on the preloaded application in the background;
    在所述开启事件由应用通知触发的情况下,冻结执行所述预加载操作的后台进程,并根据所述开启事件开启所述应用程序;When the open event is triggered by the application notification, the background process that performs the preload operation is frozen, and the application is started according to the open event;
    获取预设时间区间内的用户操作;Obtain user operations within a preset time interval;
    在所述用户操作触发所述应用程序的关闭事件的情况下,关闭所述应用程序,并解冻所述后台进程,继续执行所述预加载操作。In a case where the user operation triggers a shutdown event of the application, the application is closed, and the background process is thawed, and the preloading operation is continued.
  2. 根据权利要求1所述的方法,其中,获取应用程序的开启事件,包括:The method of claim 1, wherein acquiring an open event of the application comprises:
    检测应用程序的开启事件;Detecting the open event of the application;
    在检测到所述开启事件的情况下,确定所述开启事件的触发主体;Determining a triggering body of the opening event in the case that the opening event is detected;
    在所述触发主体是应用通知的情况下,确定所述开启事件由应用通知触发;In the case that the triggering body is an application notification, determining that the opening event is triggered by an application notification;
    在所述触发主体是触摸屏或传感器的情况下,确定所述开启事件由用户操作触发。In the case where the trigger body is a touch screen or a sensor, it is determined that the open event is triggered by a user operation.
  3. 根据权利要求1或2所述的方法,其中,冻结执行所述预加载操作的后台进程,包括:The method according to claim 1 or 2, wherein freezing the background process of performing the preloading operation comprises:
    根据预加载完成的应用程序确定作为恢复起点的起始应用程序;Determine the starting application as the recovery starting point based on the preloaded application;
    关联存储所述起始应用程序的标识信息以及所述后台进程的进程标识,并冻结所述后台进程。Correlation stores the identification information of the originating application and the process identifier of the background process, and freezes the background process.
  4. 根据权利要求3所述的方法,其中,解冻所述后台进程,继续执行所述预加载操作,包括:The method of claim 3, wherein the thawing the background process and continuing to perform the preloading operation comprises:
    解冻所述进程标识对应的后台进程;Thawing the background process corresponding to the process identifier;
    以所述起始应用程序作为恢复预加载操作的起点,通过所述后台进程对剩余的待预加载应用程序执行预加载操作。The pre-loading operation is performed on the remaining to-be-preloaded applications by the background process as the starting point of the recovery preloading operation.
  5. 根据权利要求4所述的方法,其中,通过所述后台进程对剩余的待预加载应用程序执行预加载操作,包括:The method of claim 4, wherein performing a preload operation on the remaining applications to be preloaded by the background process comprises:
    通过所述后台进程,基于预先创建的预加载活动窗口堆栈预加载目标应用程序对应的应用界面,其中,所述预加载活动窗口堆栈对应的边界坐标位于显示屏幕的坐标范围之外。And the application interface corresponding to the target application is preloaded based on the pre-created preloaded active window stack, wherein the boundary coordinates corresponding to the preloaded active window stack are outside the coordinate range of the display screen.
  6. 根据权利要求5所述的方法,其中,基于预先创建的预加载活动窗口堆栈预加载目标应用程序对应的应用界面,包括:The method of claim 5, wherein the pre-loading the pre-loaded active window stack preloads the application interface corresponding to the target application, comprising:
    在预先创建的预加载活动窗口堆栈中创建所述目标应用程序对应的任务栈;Creating a task stack corresponding to the target application in a pre-created preloaded active window stack;
    基于所述后台进程在所述任务栈中启动所述目标应用程序对应的活动窗口;And launching, according to the background process, an active window corresponding to the target application in the task stack;
    基于所启动的活动窗口绘制并显示所述目标应用程序对应的应用界面。An application interface corresponding to the target application is drawn and displayed based on the activated activity window.
  7. 根据权利要求6所述的方法,还包括:The method of claim 6 further comprising:
    向所述目标应用程序发送伪造焦点通知,并基于所述伪造焦点通知在预设时间段内保持所述目标应用程序对应的应用界面的持续绘制以及显示更新,其中,所述预设时间段的长度包括所述目标应用程序中启动广告或启动动画的播放时长。Sending a forged focus notification to the target application, and maintaining a continuous rendering and display update of the application interface corresponding to the target application for a preset time period based on the forged focus notification, wherein the preset time period is The length includes the duration of the play in the target application to launch the ad or launch the animation.
  8. 根据权利要求5所述的方法,在基于预先创建的预加载活动窗口堆栈预加载目标应用程序对应的应用界面之后,还包括:The method according to claim 5, after the application interface corresponding to the target application is preloaded based on the pre-created preloaded active window stack, the method further includes:
    在接收到所述目标应用程序的运行指令的情况下,将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的应用界面迁移至所述显示屏幕进行显示。And in the case that the running instruction of the target application is received, the application interface corresponding to the target application included in the preloaded active window stack is migrated to the display screen for display.
  9. 根据权利要求8所述的方法,其中,所述将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的应用界面迁移至所述显示屏幕进行显示,包括:The method of claim 8, wherein the migrating the application interface corresponding to the target application included in the preloaded active window stack to the display screen for display comprises:
    将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的任务栈迁移至应用活动窗口堆栈的顶部;Migrating the task stack corresponding to the target application included in the preloaded active window stack to the top of the application active window stack;
    更新所述任务栈的尺寸信息、配置信息和可见性。Update the size information, configuration information, and visibility of the task stack.
  10. 一种应用程序预加载装置,包括:An application preloading device comprising:
    事件检测模块,设置为在后台对待预加载应用程序执行预加载操作时,获取应用程序的开启事件;An event detection module, configured to acquire an open event of the application when performing a preload operation on the preloaded application in the background;
    进程冻结模块,设置为在所述开启事件由应用通知触发的情况下,冻结执行所述预加载操作的后台进程,并根据所述开启事件开启所述应用程序;a process freeze module, configured to freeze a background process that executes the preloading operation, and start the application according to the open event, in a case that the open event is triggered by an application notification;
    操作获取模块,设置为获取预设时间区间内的用户操作;The operation obtaining module is configured to acquire a user operation in a preset time interval;
    进程解冻模块,设置为在所述用户操作触发所述应用程序的关闭事件的情况下,关闭所述应用程序,并解冻所述后台进程,继续执行所述预加载操作。The process defrosting module is configured to, in the case that the user operation triggers a shutdown event of the application, close the application, and thaw the background process, and continue to perform the preloading operation.
  11. 根据权利要求10所述的装置,其中,所述事件检测模块还设置为:The apparatus of claim 10, wherein the event detection module is further configured to:
    检测应用程序的开启事件;Detecting the open event of the application;
    在检测到所述开启事件的情况下,确定所述开启事件的触发主体;Determining a triggering body of the opening event in the case that the opening event is detected;
    在所述触发主体是应用通知的情况下,确定所述开启事件由应用通知触发;In the case that the triggering body is an application notification, determining that the opening event is triggered by an application notification;
    在所述触发主体是触摸屏或传感器的情况下,确定所述开启事件由用户操作触发。In the case where the trigger body is a touch screen or a sensor, it is determined that the open event is triggered by a user operation.
  12. 根据权利要求10或11所述的装置,其中,所述进程冻结模块还设置为:The apparatus according to claim 10 or 11, wherein the process freeze module is further configured to:
    根据预加载完成的应用程序确定作为恢复起点的起始应用程序;Determine the starting application as the recovery starting point based on the preloaded application;
    关联存储所述起始应用程序的标识信息以及所述后台进程的进程标识,并冻结所述后台进程。Correlation stores the identification information of the originating application and the process identifier of the background process, and freezes the background process.
  13. 根据权利要求12所述的装置,其中,所述进程解冻模块包括:The apparatus of claim 12, wherein the process defrosting module comprises:
    进程解冻子模块,设置为解冻所述进程标识对应的后台进程;The process unfreeze submodule is configured to thaw the background process corresponding to the process identifier;
    预加载子模块,设置为以所述起始应用程序作为恢复预加载操作的起点,通过所述后台进程对剩余的待预加载应用程序执行预加载操作。Preloading the sub-module, set to use the starting application as a starting point for restoring the pre-loading operation, and performing a pre-loading operation on the remaining pre-loaded applications by the background process.
  14. 根据权利要求13所述的装置,其中,所述预加载子模块还设置为:The apparatus of claim 13, wherein the preloading submodule is further configured to:
    通过所述后台进程,基于预先创建的预加载活动窗口堆栈预加载目标应用程序对应的应用界面,其中,所述预加载活动窗口堆栈对应的边界坐标位于显示屏幕的坐标范围之外。And the application interface corresponding to the target application is preloaded based on the pre-created preloaded active window stack, wherein the boundary coordinates corresponding to the preloaded active window stack are outside the coordinate range of the display screen.
  15. 根据权利要求14所述的装置,其中,所述预加载子模块还设置为:The apparatus of claim 14, wherein the preloading submodule is further configured to:
    在预先创建的预加载活动窗口堆栈中创建所述目标应用程序对应的任务栈;Creating a task stack corresponding to the target application in a pre-created preloaded active window stack;
    基于所述后台进程在所述任务栈中启动所述目标应用程序对应的活动窗口;And launching, according to the background process, an active window corresponding to the target application in the task stack;
    基于所启动的活动窗口绘制并显示所述目标应用程序对应的应用界面。An application interface corresponding to the target application is drawn and displayed based on the activated activity window.
  16. 根据权利要求15所述的装置,还包括:The apparatus of claim 15 further comprising:
    界面绘制模块,设置为向所述目标应用程序发送伪造焦点通知,并基于所述伪造焦点通知在预设时间段内保持所述目标应用程序对应的应用界面的持续绘制以及显示更新,其中,所述预设时间段的长度包括所述目标应用程序中启动广告或启动动画的播放时长。An interface drawing module is configured to send a forged focus notification to the target application, and keep the continuous drawing and display update of the application interface corresponding to the target application within a preset time period based on the forged focus notification, where The length of the preset time period includes the playing duration of starting the advertisement or starting the animation in the target application.
  17. 根据权利要求14所述的装置,还包括:The apparatus of claim 14 further comprising:
    界面迁移模块,设置为在接收到所述目标应用程序的运行指令的情况下,将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的应用界面迁移至所述显示屏幕进行显示。The interface migration module is configured to, when receiving the running instruction of the target application, migrate the application interface corresponding to the target application included in the preloaded active window stack to the display screen for display.
  18. 根据权利要求17所述的装置,其中,所述界面迁移模块还设置为:The apparatus of claim 17, wherein the interface migration module is further configured to:
    将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的任务栈迁移至应用活动窗口堆栈的顶部;Migrating the task stack corresponding to the target application included in the preloaded active window stack to the top of the application active window stack;
    更新所述任务栈的尺寸信息、配置信息和可见性。Update the size information, configuration information, and visibility of the task stack.
  19. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至9中任一项所述的应用程序预加载方法。A computer readable storage medium having stored thereon a computer program, the computer program being executed by a processor to implement the application preloading method according to any one of claims 1 to 9.
  20. 一种智能终端,包括存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至9中任一项所述的应用程序预加载方法。An intelligent terminal comprising a memory, a processor, and a computer program stored on the memory and operable by the processor, the processor executing the computer program to implement the application according to any one of claims 1 to 9. Program preload method.
PCT/CN2019/085662 2018-05-15 2019-05-06 Application program pre-loading method and apparatus, and storage medium and intelligent terminal WO2019218885A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810463397.6A CN108595231B (en) 2018-05-15 2018-05-15 Application program preloading method and device, storage medium and intelligent terminal
CN201810463397.6 2018-05-15

Publications (1)

Publication Number Publication Date
WO2019218885A1 true WO2019218885A1 (en) 2019-11-21

Family

ID=63631097

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/085662 WO2019218885A1 (en) 2018-05-15 2019-05-06 Application program pre-loading method and apparatus, and storage medium and intelligent terminal

Country Status (2)

Country Link
CN (1) CN108595231B (en)
WO (1) WO2019218885A1 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595227A (en) 2018-05-10 2018-09-28 Oppo广东移动通信有限公司 Application program preloads method, apparatus, storage medium and mobile terminal
CN108595228B (en) 2018-05-10 2021-03-12 Oppo广东移动通信有限公司 Application program prediction model establishing method and device, storage medium and mobile terminal
CN108595231B (en) * 2018-05-15 2021-06-15 Oppo广东移动通信有限公司 Application program preloading method and device, storage medium and intelligent 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
CN109731336B (en) * 2018-12-27 2022-09-09 三星电子(中国)研发中心 Control method and device for game application
CN109979180B (en) * 2019-03-25 2021-12-10 深圳创维数字技术有限公司 Remote controller key multiplexing method and device, storage medium and remote controller
CN110162161A (en) * 2019-04-17 2019-08-23 努比亚技术有限公司 Control method, wearable device and the computer readable storage medium of target application
CN110471714B (en) * 2019-08-16 2022-07-12 北京字节跳动网络技术有限公司 Method, device, terminal and storage medium for controlling application starting
CN112594937B (en) * 2020-12-16 2022-03-18 珠海格力电器股份有限公司 Control method and device of water heater, electronic equipment and storage medium
CN115016855B (en) * 2021-11-17 2023-05-09 荣耀终端有限公司 Method, apparatus and storage medium for application preloading
CN116661882B (en) * 2022-11-22 2024-04-16 荣耀终端有限公司 Method for preloading applet, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7194582B1 (en) * 2003-05-30 2007-03-20 Mips Technologies, Inc. Microprocessor with improved data stream prefetching
CN105431822A (en) * 2013-06-12 2016-03-23 微软技术许可有限责任公司 Managing a succession of deployments of an application programming interface (api) server configuration in the software lifecycle development
CN105955765A (en) * 2016-04-22 2016-09-21 北京小米移动软件有限公司 Method and device for application preloading
CN106569932A (en) * 2016-10-31 2017-04-19 珠海市魅族科技有限公司 Method and device for starting application
CN107436800A (en) * 2016-05-28 2017-12-05 宇龙计算机通信科技(深圳)有限公司 A kind of application management method and terminal device
CN108595231A (en) * 2018-05-15 2018-09-28 Oppo广东移动通信有限公司 Application program preloads method, apparatus, storage medium and intelligent terminal

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102520946A (en) * 2011-12-09 2012-06-27 山东大学 Method for realizing desktop system based on embedded Linux
WO2013169846A1 (en) * 2012-05-09 2013-11-14 Yknots Industries Llc Device, method, and graphical user interface for displaying additional information in response to a user contact
US10585553B2 (en) * 2012-12-06 2020-03-10 Samsung Electronics Co., Ltd. Display device and method of controlling the same
CN103106000B (en) * 2013-01-23 2015-11-25 东莞宇龙通信科技有限公司 The implementation method of multifocal window and communication terminal
US9959255B2 (en) * 2014-01-31 2018-05-01 Yahoo Holdings, Inc. Dynamic streaming content provided by server and client-side tracking application
US9497148B2 (en) * 2014-09-27 2016-11-15 Intel Corporation Context-based automated/intelligent content management
US10447759B2 (en) * 2016-05-27 2019-10-15 Microsoft Technology Licensing, Llc Web page accelerations for web application hosted in native mobile application
CN106201241A (en) * 2016-06-24 2016-12-07 北京奇虎科技有限公司 The multi-screen display method of terminal screen, device and terminal
CN106126295A (en) * 2016-06-29 2016-11-16 宇龙计算机通信科技(深圳)有限公司 The control method of application program and control device, terminal
CN106250177A (en) * 2016-07-26 2016-12-21 宇龙计算机通信科技(深圳)有限公司 application program freezing method and system
CN106775194B (en) * 2016-11-22 2020-01-14 腾讯科技(深圳)有限公司 Application interface switching method and device
CN107368361B (en) * 2017-06-26 2019-08-20 中广热点云科技有限公司 A kind of application program for mobile terminal switching method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7194582B1 (en) * 2003-05-30 2007-03-20 Mips Technologies, Inc. Microprocessor with improved data stream prefetching
CN105431822A (en) * 2013-06-12 2016-03-23 微软技术许可有限责任公司 Managing a succession of deployments of an application programming interface (api) server configuration in the software lifecycle development
CN105955765A (en) * 2016-04-22 2016-09-21 北京小米移动软件有限公司 Method and device for application preloading
CN107436800A (en) * 2016-05-28 2017-12-05 宇龙计算机通信科技(深圳)有限公司 A kind of application management method and terminal device
CN106569932A (en) * 2016-10-31 2017-04-19 珠海市魅族科技有限公司 Method and device for starting application
CN108595231A (en) * 2018-05-15 2018-09-28 Oppo广东移动通信有限公司 Application program preloads method, apparatus, storage medium and intelligent terminal

Also Published As

Publication number Publication date
CN108595231B (en) 2021-06-15
CN108595231A (en) 2018-09-28

Similar Documents

Publication Publication Date Title
WO2019218885A1 (en) Application program pre-loading method and apparatus, and storage medium and intelligent terminal
CN108762843B (en) Application program preloading method and device, storage medium and intelligent terminal
CN108614722B (en) Application program preloading method and device, storage medium and terminal
US11467855B2 (en) Application preloading method and device, storage medium and terminal
EP3579104B1 (en) Method and apparatus for establishing an application prediction model, storage medium and terminal
CN108647055B (en) Application program preloading method and device, storage medium and terminal
EP3575961B1 (en) Method and apparatus for updating application prediction model, storage medium, and terminal
CN108595230B (en) Application program preloading method and device, storage medium and terminal
US11604660B2 (en) Method for launching application, storage medium, and terminal
CN108958830B (en) Application program starting method and device, storage medium and terminal
CN108762831B (en) Application program preloading method and device, storage medium and terminal
CN108595224B (en) Application program prompting method and device, storage medium and terminal
US11099861B2 (en) Method for preloading application, storage medium, and terminal
CN108776599B (en) Management method and device for preloaded application, storage medium and intelligent terminal
WO2019214477A1 (en) Application program pre-loading method and device, storage medium and terminal
CN108804153B (en) Application program preloading method and device, storage medium and terminal
CN108958828B (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
CN108647057B (en) Screen direction setting method and device, storage medium and terminal
WO2019214475A1 (en) Application preloading method, device, storage medium, and mobile terminal
WO2019228149A1 (en) Collection method and apparatus for prediction sample, and storage medium and smart terminal
CN108845838B (en) Application program preloading method and device, storage medium and terminal

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19802665

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19802665

Country of ref document: EP

Kind code of ref document: A1