Application startup method and electronic device

By introducing an application startup method in electronic devices, the problem of long response time during the fast startup process is solved, and faster application startup and better user experience is achieved.

CN118444995BActive Publication Date: 2025-04-15HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311869935.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-04-15
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

During the quick startup process, the application response time is long, which affects the user experience.

Method used

By introducing an application startup method in the electronic device, in response to the user's first operation, the desktop process sends a startup message to the system service process, the system service process starts the first activity and creates a transition component, the system interface process adds and draws a startup window for the first activity, and when the transition component is ready, the desktop process notifies the desktop process to execute the transition component.

Benefits of technology

Shorten the response time of application quick startup, improve user experience, and reduce user waiting time by adding and drawing startup windows and transition components in advance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118444995B_ABST
    Figure CN118444995B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides an application startup method and an electronic device, the method is applied to an electronic device, the electronic device includes a system service process, a system interface process and a desktop process, the method includes: in response to a first operation of a user, the desktop process sends a startup message to the system service process, wherein the startup message is used to indicate that a first function of a first application is started through a shortcut, and the interface corresponding to the first function is an interface displayed after the first application loads n activities in sequence; in response to the startup message, the system service process starts the first activity of the n activities and creates a first transition component, wherein in the process of starting the first activity, the system interface process adds and draws a first startup window for the first activity; in response to the first transition component being ready, the system service process notifies the desktop process to execute the first transition component; the desktop process executes the first transition component. The method can improve the response speed when the application is started.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to an application startup method and an electronic device. Background Art

[0002] With the development of electronic devices, there are more and more types of application programs (applications, APPs, or applications for short) that can be installed in electronic devices, and the functions of the applications are becoming more and more abundant.

[0003] Users can start an application by clicking on a desktop icon. In order to provide users with a one-step direct access effect, some applications provide a quick start method. For example, when a user long presses an application icon on the desktop, the desktop will display some function options of the application. Clicking a function option can directly open the function of the application. This process is the quick start of the application.

[0004] However, some applications have a slow startup response problem during the quick startup process, which affects the user experience. Summary of the invention

[0005] The present application provides an application startup method and an electronic device, which can shorten the response time of application quick startup and improve user experience.

[0006] In a first aspect, the present application provides an application startup method, which is applied to an electronic device, wherein the electronic device includes a system service process, a system interface process and a desktop process, and the method includes: in response to a first operation of a user, the desktop process sends a startup message to the system service process, wherein the startup message is used to indicate that a first function of a first application is started through a shortcut, and an interface corresponding to the first function is an interface displayed after the first application loads n activities in sequence, where n is an integer greater than 1; in response to the startup message, the system service process starts the first activity of the n activities and creates a first transition component, wherein, in the process of starting the first activity, the system interface process adds and draws a first startup window for the first activity; in response to the first transition component being ready, the system service process notifies the desktop process to execute the first transition component; in response to the notification of the system service process, the desktop process executes the first transition component.

[0007] Optionally, transition component readiness can be implemented via the onTransactionReady() function, also known as transitionReady.

[0008] In the application startup method provided in the first aspect of the present application, in the process of starting the first activity, the system interface process adds and draws the first startup window for the first activity. And the system service process creates the first transition component, which is processed by the system interface process and the desktop process, and finally executes the first transition component to display the transition page. The entire process of adding the first startup window and displaying the transition page is synchronized with the life cycle of the process execution activity of the first application, without relying on the life cycle of the first application, which greatly shortens the response time. Moreover, in this scheme, the first startup window is added earlier, so the transition component starts to execute earlier, and the execution of the transition component can be executed concurrently with the process of the first application execution activity execution life cycle, so the transition component can be executed earlier, the application activity is loaded, and the user operation can be responded to when the interface starts to be displayed, without the user waiting, thereby improving the user experience.

[0009] In a possible implementation, the moment when the first transition component is ready is between a first moment and a second moment, the first moment is the moment when the first startup window is added, and the second moment is the moment when the first startup window is finished drawing.

[0010] That is to say, the first transition component is ready, which need not be triggered by the first startup window finishing drawing (finishDrawing), but can be triggered during the first startup window drawing process (onTransactionReady). In this way, advancing the moment of the first transition component being ready can further advance the time of displaying the transition page, further shorten the response time of application startup, and further improve the user experience.

[0011] In one possible implementation, the system interface process adds and draws a first startup window for the first activity, including: the system interface process calls the addStartingWindow() function to add the first startup window; the system interface process calls the doFrame() function to draw the frame of the first startup window; after the system interface process completes drawing the frame of the first startup window, the system service process requests the system service process to add display to the first startup window; the system service process calls the addToDisplay() function to add display to the first startup window; after adding the display to the first startup window, the system service process triggers the readiness of the first transition component.

[0012] In this implementation, the system service process executes addToDisplay(), that is, the first startup window is added and displayed, triggering the readiness of the first transition component, thereby advancing the time when the first transition component is ready and the time to display the transition page, further shortening the response time of the application startup and further improving the user experience.

[0013] In one possible implementation, the startup message carries information about the first application, and before the system service process starts the first activity of n activities, the method also includes: if it is determined that the startup message carries the first information, the system service process determines whether the first application meets the preset conditions based on the information of the first application; the first information is used to indicate that the first function is started through a shortcut; if it is determined that the first application meets the preset conditions, the system service process sets a first identifier, and the first identifier is used to indicate that the current scene is a quick startup scene, and the currently started activity is the first activity of the application.

[0014] The first identifier may be, for example, a shortcut function ID.

[0015] In this implementation, before starting the first activity, it is determined whether the first application meets the preset conditions to determine whether it meets the quick start scenario. If the preset conditions are met, it means that the current scenario is a quick start scenario, and the first identifier is set. Moreover, this solution can set the first identifier only before starting the first activity, so the first identifier can also indicate that the activity to be started is the first activity. By setting the first identifier, it is convenient to quickly and accurately identify the quick start scenario and the first activity based on the first identifier, so that the subsequent processes of this solution can be executed more accurately, improving the operating efficiency and accuracy of the system.

[0016] In a possible implementation, the preset condition includes one or more of the following: the type of the first application is in a preset application whitelist; the package of the first application is not in a preset package blacklist; the first information is not in a function blacklist.

[0017] In this implementation, by setting an application type whitelist and a package blacklist, applications that are not applicable to the process of this solution can be filtered out, preventing these applications from entering the process of this solution and failing to execute, thereby preventing application startup failure. In other words, this method improves the reliability and stability of system operation.

[0018] In a possible implementation manner, the first identifier is the first information.

[0019] That is, the current scene can be directly identified as a quick start scene and the currently started activity can be identified as the first activity of the application through the first information carried in the start message. In this way, the number of identifications can be reduced, the algorithm can be simplified, and the system operation efficiency can be improved.

[0020] In a possible implementation, before the system interface process adds and draws the first startup window for the first activity, the method further includes: the system service process determines that the first identifier exists.

[0021] That is to say, the system service process reads the first identifier. If the first identifier is read, it means that the current scene is a quick launch scene, and the currently launched activity is the first activity of the application. Therefore, the system interface process adds and draws the first launch window for the first activity. In this way, the addition and drawing of the first launch window can be further limited to the launch process of the first activity in the quick launch scene, improving the accuracy of adding the launch window, and then improving the accuracy and stability of application launch.

[0022] In a possible implementation, the method also includes: after the system interface process starts to add a first startup window for the first activity, the system service process determines whether the type parameter of the first startup window is the first type, and determines whether there is a first identifier, the first type indicating that the startup window has not been added; if the type parameter of the first startup window is the first type and there is a first identifier, the system service process sets a second identifier for the first startup window, and modifies the type parameter of the first startup window to a splash type; if the type parameter of the first startup window is not the first type and there is a first identifier, the system service process determines whether there is a first result, the first result indicating that adding the startup window has failed; if the first result exists, the system service process sets the second identifier; if the first result does not exist, the system service process clears the first identifier.

[0023] The first type may be, for example, NONE.

[0024] That is to say, if the type parameter shows that the startup window has not been added, then it means that the native process of the system has not added the startup window. Further, if there is a first identifier, it means that the startup window is added by the process of this solution (i.e., the optimized process), and the system service process sets a second identifier to identify the first startup window as the startup window added by the process of this solution. This facilitates the subsequent rapid and accurate identification of the startup window, ensures the accurate management of the subsequent startup window, and improves the accuracy, reliability and stability of the solution. Moreover, in the case where the startup window is added to the process of this solution, the first identifier is cleared, so that the subsequent process enters the native process of the system, prevents application startup errors, improves the accuracy of the process execution of this solution, and then improves the stability of the system operation. In addition, the type parameter of the startup window is corrected to a splash type to improve the accuracy of subsequent process execution. Moreover, the splash type startup window can not only be applied to hot starts, but also to cold starts, thereby improving the scope of application of the solution.

[0025] In one possible implementation, the method also includes: in the process of starting the first activity, the system service process clears the activities in each task stack in the electronic device; when it is determined that the first identifier exists, the system service process creates a first source record corresponding to the first activity, uses the activity record of the first activity as the value of the first source record, and adds the first source record to the source record set.

[0026] The existence of the first identifier indicates that the current scene is a quick launch scene, and the currently launched activity is the first activity. In this case, the first source record corresponding to the first activity is created, and the first source record is assigned a value and added to the source record set. The source record represents the source activity of the launch activity, which can be used as a basis for subsequent identification of whether the activity is the first activity or other activities other than the first activity, and as a basis for subsequent window transfer, improving the accuracy and convenience of the execution of the process of this solution.

[0027] Moreover, in this implementation, the activities in each task stack in the electronic device are cleared, so that during the quick start process, there are no historical activities in each task stack, and there will be no reuse of the already started activities. In this way, when the second and subsequent activities are started, when the source record is transferred, there will be no empty value, which improves the accuracy of the algorithm operation, and there is no need to find the activity that currently holds the startup window, which simplifies the algorithm operation process and improves the efficiency of the algorithm operation.

[0028] In one possible implementation, the electronic device also includes a process of a first application, and the method also includes: during the execution of the life cycle of the first activity, the process of the first application determines whether the interface corresponding to the first activity is a visual interface; if the interface corresponding to the first activity is a visual interface, the system service process sets the value of the visual identifier of the first activity to the first value.

[0029] The first value may be, for example, "yes" or "true".

[0030] In one possible implementation, the method further includes: in the activity layout stage of the first activity, if it is determined that the custom interface includes a view, or it is determined that there is a background layout and the transparency is not 0, then the process of the first application determines that the interface corresponding to the first activity is a visual interface.

[0031] In one possible implementation, the method also includes: after receiving the first completion indication of the process of the first application, the system service process determines whether a delayed removal condition is met, and the first completion indication is used to indicate that the first activity has completed drawing; if the delayed removal condition is met, the system service process delays the removal of the first startup window and clears the first identifier, the second identifier, the source record set and the first value; if the delayed removal condition is not met, the system service process removes the first startup window.

[0032] Optionally, the first completion indication may be given by the process of the first application to the system service process through a finishDrawing() function.

[0033] In a possible implementation, the delayed removal condition includes: the value of the visual identifier of the first activity is not the first value, and the second identifier exists.

[0034] In the above-mentioned implementations, it is determined whether to delay the removal of the window by identifying whether the interface corresponding to the activity is a visual interface. If the value of the visual identifier is not the first value, and there is a second identifier, it means that the interface corresponding to the current activity is an interface that is not perceptible to the user, and the first startup window is a startup window added by the process of this solution, then there is no need to remove the startup window, and thus the removal of the startup window is delayed. If the value of the visual identifier is the first value, or there is no second identifier, it means that the interface corresponding to the current activity is an interface that is perceptible to the user, or the first startup window is not a startup window added by the process of this solution, then the startup window is removed. In this way, the startup window can be removed in time when the first application needs to display the interface, to prevent disruption of the normal startup logic of the application and to prevent affecting the user experience. Moreover, the startup window added by the native process can be removed normally to prevent disruption of the normal execution logic of the native process, thereby improving system stability and reliability.

[0035] Moreover, after removing the startup window, clearing the various identifiers added by the process of this solution can prevent the process from being disordered in the subsequent operation, thereby improving the stability and reliability of the system. In addition, clearing the various identifiers added by the process of this solution can also prevent errors when quickly starting the first function of the first application next time, thereby improving the reliability of system operation.

[0036] In addition, the value of the visual identifier can accurately and quickly determine whether it is a visual interface, thereby improving the speed and accuracy of the execution of the process of this solution.

[0037] In a possible implementation, the delayed removal condition further includes one or more of the following: the startup window held by the first activity has not been removed; the current delayed removal times threshold is greater than 0; and the source record exists in the source record set.

[0038] The delayed removal condition in this implementation can prevent the startup window of the same activity from being delayed and removed multiple times, that is, prevent the process from being stuck at the same activity all the time, causing startup jams, and improve user experience.

[0039] In a possible implementation, the first transition component has a dynamic effect attribute.

[0040] If the first transition component has a dynamic effect attribute, the first transition component will be displayed with a dynamic effect, which can improve the vividness of the interface display and enhance the user's visual experience.

[0041] In one possible implementation, the animation corresponding to the first transition component is an icon enlargement animation. The method also includes: before submitting the first transition component to the desktop process, when it is determined that the first transition component is the transition component corresponding to the first activity, the system service process cancels the transparent attribute of the first transition component.

[0042] In this implementation, before submitting the first transition component to the desktop process, the transparent property of the first transition component corresponding to the first activity is canceled, so that the desktop process can execute the icon enlargement animation, improve the animation effect, and enhance the user's visual experience.

[0043] In a possible implementation, the method further includes: in the process of starting the first activity, the system service process determines that the first transition component is the transition component corresponding to the first activity based on the activity record corresponding to the first activity collected in the first transition component.

[0044] In this implementation, through the activity record, it is possible to simply and quickly determine whether the transition component is the transition component corresponding to the first activity. Specifically, if the activity record collected by the transition component records the record of the first activity, it means that the transition component is the transition component corresponding to the first activity.

[0045] In one possible implementation, the electronic device also includes a process of a first application, and the method also includes: in response to the system service process starting the first activity, the process of the first application executes the life cycle of the first activity; in the process of executing the life cycle of the first activity, the process of the first application requests the system service process to start a second activity among n activities; in response to the request of the first application process, the system service process starts the second activity and creates a second transition component; in the process of starting the second activity, the system service process passes the first start window to the second activity.

[0046] In this implementation, when the second activity is started, the first start window is transferred from the first activity to the second activity, so that the transition page can be continuously displayed without screen flashing, thereby improving the user's visual experience.

[0047] In a possible implementation, the second activity is started after the first transition component is ready, and / or the second activity is started after the layer display of the first starting window is completed.

[0048] The completion time of layer display is also the time when the showSurface() function is executed.

[0049] In this implementation, the start time of the second activity is limited to after the first transition component is ready, so as to prevent the second activity from affecting the loading of the first transition component, preventing the display of the transition page from being affected, and thus preventing the delayed start response. In addition, the start time of the second activity is limited to after the completion time of the layer display of the first start window, so as to prevent the second activity from affecting the drawing and display of the start window, preventing the display of the transition page from being affected, and thus preventing the delayed start response.

[0050] In one possible implementation, the method also includes: in the process of starting the first activity, the system service process sets a conditional variable, the conditional variable includes: the first transition component has been submitted to the desktop process, and the layer display of the first startup window has been completed; the system service process starts the second activity, including: when it is determined that the conditional variable has been unlocked, the system service process starts the second activity.

[0051] In this implementation, by setting the conditional variable, the start time of the second activity can be accurately limited, further preventing the display of the transition page from being affected.

[0052] In one possible implementation, the method also includes: in the process of starting the first activity, the system service process sets the effective duration; if the condition variable is satisfied within the effective duration from the moment the condition variable is set, the system service process determines that the condition variable has been unlocked; if the condition variable is still not satisfied after the effective duration from the moment the condition variable is set, the system service process unlocks the condition variable.

[0053] In this implementation, by setting the effective time, the condition variable is automatically unlocked when the condition variable is not satisfied after the effective time. This can prevent the condition variable from being unlocked due to abnormal process execution, which in turn causes the subsequent activities to be unable to start, thereby improving system stability.

[0054] In one possible implementation, before the system service process passes the first startup window to the second activity, the method also includes: in the process of starting the second activity, when it is determined that there is a source record in the source record set, the system service process sets a second source record corresponding to the second activity and assigns a value to the second source record; the source record is used to represent the previous activity that starts the third activity, and the third activity is any one of the n activities; and the second source record is added to the source record set.

[0055] In this implementation, by setting the second source record, it is convenient to quickly and accurately determine whether the activity is the first activity or another activity.

[0056] In a possible implementation, assigning a value to the second source record includes: the system service process transfers the value of the first source record to the second source record, where the first source record is a source record corresponding to the first activity.

[0057] In a possible implementation, the system service process transfers the first startup window to the second activity, including: obtaining a second source record from a source record set; and transferring the first startup window from the first activity to the second activity according to a value of the second source record.

[0058] In this implementation, the startup window is transferred based on the source record, so that the startup window can be transferred to the current activity quickly and accurately.

[0059] In one possible implementation, after the system service process passes the first startup window to the second activity, the method also includes: in the process of starting the second activity, if the first activity and the second activity do not belong to the same task stack, the system service process displays the layer of the target task stack to which the second activity belongs, migrates the layer of the target task stack to the desktop animation layer as a sublayer of the desktop animation layer, and adjusts the layer of the first startup window to the top layer of the desktop animation layer.

[0060] The first activity and the second activity belong to different task stacks, that is, the current launch window is transferred across task stacks. In this case, the layer of the target task stack to which the second activity belongs is displayed. And the way to display the target task stack is: migrate to the desktop motion effect layer, and display it as a sublayer of the desktop motion effect layer. In other words, the layer of the target task stack is displayed as part of the motion effect display. In this way, the layer of the target task stack will change with the change of the motion effect. For example, the motion effect is an icon enlargement motion effect, then, as the icon is enlarged, the layer of the target task stack is gradually enlarged. In this way, the content related to the first application in the interface is displayed uniformly, and the overlapping of sub-interfaces of different sizes, or the desktop is transparent or the screen flashes, etc., are prevented, thereby improving the user's visual experience.

[0061] In addition, the level of the first startup window is adjusted to the top layer of the desktop animation layer. In this way, other layers in the task stack can be prevented from covering the startup window. For example, when the native process also successfully adds a startup window, the startup window of the native system can be prevented from covering the first startup window added by the process of this solution, that is, the first startup window is prevented from being blocked, the effect of the transition page is prevented from being affected, and the user experience is improved.

[0062] In a possible implementation, the method further includes: after the desktop process completes executing the transition component, the system service process migrates the layer of the target task stack back to the parent layer of the target task stack.

[0063] In this implementation, after the animation is executed, the migrated task stack layer is migrated back to its original parent layer, which is, for example, the default display area layer. In this way, the task stack layer is prevented from being destroyed as a sublayer of the desktop animation layer, thereby preventing the subsequent interface from being unable to be displayed, that is, ensuring the normal display of the application interface and improving the user experience.

[0064] In one possible implementation, the method also includes: before submitting the second transition component to the desktop process, when it is determined that the second transition component is other transition components, the system service process cancels the animation attribute of the second transition component, and the other transition components refer to activities other than the first activity among the n activities.

[0065] That is to say, the transition component corresponding to the first activity has the animation attribute, and the transition component corresponding to the activity after the first activity does not have the animation attribute. This can prevent the screen from flashing due to frequent switching of animations when starting activities across task stacks, thus improving the display effect. In addition, only the first transition component has the animation attribute, and the animation execution time is short. It will not happen that the animation execution time is too long, resulting in the application activity being loaded but the animation not being executed. Therefore, it can prevent the application interface from being unable to respond to user operations, thus improving the user experience.

[0066] In a possible implementation, the method further includes: in the process of starting the second activity, the system service process determines that the second transition component is another transition component according to the activity record corresponding to the second activity collected in the second transition component.

[0067] In this implementation, through the activity records, it is possible to simply and quickly determine whether the transition component is another transition component corresponding to another activity. Specifically, if the activity records collected by the transition component record records of other activities, it means that the transition component is a transition component corresponding to another activity.

[0068] In one possible implementation, the method also includes: during the execution of the life cycle of the second activity, the process of the first application determines whether the interface corresponding to the second activity is a visual interface; if the interface corresponding to the second activity is a visual interface, the system service process sets the value of the visual identifier of the second activity to the first value.

[0069] In one possible implementation, the method also includes: after receiving the second completion indication, the system service process determines whether a delayed removal condition is met, and the second completion indication is used to indicate that the second activity has completed drawing; if the delayed removal condition is met, the system service process delays the removal of the first startup window; if the delayed removal condition is not met, the system service process removes the first startup window.

[0070] Optionally, the second completion indication may be given by the process of the first application to the system service process through a finishDrawing() function.

[0071] The specific process of identifying whether the interface corresponding to the second activity is a visual interface and triggering the delayed removal judgment when the second activity is drawn is similar to that of the first activity, and the beneficial effects are also similar, so it will not be repeated here.

[0072] The subsequent third activity, fourth activity, etc. are executed in a similar process to the second activity. The main difference is that the third activity and subsequent activities do not need to determine whether to unlock the condition variable.

[0073] In a second aspect, the present application provides a device, which is included in an electronic device, and the device has the function of implementing the electronic device behavior in the above-mentioned first aspect and the possible implementation of the above-mentioned first aspect. The function can be implemented by hardware, or it can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-mentioned functions. For example, a receiving module or unit, a processing module or unit, etc.

[0074] In a third aspect, the present application provides an electronic device, comprising: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other so that the electronic device executes any one of the methods in the technical solution of the first aspect.

[0075] In a fourth aspect, the present application provides a chip, including a processor. The processor is used to read and execute a computer program stored in a memory to perform the method in the first aspect and any possible implementation thereof.

[0076] Optionally, the chip also includes a memory, and the memory is connected to the processor via a circuit or wire.

[0077] Further optionally, the chip also includes a communication interface.

[0078] In a fifth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes any one of the methods in the technical solution of the first aspect.

[0079] In a sixth aspect, the present application provides a computer program product, the computer program product comprising: a computer program code, when the computer program code runs on an electronic device, the electronic device executes any one of the methods in the technical solution of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] Figure 1 This is a schematic diagram of an application scenario of an application startup method provided in an embodiment of the present application;

[0081] Figure 2 is a schematic diagram of an application scenario of another application startup method provided in an embodiment of the present application;

[0082] Figure 3 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application;

[0083] Figure 4 is a software structure block diagram of an example of an electronic device 100 provided in an embodiment of the present application;

[0084] Figure 5 This is a timing diagram of an application startup method provided in an embodiment of the present application;

[0085] Figure 6 is a schematic diagram of the software architecture of another electronic device provided in an embodiment of the present application;

[0086] Figure 7 This is a timing diagram of an application startup method provided in an embodiment of the present application;

[0087] Figure 8 This is a schematic diagram of a response time comparison provided in an embodiment of the present application;

[0088] Fig. 9 is a timing diagram of another application startup method provided in an embodiment of the present application;

[0089] Fig.10 This is a flowchart of an application startup method provided in an embodiment of the present application;

[0090] Fig.11 is a flowchart of another application startup method provided in an embodiment of the present application;

[0091] Fig.12 This is a timing diagram of another application startup method provided in an embodiment of the present application;

[0092] Fig.13 This is a flowchart of another application startup method provided in an embodiment of the present application;

[0093] Fig.14 This is a schematic diagram of an interface change provided in an embodiment of the present application;

[0094] Fig.15 This is a schematic diagram of an interface comparison of an optimized process and a native process for quickly launching an application provided in an embodiment of the present application;

[0095] Fig.16 This is a schematic diagram of an interface comparison of an optimized process and a native process for quickly launching an application provided in an embodiment of the present application;

[0096] Fig.17 This is a timing diagram of another application startup method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0097] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0098] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.

[0099] References to "one embodiment" or "some embodiments" etc. described in the specification of the present application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in the specification of the present application do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0100] In order to better understand the embodiments of the present application, the terms or concepts that may be involved in the embodiments are explained below.

[0101] 1. Interface, activity and window

[0102] Electronic devices can install and run applications. When an electronic device runs any application, such as application A, in the foreground, the display screen of the electronic device displays the interface (also called a page) of application A, and the user of the electronic device can interact with the interface of application A. When the electronic device runs application A in the background, the electronic device no longer displays the interface of application A, and the user of the electronic device cannot interact with the interface of application A.

[0103] After receiving the instruction to start the application, the electronic device will create a process corresponding to the application. After that, based on the application process, the activity is loaded. The activity is responsible for displaying the application interface, interacting with the user and processing business logic. It can be understood that when the application is running, there is only one process corresponding to the application in the system. However, during the process running, multiple processes can be loaded in sequence according to user operations or different display logics preset by the application. Different activities can correspond to different interfaces.

[0104] The interface is composed of views. When displaying the interface and interacting with the user, the activity can hold a window object to help the activity manage the view. When the application is started, the system will create a window for the activity to display the view in the interface. Therefore, from another perspective, the window is the carrier of the view and the container of the view.

[0105] 2. Task stack

[0106] A task stack, also called a task, is a container for activity instances. When you start an application, the system will create a corresponding task stack for the application. In other words, one application corresponds to one task stack.

[0107] In actual applications, during the startup or operation of an application, some interface jumps may be involved. These interfaces can be implemented through the activities of other applications, that is, the display of the interface requires loading activities across the task stack. For example, when application A is started, it needs to jump from interface a1 to interface b1, and then to interface c1. Among them, the activities corresponding to interface a1 and interface b1 are in the task stack of application A, while the activity corresponding to interface c1 is in the task stack of application B. Therefore, in the process of jumping from interface b1 to interface c1, it is necessary to load activities across the task stack.

[0108] 3. Transition page

[0109] It can be understood that during the process of application startup, that is, from the user executing the operation of starting the application to the display of a certain interface to be displayed in the application (hereinafter referred to as the target interface) on the screen, the terminal device needs to go through a series of processing operations, and the user needs to wait for a certain time. In order to reduce the user's waiting time and to improve the user's visual experience, the electronic device can display some transitional interfaces during this period of time. These interfaces are called transition pages (or transition pages, startup pages, dynamic effect pages or startup dynamic effects). Optionally, the transition page can be an icon page, an advertising page, a blank page, a logo page, and a snapshot page. Optionally, the dynamic effect attribute of the transition page can be set as needed. If the dynamic effect attribute is set to "yes" (for example, true), the transition page presents an animation effect (abbreviated as dynamic effect). If the dynamic effect attribute is set to "no" (for example, false), the transition page presents a static effect. In other words, the transition page can be a statically displayed interface or a dynamic effect interface. The dynamic effect displayed in the dynamic effect interface can be, for example, an icon gradually enlarged, or text appears in sequence, etc.

[0110] The system can trigger the execution of the transition component by adding a startup window to realize the display of the transition page. Transition, hereinafter referred to as transition, is used to realize the display of transition effects in the window, for example, to realize the display of animation effects.

[0111] 4. Cold start, warm start and hot start

[0112] It is understandable that after the application is started, the application process continues to run in the background, and the application activity is also placed in the task stack. However, after the application goes from the foreground to the background, the application process may be destroyed and the activity may be recycled, that is, the application process does not exist in the system background.

[0113] Depending on whether there is an application process in the system background and whether there is an activity of the application when the application is started, the application startup can be divided into cold start, warm start and hot start.

[0114] When a user clicks an application icon to start the application, there is no process for the application in the system background. The system needs to create and start a process for the application, and then load the activity of the application through the process after the process is started. After the activity is successfully loaded, the interface of the application is displayed. This startup process can be called a cold start.

[0115] After the application is started, it can go from the foreground to the background. After entering the background, the application process can still exist in the system. If the user clicks the application icon to bring the application back to the foreground, the system no longer needs to create and start a process for the application because the application process exists in the system background. If the application's activity still exists in the system memory, the application does not need to reload the activity, but instead displays the interface corresponding to the activity in the application's task stack in the foreground. This startup process can be called a hot start.

[0116] After the application goes from running in the foreground to running in the background, the application process may be killed in the background (for example, the application process is destroyed), the activity is recycled, and the application process does not exist in the system background. However, after the process is killed, the application may still have self-starting behavior, that is, the application can request the system to create and start a process for the application in the background. If the application process is successfully created and started in the system background, and the user clicks on the application icon to make the application return to the foreground again, the system no longer needs to create and start a process for the application because the application process exists in the system background. However, since the application's activity has been recycled, the system needs to load the application's activity through the application's process until the activity is successfully loaded and the application interface is displayed. This startup process can be called a warm startup.

[0117] 5. Start activity, execute activity life cycle and load activity

[0118] In the embodiment of the present application, starting an activity refers to a system server process processing an activity start request or an activity start transaction, that is, a process of controlling the activity start. Starting an activity can be implemented by a startActivity() function.

[0119] The execution of the activity life cycle refers to the process of the application process executing the activity start (activityStart), loading the activity layout (activityResume), drawing the frame, and finishing the drawing (finishDrawing). In other words, the start of the activity is controlled by the systemserver, but the actual start action is performed by the application process.

[0120] In the embodiment of the present application, loading an activity refers to the process from starting the activity to completing the life cycle of the activity.

[0121] The application scenarios and technical issues of this application are explained below.

[0122] To facilitate users in launching applications, the system of electronic devices provides a mechanism for launching applications through shortcuts (i.e., quick launch). Applications can design quick launches of different functions according to their own needs, so that users can directly display the interface of the required function in one step.

[0123] For example, Figure 1 A schematic diagram of an application scenario of an application startup method provided in an embodiment of the present application. In this embodiment, a user can quickly start a function of an application by long pressing an application icon on the desktop, and directly display the interface of the function. Specifically, taking a mobile phone as an example, Figure 1 As shown in Figure (a) in FIG. 1 , multiple application icons are displayed on the desktop of the mobile phone. Taking the payment application as an example, the user can long press the icon 101 of the payment application. In response to the user's operation, the desktop displays the function options of the payment application, for example, including: more settings function option 1011, receiving money function option 1012, payment function option 1013 and scanning function option 1014. Figure 1 As shown in Figure (b) in the figure. When a user clicks a function option, the function is activated and the interface corresponding to the function is displayed. For example, the user clicks the receive money function option 1012. In response to the user's operation, the payment application's receive money function is activated and the payment code interface 102 is displayed, as shown in Figure (b). Figure 1 As shown in Figure (c).

[0124] For example, Figure 2 This is a schematic diagram of another application scenario of the application startup method provided in the embodiment of the present application. In this embodiment, the user can start a function of the application through the shortcut icon of the application on the desktop and display the interface of the function. Figure 2 As shown in Figure (a) of FIG. 1 , taking the payment application as an example, the desktop includes an icon of the payment application. The user can long press the icon of the payment application, and in response to the user's operation, the desktop displays function options of the payment application, such as more settings function option 1011, receiving money function option 1012, paying money function option 1013 and scanning function option 1014, as shown in FIG. Figure 2 As shown in Figure (b) in the figure. The user can long press a function option and drag it to the desktop to form a shortcut icon on the desktop. Continuing with the example of the function option 1012 for collecting money, the user long presses and drags the function option 1012 for collecting money to a certain position on the desktop and then raises his hand. After the user raises his hand, the interface displays the shortcut icon 201 corresponding to the function option 1012 for collecting money, as shown in Figure (b). Figure 2 As shown in Figure (c).

[0125] The user clicks the shortcut icon 201. In response to the user's operation, the mobile phone starts the payment function of the payment application and displays the payment code interface 102. Figure 2 As shown in Figure (d).

[0126] It should be noted that the above two application scenarios are explained by taking the quick launch of the application from the desktop as an example. In actual use, the application can also be launched through shortcuts from other entrances. For example, the application can also be launched through a shortcut on the negative one screen. The embodiment of the present application does not impose any restrictions on the specific entrance of the quick launch, the specific triggering method of the quick launch, etc. It can be understood that no matter which quick launch method is used, the process of launching the application by the electronic device is the same or similar.

[0127] The inventors have found that in the related art, some functions of some applications have a long response time, that is, a slow response, during the quick start process. The response time of an application is also called response delay or startup time, which refers to the time from when the user executes the operation of starting the application (for example, clicking on a function option or clicking on a shortcut icon in the above embodiment) to when the first frame of the application related to the application is displayed on the screen. The first frame of the application related to the application can be the interface of the application itself or a transition page of the application.

[0128] Specifically, in the related art, some functions of some applications do not have transition pages during the quick launch process, which not only leads to a long application launch response time, but also poor user visual effects. Some functions of some applications have transition pages during the quick launch process, but the response time is also relatively long, which also brings poor user experience. For example, when launching via shortcut When using the payment function, the response time is about 621 milliseconds (ms); When using the scan function, the response time is about 447ms; The payment function has a response time of about 600ms. When using the scan function, the response time is about 155ms.

[0129] In view of this, the embodiment of the present application provides an application startup method, which can identify the quick startup scenario, and in the quick startup scenario, add a startup window to the first activity of the application when loading, display a transition page, and transfer (or migrate) the startup window to the subsequent activity. In this way, not only can the response time be greatly shortened, but the transition page can also bring a better visual experience to the user. In short, this method can improve the user experience.

[0130] The hardware structure and software architecture of the electronic device to which the method is applicable are introduced below in conjunction with the accompanying drawings.

[0131] The application startup method provided in the embodiment of the present application can be applied to mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), and other electronic devices that can install application programs (APP). The embodiment of the present application does not impose any restrictions on the specific type of electronic devices.

[0132] For example, Figure 3 1 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0133] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0134] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0135] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0136] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0137] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0138] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0139] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0140] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0141] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0142] Figure 41 is a software structure diagram of the electronic device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework (framework, FWK) layer, the Android runtime (Android runtime) and the system library, and the kernel layer.

[0143] like Figure 4 As shown, the application layer may include a series of application packages, which are applications that can start one or more functions through shortcuts, and are uniformly shown as applications (APP) in the figure. It can be understood that these applications can be system applications or third-party applications, such as video, camera, gallery, payment application, etc. In the embodiment of the present application, the application layer may also include Android system applications such as desktop launcher (launcher), system user interface (systemUI) and mobile phone manager.

[0144] Usually, after the Android system is started, the launcher can be used as a core application to run in the Android system. The application startup icon is generally set in the launcher. Specifically, the launcher can monitor the application process (apTouchDaemon) ( Figure 4 The systemUI (not shown) monitors the user's operation on the application icon. When apTouchDaemon monitors the user clicking on the startup icon of an application, apTouchDaemon generates an input event and reports the input event to the launcher. The launcher distributes and processes the input event, generates an application startup message and sends it to the relevant services in the application framework layer, starts the application process of the application through these services, and loads the activity. The systemUI is responsible for drawing the startup window or the application window, etc. It should be understood that when the user clicks on the icons of different applications, the launcher will generate startup messages for different applications, thereby starting the application processes corresponding to different applications.

[0145] Mobile Manager is a system used to manage electronic devices.

[0146] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0147] like Figure 4As shown, in an embodiment of the present application, the application framework layer may include a system server process, a system UI process, a Zygote process, a surfaceflinger process, etc. Specifically, the application framework layer may include a Java framework layer and a native framework layer (also called a C++ framework layer). The system server process, the system UI process, and the Zygote process may run in the Java framework layer. The surfaceflinger process runs in the native framework layer. In addition, after the mobile phone manager application is started, the Java framework layer may also include a mobile phone manager process.

[0148] Among them, the systemserver process can provide almost all system services for applications in the application layer, such as activity manager service (AMS), window manager service (WMS), package manager service (PMS), and resource manager service (RMS). These system services can reside in the systemserver process in the form of threads. Among them, AMS is responsible for unified scheduling and management of activities of all processes in the system. WMS is responsible for managing window views, such as the location, size, and layout of application windows. PMS is responsible for the installation, management, and uninstallation of application packages in the system. Specifically, PMS can identify all components of an application, such as activities, and assign corresponding permissions to these components. RMS is responsible for unified management, scheduling, and optimization of resources in the system.

[0149] The Zygote process is a daemon service in the Android system. Almost all application processes are forked from the Zygote process. Since each application is written in Java, each application needs to run in its own independent virtual machine as a process. When an application is started, it can fork its own virtual machine through the Zygote process and share the virtual machine memory and various services provided by the systemserver process.

[0150] The surfaceflinger process is responsible for rendering the interface and application graphics. For example, the window drawn by the systemUI process can be rendered and displayed by the surfaceflinger process.

[0151] Usually, in response to a user clicking on an application icon, the launcher can send a startup message of the application to the systemserver process. If the application process of the application does not exist in the current application process, then it is necessary to create an application process for the application. The systemserver process can call AMS to communicate with the Zygote process and request the Zygote process to create a corresponding application process for the application. After receiving the request, the Zygote process creates application process 1 in response to the request. Application process 1 includes the main thread of the application (activityThread). In order to start running the application code normally, application process 1 needs to initialize the main thread of the application first and load the class file of the application into memory. Among them, the main thread can complete the initialization of the main thread by executing the main function of activityThread.

[0152] The mobile manager process is the process corresponding to the mobile manager application forked by the Zygote process when the mobile manager application is started. It is used to manage the various applications, functions or data running in the system. The mobile manager process can run a non-real-time processing subsystem, which includes a configuration processing module. The configuration processing module is used to process the configuration information of the application or activity.

[0153] The application startup method provided in the embodiment of the present application can be implemented by the cooperation of apTouchDaemon process, launcher process, Zygote process, mobile phone manager process, systemserver process, systemUI process, surfaceflinger process, etc. Among them, apTouchDaemon process, launcher process, systemserver process, systemUI process, surfaceflinger process and mobile phone manager process can communicate with each other based on the binder mechanism. The systemserver process and the Zygote process can communicate based on the socket mechanism.

[0154] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0155] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0156] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0157] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0158] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0159] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0160] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc.

[0161] A 2D graphics engine is a drawing engine for 2D drawings.

[0162] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0163] The following will Figure 4 Based on the software architecture provided, combined with Figure 5 Introduces the native process of application startup. This native process can be applied to Figure 1 and Figure 2 In the scenario example shown in the figure, take the function a of application A launched through shortcut as an example, assuming that the interface of function a is the interface corresponding to the nth activity (i.e., the target interface) is interface a, and the system needs to load the 1st to nth activities in sequence and then display the target interface a. Among them, function a can be, for example, the payment function of the payment application, then the target interface a can be Figure 1 Figure (c) in Figure 2 The payment code interface 102 is shown in Figure (d).

[0164] Figure 5 FIG. 1 is a timing diagram of an example of an application startup method provided in an embodiment of the present application. Figure 5 As shown, taking function a of application A cold started through shortcut as an example, the startup process includes:

[0165] ① In response to the occurrence of an up event in the quick launch operation, the launcher process calls the startShortcut() function to send a startup message to the systemserver process.

[0166] Optionally, the quick start operation may be, for example, the operation of clicking on a desktop shortcut icon, or long pressing an application icon and then clicking on a function option. Specifically, apTouchDaemon detects the user's quick start operation, and detects that the quick start operation has been lifted (i.e., a lift event occurs), and generates an input event. apTouchDaemon calls the InputEvent() function to report the input event to the launcher process. After receiving the input event, the launcher process determines the application (application A) corresponding to the input position and the interface (interface a) corresponding to the function to be started. Afterwards, the launcher process sends a start message to the AMS in the systemserver process through the startShortcut() function based on the binder mechanism. The start message is used to request to start function a of application A in a shortcut manner. Optionally, the start message may carry information about the application to be started (i.e., application A) and information about the function to be started (i.e., function a). Among them, the application information may include, for example, one or more of the application package name, the package identity document (ID), etc. The information of the function to be started may include, for example, one or more of the name of the function to be started, the ID of the function to be started (also called the ID of the quick start function or the first information, hereinafter referred to as the quick function ID), etc. The quick function ID is used to mark the unique identity of the function to be started.

[0167] ②The systemserver process responds to the startup message and requests the Zygote process to fork the process of application A. The Zygote process responds to the request and forks the process of application A.

[0168] Specifically, the AMS in the systemserver process responds to the startup message and requests the Zygote process to fork the process of the application A through the socket communication mechanism. The Zygote process responds to the request of the AMS and forks the process of the application A.

[0169] ③The systemserver process handles the startup transaction of the first activity. At the same time, the systemserver process collects the activity record (activityRecord) corresponding to the first activity of application A.

[0170] It can be understood that the AMS in the systemserver process is responsible for unified management and scheduling of activities, and handling activity-related affairs, such as start requests. While AMS is processing activity affairs, WMS can collect the activity's status information to facilitate the subsequent management of the activity's operation, as well as determine the participants of the animation in the subsequent transition page, assign layers to participants to draw animations, etc. The activity's status information can be maintained through activityRecord. ActivityRecord is the smallest unit of activity management, and each activityRecord corresponds to an activity in the application process.

[0171] In this step, in response to the start message, the systemserver process starts the first activity of application A by default, so after the process of application A forks, AMS processes the start transaction of the first activity. At the same time, WMS collects the activityRecord corresponding to the first activity to record the status of the activity.

[0172] ④The systemserver process calls the activityPaused() function to notify the activity in the launcher process to enter the pause state. At the same time, the systemserver process collects the launcher's activityRecord.

[0173] In this step, the activity in the launcher process enters the paused state, so AMS records the state of the activity in the launcher process by collecting activityRecord.

[0174] Optionally, when pausing the activity in the launcher process, the participants of the animation may also involve wallpaper or the leftmost home screen, so the activityRecord of the wallpaper or the leftmost home screen may also be collected, which is not specifically limited in this application.

[0175] It is understandable that when other activities are started or paused, WMS also collects activityRecord until the application transaction is ready. This will not be described in detail in the subsequent embodiments.

[0176] ⑤The systemserver process instructs the process of application A to execute the life cycle of the first activity. In response to the instruction of the systemserver process, the process of application A executes the life cycle of the first activity.

[0177] Specifically, executing the life cycle of an activity includes starting the activity using the activityStart() function, loading the activity layout using the activityResume() function, drawing the frame using the doFrame() function, and completing the drawing indicated by the finishDrawing() function. Figure 5 After drawing the frame using the doFrame() function, the process of application A can request the systemserver process to add a display. The systemserver process uses addToDisplay() to add a display to the activity.

[0178] Optionally, the systemserver process can call the scheduleTransaction() function to instruct the process of application A to execute the start of the activity to start the life cycle of the first activity.

[0179] ⑥ During the execution of the first activity life cycle, the process of application A calls the startActivity() function to request the systemserver process to start the second activity. The systemserver process processes the start request of the second activity and collects the activityRecord corresponding to the second activity.

[0180] Optionally, the process of application A can request to start the second activity during the activityStart phase or activityResume phase of the first activity life cycle.

[0181] ⑦After determining that the process of application A has completed the life cycle of the first activity, the systemserver process calls the activityPaused() function to notify the process of application A to pause the first activity and instruct the process of application A to execute the life cycle of the second activity. In response to the instruction of the systemserver process, the process of application A executes the life cycle of the second activity.

[0182] And so on, until the process of application A executes the life cycle of the n-1th activity.

[0183] ⑧ During the life cycle of the n-1th activity, the process of application A calls the startActivity() function to request the systemserver process to start the nth activity. The systemserver process processes the start request of the nth activity and collects the activityRecord corresponding to the nth activity.

[0184] ⑨ When processing the start request of the nth activity, the systemserver process notifies the systemUI to add the start window. The systemUI process calls the addStartingWindow() function to create the start window, uses the doFrame() function to draw the start window view, and then the finishDrawing() function indicates that the start window drawing is completed. After the systemserver process determines that the start window drawing is completed, the application is ready (applyReady).

[0185] ⑩After determining that the process of application A has completed the life cycle of the n-1th activity, the systemserver process calls the activityPaused() function to notify the process of application A to pause the n-1th activity and instruct the process of application A to execute the life cycle of the nth activity. In response to the instruction of the systemserver process, the process of application A executes the life cycle of the nth activity.

[0186] After determining that the startup window has been drawn, the systemserver process calls AppTransitionReady to execute the application transaction ready.

[0187] Application transaction ready indicates that the transition is ready and can start executing the transition.

[0188] In other embodiments, application transaction ready (AppTransitionReady) may also be referred to as transition ready (transitionReady).

[0189] After the application transaction is ready and executed, the systemserver process notifies the launcher process to execute the animation. The launcher process starts the animation through the startAnimation() function and executes the animation through the animator() function, that is, executes the transition to display the transition page. Among them, the transition is generated based on the activityRecord collected from each activity.

[0190] It can be understood that when the systemserver process notifies the launcher process to execute the animation, the ready transition can be submitted to the launcher process.

[0191] After determining that the process of application A has completed the life cycle of the nth activity, the systemserver process calls performSurfacePlacement() to display the layer corresponding to the nth activity, that is, to display the target interface a.

[0192] Optionally, the systemserver process can also call showSurface() to display the layer.

[0193] The systemserver process calls the removeStartingWindow() function to remove the startup window and displays the interface of application A in the window of application A.

[0194] It should be noted that if the target interface a of application A is drawn during the execution of the animation, the interface can be displayed, but at this time, the animation layer is on the upper layer and the interface cannot respond to user operations. After the animation is executed, the interface displayed in the window can respond to user operations.

[0195] From the above description, we can know that in the native process, the quick launch process of application A requires the jump of n activities. The time length (i.e., response time) from the moment the user executes the quick launch operation to the moment the transition page is displayed in the interface is relatively long. The response time is approximately equal to the sum of the life cycle durations of all activities in application A. In other words, in the native process, all interfaces before the target interface (called intermediate interfaces) must be ready before responding. The response time depends on the life cycle of the intermediate interface of application A, and the response is relatively slow.

[0196] The following is an analysis of the reasons why the native process responds slowly.

[0197] The display of the transition page depends on the startup window. The transition page can be displayed normally only when the startup window is successfully added.

[0198] In some embodiments, when cold starting an application from the desktop through a non-shortcut method (i.e., clicking an application icon on the desktop), a partial process of adding a startup window is as follows:

[0199]

[0200]

[0201] It can be seen that when the application is started without a shortcut, the startup window can be added through the related process of addStartingWindow to display the transition page.

[0202] In some other embodiments, when cold starting an application from the desktop through a shortcut, a partial process of adding a startup window is as follows:

[0203]

[0204] It can be seen that when quickly launching an application, adding a startup window through the addStartingWindow() function returns false, that is, adding a startup window is blocked.

[0205] After analysis, it is found that the themes of the activities whose startup windows are blocked are empty. The reason for the empty themes is that the activities have transparent properties, that is, the value of the windowIsTranslucent property is true. The native system will not add startup windows to activities with transparent properties.

[0206] Further analysis revealed that the multiple activities loaded during the application startup process are activities in different task stacks, that is, the quick startup process involves loading activities across task stacks. For example, in the above embodiment, in the process of quickly starting the payment application's money collection function, n activities may be located in different task stacks. However, there is no maintenance mechanism for the startup window across task stacks in the native system. When loading activities across task stacks, the system will try to add a startup window to the activity of each task stack, which will cause frequent switching of the startup window when switching task stacks, and then cause screen flashing. In order to solve this problem, the application sets the value of the windowIsTranslucent property of the activity corresponding to the interface before the target interface of the quick startup to true. In this way, the native system intercepts the startup windows of these activities, which can avoid screen flashing when quickly starting a certain function of the application. It should be noted that although the startup window of the activity is intercepted, the system will still load transitions for these activities, but there is no startup window, and the transition cannot be finally displayed.

[0207] In other words, the native system does not support maintaining the startup window across task stacks, which will cause screen splashes. In order to avoid screen splashes, the application sets the transparent attribute of the activity to intercept the startup window, which ultimately results in the failure to add the startup window when the application is quickly started, or the startup window is added only when the last activity is started, which in turn causes the application's response time to depend on the life cycle of the activity corresponding to the intermediate interface, resulting in a slow response.

[0208] Based on the above analysis, the present application provides an application startup method, which adds an additional startup window addition process based on the native system. Specifically, when processing the first activity startup transaction of the application (that is, before the first activity is started), the startup window is added. The addition process is triggered by the systemserver process and is specifically executed by the systemUI process. It does not require the participation of the application process and does not involve the application's activity. Therefore, it will not be intercepted by the system due to issues such as activity transparency. Before the first activity is started, the startup window is added. After the window is drawn and the transition is loaded, the transition page can be displayed. In this way, the display of the transition page does not need to rely on the application activity life cycle, which can not only greatly shorten the application's response time, but also advance the interface response time and improve the user experience. In addition, when a quick start is identified, each activity and transition of the application is identified, and a startup window is added for the first activity. For the activities after the first activity and before the activity corresponding to the target interface, the startup window is passed to these activities in sequence. After the activity corresponding to the target interface is loaded, the startup window is removed. In this way, the continuity of the transition page display is guaranteed, and the frequent switching of the startup window to cause screen flashing is also prevented.

[0209] Below Figure 4 Based on the software architecture shown, the improvement of the software architecture involved in the embodiment of the present application is described.

[0210] It can be understood that each system service running in the systemserver process can be regarded as a software module, which can provide corresponding services and implement corresponding functions. Based on this, each system service can include a module for implementing a part of the functions (i.e., sub-functions) in the system service function to implement the application startup method of the present application. The same is true for other modules. The following describes the functional modules related to the application startup method provided by the present application contained in each system service and related modules.

[0211] For ease of description, the process of the quick launch application method capable of shortening the response time provided in the embodiment of the present application is referred to as an optimization process, and the quick launch function corresponding to the optimization process is referred to as an optimized launch function.

[0212] For example, Figure 6 This is a schematic diagram of the software architecture of another electronic device provided in an embodiment of the present application. Figure 6In the embodiment of the present application, the configuration processing module may include a parsing configuration module. The parsing configuration module is used to read and parse the relevant configuration of the optimized startup function, including but not limited to the switch of the optimized startup function, the delayed removal time of the startup window, the delayed removal number threshold, the application type whitelist, the package blacklist, etc. The optimized startup function switch is used to control the opening and closing of the optimized startup function, that is, to control the execution and non-execution of the optimization process. When the switch is turned on, the system executes the optimization process. When the switch is turned off, the system does not execute the optimization process and executes the native process. The delayed removal time of the startup window refers to the duration of the delayed removal of the startup window, that is, how long it takes to remove the startup window. The delayed removal number threshold refers to the maximum number of delayed removal of the startup window allowed, such as 5 times, 8 times, etc. The application type whitelist includes information on application types that are allowed to be started through the optimization process. The application type whitelist may include, for example, video applications, audio applications, instant messaging applications, payment applications, etc. The package blacklist includes information on packages of applications that are not allowed to be started through the optimized process. The package blacklist may include, for example, package a, package b, package c...

[0213] RMS includes a cache configuration module, which is used to cache the configuration information parsed by the parsing configuration module to support the optimized startup function.

[0214] The PMS may include a quick launch identification module. The quick launch identification module is used to identify whether the launch of the application is a quick launch, that is, whether it is launched through a shortcut. Moreover, the quick launch identification module is also used to filter the quick launch application or application function according to the application type whitelist and package blacklist cached in the cache configuration module to determine whether the current launch meets the execution scenario of the optimization process provided in this application.

[0215] WMS may include an activity identification module, a transition identification module, a startup window management module, and a transition component management module. The activity identification module is used to identify each activity requested to be loaded during the application startup process to determine whether each activity is the first activity in the quick startup scenario or other activities. The transition identification module is used to identify each transition loaded by WMS to determine whether each transition is the first transition (also called the first transition component) in the quick startup scenario or other transitions. The startup window management module is used to manage the startup window according to the identification results of the activity identification module and the transition identification module, including but not limited to requesting to add a startup window, transferring a startup window, removing a startup window, etc. The transition component management module is used to manage transitions, including but not limited to creating transitions, controlling the execution timing of transitions, setting transition parameters, etc. The parameters of transitions may include, for example, dynamic effect attributes. If the dynamic effect attribute is set to "yes" (for example, true), the transition is displayed in the form of dynamic effects, that is, there is dynamic effect; if the dynamic effect attribute is set to "no" (for example, false), the transition is not displayed in the form of dynamic effects, that is, there is no dynamic effect.

[0216] The following will have Figure 3 and Figure 6 Taking the electronic device with the structure shown as an example, the application startup method provided in the embodiment of the present application is specifically described in combination with the accompanying drawings and application scenarios.

[0217] Figure 7 FIG. 1 is a timing diagram of an example of an application startup method provided in an embodiment of the present application. Figure 7 As shown, taking function a of cold starting application A through a shortcut as an example, the starting process includes:

[0218] ① In response to the occurrence of an up event in the quick launch operation, the launcher process calls the startShortcut() function to send a startup message to the systemserver process.

[0219] ②The systemserver process responds to the startup message and requests the Zygote process to fork the process of application A. The Zygote process responds to the request and forks the process of application A.

[0220] ③The systemserver process handles the startup transaction of the first activity, and the systemserver process collects the activityRecord corresponding to the first activity of application A. Afterwards, the systemserver process calls the activityPaused() function to notify the activity in the launcher process to enter the paused state, and instructs the process of application A to execute the life cycle of the first activity. At the same time, the systemserver process collects the activityRecord of the launcher.

[0221] Optionally, the systemserver process can call the scheduleTransaction() function to instruct the process of application A to execute the start of the activity to start the life cycle of the first activity.

[0222] ④After the systemserver process handles the startup transaction of the first activity, it notifies the systemUI process to add the startup window. The systemUI process calls the addStartingWindow() function to create the startup window, uses the doFrame() function to draw the startup window view, and then the finishDrawing() function indicates that the startup window drawing is completed. After the systemserver process determines that the startup window drawing is completed, the application is ready (applyReady).

[0223] ⑤While the systemUI process creates the startup window, the process of application A responds to the instructions of the systemserver process and executes the life cycle of the first activity.

[0224] ⑥After confirming that the startup window has been drawn, the systemserver process calls AppTransitionReady to execute the application transaction ready.

[0225] ⑦After the application transaction is ready for execution, the systemserver process notifies the launcher process to execute the animation. The launcher process starts the animation through the startAnimation() function and executes the animation through the animator() function, that is, executes the transition to display the transition page.

[0226] ⑧ During the execution of the first activity life cycle by the process of application A, the startActivity() function is called to request the systemserver process to start the second activity ( Figure 7The systemserver process processes the start request of the second activity and collects the collect activityRecord ( Figure 7 (not shown). After determining that the process of application A has completed the life cycle of the first activity, the systemserver process calls the activityPaused() function to notify the process of application A to pause the first activity and instruct the process of application A to execute the life cycle of the second activity. And so on, the third ... nth activities of application A are executed.

[0227] ⑨After determining that the process of application A has completed the life cycle of the nth activity, the systemserver process calls performSurfacePlacement() to display the layer corresponding to the nth activity, that is, to display the target interface a.

[0228] ⑩The systemserver process calls the removeStartingWindow() function to remove the startup window and displays the interface of application A in the window of application A.

[0229] contrast Figure 5 and Figure 7 , and combined with Figure 8 It can be seen that in the native process, after the process of application A requests to start the nth activity, the startup window is added. Therefore, the addition of the startup window and the display of the transition page need to be after the previous n-1 activities are started, which depends on the life cycle of the activity in the middle interface of the application. In the optimized process, the systemserver process adds the startup window when processing the startup transaction of the first activity of application A, that is, when the systemserver process starts the first activity. After adding the startup window and completing the drawing of the startup window, the application transaction is ready. After executing the APPTransactionReady() function, the transition page can be displayed. The entire process of adding the startup window and displaying the transition page can be synchronized with the execution of the activity life cycle by the application A process, without relying on the life cycle of the activity of application A, which greatly shortens the response time. Simply put, the optimized process is equivalent to moving the execution timing of step ⑨ in the native process from starting the nth activity to starting the first activity, and the subsequent steps and The responses are also moved forward one by one, thus greatly shortening the response time and effectively improving the user experience.

[0230] Continue to see Figure 5 , Figure 7 and Figure 8 On the other hand, in the native process, if the animation is not completed, even if the application's activity has been loaded and the application's interface has been displayed, the application's interface cannot respond to user operations, resulting in a poor user experience. In the optimized process, the animation is executed earlier and can be executed concurrently with the process of loading the application A's activity. Therefore, the animation can be completed earlier, and the application's activity is loaded and starts to display the interface. It can respond to user operations without the user having to wait, thus improving the user experience.

[0231] The above is an overview of the optimization process in conjunction with the accompanying drawings to illustrate how the method provided by the present application shortens the response time from a timing perspective. Figure 6 , explain the specific implementation process of the optimization process to clarify the execution details of the process, explain how to pass and manage the startup window after it is added, and how to manage the transition to improve the smoothness of the transition page display, etc.

[0232] First, the process of parsing the configuration module in the mobile phone manager process to parse the relevant configuration of the optimization startup function is explained.

[0233] The parsing configuration module is initialized when the electronic device is turned on, and reads and parses the relevant configuration of the optimized startup function. Optionally, the name of the relevant configuration of the optimized startup function can be, for example, "AwareAddStartWindow". Through parsing, the type (type) corresponding to the function, the switch (switch) of the optimized startup function, the delayed removal time (delayTime) of the startup window, the delay removal number threshold (delayCount), the application type whitelist (also called the support type supportType) and the package blacklist (pkgBlacklist) can be obtained.

[0234] It can be understood that when the type of an application belongs to the application type whitelist and the package of the application is not in the package blacklist, it means that the application is suitable for the optimization process and can be quickly started through the optimization process. Otherwise, it means that the application is not suitable for the optimization process and can be started through the native process.

[0235] The parsing configuration module caches the parsing results in the RMS in the systemserver process. When the optimization startup function is turned on, the optimization process runs. During the optimization process, each module can obtain corresponding parameters from the RMS according to needs.

[0236] The implementation of the optimization process is described below. This embodiment continues to use the quick launch of application A as an example for description. In the following description, the fork process of the process of application A is not repeated. In addition, for ease of understanding, the method provided in the embodiment of the present application is described according to the launch process of the first activity of the application (referred to as the first stage) and the launch process of the second and subsequent activities (referred to as the second stage).

[0237] 1. Phase 1

[0238] The first stage involves starting the first activity of the application. Before starting the first activity of the application, identify the quick start scenario. When processing the start transaction of the first activity, identify the first activity to determine that the activity to be started is the first activity of the application in the quick start scenario, so as to accurately add a start window for the first activity. In addition, identify the first transition to set the properties of the first transition and improve the display effect of the transition page. The following is a detailed introduction with reference to the accompanying drawings.

[0239] Fig. 9 A timing diagram of another application startup method provided in an embodiment of the present application. Fig.10 For a flowchart of an application startup method provided in an embodiment of the present application, please refer to Fig. 9 and Fig.10 , the method comprising:

[0240] S101. In response to the occurrence of an up event in a quick launch operation, the launcher process calls a startShortcut() function to send a launch message to the systemserver process.

[0241] Optionally, the startup message carries information of the application to be started (application A) and information of the function to be started (function a). In this embodiment, the information of the function to be started is taken as a shortcut function ID as an example for description.

[0242] Optionally, the launcher process may also pass the information of the application to be launched and the shortcut function ID to the systemserver process through an intent.

[0243] S102 . The quick launch identification module in the PMS of the systemserver process responds to the launch message, and if it is determined that the current launch is a quick launch and the information of application A meets the preset conditions, the quick function ID is stored in the cache.

[0244] Determining whether an application meets the preset conditions is actually filtering the application. Therefore, this step can be simply called identifying and filtering quick launches.

[0245] Optionally, the quick launch identification module can determine whether the current launch is a quick launch based on whether the launch message carries a quick function ID. Specifically, the quick launch identification module obtains the application information and quick function ID from the intent in response to the launch message. If the quick function ID is obtained from the intent, it means that the current launch is a quick launch, that is, the current scene is a quick launch scene, otherwise it means that the current launch is not a quick launch, and the current scene is not a quick launch scene.

[0246] The preset conditions may include, for example: the type of application A is in the application type whitelist, and the package of application A is not in the package blacklist. Specifically, when it is determined that the current startup is a quick startup, the quick startup identification module can obtain the application type whitelist and the package blacklist from the configuration cache module, and determine whether the class of application A is in the application type whitelist and whether the package of application A is in the package blacklist based on the information of application A carried in the startup message, thereby determining whether application A meets the preset conditions. If the type of application A is in the application type whitelist, and the package of application A is not in the package blacklist, it is determined that the information of application A meets the preset conditions. Otherwise, it means that the information of application A does not meet the preset conditions.

[0247] If the current startup is a quick startup, and the information of application A meets the preset conditions, it means that the current scenario is a quick startup scenario, and quick startup can be performed according to the optimization process in the current scenario, so the quick function ID is stored in the cache of the systemserver process. In this way, on the one hand, the quick function ID in the cache is used as the identifier of the scene to mark that the current scene can be quickly started through the optimization process. On the other hand, the quick function ID in the cache is used as the identifier of the first activity to mark the activity to be started at the current moment as the first activity of application A. It should be noted that in other embodiments, the above two aspects can also be marked by other identification information, such as preset characters, preset numbers, preset text, etc. The embodiment of the present application does not impose any limitation on this and can be set according to actual needs.

[0248] If the current launch is not a quick launch, and / or the information of application A does not meet the preset conditions, it means that the current scenario is not suitable for quick launch through the optimized process, so the quick function ID is not cached. In the subsequent process, if the quick function ID cannot be identified from the cache, the process automatically switches to the native process for execution.

[0249] In this step, by identifying quick launch, the optimization process is limited to the quick launch scenario, improving the accuracy of process execution. In addition, by setting the application type whitelist and package blacklist, applications that are not suitable for the optimization process can be filtered out to prevent these applications from entering the optimization process and failing to execute, and the normal startup of these applications is guaranteed through the native process.

[0250] In other embodiments, during the execution of the optimization process, the quick function IDs with startup anomalies can be collected and added to the function blacklist. In this case, the preset conditions can further include: the quick function ID is not in the function blacklist. The quick function ID is not in the function blacklist, which further indicates that function a of application A is suitable for quick startup through the optimization process and caches the quick function ID. In this way, the functions to be started that are not suitable for the optimization process are further filtered to prevent quick startup errors and improve user experience.

[0251] S103, the AMS in the systemserver process starts to process the start transaction of the first activity, and the transition component management module in the WMS in the systemserver process collects the activityRecord corresponding to the first activity.

[0252] S104. The activity identification module in the WMS identifies the first activity according to the shortcut function ID. After identifying the first activity, the source record (sourceRecord) (also called the first sourceRecord) of the first activity is set to the activityRecord corresponding to the first activity, and the first sourceRecord is added to the sourceRecord collection.

[0253] This step can be simply called identifying the first activity and setting the sourceRecord.

[0254] Specifically, the activity recognition module reads the shortcut function ID from the cache. If the reading is successful, it determines that the currently launched activity is the first activity launched in the shortcut launch scenario, that is, the first activity is recognized. Optionally, the activity recognition module can add an identifier to the first activity to indicate that the activity is the first activity, so as to facilitate the subsequent quick determination of whether the activity is the first activity. The identifier of the first activity can be, for example, "first".

[0255] After identifying the first activity, the activity identification module sets the value of the first sourceRecord to the activityRecord corresponding to the first activity, and adds the first sourceRecord to the sourceRecord set.

[0256] sourceRecord is used to indicate the source of the activity, that is, the previous activity that started the currently started activity. In the embodiment of the present application, a corresponding sourceRecord is set for each activity, and a value is assigned to the sourceRecord. The set formed by the sourceRecords corresponding to multiple activities is called a sourceRecord set.

[0257] Specifically, after identifying the first activity, assign a value to the sourceRecord (i.e., the first) corresponding to the first activity. Optionally, the value of the sourceRecord corresponding to the first activity can be set to its (first activity) activityRecord. For any activity started after the first activity, perform the sourceRecord value transfer operation. For ease of explanation, the next activity to be started is called the new activity. The activity that requests to start the new activity is called the old activity or the source activity. In a specific embodiment, the old activity transfers the sourceRecord value to the new activity, that is, the sourceRecord of the old activity is used as the value of the sourceRecord of the new activity. In this way, the old activity that starts the new activity can be determined by the value of the sourceRecord.

[0258] In this embodiment, each activity is identified and a corresponding sourceRecord value is set for each activity. On the one hand, it is convenient to use sourceRecord as the basis for the subsequent transfer of the startup window. Specifically, the value of the sourceRecord of the new activity can be obtained. The old activity corresponding to the value is usually the activity that currently holds the startup window. Therefore, according to the value of sourceRecord, the activity holding the startup window can be found, so that the startup window can be obtained from the activity and transferred to the activity requesting to start. The transfer of the startup window will be further explained in step S208 of the subsequent embodiment.

[0259] On the other hand, the optimization process of this solution identifies each activity and sets the corresponding sourceRecord for the activity, which is not available in the native process. Then, conversely, if there is sourceRecord in the sourceRecord set, then the sourceRecord is set by the optimization process of this solution, which means that the current scene is a quick start scenario, and at least the first activity has been started. Therefore, in the subsequent process, sourceRecord is also used as the basis for identifying other activities after the first activity. Specifically, if there is sourceRecord in the sourceRecord set, it means that the currently started activity is the second activity in the quick start scenario or the activity after the second activity (referred to as other activities). Other activities will be further described in step S205 in the subsequent embodiments.

[0260] In some embodiments, during a cross-process launch, such as launching In the applet in the , or in some other special scenarios, when requesting to start a certain activity, if the activity has been started, the system will reuse the started activity. In this case, the activity holding the start window is not actually the old activity that requested to start the new activity, but the reused activity. Then, when the sourceRecord value is passed according to the above logic, the value passed may be empty, and the empty value may cause the subsequent start window transfer failure or activity recognition failure, which in turn causes the optimization process to fail. For this situation, in the optimization solution, when starting a new activity, if the sourceRecord value passed is empty, and there is an activity holding the start window in the collected sourceRecord set, it means that the activity involves special scenarios such as cross-process startup, so the activityRecord corresponding to the activity holding the start window can be used as the sourceRecord value of the new activity. In this way, the correct assignment of sourceRecord is guaranteed, the subsequent start window transfer failure or activity recognition failure is prevented, and the reliability of the optimization process is guaranteed.

[0261] In other embodiments, after collecting the activityRecord corresponding to the first activity, all historical activities in each task stack may be cleared. Specifically, before officially starting the first activity, all activities in each task stack are cleared (also called task cleaning), and then the first activity is placed in the corresponding task stack. In this way, during the quick start process, there is no historical activity in each task stack, and there will be no reuse of the started activity, and there will be no null value transfer. Therefore, there is no need to search for the activity holding the start window according to the above process, which simplifies the algorithm operation process and improves the algorithm operation efficiency.

[0262] S105. The activity identification module in the WMS of the systemserver process sets the condition variable and the validity period of the condition variable.

[0263] This step can be simply called setting the conditional variables.

[0264] The conditional variable is used to limit the startup timing of the second activity of application A to prevent the startup of the second activity from affecting the loading of the first transition and thus affecting the display of the transition page.

[0265] Optionally, the conditional variable may include two: conditional variable 1 and conditional variable 2. Conditional variable 1 is: the first transition has been submitted to the launcher process. Conditional variable 1 indicates that the first transition has been handled by the systemUI process, and the processing of the first transition no longer occupies the systemserver process. Therefore, starting the second activity of application A and creating the second transition (also called the second transition component) will not affect the loading of the first transition, and thus will not affect the display of the transition page. Conditional variable 2 is: the layer display (showSurface) of the startup window has been completed. The layer display of the startup window has been completed, and the processing of the startup window of the first activity no longer occupies the systemserver process. Therefore, starting the second activity of application A and creating the second transition will not affect the loading of the first transition, and thus will not affect the display of the transition page.

[0266] The validity period of the condition variable indicates how long the condition variable is valid after the setting time. For example, the condition variable can be 20ms, which means that it is valid within 20ms after the condition variable is set.

[0267] If the condition variable is unlocked within the valid time, the start request of the second activity of application A is triggered, which will not affect the processing of the transition page, so that the transition page can be displayed as soon as possible, thereby minimizing the response time of the application quick start.

[0268] If the condition variable is not unlocked within the valid time, it will be automatically unlocked when the valid time is reached. This can prevent the condition variable from being unlocked due to abnormal process execution, which will cause the subsequent activities to be unable to start, thereby improving system stability.

[0269] The unlocking of the conditional variable and the process after unlocking may refer to steps S202 to S204 in the subsequent embodiments.

[0270] S106. The transition component management module in the WMS of the systemserver process creates the first transition according to the activityRecord corresponding to the first activity collected.

[0271] S107. The transition component identification module in the WMS of the systemserver process identifies the first transition according to the activityRecord in the first transition.

[0272] This step can be simply called identifying the first transition.

[0273] Specifically, in step S104 above, the activity identification module has identified the first activity. Therefore, the transition component identification module determines whether the activityRecord collected in the current transition is the activityRecord corresponding to the first activity, and further determines whether the current transition is the first transition.

[0274] Optionally, the transition component identification module may add a transition identifier 1 to the identified first transition, where the transition identifier 1 is used to indicate that the transition is the first transition.

[0275] S108. The startup window management module in the WMS of the systemserver process requests the systemUI process to add a startup window (also called the first startup window) for the first activity.

[0276] As a possible implementation, after identifying the first transition and before requesting to add a startup window to the systemUI process (i.e., after step S107 and before step S108), the activity identification module in the WMS of the systemserver process may execute step S104 again, i.e., identify the first activity and set the sourceRecord corresponding to the first activity. As mentioned above, in some cases, the system may reuse activities, so the first activity may be a reused activity. After identifying the first transition and before requesting to add a startup window, the systemserver process executes step S104 again, which can further accurately identify the first activity, thereby further ensuring the correct assignment of sourceRecord, preventing subsequent startup window delivery failures or activity recognition failures, and ensuring the reliability of the optimization process.

[0277] S109: The systemUI process starts to add and draw a startup window in response to a request from the startup window management module.

[0278] Specifically, the systemUI process calls the addStartingWindow() function to create the startup window and uses the doFrame() function to draw the frame of the startup window. After the frame is drawn, the systemUI process requests the WMS in the systemserver process to add the startup window to display.

[0279] After the startup window is drawn, the systemUI process calls the finishDrawing() function to indicate to the systemserver process that the startup window is drawn. The WMS in the systemserver process displays the startup window layer through showSurface().

[0280] Steps S108 and S109 may be simply referred to as adding a startup window.

[0281] S110, the AMS in the systemserver process calls the activityPaused() function to notify the launcher process's activity to enter a paused state, and instructs the process of application A to execute the life cycle of the first activity. The transition component management module in the WMS of the systemserver process collects the launcher's activityRecord.

[0282] It can be understood that step S110 can be executed after the above steps S102 to S109, or can be executed synchronously with the above steps S102 to S109.

[0283] S111. The process of application A responds to the instruction of AMS and starts to execute the life cycle of the first activity.

[0284] S112. After the systemUI process starts to add a startup window, the startup window management module identifies whether the startup window is a startup window added through the optimization process; if so, execute step S113; if not, execute step S114.

[0285] S113: The startup window management module adds an optimized window identifier to the startup window, and saves the optimized window identifier to the cache. The optimized startup identifier is used to indicate that the currently added startup window is a startup window added through the optimization process.

[0286] S114: Start the window management module to clear the identification information added through the optimization process.

[0287] The above steps S112 to S114 may be simply referred to as identifying the optimization window.

[0288] As analyzed in the above embodiments, when the application's activity starts, the native system may add a startup window to the activity. If the application sets a transparent attribute for the activity, or the application sets a code to refuse to add a startup window, the native system will fail to add the startup window. However, in actual use, if the actual business of the application requires adding a startup window to the first activity, in this case, the application no longer sets a transparent attribute for the activity. In this way, the process of the native system can successfully add a startup window to the first activity. In this case, it is necessary to abandon the optimization process of this application and run it according to the native process to prevent disrupting the original startup logic of the application.

[0289] Based on this, in this embodiment, after the startup window begins to be added, it is further identified whether the startup window is a startup window added by the optimization process. If the startup window is a startup window added by the optimization process, an optimization window identifier is added. The optimization window identifier can be used as a basis for determining whether to remove the startup window later, see subsequent steps S209 to S212 for details. If the startup window is not a startup window added by the optimization process, all marking information added by the optimization process is cleared, including but not limited to the shortcut function ID, sourceRecord collection, conditional variables, the effective duration of the conditional variables, etc. In addition, if the first activity and the first transition are identified and marked, these identifiers are also cleared. In this way, the subsequent process enters the native process to prevent disruption to the original startup logic of the application, improve the accuracy of the execution of the optimization process, and thereby improve the stability of the system operation.

[0290] It can be understood that no matter whether the start window is a window added by the optimization process, the start window will continue to be added. That is, after steps S113 and S114, the start window will continue to be added. The difference is that after S113, other steps of the optimization process will continue to be executed, and after S114, the native process will be executed.

[0291] The specific method for identifying whether the first startup window is a startup window added by the optimization process will be further described in the subsequent embodiments.

[0292] S115. The WMS in the systemserver process responds to the request of the systemUI process and calls the addToDisplay() function to start the window adding display. After the window adding display is completed, applyReady is triggered. The transition component management module in the WMS prepares the first transition. After the first transition is prepared and before the first transition is submitted to the launcher process, the transition component management module cancels the transparent attribute of the first transition.

[0293] Before the first transition is submitted to the launcher process, that is, before the systemserver process requests the launcher process to execute the animation.

[0294] Specifically, as described above, after the systemUI process completes drawing the frame of the startup window through the doFrame() function, it requests the WMS in the systemserver process to add display to the startup window. In response to the request of the systemUI process, the WMS in the systemserver process calls the addToDisplay() function to add display to the startup window. After the startup window is added and displayed, the WMS is triggered to enter the apply ready (applyReady) stage, and the WMS prepares for transition. After the transition preparation is completed, the WMS executes the application transaction ready (AppTransitionReady), and then submits the transition to the launcher process, requesting the launcher process to request the execution of the animation. In other words, adding display (addToDisplay) to the startup window triggers transitionReady, so before the startup window is finished drawing (finishDrawing), it has entered the transitionReady stage. In the native process, transitionReady is triggered by finishDrawing of the startup window. In other words, the optimization process advances transitionReady so that transitionReady is between the moment of adding the startup window (addStartingWindow) and the moment of finishing drawing (finishDrawing) of the startup window. In this way, the animation effect can be displayed earlier, which can further shorten the response time when the application is quickly started and improve the user experience.

[0295] It should be noted that triggering transitionReady in advance can be performed as an optional solution. In other embodiments, Figure 7As shown, transitionReady is triggered by the completion of drawing (finishDrawing) of the startup window, and the embodiment of the present application does not impose any limitation on this.

[0296] To cancel the transparent property of a transition, for example, one may set the transparent property value of the transition to false.

[0297] S116. The transition component management module in the WMS of the systemserver process submits the first transition after canceling the transparent attribute to the launcher process, notifies the launcher process to execute the first transition, and the launcher process executes the first transition to display the transition page.

[0298] Steps S115 and S116 can be simply referred to as the control of the first motion effect.

[0299] Specifically, the transition component management module submits the first transition after canceling the transparent attribute to the launcher process, and notifies the launcher process to execute the transition. The launcher process starts the animation through the startAnimation() function, and executes the animation through the animator() function to display the transition page.

[0300] If the transition has a transparent attribute, the system cannot create an icon magnification effect. Therefore, in this step, the transparent attribute of the first transition is canceled, so that the transition without the transparent attribute is passed to the launcher process. In this way, the launcher process can execute the icon magnification effect, improve the effect, and enhance the user's visual experience.

[0301] S117. During the execution of the life cycle of the first activity, the process of application A determines whether the interface corresponding to the first activity is a user-perceivable (ie, visual) interface in the activityResume phase, and sets a visual identifier of the first activity according to the determination result.

[0302] Specifically, if any one of the following conditions 1 and 2 is met, it can be determined that the interface corresponding to the first activity is a user-perceivable interface. Condition 1: It is determined that the activity's customized layout contains at least one view. Condition 2: It is determined that there is a background layout and the transparency is not 0.

[0303] The visualization flag is used to identify whether the interface corresponding to the activity is visualized, that is, whether it is an interface perceptible to the user. The visualization flag can be set to "no" by default (for example, false). If it is determined that the interface corresponding to the first activity is an interface perceptible to the user, set the visualization flag to "yes" (for example, true, also called the value of the visualization flag is the first value). If it is determined that the interface corresponding to the first activity is not perceptible to the user, maintain the visualization flag at no.

[0304] The visual identifier can be used as a basis for determining whether to remove the startup window in the subsequent process. Specifically, if the visual identifier is "yes", it means that the interface corresponding to the activity is a user-perceivable interface, so the interface needs to be displayed normally, so the startup window needs to be removed. The details will be further described in the subsequent embodiments.

[0305] It is understandable that step S117 can be executed by a functional module running in the system framework in the process of application A. In other words, the present application can add a module for determining whether an activity is visualized in the application layer on the system side without changing the execution logic of application A itself, which is convenient for maintenance and can improve the security of the application and the system.

[0306] S118. During the process of executing the life cycle of the first activity by the process of application A, in the addToDisplay phase of requesting WMS in the systemserver process to add display, the visual identifier of the first activity is transmitted to WMS along with parameters, and the startup window management module in WMS saves the visual identifier in the activityRecord corresponding to the first activity.

[0307] Steps S117 and S118 can be simply called visual recognition.

[0308] Optionally, WMS can save the visual identifier to the activityRecord corresponding to the first activity when creating the window state (WindowState).

[0309] The following describes the process of identifying the startup window added by the optimization process.

[0310] See also Fig.11 In one embodiment, in the above step S112, after the systemUI process starts to add the startup window, the startup window management module identifies whether the startup window is a startup window added by the optimization process, including:

[0311] S1121: Determine whether the type parameter of the startup window is NONE (also called the first type), and the currently started activity is the first activity in the quick start scenario. If so, determine that the startup window is the startup window added by the optimization process; if not, execute step S1122.

[0312] In the native process, a type parameter is set for the startup window. The type parameter of the startup window represents the type of the added startup window. Optionally, the type of the startup window can be a snapshot type or a splash type. When adding a startup window, set the type parameter to one of the above two types as needed. When the system does not need to add a startup window for an activity, the type parameter can be set to NONE. In other words, when the type parameter of the startup window is NONE, it represents that the native process does not add a startup window to the activity. In this case, if it is further determined that the currently launched activity is the first activity in the quick launch scenario, it means that the current startup window is the startup window added by the optimized process of this application.

[0313] As described in the above embodiment, whether the currently started activity is the first activity in the quick start scenario can be determined by whether the quick function ID is included in the cache.

[0314] S1122: Determine whether the window adding result is adding failure (also called the first result), and the currently started activity is the first activity in the quick start scenario. If so, determine that the start window is the start window added by the optimization process; if not, determine that the start window is not the start window added by the optimization process.

[0315] The window adding result is used to represent the result of adding the startup window to the native process. The window adding result can be a successful addition or a failed addition. A successful addition can be indicated by returning a true value, and a failed addition can be indicated by returning a false value.

[0316] As described above, when the native system adds a startup window to an activity, if the activity has a transparent attribute, or the application sets a code to refuse to add a startup window, the native system fails to add the startup window and returns a "false" value. In this case, if it is further determined that the currently launched activity is the first activity in the quick launch scenario, it means that the current startup window is the startup window added by the optimization process of this application.

[0317] Otherwise, it means that the current startup window is not the startup window added by the optimization process.

[0318] In this embodiment, through the type parameter of the startup window and the window adding result, it is possible to accurately determine whether the startup window is added by the optimization process, thereby improving the accuracy of the execution of the optimization process and thus improving the stability of the system.

[0319] Continue to see Fig.11 In one embodiment, if the judgment result of step S1121 is "yes", step S1123 is executed.

[0320] S1123. Change the type parameter of the startup window to a splash type.

[0321] That is to say, if the native process does not add a startup window, and the startup window is a startup window added by the optimization process, the type parameter of the startup window is corrected to the type of the startup window added by the optimization process. In this way, the subsequent startup window is accurately added. In addition, the type parameter of the startup window is set to the splash type, which makes the startup window applicable not only to hot start but also to cold start compared to the snapshot type, thereby improving the scope of application of the optimization process.

[0322] 2. Second stage

[0323] In the second stage, the second and subsequent activities of the application are started in sequence, and the added startup window is passed to these activities in sequence. Moreover, when an activity is finished drawing (finishDrawing), it is decided whether to remove the startup window based on the visual mark of the activity. In addition, the properties of transition are managed. Through the above measures, the transition page can be displayed stably and smoothly without screen flashing, further improving the user's visual experience. The following is a detailed introduction with reference to the attached figures.

[0324] Fig.12 A timing diagram of another application startup method provided in an embodiment of the present application is shown below. Fig.13 For another example of an application startup method provided in the present application embodiment, please refer to Fig.12 and Fig.13 , the method comprising:

[0325] S201. During the execution of the first activity life cycle, the process of application A calls the startActivity() function to request the AMS in the systemserver process to start the second activity.

[0326] S202, the AMS in the systemserver process determines in real time whether the condition variable is unlocked and whether the valid time of the condition variable is exceeded; if the condition variable is not unlocked and the valid time of the condition variable is not exceeded, step S203 is executed; if the condition variable is not exceeded and the condition variable is unlocked, or the condition variable is not unlocked and the valid time of the condition variable is exceeded, step S204 is executed.

[0327] S203, the AMS in the systemserver process blocks the start of the second activity.

[0328] Blocking the second activity means not processing the start request of the second activity.

[0329] S204, the AMS in the systemserver process starts to process the start request of the second activity, and the transition component management module in the WMS in the systemserver process collects the activityRecord corresponding to the second activity.

[0330] Steps S202 to S204 may be simply referred to as unlocking of the conditional variable.

[0331] As described in step S105, the conditional variables may include conditional variable 1 and conditional variable 2. Determining whether to unlock the conditional variables means determining whether both conditional variables are unlocked, that is, determining whether the transition corresponding to the first activity has been submitted to the launcher process and the layer display of the launch window is completed.

[0332] Determine whether the valid duration of the condition variable is exceeded, that is, determine whether the time from the current moment to the moment when the condition variable is set exceeds the valid duration.

[0333] If the time difference between the current moment and the condition variable moment does not exceed the valid duration of the condition variable, and either of the two condition variables is not unlocked, the start of the second activity is blocked.

[0334] If the time difference between the current moment and the condition variable moment does not exceed the valid duration of the condition variable, and both condition variables have been unlocked, that is, the condition variables are unlocked within the valid duration, it means that starting the second activity of application A and creating the second transition will not affect the display of the transition page, then AMS starts processing the start request of the second activity. This prevents the second activity and the second transition from affecting the processing of the transition page, allowing the transition page to be displayed as soon as possible, thereby minimizing the response time of the application quick start.

[0335] It should be noted that the unlocking order of the two condition variables is not restricted. Condition variable 1 can be unlocked first, or condition variable 2 can be unlocked first, or both condition variables can be unlocked at the same time.

[0336] If the time difference between the current moment and the condition variable moment exceeds the valid duration of the condition variable, and at least one of the two condition variables is not unlocked, the condition variable is automatically unlocked, and AMS starts processing the start request of the second activity. This can prevent the situation where the condition variable cannot be unlocked due to abnormal process execution, which in turn causes the subsequent activities to be unable to start, thereby improving system stability.

[0337] S205. After the AMS starts processing the start request of the second activity, the activity identification module in the WMS identifies the second activity as other activity in the quick start scenario according to the sourceRecord set, uses the first sourceRecord as the sourceRecord value of the second activity, and adds the sourceRecord to the sourceRecord set; at the same time, sets the value of the source (from) parameter of the second activity to the value of the sourceRecord of the second activity.

[0338] This step can be simply called identifying other activities and setting sourceRecord.

[0339] As described in step S104 above, sourceRecord can be used as a basis for identifying an activity. Therefore, if sourceRecord exists in the sourceRecord set, it means that the activity currently requested to be started is the second activity or an activity after the second activity in the quick start scenario, that is, other activities.

[0340] In this step, when other activities are identified, on the one hand, the sourceRecord value is passed to the other activities, and on the other hand, the from parameter value of the other activities is changed. The from parameter is a parameter that marks the source of the activity in the native system, that is, the value of the from parameter represents the old activity that requests to start the new activity. Unlike the sourceRecord in this application, there is no maintenance mechanism for starting windows across task stacks in the native system, so the from parameter is only valid for activities in the same task stack. Specifically, if the new activity and the old activity are in the same task stack, the value of the from parameter is the information of the old activity. If the new activity and the old activity are in different task stacks, the value of the from parameter is NONE, indicating that the activity has no source. In this embodiment, after determining the sourceRecord of a certain other activity, the value of the sourceRecord of the other activity is written into the from parameter of the other activity. In this way, by rewriting the value of the from parameter, the startup window can also be accurately transmitted through the from parameter in the subsequent process, preventing the occurrence of flashing screens due to failure to transmit the startup window, improving the stability of the startup window display, and improving the user's visual experience.

[0341] S206. The transition component management module in the WMS of the systemserver process creates a second transition according to the collected activityRecord corresponding to the second activity.

[0342] S207. The transition identification module in the WMS of the systemserver process identifies the second transition as another transition according to the activityRecord in the second transition.

[0343] This step can be simply called identifying other transitions.

[0344] Other transitions refer to the second transition or the transitions after the second one.

[0345] Specifically, in step S203 above, the activity identification module has identified that the activity currently requested to be started is another activity. Therefore, the transition component identification module determines whether the activityRecord collected in the current transition is the activityRecord corresponding to the other activity, and further determines whether the current transition is another transition.

[0346] Optionally, if the transition identification module determines that the current transition is other transition, an identifier may be added to the current transition to facilitate subsequent search. The identifier added to other transition may be, for example, "other".

[0347] S208a. The startup window management module in the WMS of the systemserver process obtains the sourceRecord corresponding to the second activity, and passes the startup window to the second activity according to the value of the sourceRecord corresponding to the second activity.

[0348] Steps S208a and S208b may be simply referred to as starting window transfer.

[0349] As described in step S104 above, sourceRecord can be used as the basis for window transfer. Specifically, in step S205 above, a value has been set for the sourceRecord corresponding to the second activity, and the sourceRecord is added to the sourceRecord collection. Therefore, in this step, the value of the sourceRecord corresponding to the second activity can be obtained, and according to this value, the old activity (i.e., the source activity) that starts the activity can be determined. Referring to the explanation of step S104 above, in most cases, the activity that holds the startup window is the old activity. For some cases where the activity that holds the startup window is not the source activity, when the value is null, the sourceRecord of the activity that holds the startup window in the sourceRecord collection is used as the value of the sourceRecord of the new activity. Therefore, in any case, the activity corresponding to the value of sourceRecord in the optimization process of this application holds the startup window. Therefore, the activity that currently holds the startup window can be accurately obtained through sourceRecord, so that the startup window can be accurately transferred to the new activity, the accuracy of the startup window transfer is improved, and the reliability of the optimization process is improved.

[0350] As an optional implementation, after identifying other transitions and before starting the window transfer (i.e., after step S207 and before step S208), step S205 can be performed again to identify other activities and set the sourceRecord corresponding to the other activities. In this way, other activities can be further accurately identified, thereby further ensuring the correct assignment of sourceRecord, preventing subsequent startup window transfer failure or activity recognition failure, and ensuring the reliability of the optimization process.

[0351] S208b. If the first activity and the second activity belong to different task stacks, the transition component management module in the WMS controls the layer of the task stack to which the second activity belongs, and migrates the layer of the task stack to which the second activity belongs to the desktop animation layer as a sublayer of the desktop animation layer, and adjusts the layer of the startup window to the top layer in the desktop animation layer.

[0352] The transition component management module can determine the task stack to which the activity belongs based on the activityRecord. If the task stacks to which the two activities belong are different when the startup window is transferred, it is determined that the startup window is currently transferred across task stacks. In this case, the layer of the task stack to which the new activity belongs (called the target task stack) is displayed. The target task stack is displayed in the following way: migrate to the desktop animation layer and display it as a sublayer of the desktop animation layer. In other words, the layer of the target task stack is displayed as part of the animation display. In this way, the layer of the target task stack will change with the change of the animation. For example, if the animation is an icon magnification animation, then as the icon is enlarged, the layer of the target task stack will gradually enlarge. In this way, the content related to application A in the interface is displayed uniformly, and the overlapping of sub-interfaces of different sizes, or the desktop is transparent or the screen flashes, etc. are prevented, thereby improving the user's visual experience.

[0353] In addition, the level of the startup window is adjusted to the top of the desktop animation layer. In this way, other layers in the task stack can be prevented from covering the startup window. For example, when the native system also successfully adds a startup window, the startup window of the native system can be prevented from covering the startup window added by the optimization process of this solution, that is, the startup window added by the optimization process of this solution is prevented from being blocked, thereby preventing the effect of the transition page from being affected, and improving the user experience.

[0354] S209, the process of application A continues to execute the life cycle of the first activity. After the frame of the first activity is drawn, the finishDrawing() function is used to indicate to the WMS that the interface drawing is completed. In response to the indication, the startup window management module in the WMS obtains the visual identifier of the first activity from the activityRecord of the first activity, and obtains the optimized window identifier from the cache.

[0355] As described in the above steps S117 and S118, in the activityStart phase of the first activity, a visual identifier is set for the activity, and the visual identifier is transferred and saved in the activityRecord of the first activity. Therefore, this step can obtain the visual identifier of the first activity.

[0356] As described in steps S112 and S113, the startup window management module identifies that the startup window is a startup window added through the optimization process, and adds an optimized window identifier to the startup window. Therefore, if the startup window is the startup window passed by the first activity, the optimized window identifier can be obtained.

[0357] S210, starting the window management module to determine whether a delayed removal condition is met according to the visual identifier of the first activity and the acquisition result of the optimized window identifier; if the delayed removal condition is met, executing step S211; if the delayed removal condition is not met, executing step S212.

[0358] S211. The startup window management module delays removing the startup window.

[0359] S212: The startup window management module removes the startup window and clears all identification information added through the optimization process.

[0360] Steps S209 to S212 may be simply referred to as the removal of the activation window.

[0361] The delay removal condition may at least include: the visual indicator of the first activity is "no", and there is an optimization window indicator. In other words, if the interface corresponding to the first activity is an interface that is not perceptible to the user, and the current startup window is a startup window added by the optimization process, it means that the interface corresponding to the first activity does not need to be displayed, and the startup window can be removed with delay.

[0362] In another embodiment, the delayed removal condition may further include at least one of the following: the startup window held by the activity has not been delayed and removed, and the current delayed removal times threshold is greater than 0. Setting "the startup window held by the activity has not been delayed and removed" in the delayed removal condition can prevent the startup window of the same activity from being delayed and removed multiple times, that is, prevent the process from being stuck at the same activity all the time, causing startup stuck, and improve user experience.

[0363] As described in the above embodiment, when the electronic device is turned on, the configuration can be parsed to obtain the delay removal times threshold and cached in the cache configuration module. It can be understood that within a quick startup cycle, each time the WMS delays the removal of the startup window, the cache configuration module will reduce the delay removal times threshold by 1 until the delay removal times threshold is 0. When the startup window management module needs to determine whether the delay removal condition is met, it can obtain the latest delay removal times threshold from the cache configuration module. "Delay removal times threshold is greater than 0" is set in the delay removal condition, that is, when the delay removal times is 0, the removal can no longer be delayed. This can prevent the unlimited delay in removing the startup window, prevent the transition page from being displayed on the screen for a long time, cause startup jams, and improve the user experience.

[0364] It is understandable that, in some embodiments, the delayed removal condition may further include: determining that sourceRecord exists in the sourceRecord set, and determining that a startup window currently exists. Determining that sourceRecord exists in the sourceRecord set means determining that the current scene is a quick startup scene, and the current startup process is an optimized process. By determining that sourceRecord exists in the sourceRecord set and determining that a startup window currently exists, the judgment of the delayed removal window is further enhanced, the reliability of the system is improved, and the user experience is further improved.

[0365] Optionally, when the delayed removal condition is met, the window management module can obtain the delayed removal time of the startup window from the configuration cache module, and can delay the removal of the startup window by delaying the removal and recalling the delayRemoveCallback() function. The Callback time is the time from the current moment to the moment when the delayed removal time of the startup window is reached. Taking the delayed removal time of the startup window as 500ms as an example, after 500ms, the process of removing the startup window is restarted. However, within these 500ms, through the execution of subsequent steps in the optimization process, the startup window may have been passed to the subsequent activity (see step S208), and therefore, the startup window removal in the Callback process fails, which ensures the normal execution of the subsequent process and further ensures the normal display of the transition page. If the startup window is not passed out after 500ms, the startup window is removed to prevent the transition page from being displayed on the screen for a long time, causing startup jams, and improving the user experience.

[0366] Based on this, as a possible implementation, in the above step S208, after the startup window is successfully delivered, if there is a Callback for removing the delayed startup window, the Callback is cancelled. In this way, there is no need to return to remove the startup window, saving processes and reducing power consumption.

[0367] The delayed removal condition is not met, that is, the current startup window visualization flag is "yes", or there is no optimized window flag, or the startup window held by the activity has been delayed and removed, or the current delayed removal count threshold is equal to 0. In these cases, the startup window is removed normally, so that the application interface can be displayed normally and can respond to user operations normally, ensuring the normal switching between the startup window and the application window.

[0368] After removing the startup window, clear all identification information added by the optimization process, including but not limited to the shortcut function ID, sourceRecord collection, conditional variables, the effective duration of conditional variables, optimization window identification, identification of each activity, identification of each transition, etc. After removing the startup window, the system will continue to run according to the application process or native process. Clearing the identification information added by the optimization process can prevent process confusion in subsequent operations and improve system stability and reliability. In addition, clearing the identification information added by the optimization process can also prevent errors when quickly starting the function of the application next time, improving the reliability of system operation.

[0369] S213. After determining that the life cycle of the first activity is completed, the AMS in the systemserver process calls the activityPaused() function to notify the process of application A to pause the first activity, and instructs the process of application A to execute the life cycle of the second activity.

[0370] S214, the AMS in the systemserver process instructs the process of application A to pause the first activity and start executing the life cycle of the second activity. During the execution of the life cycle of the second activity, the process of application A determines whether the interface corresponding to the second activity is a user-perceivable interface in the activityResume phase, and sets the visual identifier of the second activity according to the determination result.

[0371] S215. During the process of executing the life cycle of the second activity by the process of application A, in the addToDisplay phase of requesting WMS in the systemserver process to add display, the visual identifier of the second activity is transmitted to WMS along with parameters, and the startup window management module in WMS saves the visual identifier in the activityRecord corresponding to the second activity.

[0372] Steps S214 and S215 can be simply called visual recognition.

[0373] The specific execution of steps S214 and S215 is similar to the above steps S117 and S118 and will not be repeated here.

[0374] S216. The WMS in the systemserver process responds to the request of the systemUI process and calls the addToDisplay() function to start the window adding display. After the window adding display is completed, applyReady is triggered. The transition component management module in the WMS prepares the second transition. After the second transition is prepared and before the second transition is submitted to the launcher process, the transition component management module in the WMS of the systemserver process sets the animation attribute of the second transition to "no" (that is, cancels the animation attribute).

[0375] It can be understood that during the second and subsequent activity startups, the application process requests the systemserver process to pause the activity (activityPause) to trigger WMS to enter the apply ready (appReady) phase, after which WMS prepares for transition. In other words, activityPause triggers the application transaction to be ready (APPTransactionReady).

[0376] S217. The transition component management module in the WMS sends the second transition with the animation attribute of "no" to the launcher process, notifying the launcher process to execute the second transition. The launcher process executes the second transition to continue displaying the transition page.

[0377] The above steps S216 and S217 can be simply referred to as the control of other animation effects.

[0378] It can be understood that each transition after the second transition sets the animation attribute to "No" before being submitted to the launcher process. In other words, the first transition has the animation attribute, and the transitions after the first one do not have the animation attribute, and the first transition can be an animation of icon enlargement. In this way, the display effect presented on the screen is: the icon gradually enlarges, and then the enlarged interface of the icon is maintained. The following will be explained in conjunction with the accompanying drawings. In this way, it is possible to prevent screen flashing caused by frequent switching of animations when starting activities across task stacks, thereby improving the display effect. In addition, only the first transition is an animation, and the execution time of the animation is short. The execution time of the animation is too long, which will cause the application's activity to be loaded but the animation has not been executed. Therefore, it is possible to prevent the phenomenon that the interface cannot respond to user operations, thereby improving the user experience.

[0379] S218, after the animation is executed, the launcher process requests the transition component management module in the WMS to end the animation. In response to the request of the launcher process, the transition component management module calls the onAnimationFinished() function to end the animation, and after the animation is executed, the task stack layer in the desktop animation layer is moved back to its parent layer.

[0380] This step can be simply called task stack layer migration.

[0381] Specifically, after the animation is executed, the launcher process requests the systemserver process to end the animation. The transition component management module in the systemserver process responds to the request of the launcher process and calls the onAnimationFinished() function to end the animation. It can be understood that after the animation ends, the desktop animation layer will be destroyed.

[0382] As in step S208b above, when starting window transfer, if it involves cross-task stack transfer, the layer of the task stack is migrated to the desktop animation layer as a sublayer in the desktop animation layer. After the animation is executed, the migrated task stack layer is migrated back to its original parent layer, which is, for example, the default display area layer. In this way, the task stack layer is prevented from being destroyed as a sublayer of the desktop animation layer, thereby preventing the subsequent interface from being unable to be displayed, that is, ensuring the normal display of the application interface and improving the user experience.

[0383] The above steps S201 to S218 illustrate the process related to the second activity startup phase. It can be understood that each subsequent activity is executed according to the above steps. In this way, the second activity and subsequent activities sequentially pass the startup window and display a static screen until an activity does not meet the delayed removal condition, or the last activity of application A is loaded, the startup window is removed, and the target interface a is displayed.

[0384] It should be noted that, in the above embodiment, the optimization process is described by taking cold start as an example, but the optimization process provided in the present application is applicable to cold start, warm start and hot start.

[0385] The interface change process of the first stage and the second stage mentioned above is explained below with reference to the accompanying drawings.

[0386] For example, Fig.14 This is a schematic diagram of an example of interface changes provided in an embodiment of the present application. Fig.14 As shown in Figure (a), in response to the user clicking the shortcut icon of the money collection function on the desktop, the electronic device creates a payment application process and then starts the first activity of the payment application. During the process of starting the first activity, the electronic device adds a startup window and draws the startup window to prepare to display the transition page. For example, when the first transition has an animation attribute and the animation is icon enlargement, after the startup window is drawn, the animation is executed and the icon enlargement effect is displayed on the screen, as shown in Figure 1. Fig.14 As shown in Figure (b) in the figure. After that, the icon continues to enlarge, as shown in Fig.14As shown in Figure (c) in the figure, the animation is played until the animation is completed. The second transition and subsequent transitions cancel the animation attribute, so it does not affect the animation of icon enlargement. After the animation is played, if the activity has not been loaded, a static picture is displayed in the transition page, such as a blank picture. Fig.14 As shown in Figure (d) in the figure. After that, the content that the payment application needs to display is ready, the startup window is removed, and the interface of the payment application is displayed, such as the Logo page of the payment application. Fig.14 As shown in Figure (e) in the figure. After that, the interface jumps to the payment code interface, as shown in Fig.14 As shown in Figure (f).

[0387] Depend on Fig.14 It can be seen that by optimizing the process, the preset functions of the application can be quickly started, and the transition page during the startup process can be displayed smoothly and stably without problems such as screen flashing, effectively improving the user's visual experience.

[0388] The response time of the optimization process is further explained below.

[0389] For example, Fig.15 and Fig.16 This is a schematic diagram of an example of a quick application startup interface comparison based on an optimized process and a native process provided in an embodiment of the present application. Fig.16 Figure (a) continues Fig.15 Figure (b) in the figure. Fig.15 and Fig.16 In each group of pictures in , the left picture shows the interface of the electronic device running the optimized process, and the right picture shows the interface of the electronic device running the native process. Fig.15 As shown in Figure (a), at the same time T1, the payment application is started through the shortcut method through the optimized process and the native process at the same time. Fig.15 As shown in Figure (b) in Figure 2, at time T2, the device interface running the optimized process displays a transition page, showing the effect of icons gradually expanding, while the device running the native process does not respond. Fig.16 As shown in Figure (a) in Figure 3, at time T3, the device running the optimized process has removed the startup window and displayed the logo page of the payment application, while the device running the native process is still unresponsive. Fig.16 As shown in Figure (b), at time T4, the interface of the payment function is displayed in the interface of the device running the optimized process, while the device running the native process begins to include a Logo page that displays the payment application.

[0390] Depend on Fig.15 and Fig.16It is obvious that the response time of the optimized process is greatly shortened. Moreover, in the native process, there is no animation during the startup process, and the visual effect is poor.

[0391] In addition, experimental test data also shows that the various quick start response times of various applications under the optimization process of this application are greatly reduced, for example: starting through shortcuts When using the payment function, the response time is shortened to 84ms; start via shortcut When using the scan function, the response time is shortened to 80ms; start via shortcut When using the payment function, the response time is shortened to 90ms; start via shortcut When the scan function is used, the response time is shortened to 80ms. It can be seen that the optimization process of this application can shorten the response time by up to 537ms compared with the related art.

[0392] In addition, from the description of the first and second stages above, it can be seen that the application startup method provided in this application improves the native process on the system side, without changing the original startup logic of the application, which facilitates the maintenance of the optimized process and has high security.

[0393] Next, the update of the function blacklist is explained.

[0394] Optionally, during the optimization process, if the following situations occur, the currently started function can be added to the function blacklist:

[0395] If the old activity is paused before the new activity is requested to start, the application transaction is ready (APPTransactionReady), wherein the old activity is the second activity or an activity after the second activity.

[0396] As described in the above embodiment, during the running of a certain activity (i.e., the old activity), if there is another activity (i.e., the new activity) that needs to be started after the old activity, a request can be made to the systemserver process to start the new activity during the start (activityStart) phase of the old activity. Afterwards, the systemserver process processes the start request, and after the life cycle of the old activity is completed, the old activity is paused and the new activity is started. It can be seen that the request to start the new activity is made before the old activity is paused.

[0397] See also Fig.17 However, in actual applications, for the second and subsequent activities, the application process may perform a finishActivity operation on the old activity. After completing the activity operation, the old activity is paused. After that, a request to start a new activity may be made, resulting in the request to start the new activity being made after the old activity is paused. In this case, when the old activity is paused, it has not yet requested to start a new activity from the systemserver process, and thus the transfer operation of executing the start window is not triggered, so the start window is still held by the old activity.

[0398] After the activity is paused, the application transaction may be triggered (APPTransactionReady). If the launch window is still held by the old activity when the old activity is paused, the launch window will be hidden when the old activity is paused, and the launch window will be displayed again after being transferred to the new activity, resulting in screen flashing and affecting the user experience.

[0399] In view of this, the optimization process provided by the embodiment of the present application, on the one hand, for this scenario, delays the application transaction ready (APPTransactionReady) of the transition corresponding to the old activity, that is, delays the transition ready transitionReady, waits for the old activity to request the systemserver process to start the new activity, and passes the startup window, and then executes the application transaction ready (APPTransactionReady). In this way, the startup window can be passed to the next activity while always being displayed, preventing screen flashing and improving user experience. On the other hand, the shortcut function ID of such a scenario is added to the function blacklist. In this way, the function of the application is not allowed to be executed according to the optimization process during the next quick startup, further preventing screen flashing and improving system reliability.

[0400] The application startup method provided in the embodiments of the present application is further summarized and explained below.

[0401] The application startup method provided in the embodiment of the present application, when it is determined that the current scene is suitable for quick startup through the optimization process, firstly, a startup window is added during the startup of the first activity to display the transition page, thereby shortening the response time. Secondly, when the second and subsequent activities are started, the startup window is passed to keep the transition page displayed. Thirdly, when it is determined that the interface of the application needs to be displayed, the startup window is removed to ensure the normal display of the application interface.

[0402] Then, when implementing the above three solutions, it is necessary to identify the activity in the quick start scenario and determine whether the activity is the first activity or the second and subsequent activities (i.e., other activities). In the embodiment of the present application, in the first aspect, by setting a first identifier (for example, a quick function ID), marking the quick start scenario and the first activity, the first activity in the quick start scenario can be accurately and quickly identified, and then the start window can be accurately added. In the second aspect, by setting sourceRecord, the source activity of the start activity is marked, so that other activities in the quick start scenario can be accurately and quickly identified, and then the start window can be accurately transferred. In the third aspect, by assigning a value to the visual identifier of each activity, marking whether the interface corresponding to the activity is visible, it can accurately determine whether the interface of the application needs to be displayed, and then determine whether the start window needs to be removed. Moreover, by adding a second identifier (for example, an optimization window identifier) ​​to the start window added by the optimization process, the start window added by the optimization process is marked, so that it is accurately removed when the start window is removed, and the start window added by the native process is prevented from being removed, thereby improving the accuracy of the process operation and improving the stability of the system operation.

[0403] In addition, the optimization process also identifies the first transition, as well as the second and subsequent transitions (i.e. other transitions). On the one hand, the transparency attribute of the first transition is canceled, so that the icon enlargement effect can be executed and the effect can be improved. On the other hand, the transparency attribute of other transitions is canceled, so that the screen flashing caused by frequent switching of effects can be prevented, and the display effect can be improved. In addition, the execution time of the effect is shortened, and the situation where the application's activity has been loaded but the effect has not been executed due to the long execution time of the effect will not occur. Therefore, the phenomenon that the application interface cannot respond to user operations can be prevented, thereby improving the user experience.

[0404] In addition, the optimization process limits the startup timing of the second activity by setting conditional variables to prevent affecting the loading of the first transition and the display of the transition page.

[0405] In summary, the application startup method provided in the embodiment of the present application can not only shorten the response time when the application is quickly started, but also make the transition page display smoothly and steadily, thereby improving the user experience.

[0406] The above describes in detail an example of an application startup method provided by an embodiment of the present application. It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of the present application.

[0407] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0408] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0409] The electronic device provided in this embodiment is used to execute the above-mentioned application startup method, and thus can achieve the same effect as the above-mentioned implementation method.

[0410] In the case of an integrated unit, the electronic device may further include a processing module, a storage module and a communication module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device to execute stored program codes and data, etc. The communication module may be used to support the electronic device to communicate with other devices.

[0411] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

[0412] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 3 Device of the structure shown.

[0413] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the application startup method of any of the above embodiments.

[0414] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the application startup method in the above-mentioned embodiment.

[0415] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor can execute the computer execution instructions stored in the memory so that the chip executes the application startup method in the above-mentioned method embodiments.

[0416] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

[0417] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0418] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0419] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0420] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0421] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0422] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for starting an application, characterized in that: Applied to an electronic device, the electronic device includes a system service process, a system interface process and a desktop process, and the method includes: In response to a first operation of the user, the desktop process sends a startup message to the system service process, wherein the startup message is used to instruct to start a first function of the first application through a shortcut, and the interface corresponding to the first function is an interface displayed after the first application loads n activities in sequence, where n is an integer greater than 1; In response to the startup message, the system service process starts the first activity of the n activities and creates a first transition component, where the first transition component is used to realize the display of the transition effect in the window; wherein, in the process of starting the first activity, the system interface process adds and draws a first startup window for the first activity, and after the system service process completes adding and displaying the first startup window through the addToDisplay() function, the readiness of the first transition component is triggered; In response to the first transition component being ready, the system service process notifies the desktop process to execute the first transition component; In response to the notification of the system service process, the desktop process executes the first transition component.

2. The method according to claim 1, characterized in that The system interface process adds and draws a first startup window for the first activity, including: The system interface process calls the addStartingWindow() function to add the first starting window; The system interface process calls the doFrame() function to draw the frame of the first startup window; After the frame drawing of the first startup window is completed, the system interface process requests the system service process to add display to the first startup window; The system service process calls the addToDisplay() function to add display to the first startup window; After the first startup window is added and displayed, the system service process triggers the readiness of the first transition component.

3. The method according to claim 1, characterized in that The startup message carries information about the first application, and before the system service process starts the first activity among the n activities, the method further includes: If it is determined that the startup message carries the first information, the system service process determines whether the first application meets a preset condition according to the information of the first application; the first information is used to indicate that the first function is started through a shortcut; If it is determined that the first application meets the preset condition, the system service process sets a first identifier, where the first identifier is used to indicate that the current scene is a quick start scene and the currently started activity is the first activity of the application.

4. The method according to claim 3, characterized in that The preset conditions include one or more of the following: The type of the first application is in a preset application whitelist; The package of the first application is not in a preset package blacklist; The first information is not in the function blacklist.

5. The method according to claim 3, characterized in that: Before the system interface process adds and draws the first startup window for the first activity, the method further includes: The system service process determines that the first identifier exists.

6. The method according to claim 5, characterized in that The method further comprises: After the system interface process starts to add the first startup window for the first activity, the system service process determines whether the type parameter of the first startup window is a first type, and determines whether the first identifier exists, the first type indicating that no startup window is added; If the type parameter of the first startup window is the first type and the first identifier exists, the system service process sets a second identifier for the first startup window and modifies the type parameter of the first startup window to a splash type; If the type parameter of the first startup window is not the first type and the first identifier exists, the system service process determines whether a first result exists, and the first result indicates that adding the startup window fails; If the first result exists, the system service process sets the second identifier; If the first result does not exist, the system service process clears the first identifier.

7. The method according to claim 6, characterized in that The method further comprises: In the process of starting the first activity, the system service process clears the activities in each task stack in the electronic device; When it is determined that the first identifier exists, the system service process creates a first source record corresponding to the first activity, uses the activity record of the first activity as the value of the first source record, and adds the first source record to a source record set.

8. The method according to claim 7, characterized in that The electronic device further includes a process of the first application, and the method further includes: During the execution of the life cycle of the first activity, the process of the first application determines whether the interface corresponding to the first activity is a visual interface; If the interface corresponding to the first activity is a visual interface, the system service process sets the value of the visual identifier of the first activity to a first value.

9. The method according to claim 8, characterized in that The method further comprises: In the activity layout phase of the first activity, if it is determined that the custom interface includes a view, or it is determined that there is a background layout and the transparency is not 0, the process of the first application determines that the interface corresponding to the first activity is a visual interface.

10. The method according to claim 8, characterized in that The method further comprises: After receiving the first completion indication of the process of the first application, the system service process determines whether a delayed removal condition is met, wherein the first completion indication is used to indicate that the first activity has completed drawing; If the delayed removal condition is met, the system service process delays the removal of the first startup window, and clears the first identifier, the second identifier, the source record set, and the first value; If the delayed removal condition is not satisfied, the system service process removes the first startup window.

11. The method according to claim 10, characterized in that The delayed removal condition includes: the value of the visual identifier of the first activity is not the first value, and the second identifier exists.

12. The method according to claim 11, characterized in that The delayed removal conditions also include one or more of the following: The launch window held by the first activity has not been removed; The current delayed removal times threshold is greater than 0; There are source records in the source record set.

13. The method according to claim 1, characterized in that The first transition component has a dynamic effect attribute.

14. The method according to claim 13, characterized in that The animation corresponding to the first transition component is an icon magnification animation, and the method further includes: Before submitting the first transition component to the desktop process, when it is determined that the first transition component is the transition component corresponding to the first activity, the system service process cancels the transparent attribute of the first transition component.

15. The method according to any one of claims 1 to 14, characterized in that The electronic device further includes a process of the first application, and the method further includes: In response to the system service process starting the first activity, the process of the first application executes the life cycle of the first activity; During the execution of the life cycle of the first activity, the process of the first application requests the system service process to start a second activity among the n activities; In response to the request of the first application process, the system service process starts the second activity and creates a second transition component; In the process of starting the second activity, the system service process transfers the first starting window to the second activity.

16. The method according to claim 15, characterized in that The second activity is started after the first transition component is ready, and / or the second activity is started after the layer display of the first starting window is completed.

17. The method according to claim 16, characterized in that The method further comprises: In the process of starting the first activity, the system service process sets a condition variable, the condition variable including: the first transition component has been submitted to the desktop process, and the layer display of the first start window has been completed; The system service process starts the second activity, including: When it is determined that the condition variable is unlocked, the system service process starts the second activity.

18. The method according to claim 17, further comprising: In the process of starting the first activity, the system service process sets an effective duration; If the condition variable is satisfied within the effective time period from the moment when the condition variable is set, the system service process determines that the condition variable has been unlocked; If the condition variable is still not satisfied after the valid time period from the moment when the condition variable is set, the system service process unlocks the condition variable.

19. The method according to claim 15, characterized in that Before the system service process passes the first startup window to the second activity, the method further includes: In the process of starting the second activity, when it is determined that there is a source record in the source record set, the system service process sets a second source record corresponding to the second activity and assigns a value to the second source record; the source record is used to represent the previous activity for starting the third activity, and the third activity is any one of the n activities; The second source record is added to the source record set.

20. The method according to claim 19, characterized in that The assigning a value to the second source record includes: The system service process transfers a first source record to the second source record, where the first source record is a source record corresponding to the first activity.

21. The method according to claim 19, characterized in that The system service process transfers the first startup window to the second activity, including: Acquire the second source record from the source record set; The first launch window is passed from the first activity to the second activity according to a value of the second source record.

22. The method according to claim 15, characterized in that After the system service process transfers the first startup window to the second activity, the method further includes: During the process of starting the second activity, if the first activity and the second activity do not belong to the same task stack, the system service process displays the layer of the target task stack to which the second activity belongs, migrates the layer of the target task stack to the desktop animation layer as a sublayer of the desktop animation layer, and adjusts the layer of the first startup window to the top layer of the desktop animation layer.

23. The method according to claim 22, characterized in that The method further comprises: After the desktop process completes executing the transition component, the system service process migrates the layer of the target task stack back to the parent layer of the target task stack.

24. The method according to claim 15, characterized in that The method further comprises: Before submitting the second transition component to the desktop process, the system service process cancels the animation attribute of the second transition component when it is determined that the second transition component is other transition components, and the other transition components refer to activities among the n activities except the first activity.

25. The method according to claim 15, characterized in that The method further comprises: During the execution of the life cycle of the second activity, the process of the first application determines whether the interface corresponding to the second activity is a visual interface; If the interface corresponding to the second activity is a visual interface, the system service process sets the value of the visual identifier of the second activity to the first value.

26. The method according to claim 15, characterized in that The method further comprises: After receiving the second completion indication, the system service process determines whether the delayed removal condition is met, the second completion indication being used to indicate that the second activity has completed drawing; If the delayed removal condition is met, the system service process delays removing the first startup window; If the delayed removal condition is not satisfied, the system service process removes the first startup window.

27. An electronic device, characterized in that: include: Processors, memory, and interfaces; The processor, the memory and the interface cooperate with each other so that the electronic device executes the method as claimed in any one of claims 1 to 26.

28. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 26.

Citation Information

Patent Citations

  • Application startup optimization method and apparatus, storage medium and intelligent terminal

    CN107748686A

  • Application starting method, electronic equipment and readable storage medium

    CN116126201A