Application starting method, electronic equipment and readable medium

By adjusting the duration of the transition animation, the problem of fixed transition animation time in the existing technology is solved based on the application's historical startup time and load pressure value, the user experience during the application startup process is improved, and the animation effect matching the application startup is achieved.

CN120216044APending Publication Date: 2025-06-27HONOR DEVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311764129.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-20
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the prior art, the transition animation time when the application is started is fixed, and it cannot adapt to the differences in the startup time of different applications. This causes some applications to wait for the transition animation to end before displaying the first interface after the startup is completed. Other applications are slow to start, so that the transition animation playback is completed for a long time after the transition animation is played.

Method used

It provides an application startup method, by receiving user operations, responding to user launching application operations, playing transition animations of different lengths to display the application interface, and the duration of transition animation is adjusted according to the application's historical startup time and load pressure value.

Benefits of technology

Differentiated settings for the duration of transition animations generated by different applications are realized, which improves the user experience during application startup, ensures that the transition animation matches the application startup, and avoids interface staying problems caused by the transition animation being too long or too short.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216044A_ABST
    Figure CN120216044A_ABST
Patent Text Reader

Abstract

The invention provides an application starting method, electronic equipment and a readable medium, the application starting method comprises the following steps: receiving an operation of starting a first application by a user; in response to an operation of starting the first application by a user, displaying an interface of the first application after playing the first transition animation; receiving the operation that the user quits the first application and starts the second application; in response to the operation that the user quits the first application and starts the second application, an interface of the second application is displayed after a second transition animation is played, and the duration of the second transition animation is different from that of the first transition animation. It can be seen that when the user starts the first application and the second application, the durations of the transition animations played by the electronic equipment are different, so that the durations of the transition animations generated for different applications are different.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of application control technology, and in particular, to a method for starting an application, an electronic device, a computer program product, and a computer-readable storage medium. Background Art

[0002] Currently, when a user starts an application on an electronic device, the electronic device needs to start the Activity of the application, and after the Activity starts up, it is also necessary to draw the first interface of the application. In order to improve the user experience, after the user starts the application, during the process of starting the Activity of the application and drawing the first interface, the electronic device will display a transition animation.

[0003] The startup time of the Activity of different applications and the time for drawing the first interface are all different, but currently the time of the transition animation for application startup is fixed. In this way, there are some situations where the Activity of an application starts up and the first interface is drawn, but it is necessary to wait for the transition animation to finish playing before the first interface is displayed. There are also some situations where the startup of the Activity of an application is slow, resulting in staying on the last interface of the transition animation for a long time after the transition animation finishes playing. Summary of the Invention

[0004] This application provides a method for starting an application, an electronic device, a computer program product, and a computer-readable storage medium, aiming to achieve that the durations of the transition animations generated for different applications are different.

[0005] To achieve the above object, this application provides the following technical solutions:

[0006] In a first aspect, this application provides a method for starting an application applied to an electronic device, including: receiving an operation for the user to start a first application; in response to the operation for the user to start the first application, playing a first transition animation and then displaying the interface of the first application; receiving an operation for the user to exit the first application and start a second application; in response to the operation for the user to exit the first application and start the second application, playing a second transition animation and then displaying the interface of the second application, where the duration of the second transition animation is different from the duration of the first transition animation. It can be seen that when the user starts the first application and the second application, the durations of the transition animations played by the electronic device are not the same, thus achieving that the durations of the transition animations generated for different applications are different.

[0007] In a possible implementation, after playing a first transition animation and then displaying the interface of the first application in response to a user's operation of launching the first application, the following is further included: within a first time period after the user exits the first application, receiving the user's operation of launching the first application, where the interface at the time of the first application's exit is the first interface; in response to the user's operation of launching the first application, playing a third transition animation and then displaying the interface of the first application, where the duration of the third transition animation is different from that of the first transition animation, and the third transition animation includes an image corresponding to the first interface.

[0008] In the above possible implementation, the first application exits at the moment of displaying the first interface, and the first application can enter the background for running. When the user launches the first application again within the first time period, and the transition animation played by the electronic device includes the screen of the first interface, it indicates that the first application is not a cold start and can be a warm start or a hot start. The duration of the third transition animation played by the electronic device is different from that of the first transition animation, achieving that the electronic device generates different transition animation durations according to different startup methods of the first application.

[0009] In a possible implementation, the duration of the third transition animation is less than that of the first transition animation.

[0010] In a possible implementation, receiving the user's operation of launching the first application includes: receiving the user's operation of launching the first application when the load pressure value of the electronic device is the first value. After playing a first transition animation and then displaying the interface of the first application in response to the user's operation of launching the first application, the following is further included: within a second time period after the user exits the first application, receiving the user's operation of launching the first application, where the load pressure value of the electronic device within the second time period is the second value, and the second value is greater than the first value; in response to the user's operation of launching the first application, playing a fourth transition animation and then displaying the interface of the first application, where the duration of the fourth transition animation is greater than that of the first transition animation.

[0011] In the above possible implementation, when the load pressure value of the electronic device is the first value, the duration of the first transition animation played when the electronic device launches the first application is different from the duration of the fourth transition animation played when the load pressure value of the electronic device is the second value. And the second value is greater than the first value, and the duration of the fourth transition animation is greater than that of the first transition animation, indicating that the electronic device can adjust the duration of the transition animation of the first application according to the load performance, and the duration of the transition animation is positively correlated with the load performance.

[0012] In a possible implementation, before playing the first transition animation, it further includes: generating the first transition animation based on the first data in the first data table, where the first data table is used to store multiple historical startup durations of the first application in the first startup mode. It can be seen from this that: the electronic device obtains the first transition animation based on the historical startup duration of the first application, and can make the first transition animation played when the first application starts match the first application.

[0013] In a possible implementation, before playing the third transition animation, it further includes: generating the third transition animation based on the second data in the second data table, where the second data table is used to store multiple historical startup durations of the first application in the second startup mode.

[0014] In a possible implementation, before generating the third transition animation based on the second data in the second data table, it further includes: determining that no startup process is required during the startup process of the first application.

[0015] In a possible implementation, before playing the fourth transition animation, it further includes: determining the duration of the fourth transition animation, and adjusting the duration of the fourth transition animation based on the second value; generating the fourth transition animation based on the adjusted duration of the fourth transition animation.

[0016] In a possible implementation, adjusting the duration of the fourth transition animation based on the second value includes: determining the load factor corresponding to the second value, and adjusting the duration of the fourth transition animation with the load factor.

[0017] In a possible implementation, before generating the third transition animation based on the second data in the second data table, it further includes: determining that no Activity (activity object) needs to be created during the startup process of the first application.

[0018] In a possible implementation, it further includes: determining that an Activity needs to be created during the startup process of the first application, then generating the fifth transition animation based on the third data in the third data table, where the third data table is used to store multiple historical startup durations of the first application in the third startup mode, and the duration of the fifth transition animation is less than the duration of the first transition animation.

[0019] In a second aspect, the present application provides an electronic device, including: one or more processors, a memory, and a display screen; the memory and the display screen are coupled to the one or more processors, the memory is used to store a computer program, the computer program includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the startup method of the application provided in any item of the first aspect.

[0020] In a third aspect, the present application provides a computer-readable storage medium for storing a computer program, which, when executed, is specifically used to implement the application startup method provided in any one of the first aspects.

[0021] In a fourth aspect, the present application provides a computer program product, which, when running on a computer, causes the computer to execute the application startup method provided in any one of the first aspects. Description of the Drawings

[0022] Figure 1 It is a schematic diagram showing a transition animation during the application startup process provided in the related art;

[0023] Figure 2 It is a flowchart of the method for obtaining the application startup duration provided in the embodiment of the present application;

[0024] Figure 3 It is a flowchart of the method for generating a transition animation provided in the embodiment of the present application;

[0025] Figure 4 It is a flowchart of obtaining a load coefficient based on a load pressure value provided in the embodiment of the present application;

[0026] Figure 5 It is a hardware structure diagram of an electronic device provided in the embodiment of the present application;

[0027] Figure 6 It is a software structure diagram of an electronic device provided in the embodiment of the present application. Detailed Embodiments

[0028] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and claims of the present application, the singular forms "a", "an", "the", "above-mentioned", "the foregoing", "this" are also intended to include, for example, the expression form of "one or more", unless there is a clear opposite indication in the context.

[0029] References to "some embodiments" described in this specification mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, statements such as "in some embodiments" and "in other embodiments" that appear in different places in this specification are not necessarily all referring to the same embodiment, but rather mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "comprising", "including", "having" and their variants all mean "including but not limited to", unless otherwise specifically emphasized.

[0030] The "multiple" involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, terms such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0031] The following explains some terms used in the embodiments of the present application to facilitate understanding by those skilled in the art.

[0032] The startup of an application (Application, APP) is divided into cold startup, hot startup, and warm startup. Among the three startup methods, cold startup takes the longest time, and hot startup takes the shortest time.

[0033] Cold startup: It means that the APP runs for the first time after the electronic device such as a mobile phone is started, or the APP process is cleared (for example, due to system memory tension or user-initiated clearing) and then started again. That is, before starting the application, the system does not have any processes of this APP. Cold startup requires creating a process and the APP needs to be initialized.

[0034] The process of cold startup includes:

[0035] process.start->ApplicationCreate->attachbaseContext->onCreate->onStart->onResume->activity lifecycle. Among them, after the end of the activity lifecycle, the Activity will be recycled, that is, the Activity is deleted.

[0036] Warm start: It means restarting the APP after exiting the APP. When starting, the APP process exists, but the Activity object may be recycled due to insufficient memory. At this time, starting the APP does not require re-creating the process, but it is necessary to re-execute the onCreate of the activity. Simply put, restarting the APP within the second time period after exiting the APP. During this time period, the APP process is not cleared, and the Activity is recycled. Then the APP is a warm start. The second time period is usually longer than the first time period. The life cycle of warm start: onCreate -> onStart -> onResume -> activity life cycle.

[0037] Warm start: It refers to restarting the APP after exiting the APP. When starting, the APP process exists, but the Activity object may be recycled due to insufficient memory. At this time, starting the APP does not require re-creating the process, but it is necessary to re-execute the onCreate of the activity. Briefly speaking, restarting the APP within the second time period after exiting the APP. During this time period, the APP process is not cleared, and the Activity is recycled. Then the APP is a warm start. The second time period is usually longer than the first time period. The life cycle of warm start: onCreate -> onStart -> onResume -> activity life cycle.

[0038] After the APP is started, the electronic device can display the interface of the application. The interface of the application consists of individual activities (Activities), and an Activity consists of views. A view is the form of existence of a window, and a window is the carrier of a view. When starting an Activity, the application process is notified that any Activity belongs to the application process.

[0039] Currently, when a user starts an APP on an electronic device, the electronic device needs to start the Activity of the application, and after the Activity is started, it is also necessary to draw the first interface of the application. To improve the user experience, when the user starts the APP, during the process of starting the Activity of the application and drawing the first interface, the electronic device will display a transition animation.

[0040] Exemplarily, as Figure 1 shown in (a), when the user clicks on the icon of the video to start the video application, during the process of the mobile phone starting the Activity of the video application and drawing the first interface, as Figure 1 shown in (b), a transition animation is played. After the mobile phone finishes drawing the first interface and the transition animation is played, the mobile phone is like Figure 1As shown in (c), the initial interface of the video application is displayed. For the convenience of drawing, Figure 1 In (b), the display screen of the transition animation is not shown and is replaced by the text "transition animation".

[0041] The startup times of Activities and the drawing times of the initial interfaces of different applications vary. However, the current transition animation time for application startup is fixed. As a result, for some applications, the Activity startup is completed and the initial interface is drawn, but the initial interface is not displayed until the transition animation finishes playing. There are also some applications where the Activity startup is slow, resulting in staying on the last interface of the transition animation for a long time after the transition animation finishes playing.

[0042] To implement setting an adaptable transition animation duration for different applications, the embodiments of the present application provide a method for generating a transition animation. This method for generating a transition animation is applied to the application startup scenario and can configure the duration of the transition animation in the application startup link based on the historical startup duration of different applications, achieving a differentiable setting of the duration of the transition animation to generate a transition animation adapted to the application.

[0043] It can be understood that when the electronic device starts the first application and plays the transition animation of the first application, and then starts the second application and plays the transition animation of the second application, the duration of the transition animation of the first application is different from that of the second application.

[0044] Moreover, the electronic device also configures the duration of the transition animation in the hot startup application link based on the historical startup duration of the hot startup application, configures the duration of the transition animation in the warm startup application link based on the historical startup duration of the warm startup application, and configures the duration of the transition animation of the cold startup application based on the historical startup duration of the cold startup application, realizing starting the same application in three different ways: hot startup, warm startup, or cold startup, and the duration of the transition animation during the startup process of this application also varies.

[0045] The following combines Figure 2 to introduce the method for obtaining the historical startup duration of different applications.

[0046] As Figure 2 shown, the method for obtaining the application startup duration provided by the embodiments of the present application includes the steps:

[0047] S101. Activity startup.

[0048] During the application startup process of the electronic device, the electronic device needs to start the Activity of this application.

[0049] As can be seen from the foregoing explanation of terms, application startup is divided into cold startup, warm startup, and hot startup. Therefore, for a single startup of an application, it is necessary to determine the type to which this startup belongs. Based on this, the following steps S102 to S104 provide an implementation for determining the type to which a single startup of an application belongs.

[0050] S102. Determine whether the started Activity is the main Activity.

[0051] If the electronic device determines that the started Activity is the main Activity, it executes step S103; if the electronic device determines that the started Activity is not the main Activity, it executes step S104.

[0052] In some embodiments, for cold-starting or warm-starting an application, the electronic device may first start the main Activity of the application, while for hot-starting an application, the electronic device does not need to start the main Activity of the application. However, in some cases, for warm-starting an application, the electronic device may also start the main Activity of the application. Therefore, by executing step S102, the electronic device can divide the startup of the application into: a first category including cold startup and warm startup, or a second category including hot startup and warm startup.

[0053] The electronic device can then, through step S103, determine whether the startup of the application belongs to cold startup or warm startup in the first category; or, the electronic device can, through step S104, determine whether the startup of the application belongs to hot startup or warm startup in the second category.

[0054] It should be noted that since step S102 only simply divides the startup of the application into major categories but does not accurately determine the type to which the startup of the application belongs, in some embodiments, step S102 may not be executed either.

[0055] In some embodiments, when the electronic device starts an Activity of an application, it will record the identifier of the Activity of the application in the window management service and mark whether the Activity is the main Activity. The electronic device can determine whether the started Activity is the main Activity based on the mark of the Activity recorded by the window management service.

[0056] S103. Determine whether a process needs to be started during the startup of the Activity.

[0057] As can be seen from the foregoing explanation of terms, for cold-starting an application, the electronic device needs to start the application process; for warm-starting an application, the application process already exists and the electronic device does not need to start the application process. Based on this, the electronic device can determine whether the startup of the application belongs to cold startup based on the judgment result of whether a process needs to be started during the startup of the Activity.

[0058] In some embodiments, the electronic device may find the process corresponding to the application to which the Activity belongs. If the electronic device finds the process corresponding to the application to which the Activity belongs, it determines that no process needs to be started during the startup process of the Activity; otherwise, it determines that a process needs to be started during the startup process of the Activity. In some embodiments, the electronic device may determine whether it has found the process corresponding to the application to which the Activity belongs based on the process name and the user identification (UID) of the process.

[0059] If the electronic device determines through step S103 that a process needs to be started during the startup process of the Activity, it executes step S106; otherwise, it executes step S104.

[0060] S104. Determine whether an Activity needs to be created during the startup process of the Activity.

[0061] Similarly, it can be known from the above explanations of terms that: for a hot-started application, the electronic device does not need to create an Activity; for a warm-started application, the electronic device needs to create an Activity. Based on this, the electronic device can determine whether the startup of the application is a warm start or a hot start based on the judgment result of whether an Activity needs to be created during the startup process of the Activity.

[0062] In some embodiments, the window management service WMS will record the status information indicating the life cycle of the Activity. The electronic device can find the status information of the Activity in the WMS. If the status information records that the Activity is in the created state, it determines that no Activity needs to be created during the startup process of the Activity; otherwise, it determines that an Activity needs to be created during the startup process of the Activity.

[0063] If the electronic device determines through step S104 that an Activity needs to be created during the startup process of the Activity, it executes step S105; otherwise, it executes step S107.

[0064] S105. Obtain the startup duration of the application and save it to the warm start data table.

[0065] In some embodiments, during the process of the electronic device starting an application, the electronic device may record the startup duration of the application. Based on this, when the electronic device determines that the application startup is completed, it obtains the startup duration of the application and saves it to the warm start data table.

[0066] In some embodiments, the startup duration of the application refers to the total duration of the startup duration of the Activity of the application and the drawing duration of the first interface of the application.

[0067] The electronic device is configured with a warm start data table, which is used to store the start-up duration of an application when the application is warm started. In some embodiments, one Activity is configured with a warm start data table for storing the start-up duration of the application when the Activity is started. The electronic device includes multiple applications. For each Activity of the applications of the electronic device, the electronic device is configured with different warm start data tables, and the warm start data table corresponding to each Activity can be indicated by the identifier of the Activity. Exemplarily, Figure 2 In Table (b) shown in, multiple warm start data tables are respectively identified by Warm Start Activity (A), Warm Start Activity (B), etc. Of course, Figure 2 the identifiers shown in Table (b) in are only examples.

[0068] In some embodiments, when the electronic device saves the start-up duration of an application in the warm start data table, it can be sorted in ascending order of values.

[0069] S106. Obtain the start-up duration of the application and save it to the cold start data table.

[0070] Similar to step S105, when the electronic device determines that the application has finished starting up, it obtains the start-up duration of the application and saves it to the cold start data table.

[0071] The cold start data table configured by the electronic device is used to store the start-up duration of an application when the application is cold started. In some embodiments, one Activity of an application is configured with a cold start data table for storing the start-up duration of the application when the Activity is started. The cold start data table corresponding to each Activity configured by the electronic device can also be indicated by the identifier of the Activity. Exemplarily, Figure 2 In Table (a) shown in, multiple cold start data tables are respectively identified by Cold Start Activity (A), Cold Start Activity (B), etc. Of course, Figure 2 the identifiers shown in Table (a) in are also only examples.

[0072] In some embodiments, when the electronic device saves the start-up duration of an application in the cold start data table, it can also be sorted in ascending order of values.

[0073] S107. Obtain the start-up duration of the application and save it to the hot start data table.

[0074] Similar to step S105, when the electronic device determines that the application has finished starting up, it obtains the start-up duration of the application and saves it to the hot start data table.

[0075] The hot start data table configured for the electronic device is used to store the startup duration of the application when the application is hot started. In some embodiments, an Activity of an application configures a hot start data table to store the startup duration of the application when the Activity is started. The hot start data table corresponding to each Activity configured for the electronic device can also be indicated by the identifier of the Activity. Exemplarily, Figure 2 The multiple hot start data tables shown in Table (c) in Figure 2 are respectively identified by hot start Activity (A), hot start Activity (B), etc. Of course,

[0076] In some embodiments, the electronic device saves the startup duration of the application in the cold start data table, and can also sort it in ascending order of numerical values.

[0077] In some embodiments, the cold start data table, warm start data table, and hot start data table can save a fixed number of data, such as 100 data. Based on this, during the process of the electronic device saving data to the cold start data table, warm start data table, and hot start data table, the electronic device can monitor whether the number of stored data in the cold start data table, warm start data table, and hot start data table exceeds a threshold, such as 100. If it exceeds the threshold, data will be eliminated from the cold start data table, warm start data table, and hot start data table. In some embodiments, old data, that is, data with a longer storage duration, can be preferentially eliminated.

[0078] Based on Figure 2 the method for obtaining the historical startup duration of the application shown, the data tables of different applications in cold start, warm start, and hot start are obtained, and the electronic device can generate a transition animation adapted to different applications.

[0079] The following Figure 3 is combined with

[0080] to introduce the method for generating the transition animation provided by the embodiments of the present application. Figure 3 As

[0081] shown, the method for generating the transition animation provided by the embodiments of the present application includes the steps of:

[0082] S201. Receive the startup operation of the first application to start the first application.

[0083] The user starts the first application by clicking on the icon of the first application or through the multitasking management interface. The electronic device receives the operation of starting the first application input by the user to know that the user needs to start the first application.

[0084] As can be seen from the foregoing explanation of terms, the electronic device can determine whether the first application is a cold start by judging whether a process needs to be started during the process of starting the first application. If the electronic device judges that a process needs to be started during the process of starting the first application, it determines that the first application is a cold start. If the electronic device judges that a process needs to be started during the process of starting the first application, it executes step S203; if it judges that a process does not need to be started during the process of starting the first application, it executes step S205.

[0085] For the implementation manner of the electronic device to execute step S202, reference can be made to the content of step S103 in the foregoing embodiment, which will not be elaborated here.

[0086] S203. Judge whether the cold start data table records the specified ratio of data.

[0087] If the electronic device judges that a process needs to be started during the process of starting the first application, it obtains the cold start data table. In some embodiments, the electronic device stores multiple cold start data tables, and each cold start data table corresponds to an Activity. The electronic device can obtain the cold start data table corresponding to the Activity to be started during the process of starting the first application. The electronic device can obtain the cold start data table based on the identifier of the Activity to be started by the first application.

[0088] Generally, the more data records in the cold start data table, the more it can illustrate the time required for cold starting the application. Moreover, in order to more accurately predict the time required for cold starting the application, the principle of selecting the median is usually adopted to select the specified ratio of data in the cold start data table, and the specified ratio of data can refer to the data stored at a specific position in the data table.

[0089] Exemplarily, the specified ratio of data can be the data at the 70% position, the data at the 65% position, etc. For example, the cold start data table can store a maximum of 100 data, and the data at the 70% position refers to the 70th data in the cold start data table. Similarly, the data at the 65% position refers to the 65th data in the cold start data table.

[0090] If it is judged that the cold start data table does not record the specified ratio of data, step S204 is executed; if it is judged that the cold start data table records the specified ratio of data, step S208 is executed to use the specified ratio of data in the cold start data table as the transition animation duration.

[0091] S204. Use the default value as the transition animation duration.

[0092] When the electronic device determines that the specified proportion of data is not recorded in the cold start data table, the electronic device can use the default value as the transition animation duration. The default value can be the value configured for the electronic device and belongs to an empirical value.

[0093] In some embodiments, steps S203 and S204 may not be executed either. The electronic device can select one piece of data from the cold start data table as the transition animation duration, or perform an average value operation on some of the data in the cold start data table, and use the average value as the transition animation duration.

[0094] S205. Determine whether an Activity needs to be created during the process of starting the first application.

[0095] As can be seen from the foregoing term explanation content, by determining whether an Activity needs to be created during the process of starting the first application, the electronic device can determine whether the first application is a warm start or a hot start. If the electronic device determines that an Activity needs to be created during the startup process of the first application, it is determined that the first application belongs to a warm start; otherwise, it is determined that the first application is a hot start.

[0096] If the electronic device determines that an Activity needs to be created during the process of starting the first application, it executes step S206; if the electronic device determines that an Activity does not need to be created during the process of starting the first application, it executes step S207.

[0097] For the implementation manner of the electronic device to execute step S205, reference can be made to the content of step S104 in the above embodiments, which will not be elaborated here.

[0098] S206. Determine whether the specified proportion of data is recorded in the hot start data table.

[0099] If the electronic device determines that no process needs to be started and no Activity needs to be created during the process of starting the first application, it is determined that the first application is hot started, and then the electronic device obtains the hot start data table. In some embodiments, the electronic device stores hot start data tables for multiple Activities, and the electronic device can obtain the hot start data table corresponding to the Activity to be started in the startup process of the first application. The electronic device can obtain the hot start data table corresponding to the Activity to be started in the startup process of the first application based on the identifier of the Activity.

[0100] Generally, the more data records there are in the hot start data table, the more it can illustrate the time required for hot starting the application. And, in order to more accurately predict the time required for hot starting the application, the principle of selecting the median is usually adopted to select the specified proportion of data in the hot start data table. The specified proportion of data can refer to the data stored at a specific position in the data table.

[0101] Exemplarily, the specified ratio data can be the data at the 70% position, the data at the 65% position, etc. For example, the hot start data table can store a maximum of 100 data, and the data at the 70% position refers to the data at the 70th position in the hot start data table. Similarly, the data at the 65% position refers to the data at the 65th position in the hot start data table.

[0102] Among them, if it is determined that the specified ratio data is not recorded in the hot start data table, step S204 is executed; if it is determined that the specified ratio data is recorded in the hot start data table, step S208 is executed to use the specified ratio data in the hot start data table as the transition animation duration.

[0103] In some embodiments, step S206 may not be executed either. The electronic device can select one data in the hot start data table as the transition animation duration, or perform an average value operation on some data in the hot start data table and use the average value as the transition animation duration.

[0104] S207. Determine whether the specified ratio data is recorded in the warm start data table.

[0105] When the electronic device determines that no process needs to be started during the process of starting the first application, but an Activity needs to be created, it is determined that the first application is warm started, and then the electronic device obtains the warm start data table. In some embodiments, the electronic device stores multiple Activity warm start data tables, and the electronic device can obtain the warm start data table corresponding to the Activity that needs to be created. The electronic device can obtain the warm start data table corresponding to the Activity that needs to be created based on the identifier of the Activity.

[0106] Generally, the more data recorded in the warm start data table, the more it can illustrate the time required for warm starting the application. And, in order to further accurately predict the time required for warm starting the application, the principle of selecting the median is usually adopted to select the specified ratio data in the warm start data table, and the specified ratio data can refer to the data stored at a specific position in the data table.

[0107] Exemplarily, the specified ratio data can be the data at the 70% position, the data at the 65% position, etc. For example, the warm start data table can store a maximum of 100 data, and the data at the 70% position refers to the data at the 70th position in the warm start data table. Similarly, the data at the 65% position refers to the data at the 65th position in the warm start data table.

[0108] Among them, if it is determined that the specified ratio data is not recorded in the warm start data table, step S204 is executed; if it is determined that the specified ratio data is recorded in the warm start data table, step S208 is executed to use the specified ratio data in the warm start data table as the transition animation duration.

[0109] In some embodiments, step S207 may not be executed. The electronic device may select one piece of data in the warm start data table as the transition animation duration, or perform an average value calculation on some of the data in the warm start data table, and use the average value as the transition animation duration.

[0110] S208: Use the specified ratio data as the transition animation duration.

[0111] Using the specified ratio data in the cold start data table, warm start data table, or warm start data table as the transition animation duration can use the historical start duration of the first application as a reference to obtain the transition animation duration during the current start process of the first application, and generate a transition animation adapted to the first application.

[0112] S209: Obtain a load coefficient based on the load pressure value.

[0113] During the process of the electronic device starting the first application, the load pressure of the electronic device will also affect the start duration of the first application. Based on this, the electronic device can obtain the load pressure value (CPU Pressure Stall Information, CPU PSI), and obtain the load coefficient based on the load pressure value. This load system is used to adjust the transition animation duration obtained in step S208 or step S204.

[0114] In some embodiments, the kernel layer of the electronic device operating system includes a scheduling (sched) module, which can provide the load pressure value of the electronic device. The greater the load pressure value, the higher the load of the electronic device. The scheduling module can obtain the load pressure values of the electronic device at different time durations. Exemplarily, the load pressure values at different time durations are as follows: avg10 = 0.15, avg60 = 2.16, avg300 = 3.11. avg10 represents the average load pressure value in the most recent 10 seconds, avg60 represents the average load pressure value in the most recent 60 seconds, and avg300 represents the average load pressure value in the most recent 300 seconds. The scheduling module reports the load pressure value in the most recent time duration to the upper layer module of the electronic device operating system to enable the electronic device to obtain the load coefficient based on the load pressure value. For example, the scheduling module reports the value of avg10 to the upper layer module of the electronic device operating system.

[0115] The electronic device is configured with a load system correspondence table. The method for the electronic device to obtain the load coefficient based on the load pressure value can be as Figure 4 shown, including the steps:

[0116] S301: Obtain the load pressure value.

[0117] S302: Find the load coefficient corresponding to the load pressure value in the load coefficient correspondence table.

[0118] The load factor correspondence table can indicate that the greater the load pressure value, the greater the load factor.

[0119] In some embodiments, the load factor correspondence table includes load factors corresponding to different ranges of load pressure values, and the electronic device looks up the load factor corresponding to the range to which the load pressure value belongs in the load factor correspondence table. Exemplarily, Figure 4 The shown load factor correspondence table includes: the load factor corresponding to the range where the load pressure value is less than or equal to 15, the load factor corresponding to the range where the load pressure value is less than or equal to 30, the load factor corresponding to the range where the load pressure value is less than or equal to 50, and the load factor corresponding to the range where the load pressure value is greater than 50.

[0120] S210. Adjust the duration of the transition animation based on the load factor to obtain the adjusted duration of the transition animation.

[0121] The electronic device takes the product of the duration of the transition animation and the load factor as the adjusted duration of the transition animation. In this way, it can be achieved that the adjusted duration of the transition animation follows the size of the load factor, that is, the greater the load factor, the greater the adjusted duration of the transition animation, and vice versa. Since the load factor is positively correlated with the load pressure value, therefore, when the load of the electronic device is high, the load pressure value is relatively large, the load factor is relatively large, and the adjusted duration of the transition animation is also relatively large, ensuring that when the electronic device is under high load, the electronic device plays a transition animation with a longer duration, giving the electronic device sufficient time to complete the startup of the application's Activity and the drawing of the first interface.

[0122] In some cases where the load of the electronic device does not need to be considered, steps S209 and S210 may not be executed either.

[0123] S211. Determine whether the adjusted duration of the transition animation is greater than the first threshold.

[0124] After the electronic device obtains the adjusted duration of the transition animation, through steps S211 and S212, it can be achieved that the adjusted duration of the transition animation is compared with the first threshold and the second threshold respectively. The first threshold is greater than the second threshold. The first threshold can be understood as the maximum value of the duration of the transition animation, and the second threshold can be understood as the minimum value of the duration of the transition animation. The first threshold and the second threshold can be values configured for the electronic device and belong to empirical values.

[0125] If the electronic device determines that the adjusted duration of the transition animation is greater than the first threshold, it executes step S214; if the electronic device determines that the adjusted duration of the transition animation is not greater than the first threshold, it executes step S212.

[0126] S212. Determine whether the adjusted duration of the transition animation is less than the second threshold.

[0127] If the electronic device determines that the adjusted duration of the transition animation is less than the second threshold, it executes step S215; if the electronic device determines that the adjusted duration of the transition animation is not less than the second threshold, it executes step S213.

[0128] Among them, Figure 3 FIG. shows an execution order of step S211 and step S212, but this does not constitute a limitation on the execution order of step S211 and step S212. In some embodiments, step S211 and step S212 may be executed in parallel, or step S212 may be executed first and then step S211.

[0129] In some embodiments, step S211 and step S212 may also not be executed, and the electronic device directly uses the adjusted duration of the transition animation to generate the transition animation.

[0130] S213: Use the adjusted duration of the transition animation as the duration of the transition animation.

[0131] If the electronic device determines that the adjusted duration of the transition animation is not greater than the first threshold and not less than the second threshold, it indicates that the adjusted duration of the transition animation is a reasonable value. The transition animation can be generated based on the adjusted duration of the transition animation. Therefore, the electronic device uses the adjusted duration of the transition animation as the duration of the transition animation, and this duration of the transition animation is used in the link where the electronic device generates the transition animation.

[0132] S214: Use the first threshold as the duration of the transition animation.

[0133] Since the first threshold is the maximum value of the duration of the transition animation, if the electronic device determines that the adjusted duration of the transition animation is greater than the first threshold, it indicates that the adjusted duration of the transition animation exceeds the maximum value of the duration of the transition animation. Generating the transition animation using the adjusted duration of the transition animation will cause the transition animation to be too long and lead to a long waiting time for the user. Therefore, the electronic device uses the first threshold as the duration of the transition animation and generates a transition animation with a duration of the first threshold through step S216.

[0134] S215: Use the second threshold as the duration of the transition animation.

[0135] Since the second threshold is the minimum value of the duration of the transition animation, if the electronic device determines that the adjusted duration of the transition animation is less than the first threshold, it indicates that the adjusted duration of the transition animation is less than the minimum value of the duration of the transition animation. Generating the transition animation using the adjusted duration of the transition animation will cause the transition animation curve to be severely deformed and the experience to be poor. Moreover, the user will also feel that there is an interface jump phenomenon during the transition animation. Therefore, the electronic device uses the second threshold as the duration of the transition animation and generates a transition animation with a duration of the second threshold through step S216.

[0136] S216: Generate a transition animation based on the duration of the transition animation.

[0137] The electronic device generates a transition animation with a duration equal to the duration of the transition animation.

[0138] It should be noted that during the process of the electronic device starting the first application, the electronic device can also adopt Figure 2 the method for obtaining the startup duration of the displayed application to obtain the startup duration of the first application, and save the startup duration of the first application to the cold startup data table, warm startup data table, or hot startup data table according to the way of starting the first application this time. Of course, the startup duration of the first application should be saved to the cold startup data table, warm startup data table, or hot startup data table corresponding to a certain Activity of the first application, and this Activity is the Activity to be started during the process of starting the first application this time.

[0139] It should be noted that in the scenario of cold starting an application, the drawing time consumption of the first pages of different Activities varies greatly. The transition animation generated by the electronic device with a fixed transition animation duration has a greater degree of incompatibility with cold starting different Activities. Based on this, the electronic device can determine that the Activity is a cold start based on Figure 2 step S103 in it, obtain the startup duration of the application, and save the startup duration of the application in the data table of the Activity.

[0140] In the scenario where the user starts the first application, the electronic device determines that the first application is a cold start through Figure 3 step S202 in it, obtains the transition animation duration of the first application based on the specified ratio data recorded in the data table of the Activity, and generates a transition animation with this transition animation duration.

[0141] In some embodiments, if the electronic device determines that the specified ratio data is not recorded in the data table of the Activity, it can generate a transition animation based on the default value.

[0142] In other embodiments, after the electronic device obtains the transition animation duration of the first application, it can also execute steps S209 to S216. The specific implementation process of steps S209 to S216 can be referred to Figure 3 the corresponding embodiment content, which will not be elaborated here.

[0143] The electronic device disclosed in the embodiments of the present application can be an electronic device such as a mobile phone, a tablet computer, a personal digital assistant (Personal Digital Assistant, PDA), a desktop computer, a laptop computer, a notebook computer, an ultra-mobile personal computer (Ultra-mobile Personal Computer, UMPC), a handheld computer, a netbook, and a wearable device.

[0144] Take mobile phones as an example. Figure 5 This is an example of the composition of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 400 may include a processor 410 , an internal memory 420 , a camera 430 , a display screen 440 , and a sensor module 450 , etc. It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100 .

[0145] The processor 410 may include one or more processing units, for example, the processor 410 may include an application processor (AP), a graphics processing unit (GPU), an image signal processor (ISP), and a video codec. The processor 410 may also be provided with a memory for storing instructions and data.

[0146] The internal memory 420 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 410 executes various functional applications and data processing of the electronic device 400 by running the instructions stored in the internal memory 420. In some embodiments, the internal memory 420 stores instructions for executing a method for obtaining the application startup duration and a method for generating a transition animation. The processor 410 can obtain the startup duration of an application and generate a transition animation in the application startup scene by executing the instructions stored in the internal memory 420.

[0147] The electronic device 400 can realize the shooting function through the ISP, the camera 430, the video codec, the GPU, the display screen 440, and the application processor, etc. The electronic device 400 can realize the display function through the GPU, the display screen 440, and the application processor, etc.

[0148] In the sensor module 450, the pressure sensor 450A is used to sense the pressure signal and convert the pressure signal into an electrical signal. The touch sensor 450B is also called a "touch control device". The touch sensor 450B can be set on the display screen 440, and the touch sensor 450B and the display screen 440 form a touch screen, also called a "touch control screen". The touch sensor 450B is used to detect a touch operation 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.

[0149] In addition, an operating system is running on the above components. The operating system of the electronic device 400 may adopt a layered 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 400.

[0150] Figure 5 It is a software structure block diagram of the electronic device 400 according to an embodiment of the present application.

[0151] The layered architecture divides the software into several layers, and 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 layer, the Android runtime, and the system libraries, and the kernel layer.

[0152] The application layer may include a series of application packages.

[0153] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions. As Figure 5 shown, the application framework layer may include the WindowManagerService (WMS), etc. The WindowManagerService can execute Figure 2 and Figure 3 the processes shown, which will not be elaborated here.

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

[0155] The kernel layer is the layer between hardware and software. The kernel layer at least includes a scheduling module, and the functions of the scheduling module can be referred to the content of the above embodiments, which will not be elaborated here.

[0156] Another embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When it runs on a computer or a processor, the computer or the processor is enabled to execute one or more steps in any of the above methods.

[0157] The computer-readable storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0158] Another embodiment of the present application further provides a computer program product containing instructions. When the computer program product runs on a computer or a processor, the computer or the processor is enabled to execute one or more steps in any of the above methods.

Claims

1. A method for starting an application, characterized in that, Applied to an electronic device, the method includes: Receiving an operation by the user to start a first application; In response to the operation by the user to start the first application, playing a first transition animation and then displaying the interface of the first application; Receiving an operation by the user to exit the first application and start a second application; In response to the operation by the user to exit the first application and start the second application, playing a second transition animation and then displaying the interface of the second application, wherein the duration of the second transition animation is different from the duration of the first transition animation.

2. The startup method of the application according to claim 1, characterized in that, After playing the first transition animation and then displaying the interface of the first application in response to the operation by the user to start the first application, it further includes: Within a first time period after the user exits the first application, receiving an operation by the user to start the first application, and the interface when the first application exits is a first interface; In response to the operation by the user to start the first application, playing a third transition animation and then displaying the interface of the first application, wherein the duration of the third transition animation is different from the duration of the first transition animation, and the third transition animation includes an image corresponding to the first interface.

3. The startup method of the application according to claim 2, characterized in that, The duration of the third transition animation is less than the duration of the first transition animation.

4. The startup method of the application according to any one of claims 1 to 3, characterized in that, The receiving an operation by the user to start the first application includes: receiving an operation by the user to start the first application when the load pressure value of the electronic device is a first value. After playing the first transition animation and then displaying the interface of the first application in response to the operation by the user to start the first application, it further includes: Within a second time period after the user exits the first application, receiving an operation by the user to start the first application, and the load pressure value of the electronic device within the second time period is a second value, and the second value is greater than the first value; In response to the operation by the user to start the first application, playing a fourth transition animation and then displaying the interface of the first application, wherein the duration of the fourth transition animation is greater than the duration of the first transition animation.

5. The startup method of the application according to any one of claims 1 to 4, characterized in that Before playing the first transition animation, it further includes: Generating the first transition animation based on first data in a first data table, and the first data table is used to store multiple historical start durations of the first application in a first start mode.

6. The startup method of the application according to claim 2, characterized in that, Before playing the third transition animation, it further includes: Generating the third transition animation based on second data in a second data table, and the second data table is used to store multiple historical start durations of the first application in a second start mode.

7. The startup method of the application according to claim 6, characterized in that, Before generating the third transition animation based on the second data in the second data table, it further includes: Determining that no process needs to be started during the startup process of the first application.

8. The startup method of the application according to claim 4, characterized in that, Before playing the fourth transition animation, it further includes: Determining the duration of the fourth transition animation and adjusting the duration of the fourth transition animation based on the second value; Generating the fourth transition animation based on the adjusted duration of the fourth transition animation.

9. The startup method of the application according to claim 8, characterized in that, The adjusting the duration of the fourth transition animation based on the second value includes: Determining a load coefficient corresponding to the second value and adjusting the duration of the fourth transition animation with the load coefficient.

10. The startup method of the application according to claim 7, characterized in that, Before generating the third transition animation based on the second data in the second data table, it further includes: It is determined that no Activity object needs to be created during the startup process of the first application.

11. The startup method of the application according to claim 10, characterized in that, It further includes: If it is determined that an Activity needs to be created during the startup process of the first application, then based on the third data in the third data table, the fifth transition animation is generated, and the third data table is used to store multiple historical startup durations of the first application in the third startup mode, and the duration of the fifth transition animation is less than the duration of the first transition animation.

12. An electronic device, characterized in that, It includes: One or more processors, a memory, and a display screen; The memory and the display screen are coupled to the one or more processors, and the memory is used to store a computer program, and the computer program includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the startup method of the application according to any one of claims 1 to 11.

13. A computer-readable storage medium, characterized in that, It is used to store a computer program, and when the computer program is executed, it is specifically used to implement the startup method of the application according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Video editing method and video editing device

    CN112702656A

  • Method and device for adjusting application starting animation

    CN113176904A

  • Application starting method and device

    CN116954743A

  • Calibration device for oral scanner

    KR102551332B1