WO2019223540A1 - Application program preloading method and apparatus, storage medium, and terminal - Google Patents
Application program preloading method and apparatus, storage medium, and terminal Download PDFInfo
- Publication number
- WO2019223540A1 WO2019223540A1 PCT/CN2019/086132 CN2019086132W WO2019223540A1 WO 2019223540 A1 WO2019223540 A1 WO 2019223540A1 CN 2019086132 W CN2019086132 W CN 2019086132W WO 2019223540 A1 WO2019223540 A1 WO 2019223540A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- application
- preloaded
- preloading
- interface
- abnormality
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
Definitions
- the embodiments of the present application relate to the technical field of application program loading, for example, to a method, a device, a storage medium, and a terminal for preloading an application program.
- terminals such as smart phones, tablet computers, laptops, and smart home appliances have become essential electronic devices in people's daily lives.
- terminal devices With the continuous intelligentization of terminal devices, most terminal devices are loaded with operating systems, enabling terminal devices to install a variety of applications to meet different needs of users.
- the embodiments of the present application provide a method, a device, a storage medium, and a terminal for preloading an application program, which can optimize a preloading solution for the application program.
- an embodiment of the present application provides a method for preloading an application, including: determining that an application to be preloaded is detected when an application preloading event is detected to be triggered; and performing preloading on the application to be preloaded.
- the loading operation is performed, and the pre-loading process is monitored; when an abnormality is detected during the pre-loading process, the abnormality is processed.
- an embodiment of the present application provides an apparatus for preloading an application, including: an application determining module configured to determine an application to be preloaded upon detecting that an application preloading event is triggered; the preloading module, Configured to perform a preload operation on the application to be preloaded; a preload monitoring module configured to monitor a preload process when the preload operation is performed on the application to be preloaded; a preload exception processing module, It is configured to process the abnormality when an abnormality is detected during the preloading process.
- an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored.
- the program is executed by a processor, the method for preloading an application program according to the embodiment of the present application is implemented.
- 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.
- the processor executes the computer program, the implementation is implemented as in the embodiment of the present application The application preloading method.
- FIG. 1 is a schematic 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 position 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 provided by an embodiment of the present application.
- FIG. 5 is a schematic flowchart of another application preloading method according to an embodiment of the present application.
- FIG. 6 is a schematic flowchart of another application preloading method according to an embodiment of the present application.
- FIG. 7 is a structural block diagram of an application preloading device according to an embodiment of the present application.
- FIG. 8 is a schematic structural diagram of a terminal according to an embodiment of the present application.
- FIG. 9 is a schematic structural diagram of still another terminal provided by an embodiment of the present application.
- FIG. 1 is a schematic flowchart of an application preloading method according to an embodiment of the present application.
- the method may be executed by an application preloading device, where the device may be implemented by software and / or hardware, and may generally be integrated in a terminal. As shown in FIG. 1, the method includes steps 101 to 103.
- step 101 when it is detected that an application preload event is triggered, an application program to be preloaded is determined.
- the terminal in the embodiments of the present application may include terminal devices such as a mobile phone, a tablet computer, a notebook computer, and smart home appliances.
- the terminal is loaded with an operating system.
- the triggering condition of the application preload event can be set according to the actual situation, which is not specifically limited in the embodiment of the present application.
- an application preload event can be triggered when it is detected that a user's action meets a preset condition (such as picking up a terminal, entering a screen to unlock an operation, or inputting a terminal to unlock an operation, etc.); or when a change to a foreground application is detected, Trigger an application preload event; or you can trigger an application preload event immediately (or after a preset time period has elapsed) after the prediction process of the preloaded application ends; or you can trigger at regular intervals.
- the system can detect that the application preload event has been triggered by reading a flag bit or receiving a trigger instruction, and the specific detection method is not limited in this embodiment of the present application.
- the application to be preloaded can be understood as an application that the user may open soon, it can be a fixed application that is set in advance, or an application that is predicted in a certain manner.
- the applications to be preloaded may include one or more.
- a prediction model may be used to make predictions on the application to be preloaded.
- the prediction model can be a machine learning model, and the algorithms used can include Recurrent Neural Networks (RNN), Long Short-Term Memory (LSTM) networks, threshold recurrent units, simple recurrent units, automatic encoding , Decision tree, random forest, feature mean classification, classification regression tree, hidden Markov, K-NearestNeighbor (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-NearestNeighbor
- logistic regression model Bayesian model
- Gaussian model Gaussian model
- KL divergence Kullback – Leibler divergence
- training samples can be collected, the preset initial model can be trained by using the training samples, and finally a prediction model for predicting the application to be preloaded can be obtained.
- the elements included in the training sample may include a time series or sequence sequence in which the application is opened; may include the time, place, and frequency of the application being opened; and may include a running state of the terminal, such as a switch of a mobile data network Status, the connection status of the wireless hotspot, the identity information of the connected wireless hotspot, the currently running application, the previous foreground application, the length of time the current application stays in the background, the time when the current application was last switched to the background,
- the plugging and unplugging status, charging status, battery power information, and screen display duration of the headphone jack can also include data collected by sensors integrated in the terminal, such as motion sensors, light sensors, temperature sensors, and humidity sensors.
- an appropriate sample element can be selected according to the selected machine learning model, and the selected machine learning model can be determined according to the selected sample element. It can also be combined with the requirements of prediction accuracy and preset speed.
- the selection of models and sample elements is not limited in the embodiments of the present application.
- determining the application to be preloaded may include determining the application to be preloaded according to the output result before the prediction model, or may include performing prediction using the prediction model to determine the current output result of the prediction model to determine the application to be preloaded.
- the prediction model may output the startup probability of each candidate application set in the candidate application set, and determine the candidate application with a higher startup probability as the standby application. Preload the application.
- the determining an application to be preloaded includes: predicting a startup probability of a candidate application; and determining a preset number of candidate applications with a high startup probability as the application to be preloaded.
- the candidate applications may include all applications installed in the terminal, and may also include some applications. Some applications may not include system applications or applications that are rarely used by users. This embodiment of the present application does not limit the manner and quantity of candidate application programs.
- the candidate applications can be determined according to the number of times and / or the duration of use of each application within a preset period before the current time.
- the preset period is, for example, one month.
- the corresponding application is determined as a candidate application, or each application is sorted according to the number of times and / or the duration of use, and the top-ranked application is determined as a candidate application.
- the prediction model described above may be used to determine the startup probability of each candidate application. For example, according to the training samples during prediction model training, current samples are collected, and the current samples are input into the prediction model to obtain the startup probability of each candidate application.
- the startup probability can be sorted from high to low, and the candidate N applications (N is a preset value) are determined as the applications to be loaded. This setting can preload multiple applications, and these multiple applications are determined according to the startup probability, which can improve the accuracy of the prediction.
- step 102 a preloading operation is performed on the application program to be preloaded, and a preloading process is monitored.
- the multiple applications to be preloaded may be determined one by one as the current one. Applications to be preloaded and preloaded in sequence. You can also determine more than 2 applications to be preloaded as the current to be preloaded and perform preloading operations at the same time, which means that multiple applications are preloaded.
- the loading process can be performed in parallel.
- the specific process of preloading and the resources loaded are not limited.
- corresponding hardware resources may be allocated to the application to be preloaded, and related data required for startup may be loaded based on the allocated hardware resources.
- it may include application process startup, application process initialization, application service startup, memory allocation, file content reading, network data acquisition, and interface rendering (such as drawing a startup screen of an application or other application interfaces) and the like.
- pre-loaded resources can also be determined according to the specific type of application to be pre-loaded.
- the embodiment of the present application monitors the preloading process, so that during the preloading phase of the application, that is, before the application is actually started, the loading abnormality of the application startup resource is found in time.
- the specific monitoring content can be determined according to the actual situation. Exemplarily, a situation that is prone to occur when the application is started and / or a cause of the situation may be determined through research and other methods, and the corresponding preloaded content is further determined and detected in real time. For example, some applications may crash when they are launched (for example, they appear to crash after a short period of time after the application starts). You can detect whether the application to be preloaded will crash during the preloading phase; and For example, when some applications are launched, page loading errors may occur. You can also check whether the page is successfully loaded during the preloading phase.
- step 103 if an abnormality is detected during the preloading process, the abnormality is processed.
- targeted processing when an abnormality is detected during the preloading process, targeted processing may be performed according to the type or severity of the abnormality that occurs.
- the cause of the abnormal situation may be analyzed, and repair processing shall be performed for the cause, and the preload operation of the current to-be-preloaded application program may be continued or re-exemplified; and as an example, the cause of the abnormal situation may not be analyzed.
- the cause of the abnormal situation cannot be analyzed, reload the current application to be preloaded. In the above manner, the probability that the pre-loaded application program starts abnormally when it is actually started can be effectively reduced.
- an application preloading event when it is detected that an application preloading event is triggered, an application to be preloaded is determined, a preloading operation is performed on the preloaded application, and a preloading process is monitored.
- the abnormality is processed.
- the target application when a run instruction of a target application in the application to be preloaded is received, the target application is started based on a preloaded resource of the target application. In this way, when the user actually launches an application that has been preloaded, the resources used for startup have been partially or fully preloaded, and anomaly detection has been performed during the preloading process, which can improve the speed of application startup. To increase the probability of the application launching normally.
- performing the preloading operation on the application to be preloaded includes: simulating starting the application to be preloaded outside a coordinate range of a display screen.
- a virtual screen area may be set outside the coordinate range of the display screen.
- the current to-be-loaded application is opened in the virtual screen area based on the preloaded startup resource, and The virtual screen area displays the application interface of the current application to be preloaded, so as to realize the simulation start of the current application to be preloaded.
- processing the abnormality includes processing the abnormality when an abnormality is detected during the simulation startup process.
- This setting can simulate the startup process of the application to be preloaded outside the coordinate range of the display screen. This process is invisible to the user, will not interfere with the user's use, and can be timely and accurate during the simulation startup process. To find anomalies.
- processing the abnormality includes: determining a crash cause when an application crash occurs during the simulation startup process; according to The crash cause is repaired, and the application to be preloaded is simulated and started again. This setting reduces the probability that a pre-loaded, pre-loaded application will crash when it actually starts.
- the user may encounter a crash when the application starts or is running.
- the specific performance may be that the application crashes, that is, closes quickly.
- the application cannot be processed when it is started or running. The behavior of exiting the application from time to time due to an exception or error, the user can only restart the application.
- SDK Software Development Kit
- the cause of the crash includes insufficient storage space.
- the performing repair processing according to the cause of the crash includes: clearing cache data and / or closing a preset type of application running in the background.
- the cache data in the terminal has not been cleaned for a long time and a large number of cache garbage files are accumulated, the cache data will occupy more system storage space, which will not only affect the smooth running of the system, but also cause the application to crash.
- the cache data When there are many applications running in the background in the terminal, it will also take up more system memory, which will also easily cause the application to crash.
- the cache data can be cleared, or the preset type of application running in the background can be closed, or cleaned up at the same time Cache data and close preset types of applications running in the background.
- the preset type of application can be set by the system by default or set by the user.
- a preset application list may be maintained in the terminal, and the applications in the preset application list may be considered as preset types of applications, and the applications in the preset application list may generally be used infrequently by the user or not.
- a level may be set for the cached data, and the cached data of the corresponding level is selected for cleaning according to the severity of the application crash situation during the simulated startup process.
- the cache data may be set to include a first-level cache, a second-level cache, and a third-level cache.
- the third-level cache includes cached data in a local database
- the second-level cache includes cached data in a temporary directory.
- the first level of cache includes cached data in the Document directory.
- the simulating startup of the current to-be-loaded application program outside the coordinate range of the display screen includes: based on a pre-created pre-loaded active window stack, corresponding to the to-be-loaded application program.
- the application interface performs drawing and display, wherein the boundary coordinates corresponding to the preloaded active window stack are outside the coordinate range of the display screen.
- This setting can draw and display the application interface, simulate the process of the application from startup to display the application interface, and at the same time perform the simulation startup more comprehensively, it can also complete the preparation work before the application startup to a greater extent, and improve the waiting time.
- the startup speed of the loaded application does not affect the display of the display content of the foreground application on the display screen.
- the active window may be understood as an independent interface that directly provides users with interaction and operation, and different terms may be used to name the interface in different operating systems.
- the following description is made by taking an Android operating system as an example.
- Activity is a component responsible for interacting with the user. It provides a screen (which can be understood as a screen interface instead of a physical display screen) for the user to interactively complete a certain task.
- an Activity is usually a separate screen, which can display some controls or listen to and handle user events.
- Task task stack
- Stack active window stack
- a Task corresponds to an application.
- a Task is used to store Activities.
- a Task can store one or more Activities, and these Activities follow the "first in, first out, last in, first out" principle.
- Stack is also used to manage Tasks. Generally, a Stack manages the Tasks that each Activity needs to display on a screen.
- a Stack can manage one or more Tasks.
- Stack also follows the basic management principles of the Stack.
- the screens described here are not necessarily complete and independent display screens. Taking “two screens” as an example, these two screens may be just two areas in a complete display screen that independently display their respective display contents. Of course, if the terminal has two or more independent display screens, the "two screens" may also be two independent display screens.
- multi-window mode is supported, which can include split-screen mode, picture-in-picture mode, and FreeForm.
- the stack where the application is located can have its own size, which can include the upper, lower, left, and right coordinates in a coordinate system with the upper left corner of the terminal screen as the origin.
- (a, b, c, d) generally describes a rectangular boundary, which can be expressed by the coordinates of the upper left corner and the lower right corner of the rectangle, that is, the upper left corner of the rectangle is (a, b), right The lower corner coordinate is (c, d), and such a rectangular area corresponds to the size of the Stack.
- the layout of the application 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 boundary of the size.
- pre-loading the application interface of the target application program outside the display screen can be implemented based on the multi-window mechanism of the operating system, and the size corresponding to the application program is set outside the display screen through the multi-window mechanism to the user. It is not visible, so it will not affect the display content of the foreground application on the display screen.
- Home Stack represents the stack displayed by desktop applications
- App Stack represents the stack displayed by third-party applications
- the contained content can be displayed on a display screen, which is collectively referred to as an application active window stack in the embodiments of the present application.
- a preloaded active window stack is added to indicate 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 that Stack.
- a new Stack dedicated to displaying preloaded applications can be created.
- a new stack is created because the newly created preloaded stack can have its own size and visibility, thereby achieving preloading and simulation startup outside the display screen.
- the creation timing of the preloaded stack is not limited.
- the preloaded stack can be set to the resident state by default before the terminal leaves the factory, that is, the preloaded stack always exists; or the terminal can be successfully unlocked when the terminal is powered on Create later; you can also create after the application preload event is triggered (before you determine the application to be preloaded) and so on.
- the drawing and displaying the application interface corresponding to the application to be preloaded based on the pre-created preloaded active window stack includes: determining whether a pre-created preloaded active window stack exists; if If it does not exist, a preloaded active window stack is created according to a preset rule; and the application interface corresponding to the application to be preloaded is drawn and displayed based on the preloaded active window stack created.
- This setting can determine whether the pre-loaded stack exists after determining the application to be pre-loaded. If it exists, you do not need to create a new stack. If it does not exist, create it, which can save system resources.
- the preloading stack has been created before the first application to be preloaded starts to load. After that, the pre-loading stack exists before the second application to be pre-loaded starts to be loaded, and the above judgment may not be necessary.
- the drawing and displaying an application interface corresponding to the application to be preloaded based on a pre-created preloading active window stack includes: creating a target process corresponding to the application to be preloaded; Creating a task stack corresponding to the application to be preloaded in a pre-created preloading active window stack; starting an active window corresponding to the application to be preloaded in the task stack based on the target process; based on the launched
- the active window draws and displays an application interface corresponding to the application to be preloaded.
- the application interface may include a startup interface of an application program and / or a startup animation (such as a startup advertisement).
- the initialization process of the target process can also be included.
- pre-loading of other resources may also be involved, such as application service startup, memory allocation, file content reading, and network data acquisition.
- the embodiments of this application do not limit the pre-loading process of other resources. Can be determined by the characteristics of the application to be preloaded.
- the above steps describe the preloading process of the application to be preloaded, and during the execution of the above preloading-related steps, the simulated startup of the application to be preloaded is also implemented.
- the method further includes: sending a fake focus notification to the application to be preloaded, and maintaining a continuous drawing of an application interface corresponding to the application to be preloaded for a preset period of time based on the fake focus notification. And display updates.
- This setting can complete the drawing and display of the application interface when the application to be preloaded has the focus and is visible to the system, improving the completion of the preloading without affecting the focus of the foreground application.
- the focus in the embodiments of the present application is also referred to as input focus, and the fake focus and the focus corresponding to the foreground application are independent of each other.
- the focus is unique. For example, input operations such as touch only take effect on the focus.
- the system and the application are consistent. Once the system changes the input focus information, it will Send information to the application that the input focus information has changed, this way to ensure that the system and application side input focus information is consistent.
- the application side can forge the focus by separating the system side and the application side from inputting focus information.
- the focus notification for the preloaded application is forged, so that the preloaded application has focus information, and the focus information on the system side is still correct.
- the application to be preloaded can keep the interface updated for a certain period of time after the simulation startup time, which is convenient to accurately locate the abnormal situation.
- the focus exists on the system side and the application side. It can be considered as the server and the client.
- the system side records the application that has the focus, and the application side saves a flag to indicate whether it has focus.
- the timing of falsifying the input focus may be that when the Android window system adds a new window and the focus needs to be updated, a fake focus notification is generated and sent.
- the method of falsifying 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 focus.
- a fake focus notification can be sent based on the Binder mechanism.
- the Binder mechanism is the most commonly used method for inter-process communication of the Android system, and adopts a c / s architecture, that is, a client / service architecture.
- the preset time period may be designed according to actual conditions, for example, it may be within a fixed time range after starting preloading, or it may be a period from starting preloading to completing preloading.
- the length of the preset time period includes a playing time of starting an advertisement or starting an animation in the target application.
- some advertisements or animations are usually played.
- the duration of advertisements or animations usually ranges from 3 seconds to more than ten seconds.
- the user may not be able to perform any operation, only Can wait for the playback to finish, wasting valuable time of the user.
- This embodiment of the present application is set up so that the startup advertisement or startup animation can be played off the screen before the application to be preloaded is launched.
- the application to be preloaded When the application to be preloaded is launched, it can directly enter the main page of the application or other user-operable Interface to further advance the operable time point of the application to be preloaded and reduce waiting time.
- application crashes or other abnormalities may also occur, and the preloading process can be more fully monitored.
- the method further includes: upon receiving the When the target application runs, the application interface corresponding to the target application included in the preloaded active window stack is migrated to the display screen for display.
- This setting can directly migrate the already drawn application interface to the display screen for display when the target application really needs to be started, which can achieve fast switching of the application interface and improve startup speed.
- the migrating an application interface corresponding to the target application included in the preloaded active window stack to the display screen for display includes: The task stack corresponding to the target application is migrated to the top of the application active window stack; the size information, configuration information, and visibility of the task stack are updated to implement the application interface corresponding to the target application on the display screen display.
- This setting can ensure the stability of the interface migration process, and ensure that there are no screens, black screens, or slow migration speeds during the recovery process.
- the display mode of the display screen usually includes vertical screen display and horizontal screen display.
- Many applications use vertical screen display by default, and some The application program is displayed in a horizontal screen mode (such as some online games) by default.
- some applications may switch between the horizontal and vertical screen display as the user holds the terminal.
- a boundary coordinate corresponding to the preloaded active window stack is (H, 0, 2H, H)
- a coordinate system corresponding to the boundary coordinate is a system coordinate
- an origin of the system coordinate is 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.
- the display screen is in the vertical screen mode
- the origin of the terminal system coordinates is the left vertex (0,0) of the display screen 201
- the width direction of the display screen 201 is the X axis
- the height direction is the Y axis.
- FIG. 3 is a schematic diagram of a relative position relationship between another preloaded active window stack and a display screen display area according to an embodiment of the present application.
- the display screen is in landscape mode
- the origin of the terminal system coordinates is the left vertex (0,0) of the display screen 301
- the height direction of the display screen 301 is the X axis
- the width direction is the Y axis.
- the boundary coordinates corresponding to loading Stack202 are (H, 0, 2H, H), where H is the screen height, that is, the area within the solid rectangle on the left is the main screen display area, and the area within the rectangle on the right dashed line is the preload display area.
- the horizontal axis of the upper left corner is H, which is to prevent the display screen (also called the home screen) from being displayed on the pre-loaded application interface when the screen is horizontal, because the home screen has a horizontal screen mode in addition to the vertical screen mode.
- the horizontal coordinate of the upper left corner of the rectangular area corresponding to the preloaded stack is set to the screen height.
- the vertical coordinate of the upper left corner is 0, so that the preloaded application can correctly calculate the height of the status bar.
- the Android application will customize the top status bar. If the corresponding vertical coordinate is not equal to 0, the height of the status bar may be wrong.
- the applicant set the size of the preloaded stack to (H, 0, 2H, H).
- FIG. 4 is a schematic diagram of an application interface migration provided by an embodiment of the present application.
- an application corresponding to the target application included in the active window stack 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 activity window Stack, and the size information, configuration information, and visibility of the task are updated to thereby apply the interface. Able to display normally on the display screen.
- processing the abnormality includes: detecting that the application to be preloaded is detected based on a pre-created preloaded active window stack.
- the display exception may include at least one of a loading failure on the interface, a failure to obtain network data, a missing element, and a script error.
- the startup interface or startup animation when an application starts usually contains data that is dynamically updated on the network side, and the interface needs to be loaded and displayed according to the data obtained from the network side.
- a monitoring file may be built in the terminal, and loading information of each application interface of the installed application program in the mobile terminal may be determined in advance, and the monitoring file may be written into the monitoring file.
- the interface displays whether an abnormality occurs for real-time detection. Exemplarily, it can also cooperate with a monitoring platform to implement detection of interface anomalies. For example, during the process of drawing and displaying the application interface, a monitoring request is sent to the monitoring platform, and the monitoring request is used to instruct the monitoring platform to detect the loading component of the pre-loaded application program, and feedback the element detection information to the terminal.
- the element detection information may include a schema (schema) and a document object model (dom) monitoring element.
- the monitoring platform can store the element detection information of the components to be preloaded by the application to be preloaded. For the loaded components contained in the application to be preloaded, deploy the corresponding monitoring points and the schema for monitoring. Language path) to obtain the corresponding dom monitoring element, and store the schema and dom monitoring elements as element detection information.
- the terminal can activate the pre-injected monitoring file in the preset application, and use the monitoring file and the received element detection information to perform anomaly detection on the page loading process.
- the abnormality detection may include interface loading failure detection, network data acquisition failure detection, element missing detection, and script (such as javascript) error detection.
- redrawing and displaying the current application interface can increase the probability that the application interface is normally displayed, so that when the pre-loaded application program is actually started, the application interface Can display normally.
- the method before the drawing and displaying the application interface corresponding to the application to be preloaded based on the pre-created preloading active window stack, the method further includes predicting that the application to be preloaded contains The target interface, wherein the target interface includes an interface that is predicted to be opened by a user according to a historical running rule of the application to be preloaded.
- the drawing and displaying the application interface corresponding to the to-be-loaded application program based on the pre-created pre-loading active window stack includes: corresponding to the to-be-loaded application program based on the pre-created pre-loading active window stack.
- the target interface is drawn and displayed. This setting can predict the interface that the user is about to open, and preload the interface.
- the interface opening speed is further increased.
- the display of the target interface is abnormal during the simulation startup phase.
- the target interface can be redrawn and displayed to reduce the probability of the display abnormality when the user actually opens the target interface.
- the number of target interfaces is not limited, and may include one or more.
- users In the process of using the application, users usually have their own habits and operate the application according to their own habits, so that the application will show certain operating rules under the user's operation, such as opening each interface Sequence or frequency, the length of time spent on each interface, etc., can collect data related to the above operating rules (such as the log information corresponding to the application program), statistics or analyze the historical operating rules of the application program, when you need to predict the target interface, according to the The historical running rule corresponding to the application predicts the interface that will be opened by the user.
- the target interface can be predicted based on the current usage scenario. After pre-loading the target interface, if the user chooses to launch an application that has been pre-loaded, the application will be launched based on the pre-loaded startup resources.
- predicting the target interface included in the application to be preloaded may include: according to the order in which each interface included is opened, the frequency of opening, or the stay during the running process of the application to be preloaded in the historical sampling period. Duration, predicts the target interface contained in the application to be preloaded.
- the historical sampling period may include a time period obtained after tracing a preset duration from the current moment forward. For example, 30 days forward from today, the length of the historical sampling period is 1 month; and another 24 hours forward from 9 am, the length of the historical sampling period is 1 day.
- the historical sampling period can also be a fixed period, for example, from the 1st of each month to the end of the current month, or from 0 to 24 o'clock every day.
- each interface may include multiple interfaces. Take WeChat as an example, including chat list interface, chat interface, address book interface, circle of friends interface, scan interface, shake Shake interface and wallet interface.
- the terminal can record the running rule of the application program under the user's operation.
- the order in which each interface is opened may include the first interface, the second interface that is opened under the user's operation after the application is started, ...
- the Nth interface which forms a sequence of opening sequences, among which the first interface It is not the startup interface that is opened by default when the application starts, but an interface that requires the user to actively open it. The same interface can be ignored after being opened for the first time, that is, it is not included in the opening sequence.
- the frequency with which an interface is opened may include the total number of times that the interface was opened during the historical sampling period, or the number of times that the interface was opened within a unit time period (for example, 5 minutes) during the historical sampling period.
- the dwell time of an interface may include the length of time that the interface is continuously displayed on the display screen. During the display, the user can view the content of the interface or slide the interface.
- predicting the target interface included in the application to be preloaded may also include: obtaining current usage scenario information, and predicting the target interface included in the application to be preloaded according to the current usage scenario information.
- the use scene information may include, for example, the location of the terminal, the operating status of the terminal (such as the on / off status of the mobile data network, the connection status of the wireless hotspot, the identity information of the connected wireless hotspot, and the plugging state of the headset jack , Charging status, battery power information, and screen display time, etc.), data collected by sensors integrated in the terminal (such as motion sensors, light sensors, temperature sensors, and humidity sensors) and so on. This setting can predict the target interface more accurately.
- the method before detecting that the application preloading event is triggered, before determining the application to be preloaded, the method further includes: during the application running process, when an interface switch occurs, collecting and using scene information as training For the sample, the switched interface is recorded as a sample mark corresponding to the training sample, and a preset machine learning model is trained according to the training sample and the corresponding sample mark to obtain an interface prediction model.
- the predicting a target interface included in the application to be preloaded according to the current usage scenario information includes inputting the current usage scenario information into the interface prediction model, and determining based on an output result of the interface prediction model. Target interface.
- the machine learning model can be trained using the collected training samples.
- the target interface prediction is required, the prediction is performed based on the output of the prediction model. The prediction speed is fast and the result accuracy is high.
- the target interface can also be comprehensively determined in combination with the order in which each interface included is opened, the frequency or duration of stay, and the current usage scenario information during the running of the application to be preloaded in the historical sampling period. To further improve prediction accuracy.
- the order in which each interface is opened, the frequency of opening, or the length of stay can be used as part of the training sample and added to the above training sample containing the use scene information to train the preset machine learning model to obtain the interface prediction model. To make the output of the model more accurate.
- the display abnormality of the target interface may also include at least one of interface loading failure, network data acquisition failure, missing element, and script error. Related descriptions can refer to the corresponding content in the previous article, and will not be repeated here.
- simultaneous monitoring may be performed for application crashes and abnormal interface display.
- simulating startup of the application to be preloaded outside the coordinate range of the display screen includes drawing and displaying an application interface corresponding to the application to be preloaded based on a pre-created preloaded active window stack. .
- processing the abnormality includes: when an application program crash is detected during the simulation startup process, determining the cause of the crash, and repairing according to the crash cause Processing, and re-simulating startup of the application to be preloaded; in the process of drawing and displaying the application interface corresponding to the application to be preloaded based on the pre-created preloaded active window stack, the current When the application interface is abnormal, the current application interface is redrawn and displayed. This setting can more comprehensively perform anomaly detection on the preloading process.
- FIG. 5 is a schematic flowchart of another application preloading method according to an embodiment of the present application. The method includes steps 501 to 506.
- step 501 when it is detected that an application preload event is triggered, an application program to be preloaded is determined.
- step 502 the application to be preloaded is simulated and started outside the coordinate range of the display screen.
- step 503 the simulation startup process is monitored to determine whether an application crash occurs. Based on the judgment result of the application crash, step 504 is performed; based on the judgment result of no application crash, the step 506 is performed.
- step 504 the cause of the crash is determined, and repair processing is performed according to the cause of the crash.
- the cause of the crash is insufficient storage space, you can clear the cache data and close the preset type of application running in the background; if the cause of the crash is an application version compatibility issue, you can perform an automatic version upgrade of the application or prompt the user whether to proceed Version upgrade; if the cause of the crash is related to the current network condition or memory card, the user can be prompted to check the network status or memory card status.
- step 505 the application to be preloaded is simulated and started outside the coordinate range of the display screen again.
- step 506 when a run instruction of the target application in the application to be preloaded is received, the target application is started based on the preloaded resources of the target application.
- the application preloading method provided in the embodiment of the present application after determining the application to be preloaded, performs preloading in the manner of an off-screen simulation startup, and performs anomaly detection during the preloading process. If an application crash is detected, Situation, take repair measures according to the analysis of the cause of the crash, and re-preload to ensure the correctness of the preload.
- the resources used for startup have been partially or completely Pre-loading, and anomaly detection during the pre-loading process, can improve the startup speed of the application, while increasing the probability of the application starting normally.
- FIG. 6 is a schematic flowchart of another application preloading method according to an embodiment of the present application. As shown in FIG. 6, the method includes steps 601 to 607.
- step 601 when a change in the foreground application is detected, a preset application prediction model is used to predict the startup probability of the candidate application.
- the triggering condition of the application preload event may be detecting a change in the foreground application program.
- step 602 a predetermined number of candidate application programs with a higher startup probability are determined as the application programs to be preloaded.
- step 603 for the current application to be preloaded, the target interface is predicted, a corresponding target process is created, a corresponding task stack is created in the preloaded active window stack, and a corresponding active window is started in the task stack based on the target process.
- step 604 a target interface is drawn and displayed based on the activated active window.
- step 605 it is determined whether the display of the target interface is abnormal, and based on the determination result of the display of the target interface, step 606 is performed; based on the determination of the display of the target interface, the display is abnormal, step 607 is performed.
- step 606 the target interface is drawn and displayed again based on the activated active window.
- the display exception may include at least one of a loading failure on the interface, a failure to obtain network data, a missing element, and a script error.
- the above display abnormalities may no longer appear, because during the interface drawing process, the above abnormalities may be affected by various factors such as the network. When redrawing, it may cause the previous The cause of the secondary anomaly has disappeared.
- the target interface is drawn and displayed again, further detection may be performed. If the display abnormality still occurs, the third drawing and display may be performed.
- the application does not limit the number of detections and the number of repeated drawing and display. Set freely according to the actual situation.
- step 607 when receiving a running instruction of the target application in the application to be preloaded, the target interface corresponding to the target application included in the preloaded active window stack is migrated to a display screen for display.
- multiple predicted applications to be preloaded may be preloaded in order from high to low in startup probability.
- an application preloading and monitoring process is used as an example for description.
- the preset value is four.
- the predicted applications to be preloaded include WeChat, Today's Headline, Alipay and Baidu Maps.
- the first pre-loaded application was WeChat, followed by Today's Headline, Alipay, and Baidu Map.
- the current application to be preloaded in step 603 is WeChat
- the target interface corresponding to WeChat is the circle of friends interface.
- step 605 it is determined whether the circle of friends interface displays abnormality. If it appears, redraw and display it. , You can use today ’s headline as the new current application to be preloaded, repeat step 603, and so on, and then preload Alipay and Baidu maps.
- step 607 if the user clicks the application icon of Alipay, the terminal will receive the Alipay operation instruction.
- the pre-loaded Alipay target interface (such as Ant Forest) can be removed from the pre-loaded active window.
- the stack is migrated to the display screen for display.
- Alipay When Alipay is quickly launched, it also directly opens the predicted user's upcoming interface, which saves the user from opening the target interface. In addition, it can also ensure the success rate of the target interface's normal display.
- the application preloading method uses a prediction model to predict an application to be preloaded to be started when a foreground application changes, and predicts a target interface to be opened by a user in the application to be preloaded.
- the target interface is drawn and displayed in advance based on the off-screen preloaded Stack, and display anomalies are detected in real time.
- the target interface is redrawn and displayed, and the user is preloaded when the user actually starts
- it can improve the startup speed of the application and directly enter the target interface, and also ensure the success rate of the target interface's normal display.
- FIG. 7 is a structural block diagram of an application preloading device according to an embodiment of the present application.
- the device may be implemented by software and / or hardware, and is generally integrated in a terminal.
- the application preloading method may be performed to perform application preloading. load.
- the device includes an application determining module 701, a preloading module 702, a preloading monitoring module 703, and a preloading exception processing module 704.
- the application determining module 701 is configured to determine an application to be preloaded when it is detected that an application preloading event is triggered.
- the preloading module 702 is configured to perform a preloading operation on the application to be preloaded.
- the preload monitoring module 703 is configured to monitor a preload process when a preload operation is performed on the application to be preloaded.
- the preloading exception processing module 704 is configured to process the abnormality when an abnormality is detected during the preloading process.
- the application preloading device determines that an application to be preloaded is detected when an application preloading event is triggered, performs a preloading operation on the preloaded application, and monitors the preloading process When an abnormality is detected during the preloading process, the abnormality is processed.
- anomaly detection can be performed in the preloading phase of the application, and processing can be performed when an abnormality is detected, thereby improving the preloading function.
- the preloading module is configured to: simulate the startup of the application to be preloaded outside the coordinate range of the display screen; and the preloading exception processing module is configured to: upon detecting the simulation startup When an abnormality occurs during the process, the abnormality is processed.
- the preloading exception processing module is configured to: determine the cause of the crash when an application crash is detected during the simulation startup process; perform repair processing according to the crash cause, and re-process the Wait for the pre-loaded application to simulate startup.
- the cause of the crash includes insufficient storage space; the preloading exception processing module is configured to: clear cache data and / or close a preset type of application running in the background.
- the pre-loading module is configured to draw and display an application interface corresponding to the application to be pre-loaded based on a pre-created pre-loading active window stack, wherein the pre-loading active window stack The corresponding boundary coordinates are outside the coordinate range of the display screen.
- the preloading exception processing module is configured to: during the process of drawing and displaying the application interface corresponding to the application to be preloaded based on the detection of a preloaded active window stack created in advance, the current When the application interface is abnormal, the current application interface is redrawn and displayed.
- the device further includes: an interface prediction module configured to predict an application interface before drawing and displaying an application interface corresponding to the application to be preloaded based on a pre-created preloaded active window stack.
- the target interface included in the application to be preloaded is described, wherein the target interface includes an interface that is predicted to be opened by the user according to the historical running rule of the application to be preloaded; the preloading module is configured to: A pre-created pre-loaded active window stack is used to draw and display a target interface corresponding to the application to be pre-loaded.
- An embodiment of the present application further provides a storage medium containing computer-executable instructions.
- the method is configured to perform an application preloading method.
- the method includes: detecting an application preloading event. When triggered, determine the application to be preloaded; perform a preload operation on the application to be preloaded, and monitor the preload process; and when an abnormality is detected during the preload process, target the Handle the exception.
- Storage medium any of various types of memory devices or storage devices.
- the term "storage medium” is intended to include: installation media, such as Compact Read-Only Memory (CD-ROM), floppy disks, or magnetic tape devices; computer system memory or random access memory, such as dynamic random access memory ( Dynamic Random Access Memory (DRAM), Double Data Rate Random Access Memory (DDRRAM), Static Random Access Memory (SRAM), Extended Data Output Random Access (Extended Data Output Output) Random Access Memory (EDORAM), 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.
- the storage medium may further 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 connected to the first computer system through a network such as the Internet.
- the second computer system may provide program instructions to the first computer for execution.
- the term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems connected through a network.
- the storage medium may store program instructions (for example, embodied as a computer program) executable by one or more processors.
- a storage medium including computer-executable instructions provided in the embodiments of the present application is not limited to the application preloading operation described above, and may also execute the application provided by any embodiment of the present application Related operations in the preload method.
- FIG. 8 is a schematic structural diagram of a terminal according to an embodiment of the present application.
- the terminal 800 may include: a memory 801, a processor 802, and a computer program stored on the memory 801 and executable by the processor 802. When the processor 802 executes the computer program, the application program according to the embodiment of the present application is implemented. Preload method.
- the terminal provided in the embodiment of the present application can perform anomaly detection during the preloading phase of the application program, and perform processing when an abnormality is detected, thereby improving the preloading function.
- FIG. 9 is a schematic structural diagram of another terminal according to an embodiment of the present application.
- the terminal may include: a housing (not shown in the figure), a memory 901, a central processing unit (CPU) 902 (also referred to as processing). (Hereinafter referred to as CPU), a circuit board (not shown in the figure) and a power supply circuit (not shown in the figure).
- CPU central processing unit
- FIG. 9 is a schematic structural diagram of another terminal according to an embodiment of the present application.
- the terminal may include: a housing (not shown in the figure), a memory 901, a central processing unit (CPU) 902 (also referred to as processing). (Hereinafter referred to as CPU), a circuit board (not shown in the figure) and a power supply circuit (not shown in the figure).
- CPU central processing unit
- the circuit board is disposed in a space surrounded by the housing; the CPU 902 and the memory 901 are disposed on the circuit board; and the power supply circuit is configured to supply power to various circuits or devices of the terminal;
- the memory 901 is configured to store executable program code; the CPU 902 runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory 901 to implement the following steps: When an application preload event is detected, determine the application to be preloaded; perform a preload operation on the application to be preloaded, and monitor the preload process; if an abnormality is detected during the preload process, In this case, the abnormality is processed.
- the terminal further includes: a peripheral interface 903, a radio frequency (RF) circuit 905, an audio circuit 906, a speaker 911, a power management chip 908, an input / output (I / O) subsystem 909, and other
- RF radio frequency
- the input / control device 910, the touch screen 912, other input / control devices 910, and the external port 904, these components communicate through one or more communication buses or signal lines 907.
- the illustrated terminal 900 is only an example of the terminal, and the terminal 900 may have more or fewer components than those shown in the figure, may combine two or more components, or may 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 terminal uses a mobile phone as an example.
- Memory 901 which can be accessed by CPU902, peripheral interface 903, etc.
- the memory 901 can include high-speed random access memory, and can also include non-volatile memory, such as one or more disk storage devices, flash memory devices , Or other volatile solid-state storage devices.
- the I / O subsystem 909 which can connect input / output peripherals on the device, such as touch screen 912 and other input / control devices 910, to peripheral interface 903.
- the I / O subsystem 909 may include a display controller 9091 and one or more input controllers 9092 configured to control other input / control devices 910. Among them, one or more input controllers 9092 receive electrical signals from or send electrical signals to other input / control devices 910.
- Other input / control devices 910 may include physical buttons (press buttons, rocker buttons, etc.) ), Dial, slide switch, joystick, click wheel. It is worth noting that the input controller 9092 may be connected to any of the following: a keyboard, an infrared port, a universal serial bus (Universal Serial Bus, USB) interface, and a pointing device such as a mouse.
- USB Universal Serial Bus
- a touch screen 912 which is an input interface and an output interface between a user terminal and a user, and displays a visual output to the user.
- the visual output may include graphics, text, icons, videos, and the like.
- the display controller 9091 in the I / O subsystem 909 receives an electric signal from the touch screen 912 or sends an electric signal to the touch screen 912.
- the touch screen 912 detects a contact on the touch screen, and the display controller 9091 converts the detected contact into interaction with a user interface object displayed on the touch screen 912, that is, realizes human-computer interaction.
- the user interface object displayed on the touch screen 912 may be running Icons for games, icons connected to the appropriate network, etc. It is worth noting that the device may also include a light mouse, which is a touch-sensitive surface that does not display visual output, or an extension of the touch-sensitive surface formed by a touch screen.
- the RF circuit 905 is mainly configured to establish communication between a mobile phone and a wireless network (that is, a network side), and realize data reception and transmission of the mobile phone and the wireless network. For example, send and receive text messages, e-mail, and so on.
- the RF circuit 905 receives and sends RF signals.
- the RF signals are also referred to as electromagnetic signals.
- the RF circuit 905 converts electrical signals into electromagnetic signals or converts electromagnetic signals into electrical signals, and communicates with the communication network through the electromagnetic signals. As well as other devices.
- RF circuit 905 may include known circuits configured to perform these functions, including but not limited to antenna systems, RF transceivers, one or more amplifiers, tuners, one or more oscillators, digital signal processors, codecs (COder-DECoder, CODEC) chipset, Subscriber Identity Module (SIM), and so on.
- the audio circuit 906 is mainly configured to receive audio data from the peripheral interface 903, convert the audio data into an electrical signal, and send the electrical signal to the speaker 911.
- the speaker 911 is configured to restore a voice signal received by the mobile phone from the wireless network through the RF circuit 905 to a sound and play the sound to a user.
- the power management chip 908 is configured to provide power and power management for the hardware connected to the CPU 902, the I / O subsystem, and peripheral interfaces.
- the application preloading device, the storage medium, and the terminal provided in the foregoing embodiments can execute the application preloading method provided by any embodiment of the present application, and have corresponding function modules for executing the method.
- application preloading method provided in 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)
Abstract
The embodiments of the present application disclose an application program preloading method and apparatus, a storage medium, and a terminal. Said method comprises: when it is detected that an application preloading event is triggered, determining an application program to be preloaded; performing a preloading operation on the application to be preloaded and monitoring a preloading process; and when it is detected that an abnormality occurs in the preloading process, processing the abnormality.
Description
本申请要求在2018年05月21日提交中国专利局、申请号为201810490609.X的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims priority from a Chinese patent application filed with the Chinese Patent Office on May 21, 2018 with application number 201810490609.X, the entire contents of which are incorporated herein by reference.
本申请实施例涉及应用程序加载技术领域,例如涉及应用程序预加载方法、装置、存储介质及终端。The embodiments of the present application relate to the technical field of application program loading, for example, to a method, a device, a storage medium, and a terminal for preloading an application program.
目前,诸如智能手机、平板电脑、笔记本电脑以及智能家电等终端已成为人们日常生活中必不可少的电子设备。随着终端设备不断地智能化,多数终端设备中都装载有操作系统,使得终端设备能够安装丰富多样的应用程序,满足用户不同的需求。At present, terminals such as smart phones, tablet computers, laptops, and smart home appliances have become essential electronic devices in people's daily lives. With the continuous intelligentization of terminal devices, most terminal devices are loaded with operating systems, enabling terminal devices to install a variety of applications to meet different needs of users.
随着终端设备的配置不断提升,多数终端设备中可以安装几十甚至上百个应用程序,而随着应用程序的功能日益丰富,应用程序运行时所需加载的资源也越来越多。当用户选择启动一个应用程序时,终端会对该应用程序启动所需的资源进行加载,待加载完毕后,进入应用程序的初始界面,整个过程通常要花费数秒甚至十几秒的时间,导致应用程序的启动效率较低,亟需改进。With the continuous improvement of the configuration of terminal devices, dozens or even hundreds of applications can be installed in most terminal devices, and as the functions of applications become more and more abundant, more resources need to be loaded when the applications run. When the user chooses to start an application, the terminal will load the resources required for the application to start. After loading, the initial interface of the application is entered. The entire process usually takes several seconds or even ten seconds, resulting in the application. The start-up efficiency of the program is low and urgently needs improvement.
发明内容Summary of the Invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this article. This summary is not intended to limit the scope of protection of the claims.
本申请实施例提供一种应用程序预加载方法、装置、存储介质及终端,可以优化应用程序的预加载方案。The embodiments of the present application provide a method, a device, a storage medium, and a terminal for preloading an application program, which can optimize a preloading solution for the application program.
第一方面,本申请实施例提供了一种应用程序预加载方法,包括:在检测到应用预加载事件被触发的情况下,确定待预加载应用程序;对所述待预加载应用程序进行预加载操作,并对预加载过程进行监测;在检测到预加载过程中出现异常的情况下,针对所述异常进行处理。In a first aspect, an embodiment of the present application provides a method for preloading an application, including: determining that an application to be preloaded is detected when an application preloading event is detected to be triggered; and performing preloading on the application to be preloaded. The loading operation is performed, and the pre-loading process is monitored; when an abnormality is detected during the pre-loading process, the abnormality is processed.
第二方面,本申请实施例提供了一种应用程序预加载装置,包括:应用确定模块,设置为在检测到应用预加载事件被触发的情况下,确定待预加载应用程序;预加载模块,设置为对所述待预加载应用程序进行预加载操作;预加载监测模块,设置为在对所述待预加载应用程序进行预加载操作时,对预加载过程进行监测;预加载异常处理模块,设置为在检测到预加载过程中出现异常的情况下,针对所述异常进行处理。In a second aspect, an embodiment of the present application provides an apparatus for preloading an application, including: an application determining module configured to determine an application to be preloaded upon detecting that an application preloading event is triggered; the preloading module, Configured to perform a preload operation on the application to be preloaded; a preload monitoring module configured to monitor a preload process when the preload operation is performed on the application to be preloaded; a preload exception processing module, It is configured to process the abnormality when an abnormality is detected during the preloading process.
第三方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本申请实施例所述的应用程序预加载方法。In a third aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for preloading an application program according to the embodiment of the present application is implemented.
第四方面,本申请实施例提供了一种终端,包括存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,所述处理器执行所述计算机程序时实现如本申请实施例所述的应用程序预加载方法。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. When the processor executes the computer program, the implementation is implemented as in the embodiment of the present application The application preloading method.
在阅读并理解了附图和详细描述后,可以明白其他方面。After reading and understanding the drawings and detailed description, other aspects can be understood.
图1为本申请实施例提供的一种应用程序预加载方法的流程示意图;FIG. 1 is a schematic flowchart of an application preloading method according to an embodiment of the present application; FIG.
图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为本申请实施例提供的又一种预加载活动窗口堆栈与显示屏幕显示区域的相对位置关系示意图;3 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;
图4为本申请实施例提供的一种应用界面迁移示意图;4 is a schematic diagram of application interface migration provided by an embodiment of the present application;
图5为本申请实施例提供的另一种应用程序预加载方法的流程示意图;5 is a schematic flowchart of another application preloading method according to an embodiment of the present application;
图6为本申请实施例提供的又一种应用程序预加载方法的流程示意图;6 is a schematic flowchart of another application preloading method according to an embodiment of the present application;
图7为本申请实施例提供的一种应用程序预加载装置的结构框图;FIG. 7 is a structural block diagram of an application preloading device according to an embodiment of the present application; FIG.
图8为本申请实施例提供的一种终端的结构示意图;8 is a schematic structural diagram of a terminal according to an embodiment of the present application;
图9为本申请实施例提供的又一种终端的结构示意图。FIG. 9 is a schematic structural diagram of still another terminal provided by an embodiment of the present application.
下面结合附图并通过具体实施方式来进一步说明本申请的技术方案。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。The technical solutions of the present application will be further described below with reference to the accompanying drawings and specific embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, rather than limiting the present application. It should also be noted that, for convenience of description, the drawings only show a part of the structure related to the present application, but not the entire structure.
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowchart describes the steps as sequential processing, many of the steps can be performed in parallel, concurrently, or simultaneously. 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 drawings. The processing may correspond to methods, functions, procedures, subroutines, subroutines, and so on.
图1为本申请实施例提供的一种应用程序预加载方法的流程示意图,该方法可以由应用程序预加载装置执行,其中该装置可由软件和/或硬件实现,一般可集成在终端中。如图1所示,该方法包括步骤101至步骤103。FIG. 1 is a schematic flowchart of an application preloading method according to an embodiment of the present application. The method may be executed by an application preloading device, where the device may be implemented by software and / or hardware, and may generally be integrated in a terminal. As shown in FIG. 1, the method includes steps 101 to 103.
在步骤101中,在检测到应用预加载事件被触发的情况下,确定待预加载应用程序。In step 101, when it is detected that an application preload event is triggered, an application program to be preloaded is determined.
示例性的,本申请实施例中的终端可包括手机、平板电脑、笔记本电脑以及智能家电等终端设备。终端中装载有操作系统。Exemplarily, the terminal in the embodiments of the present application may include terminal devices such as a mobile phone, a tablet computer, a notebook computer, and smart home appliances. The terminal is loaded with an operating system.
示例性的,应用预加载事件的触发条件可以根据实际情况设置,本申请实施例不作具体限定。例如,可以在检测到用户的动作满足预设条件(如拿起终端、输入屏幕解锁操作或输入终端解锁操作等)时,触发应用预加载事件;或者可以在检测到前台应用程序发生变更时,触发应用预加载事件;或者可以在预加载应用的预测流程结束后,立即(或经过预设时长后)触发应用预加载事件;或者可以定时间隔触发等等。当应用预加载事件被触发后,系统可以通过读取标志位或接收触发指令等方式检测到应用预加载事件已被触发,具体的检测方式本申请实施例也不做限定。Exemplarily, the triggering condition of the application preload event can be set according to the actual situation, which is not specifically limited in the embodiment of the present application. For example, an application preload event can be triggered when it is detected that a user's action meets a preset condition (such as picking up a terminal, entering a screen to unlock an operation, or inputting a terminal to unlock an operation, etc.); or when a change to a foreground application is detected, Trigger an application preload event; or you can trigger an application preload event immediately (or after a preset time period has elapsed) after the prediction process of the preloaded application ends; or you can trigger at regular intervals. After the application preload event is triggered, the system can detect that the application preload event has been triggered by reading a flag bit or receiving a trigger instruction, and the specific detection method is not limited in this embodiment of the present application.
示例性的,待预加载的应用程序可以理解为用户可能即将打开的应用程序,可以是预先设置好的固定的应用程序,也可以是采用一定的方式预测出来的应用程序等。待预加载的应用程序可以包括一个或多个。Exemplarily, the application to be preloaded can be understood as an application that the user may open soon, it can be a fixed application that is set in advance, or an application that is predicted in a certain manner. The applications to be preloaded may include one or more.
在一实施例中,可采用预测模型对待预加载的应用程序进行预测。该预测模型可以是机器学习模型,所采用的算法可以包括循环神经网络(Recurrent neural networks,RNN)、长短期记忆(Long Short-Term Memory,LSTM)网络、门限循环单元、简单循环单元、自动编码器、决策树、随机森林、特征均值分类、分类回归树、隐马尔科夫、K最近邻(k-NearestNeighbor,KNN)算法、逻辑回归模型、贝叶斯模型、高斯模型以及KL散度(Kullback–Leibler divergence)等等。In one embodiment, a prediction model may be used to make predictions on the application to be preloaded. The prediction model can be a machine learning model, and the algorithms used can include Recurrent Neural Networks (RNN), Long Short-Term Memory (LSTM) networks, threshold recurrent units, simple recurrent units, automatic encoding , Decision tree, random forest, feature mean classification, classification regression tree, hidden Markov, K-NearestNeighbor (KNN) algorithm, logistic regression model, Bayesian model, Gaussian model, and KL divergence (Kullback – Leibler divergence) and so on.
在一实施例中,可在用户使用终端的过程中,采集训练样本,采用训练样本对预设初始模型进行训练,最终得到用于预测待预加载的应用程序的预测模型。示例性的,训练样本中包含的元素可包括应用程序被打开的时间序列或次序序列;可包括应用程序被打开的时间、地点以及频次等;可包括终端的运行状态,如移动数据网络的开关状态、无线热点的连接状态、所连接的无线热点的身份信息、当前运行的应用程序、上一个前景应用程序、当前应用程序在后台停留的时长、当前应用程序最近一次被切换至后台的时间、耳机插孔的插拔状态、充电状态、电池电量信息以及屏幕显示时长等等;还可包括终端中集成的传感器采集到的数据,如运动传感器、光线传感器、温度传感器以及湿度传感器等等。In one embodiment, during the process of using the terminal by the user, training samples can be collected, the preset initial model can be trained by using the training samples, and finally a prediction model for predicting the application to be preloaded can be obtained. Exemplarily, the elements included in the training sample may include a time series or sequence sequence in which the application is opened; may include the time, place, and frequency of the application being opened; and may include a running state of the terminal, such as a switch of a mobile data network Status, the connection status of the wireless hotspot, the identity information of the connected wireless hotspot, the currently running application, the previous foreground application, the length of time the current application stays in the background, the time when the current application was last switched to the background, The plugging and unplugging status, charging status, battery power information, and screen display duration of the headphone jack; it can also include data collected by sensors integrated in the terminal, such as motion sensors, light sensors, temperature sensors, and humidity sensors.
示例性的,可根据所选用的机器学习模型选择合适的样本元素,也可根据所选的样本元素确定所选用的机器学习模型,还可结合对预测准确度以及预设速度等方面的需求进行模型及样本元素的选择等,本申请实施例不做限定。Exemplarily, an appropriate sample element can be selected according to the selected machine learning model, and the selected machine learning model can be determined according to the selected sample element. It can also be combined with the requirements of prediction accuracy and preset speed. The selection of models and sample elements is not limited in the embodiments of the present application.
本申请实施例中,确定待预加载应用程序可以包括根据预测模型之前的输出结果确定待预加载应用程序,也可以包括利用预测模型进行预测,将预测模型的当前输出结果确定待预加载应用程序。In the embodiment of the present application, determining the application to be preloaded may include determining the application to be preloaded according to the output result before the prediction model, or may include performing prediction using the prediction model to determine the current output result of the prediction model to determine the application to be preloaded. .
本申请实施例中,当待预加载应用程序为多个(N个)时,预测模型可以输出候选应用程序集合中每个候选应用集合的启动概率,将启动概率较高的候选应用确定为待预加载应用程序。在一实施例中,所述确定待预加载应用程序,包括:预测候选应用程序的启动概率;将启动概率较高的预设数值个候选应用程序确定为待预加载应用程序。示例性的,候选应用程序可包括终端中安装的所有应用程序,也可包括部分应用程序。部分应用程序可以不包含系统应用程序,还可以不包含用户很少使用的应用程序。本申请实施例对候选应用程序的确定方式以及数量不做限定。在一实施例中,可根据当前时刻之前的预设时段内各应用程序的使用次数和/或使用时长确定候选应用程序,预设时段例如是1个月,当使用次数和/或使用时长超过相应的阈值时,将所对应的应用程序确定为候选应用程序,或者,按照使用次数和/或使用时长对各应用程序进行排序,将排名靠前的应用程序确定为候选应用程序。In the embodiment of the present application, when there are multiple (N) applications to be preloaded, the prediction model may output the startup probability of each candidate application set in the candidate application set, and determine the candidate application with a higher startup probability as the standby application. Preload the application. In an embodiment, the determining an application to be preloaded includes: predicting a startup probability of a candidate application; and determining a preset number of candidate applications with a high startup probability as the application to be preloaded. Exemplarily, the candidate applications may include all applications installed in the terminal, and may also include some applications. Some applications may not include system applications or applications that are rarely used by users. This embodiment of the present application does not limit the manner and quantity of candidate application programs. In one embodiment, the candidate applications can be determined according to the number of times and / or the duration of use of each application within a preset period before the current time. The preset period is, for example, one month. When the number of uses and / or the duration exceeds When the corresponding threshold value is determined, the corresponding application is determined as a candidate application, or each application is sorted according to the number of times and / or the duration of use, and the top-ranked application is determined as a candidate application.
示例性的,可采用上文所述的预测模型来确定各候选应用程序的启动概率。例如,按照预测模型训练时的训练样本,采集当前样本,将当前样本输入至预测模型中,得到各候选应用程序的启动概率。可对启动概率进行由高到低的排序,将排在前N(N为预设数值)的候选应用程序确定为待加载应用程序。这样设置能够对多个应用程序进行预加载,且这多个应用程序是根据启动概率来确定的,可以提高预测的准确性。Exemplarily, the prediction model described above may be used to determine the startup probability of each candidate application. For example, according to the training samples during prediction model training, current samples are collected, and the current samples are input into the prediction model to obtain the startup probability of each candidate application. The startup probability can be sorted from high to low, and the candidate N applications (N is a preset value) are determined as the applications to be loaded. This setting can preload multiple applications, and these multiple applications are determined according to the startup probability, which can improve the accuracy of the prediction.
在步骤102中,对所述待预加载应用程序进行预加载操作,并对预加载过程进行监测。In step 102, a preloading operation is performed on the application program to be preloaded, and a preloading process is monitored.
本申请实施例中,当待预加载应用程序仅有一个时,无需考虑应用的预加载顺序;而当待预加载应用程序有多个时,可将多个待预加载应用程序逐一确定为当前待预加载应用程序,并依次进行预加载操作,也可将2个以上待预加载的应用程序确定为当前待预加载应用程序,并同时进行预加载操作,也就是说多个应用程序的预加载过程可以是并行进行的。In the embodiment of the present application, when there is only one application to be preloaded, there is no need to consider the preloading order of the applications; and when there are multiple applications to be preloaded, the multiple applications to be preloaded may be determined one by one as the current one. Applications to be preloaded and preloaded in sequence. You can also determine more than 2 applications to be preloaded as the current to be preloaded and perform preloading operations at the same time, which means that multiple applications are preloaded. The loading process can be performed in parallel.
本申请实施例中对预加载的具体过程以及所加载的资源不做限定,例如可为待预加载应用程序分配相应的硬件资源,并基于分配的硬件资源加载启动所需的相关数据。示例性的,可包括应用进程启动、应用进程初始化、应用服务启动、内存分配、文件内容读取、网络数据获取以及界面渲染(如绘制应用程序的启动画面或其他应用界面)等。此外,预加载的资源也可根据待预加载应用程序的具体类型来确定。In the embodiment of the present application, the specific process of preloading and the resources loaded are not limited. For example, corresponding hardware resources may be allocated to the application to be preloaded, and related data required for startup may be loaded based on the allocated hardware resources. Exemplarily, it may include application process startup, application process initialization, application service startup, memory allocation, file content reading, network data acquisition, and interface rendering (such as drawing a startup screen of an application or other application interfaces) and the like. In addition, pre-loaded resources can also be determined according to the specific type of application to be pre-loaded.
在进行预加载操作的过程中,本申请实施例对预加载过程进行监测,从而可以在应用程序预加载阶段,即应用程序未真正启动之前,及时发现应用程序启动资源的加载异常。具体的监测内容可根据实际情况确定。示例性的,可通过调研等方式确定应用程序在启动时容易发生的情况和/或导致出现该情况的原因等,进一步确定相应的预加载内容并进行实时检测。例如,有些应用程序在启动时,可能发生崩溃(crash)情况(例如表现为应用程序启动后短时间内发生闪退),可以在预加载阶段检测待预加载应用程序是否会发生崩溃情况;又如,有些应用程序在启动时,可能会发生页面加载错误等情况,也可在预加载阶段检测页面是否成功加载等。In the process of performing the preloading operation, the embodiment of the present application monitors the preloading process, so that during the preloading phase of the application, that is, before the application is actually started, the loading abnormality of the application startup resource is found in time. The specific monitoring content can be determined according to the actual situation. Exemplarily, a situation that is prone to occur when the application is started and / or a cause of the situation may be determined through research and other methods, and the corresponding preloaded content is further determined and detected in real time. For example, some applications may crash when they are launched (for example, they appear to crash after a short period of time after the application starts). You can detect whether the application to be preloaded will crash during the preloading phase; and For example, when some applications are launched, page loading errors may occur. You can also check whether the page is successfully loaded during the preloading phase.
在步骤103中,在检测到预加载过程中出现异常的情况下,针对所述异常进行处理。In step 103, if an abnormality is detected during the preloading process, the abnormality is processed.
本申请实施例中,在检测到预加载过程中出现异常的情况下,可针对所出现的异常情况的类型或者严重程度等进行有针对性的处理。示例性的,可分析出出现异常情况的原因,针对该原因进行修复处理,继续或重新对当前待预加载应用程序进行预加载操作;又示例性的,可不对出现异常情况的原因进行分析,或在无法分析出出现异常情况的原因时,重新对当前待预加载应用程序进行预加载操作。通过以上方式,可有效减少已进行预加载的应用程序在真正启动时出现启动异常的概率。In the embodiment of the present application, when an abnormality is detected during the preloading process, targeted processing may be performed according to the type or severity of the abnormality that occurs. Exemplarily, the cause of the abnormal situation may be analyzed, and repair processing shall be performed for the cause, and the preload operation of the current to-be-preloaded application program may be continued or re-exemplified; and as an example, the cause of the abnormal situation may not be analyzed. Or, when the cause of the abnormal situation cannot be analyzed, reload the current application to be preloaded. In the above manner, the probability that the pre-loaded application program starts abnormally when it is actually started can be effectively reduced.
本申请实施例中提供的应用程序预加载方案,在检测到应用预加载事件被触发的情况下,确定待预加载应用程序,对待预加载应用程序进行预加载操作,并对预加载过程进行监测,在检测到预加载过程中出现异常的情况下,针对异常进行处理。通过采用上述技术方案,可以在应用程序预加载阶段进行异常检测,并在检测到异常的情况下进行处理,完善了预加载功能。In the application preloading scheme provided in the embodiment of the present application, when it is detected that an application preloading event is triggered, an application to be preloaded is determined, a preloading operation is performed on the preloaded application, and a preloading process is monitored. When an abnormality is detected during the preloading process, the abnormality is processed. By adopting the above technical solution, anomaly detection can be performed in the preloading phase of the application, and processing can be performed when an abnormality is detected, thereby improving the preloading function.
在一些实施例中,在接收到所述待预加载应用程序中的目标应用程序的运行指令时,基于所述目标应用程序的已预加载资源启动所述目标应用程序。这样,在用户真正启动已进行了预加载的应用程序时,用于启动的资源已进行了部分或全部预加载,且在预加载过程中经过了异常检测,可在提高应用程序启动速度的同时,提高应用程序正常启动的概率。In some embodiments, when a run instruction of a target application in the application to be preloaded is received, the target application is started based on a preloaded resource of the target application. In this way, when the user actually launches an application that has been preloaded, the resources used for startup have been partially or fully preloaded, and anomaly detection has been performed during the preloading process, which can improve the speed of application startup. To increase the probability of the application launching normally.
在一些实施例中,所述对所述待预加载应用程序进行预加载操作,包括:在显示屏幕的坐标范围之外,对所述待预加载应用程序进行模拟启动。示例性的,可在显示屏幕的坐标范围之外设置虚拟屏幕区域,对于当前待预加载应用程序来说,在虚拟屏幕区域基于已预加载的启动资源打开该当前待预加载应用程序,并在虚拟屏幕区域显示当前待预加载应用程序的应用界面,从而实现当前待预加载应用程序的模拟启动。在检测到预加载过程中出现异常的情况下,针对所述异常进行处理,包括:在检测到模拟启动过程中出现异常的情况下,针对所述异常进行处理。这样设置可以在显示屏幕的坐标范围之外模拟待预加载应用程序的启动过程,该过程对于用户来说是不可见的,不会对用户的使用产生干扰,且能够在模拟启动过程中及时准确地发现异常情况。In some embodiments, performing the preloading operation on the application to be preloaded includes: simulating starting the application to be preloaded outside a coordinate range of a display screen. Exemplarily, a virtual screen area may be set outside the coordinate range of the display screen. For an application to be preloaded currently, the current to-be-loaded application is opened in the virtual screen area based on the preloaded startup resource, and The virtual screen area displays the application interface of the current application to be preloaded, so as to realize the simulation start of the current application to be preloaded. When an abnormality is detected during the preloading process, processing the abnormality includes processing the abnormality when an abnormality is detected during the simulation startup process. This setting can simulate the startup process of the application to be preloaded outside the coordinate range of the display screen. This process is invisible to the user, will not interfere with the user's use, and can be timely and accurate during the simulation startup process. To find anomalies.
在一些实施例中,所述在检测到模拟启动过程中出现异常的情况下,针对所述异常进行处理,包括:在检测到模拟启动过程中出现应用程序崩溃的情况下,确定崩溃原因;根据所 述崩溃原因进行修复处理,并重新对所述待预加载应用程序进行模拟启动。这样设置可降低已进行预加载的待预加载应用程序在真正启动时发生启动崩溃情况的概率。在用户使用终端的过程中,可能会遇到应用程序启动时或正在运行时发生崩溃的情况,具体表现可能是应用程序闪退,即快速关闭,一般是应用程序启动或运行时遭遇无法处理的异常或错误时而退出应用程序的表现,用户只能重新启动该应用程序。导致崩溃的原因有很多,例如,缓存垃圾过多;运行的程序过多,导致内存不足;应用版本兼容问题;访问网络时,组件中的ImageView未正常的下载并显示到应用页面上;应用程序对应的软件开发工具包(Software Development Kit,SDK)与终端的系统版本不兼容等;还有些是与当前网络状况或内存卡等因素相关的。一些导致应用程序崩溃的原因是可以检测或分析出来的,还可以进一步针对崩溃原因采取一定的措施,来消除崩溃原因对应用程序运行的影响。In some embodiments, when an abnormality is detected during the simulation startup process, processing the abnormality includes: determining a crash cause when an application crash occurs during the simulation startup process; according to The crash cause is repaired, and the application to be preloaded is simulated and started again. This setting reduces the probability that a pre-loaded, pre-loaded application will crash when it actually starts. In the process of using the terminal, the user may encounter a crash when the application starts or is running. The specific performance may be that the application crashes, that is, closes quickly. Generally, the application cannot be processed when it is started or running. The behavior of exiting the application from time to time due to an exception or error, the user can only restart the application. There are many reasons for the crash, for example, too much cache garbage; too many programs running, causing insufficient memory; application version compatibility issues; when accessing the network, ImageView in the component is not downloaded and displayed on the application page normally; application The corresponding Software Development Kit (SDK) is not compatible with the system version of the terminal, etc .; some are related to the current network status or memory card and other factors. Some causes of application crashes can be detected or analyzed, and further measures can be taken to address the cause of the crash to eliminate the impact of the crash on the application's operation.
在一些实施例中,所述崩溃原因包括存储空间不足。所述根据所述崩溃原因进行修复处理包括:清理缓存数据和/或关闭后台运行的预设类型的应用程序。当终端中的缓存数据长时间未清理,累计较多的缓存垃圾文件时,缓存数据会占用较多的系统存储空间,不仅会影响系统运行的流畅性,也会造成应用程序的崩溃。当终端中后台运行的应用程序较多时,也会占用较多的系统内存,也容易导致应用程序的崩溃。在待预加载应用程序的模拟启动过程中,若检测到应用程序发生崩溃情况的崩溃原因是由于存储空间不足时,可清理缓存数据,或者关闭后台运行的预设类型的应用程序,或者同时清理缓存数据以及关闭后台运行的预设类型的应用程序。其中,预设类型的应用程序可以由系统默认设置,或者由用户自行设置。例如,可在终端中维护一个预设应用列表,处于该预设应用列表中的应用程序可认为是预设类型的应用程序,预设应用列表中的应用程序一般可以是用户不经常使用或者不重要的应用程序,在需要针对崩溃原因进行修复处理时,可以判断当前后台运行的应用程序中是否于预设应用列表中,若存在,则可关闭该应用程序,若当前后台运行的应用程序为多个,则可依次进行判定并根据判定结果确定是否关闭。In some embodiments, the cause of the crash includes insufficient storage space. The performing repair processing according to the cause of the crash includes: clearing cache data and / or closing a preset type of application running in the background. When the cache data in the terminal has not been cleaned for a long time and a large number of cache garbage files are accumulated, the cache data will occupy more system storage space, which will not only affect the smooth running of the system, but also cause the application to crash. When there are many applications running in the background in the terminal, it will also take up more system memory, which will also easily cause the application to crash. During the simulated startup process of the application to be preloaded, if the crash of the application is detected due to insufficient storage space, the cache data can be cleared, or the preset type of application running in the background can be closed, or cleaned up at the same time Cache data and close preset types of applications running in the background. Among them, the preset type of application can be set by the system by default or set by the user. For example, a preset application list may be maintained in the terminal, and the applications in the preset application list may be considered as preset types of applications, and the applications in the preset application list may generally be used infrequently by the user or not. For important applications, when it is necessary to repair the cause of the crash, you can determine whether the current background running application is in the preset application list. If it exists, you can close the application. If the current background running application is Multiple, you can make a judgment in sequence and determine whether to close according to the judgment result.
在一些实施例中,可以为缓存数据设置等级,并根据模拟启动过程中出现应用程序崩溃情况的严重程度选择对应等级的缓存数据进行清理。示例性的,可将缓存数据设置为包括第一级缓存、第二级缓存和第三级缓存,第三级缓存包括本地数据库中的缓存数据,第二级缓存包括临时目录中的缓存数据,第一级缓存包括Document目录中的缓存数据。在模拟启动过程中首次出现应用程序崩溃的情况下,清除第三级缓存数据;在清除第三级缓存数据后,重新对待预加载应用程序进行模拟启动,若再次出现崩溃情况,则清除第二级缓存数据;在清除第二级缓存数据后,重新对待预加载应用程序进行模拟启动,若第三次出现崩溃情况,则清除第三级缓存数据。以上仅为示意性说明,可以为缓存数据设置更多的等级,以及可自由设置崩溃次数与需要清理的缓存等级的对应关系。In some embodiments, a level may be set for the cached data, and the cached data of the corresponding level is selected for cleaning according to the severity of the application crash situation during the simulated startup process. Exemplarily, the cache data may be set to include a first-level cache, a second-level cache, and a third-level cache. The third-level cache includes cached data in a local database, and the second-level cache includes cached data in a temporary directory. The first level of cache includes cached data in the Document directory. In the case of an application crash for the first time during the simulation startup, clear the third-level cache data; after clearing the third-level cache data, re-treat the preloaded application for simulated startup, and if the crash occurs again, clear the second Level cache data; after clearing the second level cache data, simulate the startup of the preloaded application again, and if a third crash occurs, clear the third level cache data. The above is only a schematic description. More levels can be set for the cache data, and the correspondence between the number of crashes and the cache level that needs to be cleared can be freely set.
在一些实施例中,所述在显示屏幕的坐标范围之外,对当前待预加载应用程序进行模拟启动,包括:基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示,其中,所述预加载活动窗口堆栈对应的边界坐标位于显示屏幕的坐标范围之外。这样设置可以对应用界面进行绘制及显示,模拟应用程序从启动到显示应用界面的过程,在更加全面的进行模拟启动的同时,还能够较大程度地完成应用启动前的准备工作,提升待预加载应用程序的启动速度,且不会影响到前台应用程序的显示内容在显示屏幕上的显示。In some embodiments, the simulating startup of the current to-be-loaded application program outside the coordinate range of the display screen includes: based on a pre-created pre-loaded active window stack, corresponding to the to-be-loaded application program. The application interface performs drawing and display, wherein the boundary coordinates corresponding to the preloaded active window stack are outside the coordinate range of the display screen. This setting can draw and display the application interface, simulate the process of the application from startup to display the application interface, and at the same time perform the simulation startup more comprehensively, it can also complete the preparation work before the application startup to a greater extent, and improve the waiting time. The startup speed of the loaded application does not affect the display of the display content of the foreground application on the display screen.
本申请实施例中,活动窗口可理解为一个独立的直接面向用户提供交互和操作的界面, 在不同的操作系统中可能采用不同的名词来命名该界面。为了便于理解,下面以安卓(Android)操作系统为例进行下面的说明。In the embodiment of the present application, the active window may be understood as an independent interface that directly provides users with interaction and operation, and different terms may be used to name the interface in different operating systems. In order to facilitate understanding, the following description is made by taking an Android operating system as an example.
在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. Activity is a component responsible for interacting with the user. It provides a screen (which can be understood as a screen interface instead of a physical display screen) for the user to interactively complete a certain task. In an android application, an Activity is usually a separate screen, which can display some controls or listen to and handle user events. In the management of Activity, there are two concepts: Task (task stack) and Stack (active window stack). A Task corresponds to an application. A Task is used to store Activities. A Task can store one or more Activities, and these Activities follow the "first in, first out, last in, first out" principle. Stack is also used to manage Tasks. Generally, a Stack manages the Tasks that each Activity needs to display on a screen. A Stack can manage one or more Tasks. Of course, Stack also follows the basic management principles of the Stack. . The screens described here are not necessarily complete and independent display screens. Taking "two screens" as an example, these two screens may be just two areas in a complete display screen that independently display their respective display contents. Of course, if the terminal has two or more independent display screens, the "two screens" may also be two independent display screens.
在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 FreeForm. In the multi-window mode, the stack where the application is located can have its own size, which can include the upper, lower, left, and right coordinates in a coordinate system with the upper left corner of the terminal screen as the origin. For example, (a, b, c, d) generally describes a rectangular boundary, which can be expressed by the coordinates of the upper left corner and the lower right corner of the rectangle, that is, the upper left corner of the rectangle is (a, b), right The lower corner coordinate is (c, d), and such a rectangular area corresponds to the size of the Stack. The layout of the application 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 boundary of the size.
在多窗口模式下,可以允许多个应用程序处于可见状态,包括系统和用户均可见和仅系统可见。系统和用户均可见指的是在显示屏幕上进行显示,且用户能够看到;仅系统可见指的是操作系统可见,而用户不可见,可能被前台的应用遮挡或者如本申请所要实现的在显示屏幕外显示。In multi-window mode, you can allow multiple applications to be visible, including both system and user visible and system only visible. Both visible to the system and the user means to be displayed on the display screen and can be seen by the user; only visible to the system means that the operating system is visible and the user is not visible, which may be obscured by the application in the foreground or as implemented in this application Show off screen.
本申请实施例中,在显示屏幕外对目标应用程序的应用界面进行预加载,可以基于操作系统的多窗口机制来实现,通过多窗口机制将应用程序对应的size设在显示屏幕外而对用户不可见,从而不会影响到前台应用程序的显示内容在显示屏幕上的显示。In the embodiment of the present application, pre-loading the application interface of the target application program outside the display screen can be implemented based on the multi-window mechanism of the operating system, and the size corresponding to the application program is set outside the display screen through the multi-window mechanism to the user. It is not visible, so it will not affect the display content of the foreground application on the display screen.
一般的,多窗口模式下,可以存在多种类型的Stack,如Home Stack表示桌面应用显示的Stack,App Stack表示第三方应用显示的Stack,还可以有其他分屏Stack等,上述三种Stack中包含的内容可在显示屏幕上显示,本申请实施例中统称为应用活动窗口堆栈。本申请实施例中,新增了预加载活动窗口堆栈(预加载Stack),用于表示预加载应用显示的Stack,并设置预加载Stack的边界坐标位于显示屏幕的坐标范围之外,待预加载的应用程序可以显示在该Stack。对于Android系统来说,可以基于Android系统的多窗口机制,新建一个专门用于显示预加载应用的Stack。本申请实施例中,新建Stack是因为可以让新建的预加载Stack拥有自己的size以及可见性,从而实现在显示屏幕外预加载以及模拟启动。Generally, in multi-window mode, there can be multiple types of stacks. For example, Home Stack represents the stack displayed by desktop applications, App Stack represents the stack displayed by third-party applications, and there can be other split-screen stacks. The contained content can be displayed on a display screen, which is collectively referred to as an application active window stack in the embodiments of the present application. In the embodiment of the present application, a preloaded active window stack (preloaded stack) is added to indicate 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 that Stack. For the Android system, based on the multi-window mechanism of the Android system, a new Stack dedicated to displaying preloaded applications can be created. In the embodiment of the present application, a new stack is created because the newly created preloaded stack can have its own size and visibility, thereby achieving preloading and simulation startup outside the display screen.
本申请实施例中,对预加载Stack的创建时机不做限定,可以是在终端出厂前默认设置预加载Stack处于常驻状态,即预加载Stack一直存在;也可以在终端开机时或终端解锁成功后创建;还可以在应用预加载事件被触发后(可以在确定待预加载应用程序之前)创建等等。在一实施例中,所述基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示,包括:判断是否存在预先创建的预加载活动窗口堆栈;若不存在, 则按照预设规则创建预加载活动窗口堆栈;基于所创建的预加载活动窗口堆栈预加载对所述待预加载应用程序对应的应用界面进行绘制及显示。这样设置可以在确定待预加载应用程序之后,判断预加载Stack是否存在,若存在,则无需新建,若不存在,则进行创建,可以节省系统资源。可以理解的是,当待预加载应用程序包含多个时,也即需要在短时间内连续预加载多个应用程序时,在第一个待预加载应用程序开始加载前,预加载Stack已创建完毕,那么第二个待预加载应用程序开始加载前,预加载Stack是存在的,可以不必进行上述判断。In the embodiment of the present application, the creation timing of the preloaded stack is not limited. The preloaded stack can be set to the resident state by default before the terminal leaves the factory, that is, the preloaded stack always exists; or the terminal can be successfully unlocked when the terminal is powered on Create later; you can also create after the application preload event is triggered (before you determine the application to be preloaded) and so on. In an embodiment, the drawing and displaying the application interface corresponding to the application to be preloaded based on the pre-created preloaded active window stack includes: determining whether a pre-created preloaded active window stack exists; if If it does not exist, a preloaded active window stack is created according to a preset rule; and the application interface corresponding to the application to be preloaded is drawn and displayed based on the preloaded active window stack created. This setting can determine whether the pre-loaded stack exists after determining the application to be pre-loaded. If it exists, you do not need to create a new stack. If it does not exist, create it, which can save system resources. It can be understood that when there are multiple applications to be preloaded, that is, when multiple applications need to be preloaded continuously in a short period of time, the preloading stack has been created before the first application to be preloaded starts to load. After that, the pre-loading stack exists before the second application to be pre-loaded starts to be loaded, and the above judgment may not be necessary.
在一些实施例中,所述基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示,包括:创建所述待预加载应用程序对应的目标进程;在预先创建的预加载活动窗口堆栈中创建所述待预加载应用程序对应的任务栈;基于所述目标进程在所述任务栈中启动所述待预加载应用程序对应的活动窗口;基于所启动的活动窗口绘制并显示所述待预加载应用程序对应的应用界面。上述应用界面可包括应用程序的启动界面和/或启动动画(如启动广告等)。在创建目标进程的同时,还可包括目标进程的初始化过程。在上述步骤的执行过程中,还可能涉及其他资源的预加载,如应用服务启动、内存分配、文件内容读取及网络数据获取等,本申请实施例对其他资源的预加载过程不做限定,可以由待预加载应用程序本身的特性决定。上述步骤描述了对待预加载应用程序的预加载过程,而上述预加载相关步骤在执行的过程中,也实现了对待预加载应用程序的模拟启动。In some embodiments, the drawing and displaying an application interface corresponding to the application to be preloaded based on a pre-created preloading active window stack includes: creating a target process corresponding to the application to be preloaded; Creating a task stack corresponding to the application to be preloaded in a pre-created preloading active window stack; starting an active window corresponding to the application to be preloaded in the task stack based on the target process; based on the launched The active window draws and displays an application interface corresponding to the application to be preloaded. The application interface may include a startup interface of an application program and / or a startup animation (such as a startup advertisement). When the target process is created, the initialization process of the target process can also be included. During the execution of the above steps, pre-loading of other resources may also be involved, such as application service startup, memory allocation, file content reading, and network data acquisition. The embodiments of this application do not limit the pre-loading process of other resources. Can be determined by the characteristics of the application to be preloaded. The above steps describe the preloading process of the application to be preloaded, and during the execution of the above preloading-related steps, the simulated startup of the application to be preloaded is also implemented.
在一些实施例中,还包括:向所述待预加载应用程序发送伪造焦点通知,并基于所述伪造焦点通知在预设时间段内保持所述待预加载应用程序对应的应用界面的持续绘制以及显示更新。这样设置能够在待预加载应用程序获得焦点并对系统可见的情况下完成应用界面的绘制及显示,提高预加载的完成度,且不对前台应用的焦点产生影响。本申请实施例中的焦点又称为输入焦点,伪造焦点与前台应用对应的焦点相互独立。一般的,对于目前的Android系统来说,焦点是唯一的,例如触摸等输入操作只对焦点生效,对于输入焦点信息,系统端和应用端是一致的,系统端一旦修改输入焦点信息,就会向应用发送输入焦点信息发生变化的信息,以此方法保证系统端和应用端输入焦点信息一致。本申请实施例中,通过分离系统端和应用端输入焦点信息的方式,实现应用端可伪造焦点。本申请实施例中,对预加载应用伪造焦点通知,使预加载应用具有焦点信息,而系统端的焦点信息仍然是正确的,这样处理可以使得预加载应用能够正常绘制,实现全部加载,同时也能够使得待预加载应用程序在模拟启动时刻之后能够保持一定时间的界面更新,方便准确定位异常情况。焦点存在于系统端和应用端,可认为是服务端(server)和客户端(client),系统端记录拥有焦点的应用,应用端保存标志位(flag)标识自己是否有焦点。伪造输入焦点的时机可以是当Android的窗口系统新增窗口,需要更新焦点时,生成伪造焦点通知并进行发送。伪造焦点的方法可以是调用窗口的client端的改变窗口焦点的方法,使得该窗口获取焦点。在一实施例中,可基于Binder机制进行伪造焦点通知的发送,Binder机制是Android系统的进程间通信的最常用的方式,采用c/s架构,即客户/服务架构。In some embodiments, the method further includes: sending a fake focus notification to the application to be preloaded, and maintaining a continuous drawing of an application interface corresponding to the application to be preloaded for a preset period of time based on the fake focus notification. And display updates. This setting can complete the drawing and display of the application interface when the application to be preloaded has the focus and is visible to the system, improving the completion of the preloading without affecting the focus of the foreground application. The focus in the embodiments of the present application is also referred to as input focus, and the fake focus and the focus corresponding to the foreground application are independent of each other. Generally, for the current Android system, the focus is unique. For example, input operations such as touch only take effect on the focus. For the input of focus information, the system and the application are consistent. Once the system changes the input focus information, it will Send information to the application that the input focus information has changed, this way to ensure that the system and application side input focus information is consistent. In the embodiment of the present application, the application side can forge the focus by separating the system side and the application side from inputting focus information. In the embodiment of the present application, the focus notification for the preloaded application is forged, so that the preloaded application has focus information, and the focus information on the system side is still correct. The application to be preloaded can keep the interface updated for a certain period of time after the simulation startup time, which is convenient to accurately locate the abnormal situation. The focus exists on the system side and the application side. It can be considered as the server and the client. The system side records the application that has the focus, and the application side saves a flag to indicate whether it has focus. The timing of falsifying the input focus may be that when the Android window system adds a new window and the focus needs to be updated, a fake focus notification is generated and sent. The method of falsifying 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 focus. In one embodiment, a fake focus notification can be sent based on the Binder mechanism. The Binder mechanism is the most commonly used method for inter-process communication of the Android system, and adopts a c / s architecture, that is, a client / service architecture.
本申请实施例中,预设时间段可根据实际情况设计,例如可以是开始预加载后的固定时长范围内,也可以是开始预加载到完成预加载的时段等。在一些实施例中,所述预设时间段的长度包括所述目标应用程序中启动广告或启动动画的播放时长。一些应用程序在启动的过程中,通常会播放一些广告或动画,广告或动画的播放时长通常为3秒至十几秒不等,在播放广告或动画期间,用户可能没办法进行任何操作,只能等待播放完毕,浪费用户的宝贵时间。本申请实施例这样设置能够在待预加载应用程序启动之前,在屏幕外播放完启动广告或 启动动画,当待预加载应用程序启动时,可直接进入应用程序的主页面或其他用户可操作的界面,从而将待预加载应用程序的可操作时间点进一步提前,减少等待时间。此外,在播放启动广告或启动动画的过程中,也可能会出现应用程序崩溃或者其他异常情况,可以更加全面地对预加载过程进行监测。In the embodiment of the present application, the preset time period may be designed according to actual conditions, for example, it may be within a fixed time range after starting preloading, or it may be a period from starting preloading to completing preloading. In some embodiments, the length of the preset time period includes a playing time of starting an advertisement or starting an animation in the target application. During the startup of some applications, some advertisements or animations are usually played. The duration of advertisements or animations usually ranges from 3 seconds to more than ten seconds. During the playback of advertisements or animations, the user may not be able to perform any operation, only Can wait for the playback to finish, wasting valuable time of the user. This embodiment of the present application is set up so that the startup advertisement or startup animation can be played off the screen before the application to be preloaded is launched. When the application to be preloaded is launched, it can directly enter the main page of the application or other user-operable Interface to further advance the operable time point of the application to be preloaded and reduce waiting time. In addition, during the process of playing startup ads or starting animations, application crashes or other abnormalities may also occur, and the preloading process can be more fully monitored.
在一些实施例中,在基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示之后,还包括:在接收到所述待预加载应用程序中的目标应用程序的运行指令时,将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的应用界面迁移至所述显示屏幕进行显示。这样设置可以在目标应用程序真正需要启动的时候,直接将已经绘制好的应用界面迁移到显示屏幕进行显示,能够达到应用界面的快速切换,提高启动速度。In some embodiments, after drawing and displaying an application interface corresponding to the application to be preloaded based on a pre-created preloading active window stack, the method further includes: upon receiving the When the target application runs, the application interface corresponding to the target application included in the preloaded active window stack is migrated to the display screen for display. This setting can directly migrate the already drawn application interface to the display screen for display when the target application really needs to be started, which can achieve fast switching of the application interface and improve startup speed.
在一些实施例中,所述将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的应用界面迁移至所述显示屏幕进行显示,包括:将所述预加载活动窗口堆栈中包含的所述目标应用程序对应的任务栈迁移至应用活动窗口堆栈的顶部;更新所述任务栈的尺寸信息、配置信息和可见性,以实现所述目标应用程序对应的应用界面在所述显示屏幕进行显示。这样设置能够保证界面迁移过程的稳定性,保证恢复过程不会出现卡屏、黑屏或迁移速度慢等情况。In some embodiments, the migrating an application interface corresponding to the target application included in the preloaded active window stack to the display screen for display includes: The task stack corresponding to the target application is migrated to the top of the application active window stack; the size information, configuration information, and visibility of the task stack are updated to implement the application interface corresponding to the target application on the display screen display. This setting can ensure the stability of the interface migration process, and ensure that there are no screens, black screens, or slow migration speeds during the recovery process.
对于一些终端来说,尤其是手机及平板电脑等移动终端,为了方便用户的使用,显示屏幕的显示方式通常包括竖屏显示和横屏显示,许多应用程序默认采用竖屏方式进行显示,而有些应用程序默认采用横屏方式进行显示(如一些网络游戏),在终端的使用过程中,有些应用程序还会随着用户握持终端的方向而进行横竖屏显示的切换。在本申请的一些实施例中,所述预加载活动窗口堆栈对应的边界坐标为(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 use of the user, the display mode of the display screen usually includes vertical screen display and horizontal screen display. Many applications use vertical screen display by default, and some The application program is displayed in a horizontal screen mode (such as some online games) by default. During the use of the terminal, some applications may switch between the horizontal and vertical screen display as the user holds the terminal. In some embodiments of the present application, a boundary coordinate corresponding to the preloaded active window stack is (H, 0, 2H, H), a coordinate system corresponding to the boundary coordinate is a system coordinate, and an origin of the system coordinate 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, the side corresponding to H is the largest side of the display area of the display screen, which is the height of the display screen when displayed in the vertical screen and the width of the display screen when displayed in the horizontal screen. This setting takes into consideration the display screen landscape, pre-loaded application landscape display, and some applications' normal display. 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, 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 corresponding to loading Stack202 are (H, 0, 2H, H), where H is the screen height, that is, the area within the solid rectangle on the left is the main screen display area, and the area within the rectangle on the right dashed line is the preload display area. FIG. 3 is a schematic diagram of a relative position relationship between another preloaded active window stack and a display screen display area according to an embodiment of the present application. As shown in Figure 3, the display screen is in landscape mode, the origin of the terminal system coordinates is the left vertex (0,0) of the display screen 301, the height direction of the display screen 301 is the X axis, and the width direction is the Y axis. The boundary coordinates corresponding to loading Stack202 are (H, 0, 2H, H), where H is the screen height, that is, the area within the solid rectangle on the left is the main screen display area, and the area within the rectangle on the right dashed line is the preload display area.
预加载Stack各个边界如此设置的原因在于:The reason for pre-loading the stack boundaries is as follows:
左上角的横坐标为H,是为了防止横屏时显示屏幕(也可称为主屏幕)显示到预加载应用的界面,因为主屏幕除了竖屏模式,还有横屏模式,当主屏幕横屏的时候,为了防止主屏幕显示区域显示了预加载的应用的局部,所以将预加载Stack对应的矩形区域的左上角横坐标设为屏幕高。The horizontal axis of the upper left corner is H, which is to prevent the display screen (also called the home screen) from being displayed on the pre-loaded application interface when the screen is horizontal, because the home screen has a horizontal screen mode in addition to the vertical screen mode. In order to prevent part of the preloaded application from being displayed in the main screen display area, 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 vertical coordinate of the upper left corner is 0, so that the preloaded application can correctly calculate the height of the status bar. In order to better design the user interface (UI), the Android application will customize the top status bar. If the corresponding vertical coordinate is not equal to 0, the height of the status bar may be wrong.
右下角的横坐标为2H(2倍屏幕高),即预加载Stack对应的矩形的宽=屏幕高,是为了预加载Stack的size能够包含预加载时候的横屏应用(即应用界面为横屏显示方式的应用程序)。The horizontal axis of the lower right corner is 2H (2 times the screen height), that is, the width of the rectangle corresponding to the preloaded stack = screen height, so that the size of the preloaded stack can include the horizontal screen application when preloaded (that is, the application interface is horizontal screen) Display mode application).
右下角的纵坐标为H,即预加载Stack对应的矩形的高=屏幕高,是为了预加载Stack的size能够包含预加载时候的竖屏应用。The vertical coordinate of the lower right corner is H, that is, the height of the rectangle corresponding to the pre-loaded Stack = screen height, so that the size of the pre-loaded Stack can include the vertical screen application when pre-loaded.
基于上述的原因,申请人将预加载Stack的size设置为(H,0,2H,H)。Based on the above reasons, the applicant set 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 an application interface migration provided by an embodiment of the present application. As shown in FIG. 4, upon receiving a running instruction of a target application, an application corresponding to the target application included in the active window stack is preloaded. The interface 401 is migrated to the display screen 201 for display. In one embodiment, the task to which the preloaded application interface belongs is migrated to the top of the application activity window Stack, and the size information, configuration information, and visibility of the task are updated to thereby apply the interface. Able to display normally on the display screen.
在一些实施例中,所述在检测到模拟启动过程中出现异常的情况下,针对所述异常进行处理,包括:在检测到基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示的过程中,当前应用界面显示异常的情况下,重新绘制并显示所述当前应用界面。这样设置可以从应用界面的角度对预加载进行进一步的监测。示例性的,显示异常可包括界面加载失败、网络数据获取失败、元素缺失以及脚本错误中的至少一项。一般的,应用程序启动时启动界面或启动动画中通常包含在网络侧动态更新的数据,需要根据从网络侧获取到的数据对界面进行加载并显示,在此过程中可能会出现各种原因导致页面显示异常。示例性的,可在终端中内置监测文件,预先确定移动终端中已安装的应用程序的各应用界面的加载信息,写入该监测文件中,在屏幕外进行界面模拟显示时,利用监测文件对界面显示是否发生异常进行实时检测。示例性的,也可与监测平台配合来实现界面异常的检测。例如,在对应用界面进行绘制及显示的过程中,向监测平台发送监测请求,监测请求用于指示监测平台对待预加载应用程序的加载组件进行检测,并向终端反馈元素检测信息。其中,元素检测信息可包括schema(架构)和文档对象模型(document object model,dom)监控元素。监测平台中可预先存储待预加载应用加载组件的元素检测信息,针对待预加载应用程序中包含的加载组件,部署对应的监控点和用于监控的schema,根据监控点的XPath(可扩展标记语言路径),获取对应的dom监控元素,将schema和dom监控元素作为元素检测信息进行存储。终端可以激活预设应用程序中预先注入的监控文件,利用监控文件和接收到的元素检测信息,对页面加载过程进行异常检测。其中,异常检测可包括界面加载失败检测、网络数据获取失败检测、元素缺失检测以及脚本(如javascript)错误检测等。本申请实施例中,在检测到界面显示异常的情况下,重新绘制并显示所述当前应用界面,可以提高应用界面正常显示的概率,从而使得经过预加载的应用程序在真正启动时,应用界面能够正常显示。In some embodiments, when an abnormality is detected during the simulation startup process, processing the abnormality includes: detecting that the application to be preloaded is detected based on a pre-created preloaded active window stack. During the process of drawing and displaying the application interface corresponding to the program, if the current application interface is abnormally displayed, the current application interface is redrawn and displayed. This setting can further monitor the preloading from the perspective of the application interface. Exemplarily, the display exception may include at least one of a loading failure on the interface, a failure to obtain network data, a missing element, and a script error. Generally, the startup interface or startup animation when an application starts usually contains data that is dynamically updated on the network side, and the interface needs to be loaded and displayed according to the data obtained from the network side. During this process, various reasons may occur The page is displayed abnormally. For example, a monitoring file may be built in the terminal, and loading information of each application interface of the installed application program in the mobile terminal may be determined in advance, and the monitoring file may be written into the monitoring file. The interface displays whether an abnormality occurs for real-time detection. Exemplarily, it can also cooperate with a monitoring platform to implement detection of interface anomalies. For example, during the process of drawing and displaying the application interface, a monitoring request is sent to the monitoring platform, and the monitoring request is used to instruct the monitoring platform to detect the loading component of the pre-loaded application program, and feedback the element detection information to the terminal. The element detection information may include a schema (schema) and a document object model (dom) monitoring element. The monitoring platform can store the element detection information of the components to be preloaded by the application to be preloaded. For the loaded components contained in the application to be preloaded, deploy the corresponding monitoring points and the schema for monitoring. Language path) to obtain the corresponding dom monitoring element, and store the schema and dom monitoring elements as element detection information. The terminal can activate the pre-injected monitoring file in the preset application, and use the monitoring file and the received element detection information to perform anomaly detection on the page loading process. The abnormality detection may include interface loading failure detection, network data acquisition failure detection, element missing detection, and script (such as javascript) error detection. In the embodiment of the present application, when an abnormal display of the interface is detected, redrawing and displaying the current application interface can increase the probability that the application interface is normally displayed, so that when the pre-loaded application program is actually started, the application interface Can display normally.
在一些实施例中,在所述基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示之前,还包括:预测所述待预加载应用程序中包含的目标界面,其中,所述目标界面包括根据所述待预加载应用程序的历史运行规律预测出的即将被用户打开的界面。所述基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示,包括:基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的目标界面进行绘制及显示。这样设置可以预测用户即将打开的界面,对该界面进行预加载,在提高应用程序启动速度的基础上,进一步提高界面打开速度,同时可预先 判断在打开目标界面过程中是否会出现异常,若在模拟启动阶段目标界面出现显示异常,可重新对目标界面进行绘制及显示,降低用户真正打开目标界面时出现显示异常的概率。本申请实施例中,对目标界面的数量不做限定,可以包括一个或多个。用户在使用应用程序的过程中,通常都会有自己的使用习惯,并按照自己的使用习惯对应用程序进行操作,使得应用程序在用户的操作下会呈现出一定的运行规律,如打开各界面的顺序或频次、在各个界面停留的时长等等,可采集上述运行规律相关的数据(如应用程序对应的日志信息),统计或分析出应用程序的历史运行规律,需要预测目标界面时,根据该应用程序对应的历史运行规律预测即将被用户打开的界面。此外,还可根据当前使用场景进行目标界面的预测等。在对目标界面进行预加载之后,若用户选择启动已经进行了预加载的应用程序,那么会基于已预加载的启动资源启动该应用程序,在需要打开目标界面时,可基于已预加载的界面资源快速打开目标界面,提高目标界面的打开速度。示例性的,预测待预加载应用程序中包含的目标界面可包括:根据待预加载应用程序在历史采样周期内的运行过程中,所包含的各个界面被打开的顺序、被打开的频次或停留时长,预测待预加载应用程序中包含的目标界面。示例性的,历史采样周期可包括从当前时刻开始向前追溯预设时长后得到的时间段。例如从今天开始向前追溯30天,历史采样周期的长度为1个月;又如从当前上午9点开始向前追溯24小时,历史采样周期的长度为1天。此外,历史采样周期也可以是固定的周期,例如每个月的1日到当月最后以前,或者每天的0点到24点等。对于一个应用程序来说,可能具备多个功能,每个功能下可能包含多个界面,以微信为例,包括聊天列表界面、聊天界面、通讯录界面、朋友圈界面、扫一扫界面、摇一摇界面以及钱包界面等。用户在使用应用程序的过程中,终端可以记录应用程序在用户操作下的运行规律。示例性的,各个界面被打开的顺序可包括应用程序启动后在用户操作下打开的第1个界面、第2个界面,……第N个界面,形成打开顺序序列,其中,第1个界面不是应用程序启动时默认打开的启动界面,而是需要用户主动打开的界面,同一个界面首次被打开之后再被打开时可忽略不计,即不列入打开顺序序列中。一个界面被打开的频次可包括在历史采样周期内该界面被打开的总次数,或历史采样周期内的单位时长(例如5分钟)内被打开的次数等。一个界面的停留时长可包括该界面持续在显示屏上进行显示的时长,在显示期间,用户可以查看界面内容或对界面进行滑动等操作。一般的,被打开的顺序越靠前、被打开的频次越高、或停留时间越长,对应的界面成为目标界面的概率越高,可根据该规律为应用程序中包含的各界面进行综合评分,得到每个界面成为目标界面的概率,进而将概率较高的一个或多个界面确定为目标界面。In some embodiments, before the drawing and displaying the application interface corresponding to the application to be preloaded based on the pre-created preloading active window stack, the method further includes predicting that the application to be preloaded contains The target interface, wherein the target interface includes an interface that is predicted to be opened by a user according to a historical running rule of the application to be preloaded. The drawing and displaying the application interface corresponding to the to-be-loaded application program based on the pre-created pre-loading active window stack includes: corresponding to the to-be-loaded application program based on the pre-created pre-loading active window stack. The target interface is drawn and displayed. This setting can predict the interface that the user is about to open, and preload the interface. On the basis of increasing the application startup speed, the interface opening speed is further increased. At the same time, it can be determined in advance whether an exception will occur during the opening of the target interface. The display of the target interface is abnormal during the simulation startup phase. The target interface can be redrawn and displayed to reduce the probability of the display abnormality when the user actually opens the target interface. In the embodiment of the present application, the number of target interfaces is not limited, and may include one or more. In the process of using the application, users usually have their own habits and operate the application according to their own habits, so that the application will show certain operating rules under the user's operation, such as opening each interface Sequence or frequency, the length of time spent on each interface, etc., can collect data related to the above operating rules (such as the log information corresponding to the application program), statistics or analyze the historical operating rules of the application program, when you need to predict the target interface, according to the The historical running rule corresponding to the application predicts the interface that will be opened by the user. In addition, the target interface can be predicted based on the current usage scenario. After pre-loading the target interface, if the user chooses to launch an application that has been pre-loaded, the application will be launched based on the pre-loaded startup resources. When the target interface needs to be opened, the pre-loaded interface can be used. Resources quickly open the target interface and increase the speed of opening the target interface. Exemplarily, predicting the target interface included in the application to be preloaded may include: according to the order in which each interface included is opened, the frequency of opening, or the stay during the running process of the application to be preloaded in the historical sampling period. Duration, predicts the target interface contained in the application to be preloaded. Exemplarily, the historical sampling period may include a time period obtained after tracing a preset duration from the current moment forward. For example, 30 days forward from today, the length of the historical sampling period is 1 month; and another 24 hours forward from 9 am, the length of the historical sampling period is 1 day. In addition, the historical sampling period can also be a fixed period, for example, from the 1st of each month to the end of the current month, or from 0 to 24 o'clock every day. For an application, there may be multiple functions, and each interface may include multiple interfaces. Take WeChat as an example, including chat list interface, chat interface, address book interface, circle of friends interface, scan interface, shake Shake interface and wallet interface. In the process of using the application program by the user, the terminal can record the running rule of the application program under the user's operation. Exemplarily, the order in which each interface is opened may include the first interface, the second interface that is opened under the user's operation after the application is started, ... the Nth interface, which forms a sequence of opening sequences, among which the first interface It is not the startup interface that is opened by default when the application starts, but an interface that requires the user to actively open it. The same interface can be ignored after being opened for the first time, that is, it is not included in the opening sequence. The frequency with which an interface is opened may include the total number of times that the interface was opened during the historical sampling period, or the number of times that the interface was opened within a unit time period (for example, 5 minutes) during the historical sampling period. The dwell time of an interface may include the length of time that the interface is continuously displayed on the display screen. During the display, the user can view the content of the interface or slide the interface. Generally, the higher the opening order, the higher the opening frequency, or the longer the dwell time, the higher the probability that the corresponding interface becomes the target interface. According to this rule, you can comprehensively score each interface included in the application. , To obtain the probability that each interface becomes the target interface, and then determine one or more interfaces with a higher probability as the target interface.
示例性的,预测待预加载应用程序中包含的目标界面也可包括:获取当前使用场景信息,根据所述当前使用场景信息预测所述待预加载应用程序中包含的目标界面。示例性的,使用场景信息可包括如终端所处地点,终端的运行状态(如移动数据网络的开关状态、无线热点的连接状态、所连接的无线热点的身份信息、耳机插孔的插拔状态、充电状态、电池电量信息以及屏幕显示时长等等),终端中集成的传感器(如运动传感器、光线传感器、温度传感器以及湿度传感器)采集到的数据等等。这样设置能够更加准确地预测出目标界面。Exemplarily, predicting the target interface included in the application to be preloaded may also include: obtaining current usage scenario information, and predicting the target interface included in the application to be preloaded according to the current usage scenario information. Exemplarily, the use scene information may include, for example, the location of the terminal, the operating status of the terminal (such as the on / off status of the mobile data network, the connection status of the wireless hotspot, the identity information of the connected wireless hotspot, and the plugging state of the headset jack , Charging status, battery power information, and screen display time, etc.), data collected by sensors integrated in the terminal (such as motion sensors, light sensors, temperature sensors, and humidity sensors) and so on. This setting can predict the target interface more accurately.
示例性的,在所述检测到应用预加载事件被触发的情况下,确定待预加载应用程序之前,还包括:在应用程序的运行过程中,当发生界面切换时,采集使用场景信息作为训练样本,将切换后的界面记为所述训练样本对应的样本标记,根据所述训练样本和对应的样本标记对预设机器学习模型进行训练,得到界面预测模型。所述根据所述当前使用场景信息预测所述待预加载应用程序中包含的目标界面,包括将所述当前使用场景信息输入至所述界面预测模 型中,根据所述界面预测模型的输出结果确定目标界面。这样设置可以利用采集到的训练样本对机器学习模型进行训练,在需要进行目标界面预测时,根据预测模型的输出结果进行预测,预测速度快且结果准确性高。Exemplarily, before detecting that the application preloading event is triggered, before determining the application to be preloaded, the method further includes: during the application running process, when an interface switch occurs, collecting and using scene information as training For the sample, the switched interface is recorded as a sample mark corresponding to the training sample, and a preset machine learning model is trained according to the training sample and the corresponding sample mark to obtain an interface prediction model. The predicting a target interface included in the application to be preloaded according to the current usage scenario information includes inputting the current usage scenario information into the interface prediction model, and determining based on an output result of the interface prediction model. Target interface. In this setting, the machine learning model can be trained using the collected training samples. When the target interface prediction is required, the prediction is performed based on the output of the prediction model. The prediction speed is fast and the result accuracy is high.
在一实施例中,也可结合待预加载应用程序在历史采样周期内的运行过程中,所包含的各个界面被打开的顺序、被打开的频次或停留时长以及当前使用场景信息综合确定目标界面,进一步提高预测准确度。另外,也可将各个界面被打开的顺序、被打开的频次或停留时长作为训练样本的一部分,加入到上述包含使用场景信息的训练样本中,对预设机器学习模型进行训练,得到界面预测模型,使得模型的输出结果更加准确。In an embodiment, the target interface can also be comprehensively determined in combination with the order in which each interface included is opened, the frequency or duration of stay, and the current usage scenario information during the running of the application to be preloaded in the historical sampling period. To further improve prediction accuracy. In addition, the order in which each interface is opened, the frequency of opening, or the length of stay can be used as part of the training sample and added to the above training sample containing the use scene information to train the preset machine learning model to obtain the interface prediction model. To make the output of the model more accurate.
在一些实施例中,目标界面的显示异常同样可包括界面加载失败、网络数据获取失败、元素缺失以及脚本错误中的至少一项。相关说明可参考前文中相应内容,此处不再赘述。In some embodiments, the display abnormality of the target interface may also include at least one of interface loading failure, network data acquisition failure, missing element, and script error. Related descriptions can refer to the corresponding content in the previous article, and will not be repeated here.
在一些实施例中,也可针对应用程序崩溃以及界面显示异常同时进行监测。例如,在显示屏幕的坐标范围之外,对当前待预加载应用程序进行模拟启动,包括:基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示。所述在检测到模拟启动过程中出现异常的情况下,针对所述异常进行处理,包括:在检测到模拟启动过程中出现应用程序崩溃的情况下,确定崩溃原因,根据所述崩溃原因进行修复处理,并重新对所述待预加载应用程序进行模拟启动;在检测到基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示的过程中,当前应用界面显示异常的情况下,重新绘制并显示所述当前应用界面。这样设置能够更加全面的对预加载过程进行异常检测。In some embodiments, simultaneous monitoring may be performed for application crashes and abnormal interface display. For example, simulating startup of the application to be preloaded outside the coordinate range of the display screen includes drawing and displaying an application interface corresponding to the application to be preloaded based on a pre-created preloaded active window stack. . In the case where an abnormality is detected during the simulation startup process, processing the abnormality includes: when an application program crash is detected during the simulation startup process, determining the cause of the crash, and repairing according to the crash cause Processing, and re-simulating startup of the application to be preloaded; in the process of drawing and displaying the application interface corresponding to the application to be preloaded based on the pre-created preloaded active window stack, the current When the application interface is abnormal, the current application interface is redrawn and displayed. This setting can more comprehensively perform anomaly detection on the preloading process.
图5为本申请实施例提供的另一种应用程序预加载方法的流程示意图,该方法包括步骤501至步骤506。FIG. 5 is a schematic flowchart of another application preloading method according to an embodiment of the present application. The method includes steps 501 to 506.
在步骤501中,在检测到应用预加载事件被触发的情况下,确定待预加载应用程序。In step 501, when it is detected that an application preload event is triggered, an application program to be preloaded is determined.
在步骤502中,在显示屏幕的坐标范围之外,对待预加载应用程序进行模拟启动。In step 502, the application to be preloaded is simulated and started outside the coordinate range of the display screen.
在步骤503中,对模拟启动过程进行监测,判断是否出现应用程序崩溃情况,基于出现应用程序崩溃情况的判断结果,执行步骤504;基于没有出现应用程序崩溃情况的判断结果,执行步骤506。In step 503, the simulation startup process is monitored to determine whether an application crash occurs. Based on the judgment result of the application crash, step 504 is performed; based on the judgment result of no application crash, the step 506 is performed.
在步骤504中,确定崩溃原因,根据所述崩溃原因进行修复处理。In step 504, the cause of the crash is determined, and repair processing is performed according to the cause of the crash.
示例性的,若崩溃原因为存储空间不足,可清理缓存数据并关闭后台运行的预设类型的应用程序;若崩溃原因为应用版本兼容问题,可对应用程序进行自动版本升级或提示用户是否进行版本升级;若崩溃原因与当前网络状况或内存卡等因素相关,可提示用户查看网络状态或内存卡状态等。For example, if the cause of the crash is insufficient storage space, you can clear the cache data and close the preset type of application running in the background; if the cause of the crash is an application version compatibility issue, you can perform an automatic version upgrade of the application or prompt the user whether to proceed Version upgrade; if the cause of the crash is related to the current network condition or memory card, the user can be prompted to check the network status or memory card status.
在步骤505中,再次在显示屏幕的坐标范围之外,对待预加载应用程序进行模拟启动。In step 505, the application to be preloaded is simulated and started outside the coordinate range of the display screen again.
在步骤506中,在接收到待预加载应用程序中的目标应用程序的运行指令时,基于所述目标应用程序的已预加载资源启动所述目标应用程序。In step 506, when a run instruction of the target application in the application to be preloaded is received, the target application is started based on the preloaded resources of the target application.
本申请实施例提供的应用程序预加载方法,在确定了待预加载应用程序后,以显示屏幕外模拟启动的方式进行预加载,并在预加载过程中进行异常检测,若检测到发生应用崩溃情况,则根据分析出的崩溃原因采取修复措施,并重新预加载,保证预加载的正确性,在用户真正启动已进行了预加载的应用程序时,用于启动的资源已进行了部分或全部预加载,且在预加载过程中经过了异常检测,可在提高应用程序启动速度的同时,提高应用程序正常启动的概率。The application preloading method provided in the embodiment of the present application, after determining the application to be preloaded, performs preloading in the manner of an off-screen simulation startup, and performs anomaly detection during the preloading process. If an application crash is detected, Situation, take repair measures according to the analysis of the cause of the crash, and re-preload to ensure the correctness of the preload. When the user actually starts the application that has been preloaded, the resources used for startup have been partially or completely Pre-loading, and anomaly detection during the pre-loading process, can improve the startup speed of the application, while increasing the probability of the application starting normally.
图6为本申请实施例提供的又一种应用程序预加载方法的流程示意图,如图6所示,该方法包括步骤601至步骤607。FIG. 6 is a schematic flowchart of another application preloading method according to an embodiment of the present application. As shown in FIG. 6, the method includes steps 601 to 607.
在步骤601中,检测到前台应用程序变更时,利用预设应用预测模型预测候选应用程序的启动概率。In step 601, when a change in the foreground application is detected, a preset application prediction model is used to predict the startup probability of the candidate application.
本申请实施例中,应用预加载事件的触发条件可以是检测到前台应用程序变更。In the embodiment of the present application, the triggering condition of the application preload event may be detecting a change in the foreground application program.
在步骤602中,将启动概率较高的预设数值个候选应用程序确定为待预加载应用程序。In step 602, a predetermined number of candidate application programs with a higher startup probability are determined as the application programs to be preloaded.
在步骤603中,对于当前待预加载应用程序,预测目标界面,创建对应的目标进程,在预加载活动窗口堆栈中创建对应的任务栈,基于目标进程在任务栈中启动对应的活动窗口。In step 603, for the current application to be preloaded, the target interface is predicted, a corresponding target process is created, a corresponding task stack is created in the preloaded active window stack, and a corresponding active window is started in the task stack based on the target process.
在步骤604中,基于所启动的活动窗口绘制并显示目标界面。In step 604, a target interface is drawn and displayed based on the activated active window.
在步骤605中,判断目标界面是否出现显示异常,基于目标界面出现显示异常的判断结果,执行步骤606;基于目标界面没有出现显示异常的判断结果,执行步骤607。In step 605, it is determined whether the display of the target interface is abnormal, and based on the determination result of the display of the target interface, step 606 is performed; based on the determination of the display of the target interface, the display is abnormal, step 607 is performed.
在步骤606中,重新基于所启动的活动窗口绘制并显示目标界面。In step 606, the target interface is drawn and displayed again based on the activated active window.
示例性的,显示异常可包括界面加载失败、网络数据获取失败、元素缺失以及脚本错误中的至少一项。在重新进行目标界面的绘制及显示后,上述出现的显示异常情况可能不再出现,因为在界面绘制过程中,出现上述异常可能受到网络等各种因素的影响,而重新绘制时,可能导致前次异常的因素已经消失。Exemplarily, the display exception may include at least one of a loading failure on the interface, a failure to obtain network data, a missing element, and a script error. After redrawing and displaying the target interface, the above display abnormalities may no longer appear, because during the interface drawing process, the above abnormalities may be affected by various factors such as the network. When redrawing, it may cause the previous The cause of the secondary anomaly has disappeared.
示例性的,再次绘制并显示目标界面后,也可进行进一步检测,若仍出现显示异常,可进行第三次绘制并显示,本申请对检测次数以及重复绘制并显示的次数不做限定,可根据实际情况自由设置。For example, after the target interface is drawn and displayed again, further detection may be performed. If the display abnormality still occurs, the third drawing and display may be performed. The application does not limit the number of detections and the number of repeated drawing and display. Set freely according to the actual situation.
在步骤607中,在接收到所述待预加载应用程序中的目标应用程序的运行指令时,将预加载活动窗口堆栈中包含的目标应用程序对应的目标界面迁移至显示屏幕进行显示。In step 607, when receiving a running instruction of the target application in the application to be preloaded, the target interface corresponding to the target application included in the preloaded active window stack is migrated to a display screen for display.
本申请实施例可对多个预测出来的待预加载应用程序按照启动概率由高到低的顺序依次进行预加载,本流程中以一个应用程序的预加载及监测过程为例进行说明。示例性的,预设数值为4个。假设预测出来的待预加载应用程序包括微信、今日头条、支付宝和百度地图。第一个进行预加载的应用程序为微信,然后依次为今日头条、支付宝和百度地图。例如,步骤603中的当前待预加载应用程序为微信,微信对应的目标界面是朋友圈界面,在步骤605中判断朋友圈界面是否出现显示异常,若出现,则重新绘制并显示,若未出现,则可将今日头条作为新的当前待预加载应用程序,并重复执行步骤603,依次类推,再预加载支付宝和百度地图。In the embodiment of the present application, multiple predicted applications to be preloaded may be preloaded in order from high to low in startup probability. In this process, an application preloading and monitoring process is used as an example for description. Exemplarily, the preset value is four. Suppose the predicted applications to be preloaded include WeChat, Today's Headline, Alipay and Baidu Maps. The first pre-loaded application was WeChat, followed by Today's Headline, Alipay, and Baidu Map. For example, the current application to be preloaded in step 603 is WeChat, and the target interface corresponding to WeChat is the circle of friends interface. In step 605, it is determined whether the circle of friends interface displays abnormality. If it appears, redraw and display it. , You can use today ’s headline as the new current application to be preloaded, repeat step 603, and so on, and then preload Alipay and Baidu maps.
示例性的,在步骤607中,若用户点击支付宝的应用图标,则终端会接收到支付宝的运行指令,此时可将已预加载好的支付宝的目标界面(如蚂蚁森林)从预加载活动窗口堆栈中迁移至显示屏幕进行显示,在快速启动支付宝的同时,还直接打开了预测出来的用户即将进入的界面,节省用户打开目标界面的操作,此外还能够保证目标界面正常显示的成功率。For example, in step 607, if the user clicks the application icon of Alipay, the terminal will receive the Alipay operation instruction. At this time, the pre-loaded Alipay target interface (such as Ant Forest) can be removed from the pre-loaded active window. The stack is migrated to the display screen for display. When Alipay is quickly launched, it also directly opens the predicted user's upcoming interface, which saves the user from opening the target interface. In addition, it can also ensure the success rate of the target interface's normal display.
本申请实施例提供的应用程序预加载方法,在前台应用发生变化时,利用预测模型预测即将启动的待预加载应用程序,并预测待预加载应用程序中即将被用户打开的目标界面,在用户不可见的状态下,基于屏幕外的预加载Stack对目标界面进行提前绘制及显示,同时对显示异常进行实时检测,在发现显示异常时,重新绘制并显示目标界面,在用户真正启动已预加载的应用程序时,能够提高应用程序的启动速度,并直接进入目标界面,同时也保证了目标界面正常显示的成功率。The application preloading method provided by the embodiment of the present application uses a prediction model to predict an application to be preloaded to be started when a foreground application changes, and predicts a target interface to be opened by a user in the application to be preloaded. In the invisible state, the target interface is drawn and displayed in advance based on the off-screen preloaded Stack, and display anomalies are detected in real time. When an abnormal display is found, the target interface is redrawn and displayed, and the user is preloaded when the user actually starts When using an application, it can improve the startup speed of the application and directly enter the target interface, and also ensure the success rate of the target interface's normal display.
图7为本申请实施例提供的一种应用程序预加载装置的结构框图,该装置可由软件和/或 硬件实现,一般集成在终端中,可通过执行应用程序预加载方法来进行应用程序的预加载。如图7所示,该装置包括应用确定模块701,预加载模块702,预加载监测模块703以及预加载异常处理模块704。FIG. 7 is a structural block diagram of an application preloading device according to an embodiment of the present application. The device may be implemented by software and / or hardware, and is generally integrated in a terminal. The application preloading method may be performed to perform application preloading. load. As shown in FIG. 7, the device includes an application determining module 701, a preloading module 702, a preloading monitoring module 703, and a preloading exception processing module 704.
应用确定模块701,设置为在检测到应用预加载事件被触发的情况下,确定待预加载应用程序。The application determining module 701 is configured to determine an application to be preloaded when it is detected that an application preloading event is triggered.
预加载模块702,设置为对所述待预加载应用程序进行预加载操作。The preloading module 702 is configured to perform a preloading operation on the application to be preloaded.
预加载监测模块703,设置为在对所述待预加载应用程序进行预加载操作时,对预加载过程进行监测。The preload monitoring module 703 is configured to monitor a preload process when a preload operation is performed on the application to be preloaded.
预加载异常处理模块704,设置为在检测到预加载过程中出现异常的情况下,针对所述异常进行处理。The preloading exception processing module 704 is configured to process the abnormality when an abnormality is detected during the preloading process.
本申请实施例中提供的应用程序预加载装置,在检测到应用预加载事件被触发的情况下,确定待预加载应用程序,对待预加载应用程序进行预加载操作,并对预加载过程进行监测,在检测到预加载过程中出现异常的情况下,针对异常进行处理。通过采用上述技术方案,可以在应用程序预加载阶段进行异常检测,并在检测到异常的情况下进行处理,完善了预加载功能。The application preloading device provided in the embodiment of the present application determines that an application to be preloaded is detected when an application preloading event is triggered, performs a preloading operation on the preloaded application, and monitors the preloading process When an abnormality is detected during the preloading process, the abnormality is processed. By adopting the above technical solution, anomaly detection can be performed in the preloading phase of the application, and processing can be performed when an abnormality is detected, thereby improving the preloading function.
在一实施例中,所述预加载模块设置为:在显示屏幕的坐标范围之外,对所述待预加载应用程序进行模拟启动;所述预加载异常处理模块设置为:在检测到模拟启动过程中出现异常的情况下,针对所述异常进行处理。In one embodiment, the preloading module is configured to: simulate the startup of the application to be preloaded outside the coordinate range of the display screen; and the preloading exception processing module is configured to: upon detecting the simulation startup When an abnormality occurs during the process, the abnormality is processed.
在一实施例中,所述预加载异常处理模块设置为::在检测到模拟启动过程中出现应用程序崩溃的情况下,确定崩溃原因;根据所述崩溃原因进行修复处理,并重新对所述待预加载应用程序进行模拟启动。In one embodiment, the preloading exception processing module is configured to: determine the cause of the crash when an application crash is detected during the simulation startup process; perform repair processing according to the crash cause, and re-process the Wait for the pre-loaded application to simulate startup.
在一实施例中,所述崩溃原因包括存储空间不足;所述预加载异常处理模块设置为:清理缓存数据和/或关闭后台运行的预设类型的应用程序。In one embodiment, the cause of the crash includes insufficient storage space; the preloading exception processing module is configured to: clear cache data and / or close a preset type of application running in the background.
在一实施例中,所述预加载模块设置为:基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示,其中,所述预加载活动窗口堆栈对应的边界坐标位于显示屏幕的坐标范围之外。In one embodiment, the pre-loading module is configured to draw and display an application interface corresponding to the application to be pre-loaded based on a pre-created pre-loading active window stack, wherein the pre-loading active window stack The corresponding boundary coordinates are outside the coordinate range of the display screen.
在一实施例中,所述预加载异常处理模块设置为:在检测到基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示的过程中,当前应用界面显示异常的情况下,重新绘制并显示所述当前应用界面。In one embodiment, the preloading exception processing module is configured to: during the process of drawing and displaying the application interface corresponding to the application to be preloaded based on the detection of a preloaded active window stack created in advance, the current When the application interface is abnormal, the current application interface is redrawn and displayed.
在一实施例中,该装置还包括:界面预测模块,设置为在所述基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示之前,预测所述待预加载应用程序中包含的目标界面,其中,所述目标界面包括根据所述待预加载应用程序的历史运行规律预测出的即将被用户打开的界面;所述预加载模块设置为:基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的目标界面进行绘制及显示。In one embodiment, the device further includes: an interface prediction module configured to predict an application interface before drawing and displaying an application interface corresponding to the application to be preloaded based on a pre-created preloaded active window stack. The target interface included in the application to be preloaded is described, wherein the target interface includes an interface that is predicted to be opened by the user according to the historical running rule of the application to be preloaded; the preloading module is configured to: A pre-created pre-loaded active window stack is used to draw and display a target interface corresponding to the application to be pre-loaded.
本申请实施例还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时设置为执行应用程序预加载方法,该方法包括:在检测到应用预加载事件被触发的情况下,确定待预加载应用程序;对所述待预加载应用程序进行预加载操作,并对预加载过程进行监测;在检测到预加载过程中出现异常的情况下,针对所述异常进行处理。An embodiment of the present application further provides a storage medium containing computer-executable instructions. When the computer-executable instructions are executed by a computer processor, the method is configured to perform an application preloading method. The method includes: detecting an application preloading event. When triggered, determine the application to be preloaded; perform a preload operation on the application to be preloaded, and monitor the preload process; and when an abnormality is detected during the preload process, target the Handle the exception.
存储介质——任何的各种类型的存储器设备或存储设备。术语“存储介质”旨在包括:安 装介质,例如只读光盘(Compact Disc Read-Only Memory,CD-ROM)、软盘或磁带装置;计算机系统存储器或随机存取存储器,诸如动态随机存取存储器(Dynamic Random Access Memory,DRAM)、双倍数据速率随机存取存储器(Double Data Rate Random Access Memory,DDRRAM)、静态随机存取存储器(Static Random Access Memory,SRAM)、扩充数据输出随机存储器(Extended Data Output Random Access Memory,EDORAM),兰巴斯(Rambus)RAM等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储器或其组合。另外,存储介质可以位于程序在其中被执行的第一计算机系统中,或者可以位于不同的第二计算机系统中,第二计算机系统通过网络(诸如因特网)连接到第一计算机系统。第二计算机系统可以提供程序指令给第一计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机系统中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如具体实现为计算机程序)。Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as Compact Read-Only Memory (CD-ROM), floppy disks, or magnetic tape devices; computer system memory or random access memory, such as dynamic random access memory ( Dynamic Random Access Memory (DRAM), Double Data Rate Random Access Memory (DDRRAM), Static Random Access Memory (SRAM), Extended Data Output Random Access (Extended Data Output Output) Random Access Memory (EDORAM), 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. The storage medium may further include other types of memory or a combination thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network such as the Internet. The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems connected through a network. The storage medium may store program instructions (for example, embodied as a computer program) executable by one or more processors.
当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的应用程序预加载操作,还可以执行本申请任意实施例所提供的应用程序预加载方法中的相关操作。Certainly, a storage medium including computer-executable instructions provided in the embodiments of the present application is not limited to the application preloading operation described above, and may also execute the application provided by any embodiment of the present application Related operations in the preload method.
本申请实施例提供了一种终端,该终端中可集成本申请实施例提供的应用程序预加载装置。图8为本申请实施例提供的一种终端的结构示意图。终端800可以包括:存储器801,处理器802及存储在存储器801上并可在处理器802运行的计算机程序,所述处理器802执行所述计算机程序时实现如本申请实施例所述的应用程序预加载方法。The embodiment of the present application provides a terminal, and the terminal may integrate the application preloading device provided by the embodiment of the present application. FIG. 8 is a schematic structural diagram of a terminal according to an embodiment of the present application. The terminal 800 may include: a memory 801, a processor 802, and a computer program stored on the memory 801 and executable by the processor 802. When the processor 802 executes the computer program, the application program according to the embodiment of the present application is implemented. Preload method.
本申请实施例提供的终端,可以在应用程序预加载阶段进行异常检测,并在检测到异常的情况下进行处理,完善了预加载功能。The terminal provided in the embodiment of the present application can perform anomaly detection during the preloading phase of the application program, and perform processing when an abnormality is detected, thereby improving the preloading function.
图9为本申请实施例提供的另一种终端的结构示意图,该终端可以包括:壳体(图中未示出)、存储器901、中央处理器(central processing unit,CPU)902(又称处理器,以下简称CPU)、电路板(图中未示出)和电源电路(图中未示出)。所述电路板安置在所述壳体围成的空间内部;所述CPU902和所述存储器901设置在所述电路板上;所述电源电路,设置为为所述终端的各个电路或器件供电;所述存储器901,设置为存储可执行程序代码;所述CPU902通过读取所述存储器901中存储的可执行程序代码来运行与所述可执行程序代码对应的计算机程序,以实现以下步骤:在检测到应用预加载事件被触发的情况下,确定待预加载应用程序;对所述待预加载应用程序进行预加载操作,并对预加载过程进行监测;在检测到预加载过程中出现异常的情况下,针对所述异常进行处理。FIG. 9 is a schematic structural diagram of another terminal according to an embodiment of the present application. The terminal may include: a housing (not shown in the figure), a memory 901, a central processing unit (CPU) 902 (also referred to as processing). (Hereinafter referred to as CPU), a circuit board (not shown in the figure) and a power supply circuit (not shown in the figure). The circuit board is disposed in a space surrounded by the housing; the CPU 902 and the memory 901 are disposed on the circuit board; and the power supply circuit is configured to supply power to various circuits or devices of the terminal; The memory 901 is configured to store executable program code; the CPU 902 runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory 901 to implement the following steps: When an application preload event is detected, determine the application to be preloaded; perform a preload operation on the application to be preloaded, and monitor the preload process; if an abnormality is detected during the preload process, In this case, the abnormality is processed.
所述终端还包括:外设接口903、射频(Radio Frequency,RF)电路905、音频电路906、扬声器911、电源管理芯片908、输入/输出(Input/Output,I/O)子系统909、其他输入/控制设备910、触摸屏912、其他输入/控制设备910以及外部端口904,这些部件通过一个或多个通信总线或信号线907来通信。The terminal further includes: a peripheral interface 903, a radio frequency (RF) circuit 905, an audio circuit 906, a speaker 911, a power management chip 908, an input / output (I / O) subsystem 909, and other The input / control device 910, the touch screen 912, other input / control devices 910, and the external port 904, these components communicate through one or more communication buses or signal lines 907.
应该理解的是,图示终端900仅仅是终端的一个范例,并且终端900可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that the illustrated terminal 900 is only an example of the terminal, and the terminal 900 may have more or fewer components than those shown in the figure, may combine two or more components, or may 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 following describes the terminal used for application preloading provided in this embodiment in detail. The terminal uses a mobile phone as an example.
存储器901,所述存储器901可以被CPU902、外设接口903等访问,所述存储器901可 以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。 Memory 901, which can be accessed by CPU902, peripheral interface 903, etc. The memory 901 can include high-speed random access memory, and can also include non-volatile memory, such as one or more disk storage devices, flash memory devices , Or other volatile solid-state storage devices.
外设接口903,所述外设接口903可以将设备的输入和输出外设连接到CPU902和存储器901。A peripheral interface 903, which can connect input and output peripherals of the device to the CPU 902 and the memory 901.
I/O子系统909,所述I/O子系统909可以将设备上的输入输出外设,例如触摸屏912和其他输入/控制设备910,连接到外设接口903。I/O子系统909可以包括显示控制器9091和设置为控制其他输入/控制设备910的一个或多个输入控制器9092。其中,一个或多个输入控制器9092从其他输入/控制设备910接收电信号或者向其他输入/控制设备910发送电信号,其他输入/控制设备910可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器9092可以与以下任一个连接:键盘、红外端口、通用串行总线(Universal Serial Bus,USB)接口以及诸如鼠标的指示设备。I / O subsystem 909, which can connect input / output peripherals on the device, such as touch screen 912 and other input / control devices 910, to peripheral interface 903. The I / O subsystem 909 may include a display controller 9091 and one or more input controllers 9092 configured to control other input / control devices 910. Among them, one or more input controllers 9092 receive electrical signals from or send electrical signals to other input / control devices 910. Other input / control devices 910 may include physical buttons (press buttons, rocker buttons, etc.) ), Dial, slide switch, joystick, click wheel. It is worth noting that the input controller 9092 may be connected to any of the following: a keyboard, an infrared port, a universal serial bus (Universal Serial Bus, USB) interface, and a pointing device such as a mouse.
触摸屏912,所述触摸屏912是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。A touch screen 912, which is an input interface and an output interface between a user terminal and a user, and displays a visual output to the user. The visual output may include graphics, text, icons, videos, and the like.
I/O子系统909中的显示控制器9091从触摸屏912接收电信号或者向触摸屏912发送电信号。触摸屏912检测触摸屏上的接触,显示控制器9091将检测到的接触转换为与显示在触摸屏912上的用户界面对象的交互,即实现人机交互,显示在触摸屏912上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。The display controller 9091 in the I / O subsystem 909 receives an electric signal from the touch screen 912 or sends an electric signal to the touch screen 912. The touch screen 912 detects a contact on the touch screen, and the display controller 9091 converts the detected contact into interaction with a user interface object displayed on the touch screen 912, that is, realizes human-computer interaction. The user interface object displayed on the touch screen 912 may be running Icons for games, icons connected to the appropriate network, etc. It is worth noting that the device may also include a light mouse, which is a touch-sensitive surface that does not display visual output, or an extension of the touch-sensitive surface formed by a touch screen.
RF电路905,主要设置为建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。在一实施例中,RF电路905接收并发送RF信号,RF信号也称为电磁信号,RF电路905将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路905可以包括设置为执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、编译码器(COder-DECoder,CODEC)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。The RF circuit 905 is mainly configured to establish communication between a mobile phone and a wireless network (that is, a network side), and realize data reception and transmission of the mobile phone and the wireless network. For example, send and receive text messages, e-mail, and so on. In an embodiment, the RF circuit 905 receives and sends RF signals. The RF signals are also referred to as electromagnetic signals. The RF circuit 905 converts electrical signals into electromagnetic signals or converts electromagnetic signals into electrical signals, and communicates with the communication network through the electromagnetic signals. As well as other devices. RF circuit 905 may include known circuits configured to perform these functions, including but not limited to antenna systems, RF transceivers, one or more amplifiers, tuners, one or more oscillators, digital signal processors, codecs (COder-DECoder, CODEC) chipset, Subscriber Identity Module (SIM), and so on.
音频电路906,主要设置为从外设接口903接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器911。The audio circuit 906 is mainly configured to receive audio data from the peripheral interface 903, convert the audio data into an electrical signal, and send the electrical signal to the speaker 911.
扬声器911,设置为将手机通过RF电路905从无线网络接收的语音信号,还原为声音并向用户播放该声音。The speaker 911 is configured to restore a voice signal received by the mobile phone from the wireless network through the RF circuit 905 to a sound and play the sound to a user.
电源管理芯片908,设置为为CPU902、I/O子系统及外设接口所连接的硬件进行供电及电源管理。The power management chip 908 is configured to provide power and power management for the hardware connected to the CPU 902, the I / O subsystem, and peripheral interfaces.
上述实施例中提供的应用程序预加载装置、存储介质及终端可执行本申请任意实施例所提供的应用程序预加载方法,具备执行该方法相应的功能模块。未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的应用程序预加载方法。The application preloading device, the storage medium, and the terminal provided in the foregoing embodiments can execute the application preloading method provided by any embodiment of the present application, and have corresponding function modules for executing the method. For technical details not described in detail in the foregoing embodiments, reference may be made to an application preloading method provided in any embodiment of the present application.
Claims (20)
- 一种应用程序预加载方法,包括:An application preloading method includes:在检测到应用预加载事件被触发的情况下,确定待预加载应用程序;Determine the application to be preloaded when it is detected that the application preload event is triggered;对所述待预加载应用程序进行预加载操作,并对预加载过程进行监测;Performing a preloading operation on the application to be preloaded, and monitoring a preloading process;在检测到预加载过程中出现异常的情况下,针对所述异常进行处理。When an abnormality is detected during the preloading process, the abnormality is processed.
- 根据权利要求1所述的方法,其中,The method according to claim 1, wherein:所述对所述待预加载应用程序进行预加载操作,包括:The preloading the application to be preloaded includes:在显示屏幕的坐标范围之外,对所述待预加载应用程序进行模拟启动;Outside the coordinate range of the display screen, performing a simulation start on the application to be preloaded;在检测到预加载过程中出现异常的情况下,针对所述异常进行处理,包括:When an abnormality is detected during the preloading process, processing the abnormality includes:在检测到模拟启动过程中出现异常的情况下,针对所述异常进行处理。When an abnormality is detected during the simulation startup process, the abnormality is processed.
- 根据权利要求2所述的方法,其中,所述在检测到模拟启动过程中出现异常的情况下,针对所述异常进行处理,包括:The method according to claim 2, wherein, when an abnormality is detected during the simulation startup process, processing the abnormality comprises:在检测到模拟启动过程中出现应用程序崩溃的情况下,确定崩溃原因;In the case of detecting an application crash during the simulation startup process, determine the cause of the crash;根据所述崩溃原因进行修复处理,并重新对所述待预加载应用程序进行模拟启动。Perform repair processing according to the cause of the crash, and re-simulate start the application to be preloaded.
- 根据权利要求3所述的方法,其中,所述崩溃原因包括存储空间不足;The method according to claim 3, wherein the cause of the crash comprises insufficient storage space;所述根据所述崩溃原因进行修复处理包括:清理缓存数据和关闭后台运行的预设类型的应用程序中的至少一种。The performing repair processing according to the cause of the crash includes at least one of cleaning cache data and closing a preset type of application running in the background.
- 根据权利要求2所述的方法,其中,所述在显示屏幕的坐标范围之外,对当前待预加载应用程序进行模拟启动,包括:The method according to claim 2, wherein the simulating startup of an application program to be currently preloaded outside the coordinate range of the display screen comprises:基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示,其中,所述预加载活动窗口堆栈对应的边界坐标位于显示屏幕的坐标范围之外。The application interface corresponding to the application to be preloaded is drawn and displayed based on a 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.
- 根据权利要求5所述的方法,其中,所述在检测到模拟启动过程中出现异常的情况下,针对所述异常进行处理,包括:The method according to claim 5, wherein, when an abnormality is detected during the simulation startup process, processing the abnormality comprises:在检测到基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示的过程中,当前应用界面显示异常的情况下,重新绘制并显示所述当前应用界面。During the process of drawing and displaying the application interface corresponding to the application to be preloaded based on the pre-created preloaded active window stack, if the current application interface is displayed abnormally, the current application is redrawn and displayed interface.
- 根据权利要求6所述的方法,在所述基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示之前,还包括:The method according to claim 6, before the drawing and displaying the application interface corresponding to the application to be preloaded based on the pre-created preloading active window stack, further comprising:预测所述待预加载应用程序中包含的目标界面,其中,所述目标界面包括根据所述待预加载应用程序的历史运行规律预测出的即将被用户打开的界面;Predicting a target interface included in the application to be preloaded, wherein the target interface includes an interface that is predicted to be opened by a user according to a historical running rule of the application to be preloaded;所述基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示,包括:The drawing and displaying the application interface corresponding to the application to be preloaded based on a pre-created preloading active window stack includes:基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的目标界面进行绘制及显示。Based on the pre-created pre-loaded active window stack, the target interface corresponding to the application to be pre-loaded is drawn and displayed.
- 根据权利要求7所述的方法,预测所述待预加载应用程序中包含的目标界面,还包括:The method according to claim 7, predicting a target interface included in the application to be preloaded, further comprising:获取当前使用场景信息,根据所述当前使用场景信息预测所述待预加载应用程序中包含的目标界面。Acquire current use scene information, and predict a target interface included in the application to be preloaded according to the current use scene information.
- 根据权利要求6所述的方法,其中,所述目标界面为至少一个。The method according to claim 6, wherein the target interface is at least one.
- 根据权利要求6所述的方法,其中,所述目标界面根据所述待预加载应用程序在历史采样周期内的运行过程中,所包含的多个界面被打开的顺序、被打开的频次或停留时长以 及当前使用场景信息确定。The method according to claim 6, wherein the target interface is based on an order in which a plurality of interfaces are opened, a frequency of opening, or staying during the running of the application to be preloaded in a historical sampling period. The duration and current use scene information are determined.
- 根据权利要求1所述的方法,其中,在所述检测到应用预加载事件被触发的情况下,确定待预加载应用程序之前,还包括:The method according to claim 1, wherein, in a case that the application preloading event is detected to be triggered, before determining the application program to be preloaded, further comprising:在应用程序的运行过程中,在发生界面切换的情况下,采集使用场景信息作为训练样本,将切换后的界面记为所述训练样本对应的样本标记,根据所述训练样本和对应的样本标记对预设机器学习模型进行训练,得到界面预测模型。In the running process of the application, in the case of interface switching, the scene information is collected as training samples, and the switched interface is recorded as a sample mark corresponding to the training sample, and according to the training sample and the corresponding sample mark The preset machine learning model is trained to obtain the interface prediction model.
- 一种应用程序预加载装置,包括:An application preloading device includes:应用确定模块,设置为在检测到应用预加载事件被触发的情况下,确定待预加载应用程序;An application determining module, configured to determine an application to be preloaded when detecting that an application preloading event is triggered;预加载模块,设置为对所述待预加载应用程序进行预加载操作;A preloading module configured to perform a preloading operation on the application to be preloaded;预加载监测模块,设置为在对所述待预加载应用程序进行预加载操作的情况下,对预加载过程进行监测;A preloading monitoring module configured to monitor a preloading process when a preloading operation is performed on the application to be preloaded;预加载异常处理模块,设置为在检测到预加载过程中出现异常的情况下,针对所述异常进行处理。The preloading exception processing module is configured to process the abnormality when an abnormality is detected during the preloading process.
- 根据权利要求12所述的装置,其中,The apparatus according to claim 12, wherein:所述预加载模块设置为:在显示屏幕的坐标范围之外,对所述待预加载应用程序进行模拟启动;The preloading module is configured to: simulate the startup of the application to be preloaded outside the coordinate range of the display screen;所述预加载异常处理模块设置为:在检测到模拟启动过程中出现异常的情况下,针对所述异常进行处理。The preloading exception processing module is configured to: when an abnormality is detected during the simulation startup process, handle the abnormality.
- 根据权利要求13所述的装置,其中,所述预加载异常处理模块设置为:The apparatus according to claim 13, wherein the preloading exception processing module is configured to:在检测到模拟启动过程中出现应用程序崩溃的情况下,确定崩溃原因;In the case of detecting an application crash during the simulation startup process, determine the cause of the crash;根据所述崩溃原因进行修复处理,并重新对所述待预加载应用程序进行模拟启动。Perform repair processing according to the cause of the crash, and re-simulate start the application to be preloaded.
- 根据权利要求14所述的装置,其中,所述崩溃原因包括存储空间不足;The apparatus according to claim 14, wherein the cause of the crash includes insufficient storage space;所述预加载异常处理模块设置为:清理缓存数据和关闭后台运行的预设类型的应用程序中的至少一种。The preloading exception processing module is configured to: at least one of clearing cache data and closing a preset type of application running in the background.
- 根据权利要求13所述的装置,其中,所述预加载模块设置为:The apparatus according to claim 13, wherein the preloading module is configured to:基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示,其中,所述预加载活动窗口堆栈对应的边界坐标位于显示屏幕的坐标范围之外。The application interface corresponding to the application to be preloaded is drawn and displayed based on a 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.
- 根据权利要求16所述的装置,其中,所述预加载异常处理模块设置为:The apparatus according to claim 16, wherein the preloading exception processing module is configured to:在检测到基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示的过程中,当前应用界面显示异常的情况下,重新绘制并显示所述当前应用界面。During the process of drawing and displaying the application interface corresponding to the application to be preloaded based on the pre-created preloaded active window stack, if the current application interface is displayed abnormally, redraw and display the current application interface.
- 根据权利要求17所述的装置,还包括界面预测模块;The apparatus according to claim 17, further comprising an interface prediction module;所述界面预测模块设置为:在所述基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的应用界面进行绘制及显示之前,预测所述待预加载应用程序中包含的目标界面,其中,所述目标界面包括根据所述待预加载应用程序的历史运行规律预测出的即将被用户打开的界面;The interface prediction module is configured to: before drawing and displaying an application interface corresponding to the application to be preloaded based on a pre-created preloading active window stack, predicting the A target interface, where the target interface includes an interface that is predicted to be opened by a user according to a historical running rule of the application to be preloaded;所述预加载模块设置为:基于预先创建的预加载活动窗口堆栈,对所述待预加载应用程序对应的目标界面进行绘制及显示。The preloading module is configured to draw and display a target interface corresponding to the application to be preloaded based on a preloaded active window stack created in advance.
- 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如权利要求1-11中任一所述的应用程序预加载方法。A computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements the method for preloading an application program according to any one of claims 1-11.
- 一种终端,包括存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1-11任一所述的应用程序预加载方法。A terminal includes a memory, a processor, and a computer program stored on the memory and executable by the processor. When the processor executes the computer program, the application program according to any one of claims 1-11 is preloaded. method.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810490609.XA CN108762837B (en) | 2018-05-21 | 2018-05-21 | Application program preloading method and device, storage medium and terminal |
CN201810490609.X | 2018-05-21 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019223540A1 true WO2019223540A1 (en) | 2019-11-28 |
Family
ID=64007461
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/086132 WO2019223540A1 (en) | 2018-05-21 | 2019-05-09 | Application program preloading method and apparatus, storage medium, and terminal |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108762837B (en) |
WO (1) | WO2019223540A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022177061A1 (en) * | 2021-02-16 | 2022-08-25 | 삼성전자주식회사 | Electronic device preloading abnormal application in background, and operation method thereof |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108762837B (en) * | 2018-05-21 | 2020-07-10 | Oppo广东移动通信有限公司 | Application program preloading method and device, storage medium and terminal |
CN110083476A (en) * | 2019-04-23 | 2019-08-02 | 努比亚技术有限公司 | Application control method, terminal and computer readable storage medium |
CN111198725B (en) * | 2019-12-30 | 2023-02-28 | 掌阅科技股份有限公司 | Application starting processing method, computing equipment and computer storage medium |
CN111562913B (en) * | 2020-04-28 | 2023-03-14 | 抖音视界有限公司 | Method, device and equipment for pre-creating view component and computer readable medium |
CN111831373A (en) * | 2020-06-09 | 2020-10-27 | 上海容易网电子商务股份有限公司 | Detection processing method for application starting state of android interactive screen |
CN114201226A (en) * | 2020-08-26 | 2022-03-18 | 北京小米移动软件有限公司 | Application starting method and device, electronic equipment and storage medium |
CN112732363A (en) * | 2021-01-20 | 2021-04-30 | 维沃移动通信有限公司 | H5 page opening method and device and electronic equipment |
CN113127053A (en) * | 2021-04-29 | 2021-07-16 | 平安国际智慧城市科技股份有限公司 | Application environment parameter configuration method and device, computer equipment and storage medium |
CN113176922B (en) * | 2021-04-30 | 2024-05-24 | 上海云扩信息科技有限公司 | Universal interface element automatic detection system |
CN113282362B (en) * | 2021-05-20 | 2024-07-05 | Oppo广东移动通信有限公司 | Application management method, device, storage medium and terminal |
CN114020354A (en) * | 2021-10-29 | 2022-02-08 | 努比亚技术有限公司 | Application program starting method, terminal and computer readable storage medium |
CN117874772B (en) * | 2024-03-11 | 2024-06-11 | 广州锦高信息科技有限公司 | Application software vulnerability scanning method and system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9513888B1 (en) * | 2014-01-30 | 2016-12-06 | Sprint Communications Company L.P. | Virtual preloads |
CN106227592A (en) * | 2016-09-08 | 2016-12-14 | 腾讯数码(天津)有限公司 | Task call method and task call device |
CN106406966A (en) * | 2016-10-31 | 2017-02-15 | 维沃移动通信有限公司 | Preloading method for application and mobile terminal |
CN106681758A (en) * | 2016-12-07 | 2017-05-17 | 广东欧珀移动通信有限公司 | Method and device for starting WiFi hotspot |
CN106919313A (en) * | 2017-04-21 | 2017-07-04 | 维沃移动通信有限公司 | The startup method and mobile terminal of a kind of application program |
CN108762837A (en) * | 2018-05-21 | 2018-11-06 | Oppo广东移动通信有限公司 | Application program preloads method, apparatus, storage medium and terminal |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8930846B2 (en) * | 2010-10-01 | 2015-01-06 | Z124 | Repositioning applications in a stack |
CN103369508B (en) * | 2013-06-25 | 2016-12-28 | 华为技术有限公司 | Data load method and terminal unit |
CN104572058B (en) * | 2013-10-28 | 2019-03-29 | 联想(北京)有限公司 | A kind of information processing method and electronic equipment |
US20160044139A1 (en) * | 2014-08-07 | 2016-02-11 | Hsiu-Ping Lin | Methods and systems for communications between apps and virtual machines |
US10073583B2 (en) * | 2015-10-08 | 2018-09-11 | Adobe Systems Incorporated | Inter-context coordination to facilitate synchronized presentation of image content |
-
2018
- 2018-05-21 CN CN201810490609.XA patent/CN108762837B/en not_active Expired - Fee Related
-
2019
- 2019-05-09 WO PCT/CN2019/086132 patent/WO2019223540A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9513888B1 (en) * | 2014-01-30 | 2016-12-06 | Sprint Communications Company L.P. | Virtual preloads |
CN106227592A (en) * | 2016-09-08 | 2016-12-14 | 腾讯数码(天津)有限公司 | Task call method and task call device |
CN106406966A (en) * | 2016-10-31 | 2017-02-15 | 维沃移动通信有限公司 | Preloading method for application and mobile terminal |
CN106681758A (en) * | 2016-12-07 | 2017-05-17 | 广东欧珀移动通信有限公司 | Method and device for starting WiFi hotspot |
CN106919313A (en) * | 2017-04-21 | 2017-07-04 | 维沃移动通信有限公司 | The startup method and mobile terminal of a kind of application program |
CN108762837A (en) * | 2018-05-21 | 2018-11-06 | Oppo广东移动通信有限公司 | Application program preloads method, apparatus, storage medium and terminal |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022177061A1 (en) * | 2021-02-16 | 2022-08-25 | 삼성전자주식회사 | Electronic device preloading abnormal application in background, and operation method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN108762837B (en) | 2020-07-10 |
CN108762837A (en) | 2018-11-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019223540A1 (en) | Application program preloading method and apparatus, storage medium, and terminal | |
CN108595230B (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 | |
CN108762843B (en) | Application program preloading method and device, storage medium and intelligent terminal | |
CN108647055B (en) | Application program preloading method and device, storage medium and terminal | |
CN108614722B (en) | Application program preloading method and device, storage medium and terminal | |
CN108363593B (en) | Application program preloading method and device, storage medium and terminal | |
WO2019233241A1 (en) | Method and apparatus for starting application program, and storage medium and terminal | |
EP3579104B1 (en) | Method and apparatus for establishing an application prediction model, storage medium and terminal | |
CN108710513B (en) | Application program starting method and device, storage medium and terminal | |
CN108762831B (en) | Application program preloading method and device, storage medium and terminal | |
US11099861B2 (en) | Method for preloading application, storage medium, and terminal | |
WO2019228134A1 (en) | Application program pre-loading method and device, storage medium, and terminal | |
CN111176960B (en) | User operation behavior tracking method, device, equipment and storage medium | |
CN108804153B (en) | Application program preloading method and device, storage medium and terminal | |
WO2019218885A1 (en) | Application program pre-loading method and apparatus, and storage medium and intelligent terminal | |
CN108647052A (en) | Application program preloads method, apparatus, storage medium and terminal | |
WO2019218886A1 (en) | Application pre-loading management method, device, storage medium and smart 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 | |
CN108762836B (en) | Management method and device for preloaded application, storage medium and intelligent terminal | |
WO2019228149A1 (en) | Collection method and apparatus for prediction sample, and storage medium and smart terminal | |
CN108664286B (en) | Application program preloading method and device, storage medium and mobile terminal | |
CN108762838B (en) | Application program preloading method and device, storage medium and terminal | |
US20140082483A1 (en) | Method and system for restoring closed webpages |
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: 19807755 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: 19807755 Country of ref document: EP Kind code of ref document: A1 |