Method and device for quickly starting application program

By processing multiple subtasks in parallel and re-executing failed tasks quickly, the problem of long-term acquisition of information by applying the application is solved, and the user experience and application startup speed is improved.

CN118916091APending Publication Date: 2024-11-08SHENZHEN SEN5 TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411071598.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

Existing applications take a long time to obtain smart device information, and also take a long time to return to the login interface when the information is failed, resulting in poor user experience.

Method used

Optimize request depth and load time by determining multiple tasks during the application startup to the homepage, using multiple threads to process subtasks in parallel, and quickly re-execute the first-order task in sequence when the task fails.

Benefits of technology

It shortens the time for the application to execute tasks, reduces the time for loading data, speeds up data acquisition, improves user experience, promptly identify and process subtask failures, and shortens the time for application restart.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916091A_ABST
    Figure CN118916091A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for quickly starting an application program. The method comprises the following steps: step A, starting the application program based on a user instruction; step B, determining a plurality of successive tasks in a process from starting the application program to entering the home page of the application program; c, determining a task needing to be executed currently, and if the number of the subtasks of the task needing to be executed currently is multiple, calling a plurality of threads with the same number as the subtasks to process the multiple subtasks at the same time; d, if all the sub-tasks are executed successfully, the next task of the task which is executed successfully currently serves as the task which needs to be executed currently, and the step C is executed; if any subtask fails to be executed, taking the first task as the task needing to be executed currently, and executing the step C; and E, when the task ranked to the last but one is successfully executed, entering the home page of the application program. According to the method and the device, the time for executing the task by the application program is shortened, and the time for restarting the application program is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for quickly starting an application program. Background Art

[0002] With the development of Internet of Things technology, more and more intelligent devices are appearing in people's daily lives, such as smart TVs, smart air conditioners, smart fire alarms, etc. After smart home products are connected to the network, users can realize intelligent control over them. Currently, users can realize intelligent control over them by installing applications in the terminal, such as remote monitoring and viewing relevant information of smart devices.

[0003] When the application is in use, it first detects the user's login status, and then obtains information from the smart device after confirming that the login is successful. When the login fails or the information acquisition fails, the application will automatically return to the login interface. The current application takes a long time to obtain information, and the time it takes from failing to obtain information to returning to the login interface is also long. Summary of the invention

[0004] In order to overcome the above-mentioned defects of the prior art, the present application provides a method and device for quickly starting an application.

[0005] The specific technical solutions are as follows:

[0006] A method for quickly launching an application, comprising:

[0007] Step A: starting the application based on user instructions;

[0008] Step B, determining a plurality of tasks in a sequence from application startup to entering the application homepage;

[0009] Step C, determining the task to be executed currently, if the task to be executed currently has multiple subtasks, calling multiple threads with the same number of subtasks to process the multiple subtasks simultaneously; each thread processes a different subtask;

[0010] Step D: If all subtasks are successfully executed, the next task of the currently successfully executed task is used as the current task to be executed based on the order, and step C is executed; if any subtask fails to be executed, the task ranked first in the order is used as the current task to be executed, and step C is executed;

[0011] Step E: When the last task in the order is successfully executed, the application homepage is entered.

[0012] In one embodiment, the plurality of tasks in a sequential order include a first task, a second task, and a third task;

[0013] The first task includes a subtask of obtaining user information data;

[0014] The second task includes a subtask of obtaining application information data and a subtask of obtaining family information data;

[0015] The third task includes a subtask of obtaining application background information data, a subtask of obtaining home room information data, a subtask of obtaining home scene information data, and a subtask of obtaining home device information data.

[0016] In one embodiment, the step C further comprises:

[0017] If the number of subtasks of the task currently to be executed is one, the subtask is directly executed.

[0018] In one embodiment, the step D further comprises:

[0019] Monitor the execution time taken since the execution of the task ranked first in the sequence. When the execution time exceeds a preset time, take the task ranked first in the sequence as the current task to be executed, and execute step C.

[0020] In one embodiment, the user information data is obtained through the user or getUserInfo interface.

[0021] In one embodiment, the application information data is obtained through a device, product, or findAccessoryProduc t interface;

[0022] And / or, obtaining the home information data through a user, home or findA ll interface.

[0023] In one embodiment, the application background information data is obtained through assets, file or findByCode interface;

[0024] and / or, obtaining the home room information data through a user, room or findRoomList interface;

[0025] And / or, obtaining the home scene information data through the user, scenes or searchSceneList interface;

[0026] And / or, obtaining the home device information data through a device, accessory or findAccessoryByHomeId interface.

[0027] A device for quickly launching an application program, comprising:

[0028] The first module is used to start the application based on the user instruction;

[0029] The second module is used to determine multiple tasks in a sequence from application startup to entering the application homepage;

[0030] The third module is used to determine the task to be executed currently. If the task to be executed currently has multiple subtasks, multiple threads equal to the number of the subtasks are called to process the multiple subtasks simultaneously; each thread processes a different subtask.

[0031] The fourth module is used for, if all subtasks are successfully executed, taking the next task of the currently successfully executed task as the task to be executed based on the sequence, and driving the third module to work; if any subtask fails to be executed, taking the task ranked first in the sequence as the task to be executed, and driving the third module to work;

[0032] The fifth module is used to enter the application home page when the last task in the sequence is successfully executed.

[0033] In one embodiment, the third module is further configured to directly execute the subtask if the number of subtasks of the task currently to be executed is one.

[0034] In one embodiment, the fourth module is also used to monitor the execution time taken since the execution of the task ranked first in the priority sequence. When the execution time exceeds the preset time, the task ranked first in the priority sequence is used as the current task to be executed, and the third module is driven to work.

[0035] This application has at least the following beneficial effects:

[0036] The present application provides a method and device for quickly starting an application, the method comprising: step A, starting the application based on a user instruction; step B, determining multiple tasks in a sequence from the start of the application to entering the application homepage; step C, determining the task to be executed currently, if the number of subtasks of the task to be executed currently is multiple, calling multiple threads with the same number of subtasks to process the multiple subtasks simultaneously; each thread processes a different subtask; step D, if all subtasks are executed successfully, then based on the sequence, the next task of the currently successfully executed task is used as the current task to be executed, and step C is executed; if any subtask fails to execute, then the task ranked first in the sequence is used as the current task to be executed, and step C is executed; step E, when the task ranked last in the sequence is executed successfully, the application homepage is entered.

[0037] The present application processes multiple subtasks simultaneously by calling multiple threads with the same number of subtasks, so as to set multiple subtasks in parallel, thereby shortening the time spent by the application to execute tasks, optimizing the request depth, reducing the time taken by the application to load data, speeding up the acquisition of data, and when any subtask fails to execute, the task ranked first in the sequence is re-executed, shortening the time to restart the application. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 A first flow chart of the method for quickly starting an application program provided in Example 1;

[0040] Figure 2 A second flow chart of the method for quickly starting an application program provided in Example 1;

[0041] Figure 3 A third flow chart of the method for quickly starting an application program provided in Example 1;

[0042] Figure 4 This is a module diagram of the application quick launch device provided in Example 2.

[0043] Reference numerals:

[0044] 1-first module; 2-second module; 3-third module; 4-fourth module; 5-fifth module. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0046] Example 1

[0047] Current applications take a long time to obtain information, and the time it takes for an application to return to the login interface after failing to obtain information is also long. Users need to spend a long time waiting, resulting in a poor user experience.

[0048] like Figure 1 , Figure 2 and Figure 3 As shown, the present application provides a method for quickly starting an application program, comprising:

[0049] Step A: starting the application based on user instructions;

[0050] Step B, determining a plurality of tasks in a sequential order from application startup to entering the application homepage;

[0051] Step C, determining the task to be executed currently, if the task to be executed currently has multiple subtasks, calling multiple threads with the same number of subtasks to process the multiple subtasks simultaneously; each thread processes a different subtask;

[0052] Step D: If all subtasks are successfully executed, the next task of the currently successfully executed task is used as the current task to be executed based on the order of priority, and step C is executed; if any subtask fails to be executed, the task ranked first in the order of priority is used as the current task to be executed, and step C is executed;

[0053] Step E: When the last task in the order of priority is successfully executed, the application home page is entered.

[0054] The present application optimizes the request depth by screening out multiple tasks with a sequence in step B, that is, multiple tasks that have a dependency relationship and need to be set in series, determining the tasks that are necessary to be set in series, and optimizing the tasks that are not necessary to be set in series; and in step C, multiple subtasks are processed simultaneously by calling multiple threads with the same number of subtasks to set multiple subtasks in parallel, thereby shortening the time spent by the application to execute tasks, reducing the time for the application to load data, speeding up data acquisition, and reducing the waiting time when the user uses the application; and in step D, it is set that when any subtask fails to execute, the task ranked first in the sequence is re-executed, thereby shortening the time to restart the application and improving the user experience.

[0055] This application is applicable to an application terminal associated with a smart home device, through which a user can remotely control and view relevant information of the smart device. Specifically, the application terminal can be set on a mobile terminal such as a mobile phone, a notebook, or a tablet computer.

[0056] like Figure 1 , Figure 2 and Figure 3 As shown, step C also includes:

[0057] If the number of subtasks of the task currently to be executed is one, the subtask is executed directly.

[0058] The present application can choose to directly execute a subtask or call multiple threads with the same number of subtasks to process multiple subtasks simultaneously according to the number of subtasks of the task currently to be executed, and has a wide range of applications.

[0059] like Figure 1 , Figure 2 and Figure 3 As shown, step D also includes:

[0060] The execution time taken since the task ranked first in the execution sequence is monitored. When the execution time exceeds the preset time, the task ranked first in the execution sequence is used as the current task to be executed, and step C is executed.

[0061] If the execution time exceeds the preset time, it means that the task failed in the middle. By monitoring the execution time, the present application can quickly discover the failure of the task so as to quickly re-execute the task that is ranked first in the priority order, thereby shortening the time for restarting the application and reducing the time spent from failure to obtain information to returning to the login interface.

[0062] like Figure 1 , Figure 2 and Figure 3 As shown, the plurality of tasks in a sequential order include a first task, a second task and a third task;

[0063] The first task includes the subtask of obtaining user information data;

[0064] The second task includes a subtask of obtaining application information data and a subtask of obtaining family information data;

[0065] The third task includes a subtask of obtaining application background information data, a subtask of obtaining home room information data, a subtask of obtaining home scene information data, and a subtask of obtaining home device information data.

[0066] This application detects user data by executing the first task to confirm whether the user has logged in successfully. If user data is detected, that is, the user has logged in successfully, the user information and corresponding token data will be read. If user data is not detected, that is, the user login failed, the application will jump to the login interface to re-check the user data.

[0067] Specifically, user information data is obtained through the user or getUser Info interface.

[0068] The present application obtains application production information by executing the second task to obtain application information data, and also obtains home information data by executing the second task to obtain home information data to obtain home information data of the user who has successfully logged in. In this embodiment, the subtask status of obtaining application information data is recorded as loadProductFinish, and the subtask status of obtaining home information data is recorded as loadHomeFinish.

[0069] Specifically, the application information data is obtained through the device, product or findA l lAccessoryProduct interface.

[0070] Specifically, family information data is obtained through user, home or findA ll interface.

[0071] This application obtains application background image information data by executing the subtask of obtaining application background information data. In this embodiment, the background image address or i gina l Url is obtained through the assets, file or findByCode interface request and saved to the application global data cache. Specifically, the subtask status of obtaining application background information data is recorded as loadHomeBgFi ni sh.

[0072] This application obtains the home room information data of the user who successfully logged in by executing the subtask of obtaining the home room information data. In this embodiment, the home room information data of the user who successfully logged in is obtained through the user, room or findRoomList interface request, and is saved in the global user home room list cache. Specifically, the subtask status of obtaining the home room information data is recorded as loadRoomFi ni sh.

[0073] This application obtains the home scene information data of the user who has successfully logged in by executing the subtask of obtaining home scene information data. In this embodiment, the home scene information data of the user who has successfully logged in is obtained through the user, scenes or searchSceneList interface request, and is saved in the global user home scene list cache. Specifically, the subtask status of obtaining home scene information data is recorded in loadSceneFi ni sh.

[0074] This application obtains the home device information data of the user who successfully logged in by executing the subtask of obtaining home device information data. In this embodiment, the home device information data of the user who successfully logged in is obtained through the device, accessory or findAccessoryByHomeId interface request, and is saved in the global user home device list cache. Specifically, the subtask status of obtaining home device information data is recorded as loadDevi ceFi ni sh.

[0075] In this embodiment, if the first task, the second task and the third task are all executed successfully, the status of each task is displayed as loadTrue, the application enters the home page, and displays the corresponding user data on the home page. If one of the tasks or subtasks fails during the execution process, the corresponding task status is displayed as loadError, the application jumps to the login interface, and the user is required to log in again.

[0076] This embodiment has at least the following beneficial effects:

[0077] 1. Greatly reduces the startup time of the application, reduces the waiting time when users use the application, and improves the user experience.

[0078] 2. Setting multiple subtasks in parallel can quickly identify which subtask failed to execute, and then quickly detect which interfaces have problems, and finally quickly return to the task ranked first in the order, shortening the time to restart the application.

[0079] 3. Split the original subtasks that are not in order but set serially, and call multiple threads with the same number of subtasks to process multiple subtasks simultaneously. Each thread processes a different subtask, and each subtask is independent of each other, which improves the readability and reusability of the code.

[0080] Example 2

[0081] like Figure 4 As shown, the present application also provides a device for quickly launching an application program, including:

[0082] The first module 1 is used to start the application based on the user instruction;

[0083] The second module 2 is used to determine a plurality of tasks in a sequential order from the start of the application to the entry into the application homepage;

[0084] The third module 3 is used to determine the task to be executed currently. If the task to be executed currently has multiple subtasks, multiple threads with the same number of subtasks are called to process the multiple subtasks simultaneously; each thread processes a different subtask.

[0085] The fourth module 4 is used to, if all subtasks are successfully executed, take the next task of the currently successfully executed task as the current task to be executed based on the order of precedence, and drive the third module to work; if any subtask fails to be executed, take the task ranked first in the order of precedence as the current task to be executed, and drive the third module to work;

[0086] The fifth module 5 is used to enter the application home page when the last task in the order of priority is successfully executed.

[0087] Through the mutual cooperation between the first module 1, the second module 2, the third module 3, the fourth module 4 and the fifth module 5, the present application shortens the time taken by the application to execute tasks, optimizes the request depth, reduces the time taken by the application to load data, speeds up the acquisition of data, shortens the time taken to restart the application, and reduces the time taken to return to the login interface from the failure to obtain information.

[0088] In one embodiment, the third module is further configured to directly execute the subtask if the number of subtasks of the task currently to be executed is one.

[0089] In one embodiment, the fourth module is also used to monitor the execution time taken since the task ranked first in the execution order is executed. When the execution time exceeds the preset time, the task ranked first in the execution order is used as the current task to be executed, and the third module is driven to work.

[0090] It should be understood by those skilled in the art that the above modules or steps of the present application can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0091] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

[0092] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for quickly starting an application, characterized in that: include: Step A: starting the application based on user instructions; Step B, determining a plurality of tasks in a sequential order from application startup to entering the application homepage; Step C, determining the task to be executed currently, if the task to be executed currently has multiple subtasks, calling multiple threads with the same number of subtasks to process the multiple subtasks simultaneously; each thread processes a different subtask; Step D: If all subtasks are successfully executed, the next task of the currently successfully executed task is used as the current task to be executed based on the order, and step C is executed; if any subtask fails to be executed, the task ranked first in the order is used as the current task to be executed, and step C is executed; Step E: When the last task in the order is successfully executed, the application homepage is entered.

2. The method for quickly launching an application according to claim 1, characterized in that: The plurality of tasks in a sequential order include a first task, a second task and a third task; The first task includes a subtask of obtaining user information data; The second task includes a subtask of obtaining application information data and a subtask of obtaining family information data; The third task includes a subtask of obtaining application background information data, a subtask of obtaining home room information data, a subtask of obtaining home scene information data, and a subtask of obtaining home device information data.

3. The method for quickly launching an application according to claim 1, characterized in that: The step C also includes: If the number of subtasks of the task currently to be executed is one, the subtask is directly executed.

4. The method for quickly starting an application according to claim 1, characterized in that: The step D also includes: Monitor the execution time taken since the execution of the task ranked first in the sequence. When the execution time exceeds a preset time, take the task ranked first in the sequence as the current task to be executed, and execute step C.

5. The method for quickly starting an application according to claim 2, characterized in that: The user information data is obtained through the user or getUserInfo interface.

6. The method for quickly starting an application according to claim 2, characterized in that: Obtain the application information data through the device, product or findAllAccessoryProduct interface; And / or, obtaining the home information data through user, home or findAll interface.

7. The method for quickly starting an application according to claim 2, characterized in that: Obtain the application background information data through assets, file or findByCode interface; and / or, obtaining the family room information data through user, room or findRoomList interface; and / or, obtaining the home scene information data through the user, scenes or searchSceneList interface; And / or, obtaining the home device information data through the device, accessory or findAccessoryByHomeId interface.

8. A device for quickly launching an application program, characterized in that: include: The first module is used to start the application based on the user instruction; The second module is used to determine multiple tasks in a sequence from application startup to entering the application homepage; The third module is used to determine the task to be executed currently, and if the task to be executed currently has multiple subtasks, call multiple threads with the same number of subtasks to process the multiple subtasks simultaneously; Each thread processes a different subtask; The fourth module is used for, if all subtasks are successfully executed, taking the next task of the currently successfully executed task as the task to be executed based on the sequence, and driving the third module to work; if any subtask fails to be executed, taking the task ranked first in the sequence as the task to be executed, and driving the third module to work; The fifth module is used to enter the application home page when the last task in the sequence is successfully executed.

9. The application quick start device according to claim 8, characterized in that: The third module is also used for directly executing the subtask if the number of subtasks of the task currently to be executed is one.

10. The application quick start device according to claim 8, characterized in that: The fourth module is also used to monitor the execution time taken since the execution of the task ranked first in the sequence. When the execution time exceeds the preset time, the task ranked first in the sequence is used as the current task to be executed, and the third module is driven to work.

Citation Information

Cited By

  • Startup acceleration method and device based on Android system

    CN119668699A