Task stack management method and electronic equipment
By adopting a two-dimensional task stack management method in lightweight wearable devices, the problem of limited device memory is solved and it is difficult to efficiently manage multiple backend applications, and efficient application switching and memory management are realized, improving user experience.
Patent Information
- Application Number
- CN202311238663.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-24
- Publication Date
- 2025-03-25
AI Technical Summary
Lightweight wearable devices such as smartwatches and smart bracelets are difficult to efficiently manage multiple backend applications due to limited memory, especially in the management of switching relationships between applications.
The two-dimensional task stack management method is adopted to achieve efficient management of background applications by creating a horizontal dimension task stack and a vertical dimension task stack. The horizontal task stack is used to manage the switching relationship between vertical task stacks, and the vertical task stack is used to manage subtasks within it.
With limited memory, efficient management and switching of background applications are achieved, user experience is improved, and the impact of memory usage and operation efficiency is reduced.
Smart Images

Figure CN119690599A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a task stack management method and an electronic device. Background Art
[0002] In recent years, wearable devices (such as smart watches and smart bracelets) have become increasingly indispensable devices in people's lives. Taking smart watches as an example, there are many applications in smart watches, so multiple applications may be opened at the same time, and different applications can be switched. The watch needs to manage the opened applications, for example, maintaining the switching relationship between applications. However, for lightweight wearable devices such as smart bracelets and smart watches, the memory is limited, so how to efficiently manage applications under limited memory is a problem that needs to be considered. Summary of the invention
[0003] The embodiments of the present application provide a task stack management method and an electronic device for efficiently managing background applications under limited memory.
[0004] In a first aspect, a task stack management method is provided, which is applied to a wearable device, and the method includes: creating a first task stack, and adding a first subtask to the first task stack, and the first subtask is located at the top of the first task stack; creating a second task stack, and adding the first task stack to the second task stack, and the first task stack is located at the top of the second task stack, wherein the task stack located at the top of the second task stack is configured to be in an activated state, and the task stack in the activated state is configured to be displayed through the foreground; the foreground displays a first interface of the first subtask; creating a third task stack, and adding a second subtask to the third task stack, and the second subtask is located at the top of the third task stack; adding the third task stack to the second task stack, and the third task stack is located at the top of the second task stack, so that the third task stack is in an activated state, and the preamble index of the third task stack points to the first task stack, and the preamble index is used to indicate that the previous task stack of the third task stack is the first task stack; the foreground displays a second interface of the second subtask.
[0005] In the embodiment of the present application, the second task stack can manage the first task stack, the third task stack, etc., for example, manage the switching order between the first task stack and the third task stack. The first task stack and the third task stack can manage their respective subtasks.
[0006] Therefore, if the second task stack is understood as a task stack of one dimension (for example, a task stack of the horizontal dimension), the first task stack and the third task stack are task stacks of another dimension (for example, a task stack of the vertical dimension). The functions of the task stacks of these two dimensions are different. The number of the task stack of the other dimension (that is, the task stack of the vertical dimension) can be multiple (for example, the first task stack and the third task stack), and each task stack is used to manage the subtasks within the task stack, for example, to manage the popping and pushing of each subtask within the task stack. The number of the task stack of one dimension (that is, the task stack of the horizontal dimension) is one, which is used to manage the task stacks of each vertical dimension, for example, to manage the popping and pushing of each vertical dimension task stack in the task stack of the horizontal dimension, and the activation of the vertical dimension task stack, etc. For example, when a vertical task stack is at the top of the horizontal task stack, the vertical task stack is activated.
[0007] Compared with a one-dimensional task stack, using a two-dimensional task stack can achieve efficient management of background applications under limited memory.
[0008] In one possible design, the method also includes: receiving a pop operation of the second subtask; determining that there are no other subtasks in the third task stack located below the second subtask; destroying the third task stack; determining the first task stack based on the preceding index of the third task stack, popping the third task stack in the second task stack, and moving the first task stack to the top of the stack to activate the first task stack; and displaying the interface of the subtask at the top of the first task stack in the foreground.
[0009] In the embodiment of the present application, the second task stack can manage the first task stack, the third task stack, etc. When the third task stack is destroyed, the third task stack originally at the top of the second task stack is popped out, and the previous task stack, i.e., the first task stack, is quickly determined according to the pre-order index of the third task stack, and then the first task stack is activated to display the interface of the subtasks in the first task stack in the foreground. In this way, the pre-order index of each vertical task stack in the horizontal task stack can be used to indicate the previous vertical task stack, and the search is relatively fast and efficient.
[0010] In one possible design, the method also includes: receiving an operation for switching the second subtask to the background; determining that there are no other subtasks in the third task stack located below the second subtask; determining the first task stack based on the prefix index of the third task stack, and moving the first task stack to the top of the second task stack so that the first task stack is in an activated state, and the prefix index of the first task stack points to the third task stack; and displaying the interface of the subtask at the top of the stack in the first task stack in the foreground.
[0011] In the embodiment of the present application, the second task stack can manage the first task stack, the third task stack, etc. When the only subtask in the third task stack is switched to the background, the previous task stack, i.e., the first task stack, is quickly determined according to the pre-order index of the third task stack, and then the first task stack is activated to display the interface of the subtask in the first task stack in the foreground. In this way, the pre-order index of each vertical task stack in the horizontal task stack can be used to indicate the previous vertical task stack, and the search is relatively fast and efficient.
[0012] In one possible design, the first subtask and the second subtask are subtasks of different applications; and / or the first subtask and the second subtask have different package names, where the package name is the name of the program package of the subtask.
[0013] In the embodiment of the present application, the first task stack and the third task stack can manage their respective subtasks. The subtasks in the first task stack and the third task stack belong to different applications or have different package names for easy management.
[0014] In one possible design, the method also includes: determining that the fourth subtask needs to be started; determining that the package names of the subtasks in the first task stack and the third task stack are different from the package name of the fourth subtask; creating a fourth task stack, and adding the fourth subtask to the fourth task stack, and the fourth subtask is located at the top of the fourth task stack; adding the fourth task stack to the second task stack and being located at the top of the stack, so that the fourth task stack is in an activated state, and the pre-order index of the fourth task stack points to the third task stack, and the pre-order index of the third task stack points to the first task stack; and displaying the interface of the fourth subtask in the foreground.
[0015] In an embodiment of the present application, if you want to start a new subtask, you need to query whether there is a qualified vertical task stack (the package name of the subtask is the same) in the existing vertical task stack. If it does not exist, create a new vertical task stack and add a new subtask to the vertical task stack. The vertical task stack is activated so that the interface of the new subtask is displayed in the foreground.
[0016] In one possible design, the method also includes: determining that the fourth subtask needs to be started; determining that the package name of the subtask in the third task stack is the same as the package name of the fourth subtask; adding the fourth subtask to the third task stack, and the fourth subtask is located at the top of the third task stack; and displaying the interface of the fourth subtask in the foreground.
[0017] In an embodiment of the present application, if you want to start a new subtask, you need to query whether there is a qualified vertical task stack (the subtask package name is the same) in the existing vertical task stack. If the currently activated vertical task stack happens to meet the conditions, then add a new subtask to the vertical task stack and place it on the top of the stack so that the interface of the new subtask is displayed in the foreground.
[0018] In one possible design, the method also includes: determining that a fourth subtask needs to be started; determining that a package name of a subtask in the first task stack is the same as a package name of the fourth subtask; adding the fourth subtask to the first task stack, and the fourth subtask is located at the top of the first task stack; moving the first task stack in the second task stack to the top of the stack so that the first task stack is activated, and the leading index of the first task stack points to the third task stack; and displaying the interface of the subtask at the top of the first task stack in the foreground.
[0019] In an embodiment of the present application, if you want to start a new subtask, you need to query whether there is a qualified vertical task stack (the package name of the subtask is the same) in the existing vertical task stack. If the currently activated vertical task stack does not meet the conditions, but the currently inactive vertical task stack (for example, the first task stack) meets the conditions, then a new subtask is added to the currently inactive vertical task stack and is located at the top of the stack, and the vertical task stack is activated so that the interface of the new subtask is displayed on the foreground.
[0020] In one possible design, the first interface includes a countdown, and the countdown is the start countdown of the fifth subtask; before creating the third task stack, it also includes: before the countdown reaches 0, an incoming call is received, the second subtask is an incoming call task, and the second interface is an incoming call interface; after the incoming call interface is displayed in the foreground, the countdown stops; when an operation for switching the incoming call interface to the background is received, the foreground returns to the first interface, and the countdown starts again; when the countdown reaches 0, the interface of the fifth subtask is displayed in the foreground.
[0021] In an embodiment of the present application, the wearable device displays the first interface in the foreground. If a call is received before the countdown in the first interface reaches 0, the first interface is switched to the background and the countdown stops. When the first interface is switched to the foreground, the countdown restarts, and when it reaches 0, the interface of the fifth subtask is displayed in the foreground.
[0022] In one possible design, when an operation for switching the incoming call interface to the background is received, the foreground returns to the first interface, including: when an operation for switching the incoming call interface to the background is received, determining that there are no other subtasks in the third task stack located below the incoming call task; determining the first task stack according to the preamble index of the third task stack, and moving the first task stack to the top of the second task stack so that the first task stack is in an activated state, and the preamble index of the first task stack points to the third task stack; and displaying the interface of the subtask located at the top of the stack in the first task stack in the foreground, and the interface is the first interface.
[0023] In an embodiment of the present application, the wearable device displays the first interface in the foreground. If an incoming call is received before the countdown in the first interface reaches 0, the first interface is switched to the background and the countdown stops. When an operation for switching the incoming call interface to the background is received, the first interface needs to be switched to the foreground, so the first task stack where the first subtask (the subtask corresponding to the first interface) is activated to display the first interface in the foreground to restart the countdown.
[0024] In one possible design, the first interface includes a countdown, and the countdown is a countdown to start the fifth subtask; before creating the third task stack, it also includes: before the countdown reaches 0, an incoming call is received, the second subtask is an incoming call task, and the second interface is an incoming call interface; after the incoming call interface is displayed in the foreground, the countdown continues; the countdown reaches 0; and the interface of the fifth subtask is displayed in the foreground.
[0025] In an embodiment of the present application, the wearable device displays the first interface in the foreground. If a call is received before the countdown in the first interface reaches 0, the first interface switches to the background. At this time, the countdown does not stop. When it reaches 0, the interface of the fifth subtask automatically switches to the foreground.
[0026] In a possible design, before the interface of the fifth subtask is displayed in the foreground, it also includes: when the countdown reaches 0, the fifth subtask is forcibly added to the first task stack and is located at the top of the first task stack; an operation for switching the incoming call interface to the background is received, and it is determined that there are no other subtasks in the third task stack located below the incoming call task; the first task stack is determined according to the preceding index of the third task stack, and the first task stack in the second task stack is moved to the top of the stack to make the first task stack active.
[0027] In an embodiment of the present application, the wearable device displays the first interface in the foreground. If an incoming call is received before the countdown in the first interface reaches 0, the first interface is switched to the background. At this time, the countdown does not stop. When it reaches 0, the fifth subtask is forced to enter the first task stack (the subtask corresponding to the first interface), and after the user switches the incoming call interface to the background, the first task stack is activated, and the interface of the fifth subtask in the first task stack is displayed in the foreground.
[0028] In a possible design, before the interface of the fifth subtask is displayed in the foreground, it also includes: when an operation for switching the incoming call interface to the background is received, determining that there are no other subtasks in the third task stack located below the second subtask; determining the first task stack according to the preceding index of the third task stack, and moving the first task stack to the top of the second task stack to make the first task stack active; and forcibly adding the fifth subtask to the first task stack, and placing it at the top of the first task stack.
[0029] In an embodiment of the present application, the wearable device displays the first interface in the foreground. If an incoming call is received before the countdown in the first interface reaches 0, the first interface is switched to the background. At this time, the countdown does not stop. When it reaches 0, the fifth subtask is not forced to enter the first task stack first. After the user switches the incoming call interface to the background, the fifth subtask is forced to enter the first task stack and the first task stack is activated. Then, the interface of the fifth subtask in the first task stack is displayed in the foreground.
[0030] In a possible design, before the interface of the fifth subtask is displayed in the foreground, it also includes: when the countdown reaches 0, forcibly adding the fifth subtask to the first task stack and placing it at the top of the first task stack; forcibly moving the first task stack in the second task stack to the top of the stack so that the first task stack is activated.
[0031] In an embodiment of the present application, the wearable device displays the first interface in the foreground. If a call is received before the countdown in the first interface reaches 0, the first interface switches to the background. At this time, the countdown does not stop. When it reaches 0, the fifth subtask is forced to enter the first task stack, and the first task stack is forcibly activated so that the countdown reaches 0, and the interface of the fifth subtask automatically appears in the foreground.
[0032] In a possible design, before creating the first task stack, it also includes: displaying a permanent interface, the permanent interface including a desktop, a multi-tasking interface, a negative one screen or a dial; creating a second task stack, and after adding the first task stack to the second task stack, it also includes: the preamble index of the first task stack points to the permanent interface.
[0033] In an embodiment of the present application, when the wearable device opens a subtask from the resident interface, the pre-order index of the task stack where the subtask is located points to the resident interface, so when returning from the subtask, it returns to the resident interface.
[0034] In one possible design, the method further includes: determining that an abnormal reminder sub-service needs to be started; adding the abnormal reminder sub-service to the third task stack and locating it at the top of the third task stack; and displaying the interface of the abnormal reminder sub-service in the foreground.
[0035] In the embodiment of the present application, the priority of the abnormal reminder sub-service is high, so the abnormal reminder sub-service can be added to the top of the task stack that is currently in the activated state, so that the interface of the abnormal reminder sub-service is displayed in the foreground to remind the user in time.
[0036] In one possible design, the interface of the abnormal reminder sub-service includes a shortcut button, and the method also includes: receiving an operation on the shortcut button, determining that the sixth sub-service needs to be started; determining that the package names of the subtasks in the first task stack and the third task stack are different from the package name of the sixth subtask; creating a fifth task stack, and adding the sixth sub-service to the fifth task stack and placing it at the top of the fifth task stack; adding the fifth task stack to the second task stack and placing it at the top of the stack, so that the fifth task stack is activated, and the pre-order index of the fifth task stack points to the third task stack, and the pre-order index of the third task stack points to the first task stack; and displaying the interface of the sixth subtask in the foreground.
[0037] In the embodiment of the present application, when the wearable device displays the interface of the abnormal reminder sub-service on the foreground, the user can quickly open the corresponding interface through the shortcut keys in the interface, which provides a good user experience.
[0038] In a possible design, after the fifth task stack is in an activated state, the abnormal reminder sub-service in the third task stack is destroyed.
[0039] In the embodiment of the present application, after the fifth task stack is activated, the abnormal reminder sub-service can be destroyed to save memory space.
[0040] In one possible design, adding the first task stack to the second task stack includes: adding a first mark of the first task stack to the second task stack, wherein the first mark is located at the top of the second task stack; adding the third task stack to the second task stack includes: adding a second mark of the third task stack to the third task stack, wherein the second mark is located at the top of the second task stack; and the preamble index of the second mark points to the first mark.
[0041] In the embodiment of the present application, the elements in the horizontal task stack may be marks of the vertical task stack to save memory space.
[0042] In a second aspect, a task stack management method is also provided, which is applied to a wearable device, wherein the wearable device is in a locked screen state, and the method includes: when an abnormal event is detected, adding an abnormal reminder sub-service to a first task stack, and the abnormal reminder sub-service is located at the top of the first task stack, and the first task stack is the task stack where the subtask corresponding to the locked screen state is located; displaying a reminder interface in the foreground, wherein the reminder interface includes a shortcut key, and the shortcut key is used to open an application corresponding to the abnormal event; receiving an operation on the shortcut key; adding an unlocking sub-service to the first task stack, and the unlocking sub-service is located at the top of the first task stack; displaying an interface for unlocking in the foreground; receiving verification information input by a user; when determining that the input verification information is correct, creating a third task stack, adding the sub-service of the application in the third task stack, and the sub-service is located at the top of the third task stack; displaying the interface of the sub-service of the application in the foreground, and the interface is related to the abnormal event.
[0043] In the embodiment of the present application, when the wearable device is in the lock screen state, an abnormal reminder interface can be popped up. If the user triggers the shortcut key in the interface, the interface for unlocking is output. After the unlocking is successful, the interface opened by the shortcut key is displayed in the foreground. In this way, the user can be reminded in time even in the lock screen state.
[0044] In one possible design, after receiving an operation on the shortcut key, the method also includes: destroying the abnormal reminder sub-service in the first task stack.
[0045] In the embodiment of the present application, the abnormal reminder sub-service can be destroyed to release a certain amount of memory space.
[0046] In one possible design, after adding the unlocking sub-service in the first task stack, it also includes: adding the sub-service of the application in a preconfigured cache; adding the sub-service of the application in the third task stack includes: adding the sub-service of the application in the preconfigured cache to the third task stack.
[0047] In an embodiment of the present application, a sub-service of an application is added to a pre-configured cache. After unlocking is successful, the sub-service in the cache is added to a third task stack, so that the sub-service can be opened quickly and the response speed can be improved.
[0048] In one possible design, after determining that the input verification information is correct, the method further includes: destroying the unlocking sub-service in the first task stack.
[0049] In the embodiment of the present application, the unlocking sub-service can be destroyed to release a certain amount of memory space.
[0050] In a third aspect, an electronic device is also provided, including:
[0051] a processor, a memory, and one or more programs;
[0052] The one or more programs are stored in the memory, and the one or more programs include instructions. When the instructions are executed by the processor, the electronic device executes the method steps provided in the first aspect or the second aspect above.
[0053] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium is used to store a computer program. When the computer program is run on a computer, the computer executes the method described in the first aspect or the second aspect above.
[0054] According to a fifth aspect, a computer program product is provided, comprising a computer program. When the computer program is run on a computer, the computer is enabled to execute the method described in the first aspect or the second aspect.
[0055] In the sixth aspect, a chip is also provided, which is coupled to a memory in an electronic device, and is used to call a computer program stored in the memory and execute the technical solution of the first aspect or the second aspect of the embodiment of the present application. In the embodiment of the present application, "coupling" refers to the direct or indirect combination of two components with each other.
[0056] For the technical effects that can be achieved by the above-mentioned third to sixth aspects, please refer to the description of the technical effects that can be achieved by the corresponding design schemes in the above-mentioned first or second aspects, and this application will not repeat them here. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A schematic diagram of a one-dimensional task stack provided in an embodiment of the present application;
[0058] Figure 2 A schematic diagram of a two-dimensional task stack provided in an embodiment of the present application;
[0059] Figure 3 A schematic diagram of using a two-dimensional task stack to manage applications provided by an embodiment of the present application;
[0060] Figure 4 Another schematic diagram of using a two-dimensional task stack to manage an application according to an embodiment of the present application;
[0061] Figure 5 A schematic diagram of a resident task stack and a two-dimensional task stack provided in an embodiment of the present application;
[0062] Figure 6 A schematic diagram of using a two-dimensional task stack to manage a reminder sub-service according to an embodiment of the present application;
[0063] Figure 7 Another schematic diagram of a two-dimensional task stack for managing a reminder sub-service using a two-dimensional task stack provided by an embodiment of the present application;
[0064] Figure 8 A schematic diagram of using a two-dimensional task stack to manage applications in a locked screen state provided by an embodiment of the present application;
[0065] Fig. 9 A schematic diagram of an electronic device provided in an embodiment of the present application;
[0066] Fig.10 Another schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0067] Below, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.
[0068] The at least one involved in the embodiments of the present application includes one or more; wherein, more than one means greater than or equal to two. In addition, it should be understood that in the description of this specification, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as expressing or implying relative importance, nor can they be understood as expressing or implying order. For example, the first task stack and the second task stack do not represent the importance of the two or the order of the two, but are only for distinguishing the description. In the embodiments of the present application, "and / or" is only a description of the association relationship, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship.
[0069] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the specification. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0070] As used in this specification, the term “when” or “after” may be interpreted to mean “if” or “after” or “in response to determining that” or “in response to detecting that”, depending on the context. Similarly, the phrase “upon determining that” or “if (stated condition or event) is detected” may be interpreted to mean “if determining that” or “in response to determining that” or “upon detecting (stated condition or event)” or “in response to detecting (stated condition or event)”, depending on the context.
[0071] The task stack management method provided in the embodiment of the present application is applicable to wearable devices. Exemplarily, the wearable device can be a wristband device such as a bracelet, a watch, or a necklace, glasses, or shoes, clothing, etc. The embodiment of the present application does not limit the type of wearable device. In addition to wearable devices, the technical solution provided in the embodiment of the present application can also be applied to other lightweight devices, where the lightweight device can be understood as a device with less memory. Alternatively, the technical solution provided in the embodiment of the present application can also be applied to any device that uses a one-dimensional stack management application.
[0072] For ease of understanding, this article mainly uses watches as an example.
[0073] The watch includes multiple applications, such as watch faces, exercise applications, heart rate measurement, phone calls, WeChat, etc. Since the watch has a small memory, in order to avoid running stuck due to insufficient memory, one possible implementation method is that the watch can only run one application at the same time. If you want to run another application, you need to close or exit the previous application to free up memory space to run another application. If this method is used, when the watch needs to switch between different applications, it needs to start or close the application frequently. Another possible implementation method is that multiple applications can be opened in the watch at the same time, and different applications can be switched. Since the watch can only display the interface of one application in the foreground at the same time, other opened applications need to run in the background, so the watch needs to manage these opened applications.
[0074] One possible way is to include a task stack in the watch for managing applications. The task stack satisfies the "last in, first out" principle. For example, when the watch needs to open the interface of application 1 in the foreground, application 1 is added to the task stack and is at the top of the stack, so the interface of application 1 is displayed in the foreground. If the interface of application 2 is opened from the interface of application 1, the watch adds application 2 to the task stack and is at the top of the stack, so the interface of application 2 is displayed in the foreground. Since application 1 is no longer at the top of the stack, application 1 switches to the background. When application 2 exits, according to the "last in, first out" principle, application 2 is popped out of the task stack, and the interface of application 2 is canceled in the foreground. After application 2 is popped out, application 1 is at the top of the stack in the task stack, so the interface of application 1 is displayed in the foreground.
[0075] In the above method, what is pushed into or popped out of the task stack is the application. In other words, the application is pushed into or popped out. Considering that an application can include multiple subtasks, different subtasks can also be switched. Therefore, another possible implementation method is that the watch includes a task stack, which is used to manage different subtasks. In simple terms, what is pushed into or popped out is the subtask of the application, not the application, that is, the subtasks of the application are pushed into or popped out, which is more fine-grained than the previous push and pop in the application. For example, when the watch needs to open the interface of subtask 1 of application 1 in the foreground, subtask 1 is added to the task stack and subtask 1 is at the top of the stack, so the interface of subtask 1 is displayed in the foreground. If the interface of subtask 2 of application 2 is opened from the interface of subtask 1, the watch adds subtask 2 to the task stack and subtask 2 is at the top of the stack, so the interface of subtask 2 is displayed in the foreground, and since subtask 1 is not at the top of the stack, subtask 1 is switched to the background. When subtask 2 exits, according to the "last in, first out" principle, subtask 2 is popped out of the task stack, and the interface of subtask 2 is canceled in the foreground. Moreover, after subtask 2 is popped out, subtask 1 is at the top of the task stack, so the interface of subtask 1 is displayed in the foreground.
[0076] The following uses the task stack to manage each subtask as an example for explanation. Among them, an application can include one or more subtasks. One possible implementation method is that the application developer stores the program code of each subtask of the application in the application package of the application in advance. Among them, a subtask can correspond to one or more interfaces, that is, the program code in a subtask can open one or more interfaces. For the sake of ease of understanding, this article uses the example of one subtask corresponding to one interface for explanation.
[0077] For ease of understanding, take the exercise application in the watch as an example. The exercise application can include three subtasks, namely list, preparation, and exercise.
[0078] like Figure 1 In (a), the watch adds the "list" subtask to the task stack and places it on the top of the stack, so the watch displays the interface of the "list" subtask, such as the list interface, on the foreground. Figure 1 In (a) of the example, when the watch receives an operation for the "skipping rope" option in the list, Figure 1 In (b), the watch adds the "prepare" subtask to the task stack and it is at the top of the stack, so the interface of the "prepare" subtask, such as the preparation interface, is displayed in the foreground, and the list interface switches to the background.
[0079] Optionally, when the watch displays the preparation interface, the preparation interface may include a countdown. When the countdown reaches 0, the watch opens the exercise interface. There is a possible situation where the watch displays the preparation interface and the countdown has not reached 0, and the watch opens other interfaces, such as when the watch receives an incoming call. Figure 1 In (c), when the watch is displaying the preparation interface, an incoming call is received. The background adds the "incoming call" subtask to the task stack and places it at the top of the stack. Therefore, the incoming call interface is displayed in the front and the preparation interface is switched to the background. It should be noted that after the preparation interface is switched to the background, the countdown continues. When the countdown reaches 0, Figure 1 In (d), the background adds the "Exercise" subtask to the task stack and places it at the top of the stack. The Exercise interface is displayed in the foreground, and the incoming call interface switches to the background.
[0080] That is to say, when the watch opens the preparation interface, the countdown starts (for example, from 3 to 0). Before reaching 0, the watch receives an incoming call and the call information is displayed in the foreground. The countdown does not stop after the preparation interface switches to the background. When it reaches 0, the exercise interface opens in the foreground and the incoming call interface switches to the background.
[0081] In the above process, different subtasks of the same application in the task stack are not adjacent. For example, the "Getting Ready" subtask and the "Exercising" subtask are not adjacent, and the "Incoming Call" subtask is inserted in between. This non-adjacency will cause the watch foreground to return to the interface of another application when returning from the interface of one application.
[0082] like Figure 1 In (e), the watch displays the exercise interface in the foreground. When the watch receives a return operation (for example, a left or right swipe operation), the "Exercise" subtask in the task stack is popped out. After the "Exercise" subtask is popped out, the "Incoming Call" subtask in the task stack is at the top of the stack, so the incoming call interface is displayed in the foreground. Figure 1 Therefore, when the user returns from the exercise interface, he returns to the incoming call interface.
[0083] Figure 1 In (f), when the incoming call interface is displayed on the watch front, if the watch receives an operation (for example, a hang-up operation or the other party hangs up), Figure 1 In (g), the "Incoming Call" subtask is popped from the task stack. After the "Incoming Call" subtask is popped, the "Preparation" subtask is at the top of the stack, so the preparation interface is displayed on the front desk, such as Figure 1 Therefore, the user returns from the incoming call interface to the preparation interface.
[0084] Figure 1 In (g), when the watch displays the preparation interface, if the watch receives a return operation (for example, a left or right swipe operation), Figure 1(h) in the task stack, the "prepare" subtask is popped out of the task stack. After the "prepare" subtask is popped out of the task stack, the "list" subtask is at the top of the stack, so the list interface is displayed in the foreground. Figure 1 Therefore, the user returns to the incoming call interface from the preparation interface.
[0085] therefore, Figure 1 The return order is: exercise interface -> incoming call interface -> preparation interface -> list interface.
[0086] In other words, due to the influence of the incoming call, the "Exercise" subtask and the "Prepare" subtask in the task stack are not adjacent, so when returning from the Exercise interface, you return to the Incoming Call interface, and then return to the Prepare interface. Users actually prefer to return directly from the Exercise interface to the Prepare interface, rather than going through the Incoming Call interface to return to the Prepare interface.
[0087] It should be noted that in the actual use of the watch, the number of subtasks in the task stack is much larger than Figure 1 There are many subtasks in an application, and they are returned in order when returning. Moreover, a larger number of subtasks of other applications may be inserted between different subtasks of an application, resulting in different subtasks of the same application not being adjacent. Therefore, when returning, it will return from the interface of one application to the interface of another application, affecting the user experience. In addition, if the watch wants to exit an application, it also needs to traverse the task stack to find all subtasks of the application, and then pop all subtasks out of the stack. It should be understood that when the number of subtasks in the task stack is very large, traversing the task stack is a time-consuming task, which will seriously affect the operating efficiency of the device, especially since the memory of the watch is limited. Traversing the task stack will take up memory and affect the normal use of other services.
[0088] It is understandable that the reason for the above problems is that the task stack used by the watch is a one-dimensional task stack. As long as the foreground needs to open a new interface, new subtasks are stacked in the task stack, which leads to a very large number of subtasks in the task stack and low traversal efficiency.
[0089] In view of this, the embodiment of the present application provides a two-dimensional task stack, which adds one dimension compared to the one-dimensional task stack. Figure 2The two-dimensional task stack may include a task stack on a longitudinal dimension, and a task stack on a transverse dimension. For ease of understanding, the task stack on the transverse dimension is called a transverse task stack, and the task stack on the longitudinal dimension is called a longitudinal task stack. It should be noted that a two-dimensional task stack refers to a task stack on two dimensions, and is not limited to a task stack on a longitudinal dimension and a task stack on a transverse dimension, as long as the task stacks on these two dimensions can realize the functions of the transverse task stack and the longitudinal task stack in this application. Alternatively, it may not be called a task stack of two dimensions, as long as there are N task stacks 1 and one task stack 2, and the task stack 2 can manage N task stacks 1, wherein the N task stacks 1 can realize the function of the longitudinal task stack in the embodiment of the present application (see below), and the task stack 2 can realize the function of the transverse task stack in the embodiment of the present application (see below).
[0090] There can be N vertical task stacks, where N is a positive integer. For example, Figure 2 In the example, N=3 is taken, that is, task1, task2, and task3 are all vertical task stacks. Each vertical task stack is from the bottom to the top. Each vertical task stack in the N vertical task stacks is used to maintain the switching relationship between subtasks with the same packageName. In other words, subtasks with the same packageName are located in the same vertical task stack.
[0091] One possible implementation is that the developer of each application configures the packageName of each subtask in the application in advance. Optionally, subtasks with the same packageName can be subtasks of the same application, or subtasks of different applications. Take the example that subtasks with the same packageName are subtasks of the same application, that is, all subtasks of application A have the same packageName, all subtasks of application B have the same packageName, and the packageName of application A is different from the packageName of application B. For ease of understanding, this article takes the example that subtasks with the same packageName are subtasks of the same application.
[0092] Continue as Figure 2, assuming that the packageName of the subtask of application A (e.g., subtask A1) is packageNameA, assuming that the packageName of the subtask of application B (e.g., subtask B1) is packageNameB, assuming that the packageName of the subtask of application C (e.g., subtask C1) is packageNameC, that is, the packageNames of application A, application B, and application C are different. Therefore, the subtasks of application A, application B, and application C need to be located in different vertical task stacks. For example, subtask A1 of application A is located in task1, and subtask B1 of application B is located in task2. Subtask C1 of application C is located in task3.
[0093] Among N vertical task stacks, only one vertical task stack is active at the same time, and the subtask at the top of the active vertical task stack is displayed in the foreground. Figure 2 In the example, it is assumed that task3 is currently in the active state, so the interface of subtask C1 at the top of the stack in task3 is displayed in the foreground.
[0094] Optionally, the number N of vertical task stacks may be less than or equal to a threshold. The value of the threshold may be pre-configured. For example, if the threshold is 3, Figure 2 The vertical task stack includes task1, task2, and task3. That is, the number of vertical task stacks has reached the threshold. If task4 needs to be created, the task with the earliest creation time among task1, task2, and task3 needs to be determined, the task needs to be destroyed, and then task4 needs to be created. In short, the number of vertical task stacks does not exceed the threshold.
[0095] The horizontal task stack is used to maintain the switching relationship between N vertical task stacks. For example, Figure 2 In the example, the vertical task stack includes task1, task2 and task3, and the horizontal task stack is used to maintain the switching relationship between task1, task2 and task3. The horizontal task stack is from the bottom to the top from left to right, and the task at the top of the horizontal task stack is the task stack in the N vertical task stacks that is in an active state.
[0096] by Figure 2Taking the opening order of the neutron tasks as A1—>B1—>C1 as an example, the horizontal task stack can manage task1, task2 and task3 in the following way: task3 is located at the top of the horizontal task stack, and a preindex of task3 is created, and preindex points to task2, indicating that the previous task of task3 is task2. A preindex of task2 is created, and preindex points to task1, indicating that the previous task of task2 is task1.
[0097] Since task3 is at the top of the horizontal task stack, that is, task3 is in an activated state, the foreground displays the interface of subtask C1 at the top of the stack in task3. If the watch receives a return operation, it can determine whether there are other subtasks below subtask C1 in the currently activated task, that is, task3. If so, return to other subtasks. If not, destroy task3, then task3 is popped out of the horizontal task stack. Since task3's preindex points to task2, task2 is at the top of the horizontal task stack, that is, task2 is in an activated state, so the foreground returns to the interface of the subtask B1 at the top of the stack in task2. If a return operation is received again, it can be determined whether there are other subtasks under subtask B1 in the currently activated task, task2. If there are, it returns to other subtasks. If not, it destroys task2, and then task2 is popped out of the horizontal task stack. Since the preindex of task2 points to task1, task1 is at the top of the horizontal task stack, that is, task1 is in the activated state, so the foreground returns to the interface of the subtask at the top of the stack in task1, that is, subtask A1. Therefore, Figure 2 The return order of neutron tasks is: C1—>B1—>A1.
[0098] Figure 2In the example, if you want to destroy a vertical task stack, for example, task3 is in an active state, if you want to destroy task1 (for example, application A exits), then in the horizontal task stack, determine task2 according to the preindex of task3, determine task1 according to the preindex of task2, and then destroy task1. According to the one-dimensional task stack, if you want to destroy a subtask of an application, you need to traverse the one-dimensional task stack to find all subtasks of the application, and then delete all the found subtasks. Because there are many subtasks in the one-dimensional task stack, the efficiency is low. According to the two-dimensional task stack, you only need to determine the task1 to be destroyed quickly according to the preindex in the horizontal task stack, and destroy task1 directly, because all the opened subtasks of application A are located in task1, which is more efficient.
[0099] Optionally, the elements in the horizontal task stack may be respective vertical task stacks, or the index or name of each vertical task stack or other mark that can uniquely identify the vertical task stack.
[0100] To illustrate how to use the two-dimensional task stack, two application scenarios are listed below.
[0101] Application scenario 1
[0102] Taking the exercise app in the watch as an example, the exercise app can include three subtasks, namely list, preparation, and exercise.
[0103] like Figure 3 In (a), the watch adds the "list" subtask to the vertical task stack task1 and it is at the top of the stack of task1, and task1 is at the top of the stack in the horizontal task stack, indicating that task1 is in an activated state, so the watch displays the interface of the "list" subtask, such as the list interface, on the foreground. Figure 3 In (a), when the watch receives the operation for the "skipping rope" option in the list, it determines that it needs to enter the preparation subtask, and determines that the packageName of the preparation subtask is packageName 1. The watch searches the horizontal task stack for a task containing a subtask with the same packageName. After searching, it can be determined that the list subtasks in task1 have the same packageName, so the watch adds the "preparation" subtask to task1 and places it at the top of the task1 stack, so the foreground displays the interface of the "preparation" subtask, such as the preparation interface. Figure 3 In (b), the list interface switches to the background.
[0104] Figure 3In (b), when the watch displays the preparation interface, the preparation interface may include a countdown. Before the countdown reaches 0, if an incoming call is received, the watch determines whether there is a task in the horizontal task stack, and the packageName of the subtask in the task is the same as the packageName of the incoming call task. After searching, it is found that there is no such task in the horizontal task stack, so the watch creates task2, and adds the "incoming call" subtask to task2 and places it at the top of the stack of task2, as shown in the following figure. Figure 3 (c) in the figure, and task2 is at the top of the horizontal task stack, so task2 is in the active state, and task2's preindex points to task1, so the incoming call interface is displayed in the foreground, and the preparation interface is switched to the background.
[0105] One possible implementation is that when the preparation interface switches to the background, the countdown is paused. Optionally, when the preparation interface switches to the background, the countdown may not be paused, and the implementation principle of not pausing is the same as the implementation principle of application scenario 2 in the following text.
[0106] Figure 3 In (c), when the watch displays the incoming call interface in the foreground, if the watch receives a return operation, it determines that the currently active task is task2 according to the horizontal task stack. The watch determines whether there are other subtasks in task2 under the incoming call task. If not, it determines to point to task1 according to the preindex of task2. Therefore, task1 is at the top of the stack in the horizontal task stack, and the preindex of task1 points to task2, that is, task1 is in the active state, so the foreground displays the subtask at the top of the stack in task1, that is, the preparation interface of the preparation subtask, such as Figure 3 (d) in. Figure 3 In (d), when the watch displays the preparation interface, the countdown continues or restarts. When the countdown reaches 0, the watch determines that it needs to enter the exercise subtask and determines the packageName of the exercise subtask. The watch searches the horizontal task stack for a task that contains a subtask with the same packageName. After searching, it can be determined that the list subtasks in task1 have the same packageName, so the watch adds the exercise subtask to task1 and is located at the top of the stack of task1, such as Figure 3 In (d), since task1 is at the top of the horizontal task stack, the interface of the subtask in exercise is displayed in the foreground, for example, the interface in exercise.
[0107] Figure 3In (f), when the watch receives a return operation in the exercise interface, it determines that the currently active task is task1 according to the horizontal task stack, and determines whether there are other subtasks under the exercise subtask in task1. After determination, there is a preparation subtask, so the exercise subtask in task1 is popped out of the stack. The preparation subtask is at the top of the stack, so the foreground returns to the preparation interface, such as Figure 3 During this process, the watch returns from the exercise interface to the preparation interface instead of the incoming call interface, which provides a better user experience. Figure 1 The return process is different.
[0108] Figure 3 In (g), when the watch front desk displays the preparation interface, if a return operation is received, the currently active task is determined to be task1 according to the horizontal task stack, and it is determined that there is a list subtask under the preparation subtask in task1, so the preparation subtask in task1 is popped out of the stack, and the list subtask is at the top of the stack, so the front desk returns to the list interface, such as Figure 3 (h) in.
[0109] Figure 3 In (h), when the watch displays the list interface in the foreground, if a return operation is received, the currently active task is determined to be task1 according to the horizontal task stack. Since there are no other subtasks in task1 under the list subtask, task1 is destroyed. Since the preIndex of task1 points to task2, task2 is at the top of the horizontal task stack, as shown in Figure 3 (k) in the code, so the incoming call interface is displayed on the foreground.
[0110] therefore, Figure 3 The return order is: exercise interface -> preparation interface -> list interface -> incoming call interface.
[0111] contrast Figure 1 and Figure 3 It can be seen that Figure 1 When the watch adopts a one-dimensional stack, the return order is: exercise interface -> incoming call interface -> preparation interface -> list interface. Figure 3 In the case of a two-dimensional task stack, the watch returns to the following order: Exercise interface -> Preparation interface -> List interface -> Incoming call interface. Therefore, when the watch uses a two-dimensional task stack, when returning from one application interface, it will not return to the interface of other applications, and the user experience is high.
[0112] Optional, Figure 3In (e), after the exercise interface is opened in the foreground of the watch, the preparation subtask in task1 can be destroyed. This is because the purpose of the preparation subtask is to pull up the exercise interface. If the exercise interface has been pulled up, the preparation subtask can be destroyed to release some memory. Optionally, the preparation subtask can be destroyed by the operating system of the watch having the ability to destroy subtasks, and the operating system opens an interface. When the exercise interface is displayed in the foreground, the preparation subtask in the background can call the interface to allow the operating system to destroy the preparation subtask. Therefore, Figure 3 In (e) of , the preparation subtask is represented by a dotted line. If the preparation subtask is destroyed, then Figure 3 In (f) in , task1 does not include the preparation subtask. Therefore, Figure 3 In (f) of the watch, the watch receives a return operation and can directly return to Figure 3 (h) in the Figure 3 (g) in.
[0113] Application scenario 2
[0114] Taking the course planning app in the watch as an example, the course planning app can include four subtasks, namely list, preparation, course preview, and exercise.
[0115] like Figure 4 In (a), the watch adds a list subtask to the vertical task stack task1 and places it at the top of task1's stack, and task1 is at the top of the horizontal task stack, that is, task1 is in an activated state, so the watch displays the list in the foreground. When the watch receives an operation for the "Basic Running and Walking" option in the list, it determines that it needs to enter the preparation subtask and determines the packageName of the preparation subtask. The watch searches the horizontal task stack for a task that contains a subtask with the same packageName. After searching, it can be determined that the list subtask in task1 has the same packageName, so the watch adds a "preparation" subtask to task1 and places it at the top of the task1 stack, so the interface of the "preparation" subtask is displayed in the foreground, such as the preparation interface. Figure 4 In (b), the list interface switches to the background.
[0116] Figure 4In (b), when the watch displays the preparation interface on the foreground, the preparation interface may include a countdown. When the countdown reaches 0, the watch determines that it needs to enter the course preview subtask and determines the packageName of the course preview subtask. The watch searches the horizontal task stack to see if there is a task containing a subtask with the same packageName. After searching, it can be determined that there is a subtask with the same packageName in task1, so the watch adds the course preview subtask to task1 and places it at the top of the task1 stack, as shown in the following figure. Figure 4 (c) in the example, so the course preview interface is displayed on the front page. Figure 4 In (b), after adding the course preview subtask in task1, the preparation subtask can be destroyed. Figure 4 In (b), the preparation subtask is represented by a dotted line.
[0117] Figure 4 In (c), the watch starts counting down when the course preview interface is displayed on the foreground. Assume that a call is received before the countdown reaches 0. The watch checks whether there is a task in the horizontal task stack whose subtask packageName is the same as the packageName of the incoming call task. After searching, it is found that there is no such task in the horizontal task stack, so the watch creates task2 and adds the "incoming call" subtask to task2 and places it at the top of the stack of task2, as shown in the following figure. Figure 4 (d) in the figure, and task2 is at the top of the horizontal task stack, so task2 is in the active state, and the preindex of task2 points to task1, so the incoming call interface is displayed in the foreground, and the course preview interface switches to the background.
[0118] One possible implementation is that when the course preview interface switches to the background, the countdown continues. When the countdown reaches 0, the subtask of exercising in task1 is forced to be pushed into the stack. At this time, the watch still displays the incoming call interface in the foreground. When a return operation is received in the incoming call interface, the watch determines that the previous task is task1 based on the preindex of task2. The watch displays the latest subtask of task1, namely the subtask of exercising, in the foreground. Figure 4 (e) in .
[0119] Another possible implementation is that when the course preview interface switches to the background, the countdown continues. When the countdown reaches 0, the exercise subtask is not added to task1. When a return operation is received on the incoming call interface, according to the preindex of task2, it is determined that the previous task is task1. At this time, the exercise subtask is forced to be stacked in task1, and the exercise interface is displayed in the foreground.
[0120] Another possible implementation is that when the course preview interface switches to the background, the countdown continues. When the countdown reaches 0, the subtask in task1 is forced into the stack, such as Figure 4 (e) in the figure, and according to the preindex of task2, it is determined that the previous task is task1, and then task1 in the horizontal task stack is forcibly moved to the top of the stack, that is, task1 is forcibly activated, and then the latest subtask of task1, that is, the training subtask, is displayed in the foreground.
[0121] Of course, when the course preview interface switches to the background, the countdown is also paused. The implementation principle of the pause is the same as that of the application scenario 1 in the previous article.
[0122] like Figure 4 In (f), when the watch front desk displays the exercise interface, if a return operation is received, the currently active task is determined to be task1 according to the horizontal task stack, and whether there are other subtasks under the exercise subtask in task1, for example, if there is a course preview subtask, the exercise subtask in task1 is popped out of the stack, and the course preview subtask is at the top of the stack, so the front desk returns to the course preview interface, such as Figure 4 During this process, the watch returns from the exercise interface to the course preview interface instead of the incoming call interface.
[0123] Figure 4 In (g), when the watch front desk displays the course preview interface, if a return operation is received, the currently active task is determined to be task1 according to the horizontal task stack, and it is determined whether there are other subtasks under the course preview subtask in task1. For example, if there is a list subtask, the course preview subtask in task1 is popped out of the stack, and the list subtask is at the top of the stack, so the front desk returns to the list interface. Figure 4 (h) in.
[0124] Figure 4 In (h), if a return operation is received when the list interface is displayed in the foreground, the currently active task is determined to be task1 according to the horizontal task stack. Since there are no other subtasks under the list subtask in task1, task1 is destroyed. Since the preIndex of task1 points to task2, task2 is at the top of the stack in the horizontal task stack, so the incoming call interface is displayed in the foreground, such as Figure 4 (k) in.
[0125] therefore, Figure 4 The return order is: exercise interface -> course preview interface -> list interface -> incoming call interface.
[0126] Optional, Figure 4 In (e), after the watch opens the exercise interface, the course preview subtask in task1 can be destroyed. This is because the role of the course preview subtask is to pull up the exercise subtask. If the exercise subtask has been pulled up, the course preview subtask can be destroyed to release some memory. Optionally, the course preview subtask is destroyed in the same way as the preparation subtask in the previous article, so it will not be repeated. Therefore, Figure 4 In (e) of , the course preview subtask is indicated by a dotted line. If the course preview subtask is destroyed, then Figure 4 In (f) in the example, task1 does not include the course preview subtask. Therefore, Figure 4 In (f) of the watch, the watch receives a return operation and can directly return to Figure 4 (h) in the Figure 4 (g) in.
[0127] Optional, above Figure 3 (e) or Figure 4 In (e), when the subtask in the exercise is completed, the exercise recording subtask can be automatically started to record the exercise duration, calories consumed, etc. The watch automatically starts the exercise recording subtask in the following manner: the watch determines the packageName of the exercise recording subtask, and determines whether there is a task including a subtask with the same packageName in the vertical task stack. After searching, if it is determined that there is no such task, task3 is created ( Figure 3 or Figure 4 (not shown in the figure), and add the exercise record subtask to task3 and place it on the top of the stack, and add task3 to the horizontal task stack and place it on the top of the stack to activate task3, so the foreground displays the interface of the exercise record subtask, which includes exercise duration, exercise time, calories burned, etc. Optionally, after task3 is activated, task1 can be destroyed. Task1 destruction means that all subtasks in task1 (for example, exercise subtasks, list subtasks) are destroyed.
[0128] The end of the subtask during exercise may include: manual end or automatic end. Manual end may be, for example, end by pressing a button, etc. Automatic end may be, for example, a countdown is included in the exercise interface, and the exercise automatically ends when the countdown reaches 0.
[0129] Optionally, after the exercise subtask is completed, the exercise recording subtask is automatically started, which may include: after the exercise subtask is completed, it is determined whether a condition is met, such as whether the exercise time is greater than a preset time (e.g., 5 minutes), or, taking running as an example, whether the running mileage is greater than a preset length (e.g., 100 meters). If so, the exercise recording subtask is automatically started. If the condition is not met, it is considered that the exercise time and mileage are short and do not need to be recorded, then after the exercise subtask is completed, it can automatically return to the previous subtask of the exercise subtask, such as Figure 4 In (e), because the course preview subtask is destroyed, the previous subtask of the exercise subtask is the list subtask, so the foreground automatically returns to the list interface.
[0130] Optionally, in some cases, the two-dimensional task stack can also be destroyed as a whole. For example, the multi-tasking interface of the watch includes a delete button, through which the two-dimensional task stack is destroyed. Destruction of the two-dimensional task stack means that all vertical task stacks and horizontal task stacks are completely destroyed.
[0131] Embodiment 2
[0132] In the above embodiment, since the vertical task stack is dynamically changing, the tasks in the horizontal task stack are also dynamically changing. For example, with the destruction of a certain vertical task stack, the corresponding task in the horizontal task stack is also destroyed. Therefore, in the embodiment of the present application, the two-dimensional task stack is a dynamic task stack. Considering that the subtasks such as the dial, negative one screen, desktop, and multitasking in the watch cannot be destroyed, the subtasks such as the dial, negative one screen, desktop, and multitasking (collectively referred to as home subtasks) are managed separately. For example, the watch includes a resident task, which is used to manage the home subtask. Among them, the resident task stack and the two-dimensional task stack (i.e., the dynamic task stack) are managed separately.
[0133] For example, see Figure 5 In (a), the watch adds the desktop to the resident task stack and it is at the top of the stack, so the watch displays the desktop in the foreground. At this time, the watch has not yet created a two-dimensional task stack. Figure 5 In (a), the watch receives an operation to start interface A1 from the desktop, then creates task1 in the background, adds subtask A1 to task1 and places it on the top of the stack, adds task1 to the horizontal task stack and places it on the top of the stack, and the preindex of task1 in the horizontal task stack points to the desktop. Since task1 is added to the horizontal task stack and is at the top of the stack, that is, task1 is in the activated state, the watch displays interface A1 in the foreground.
[0134] Figure 5In (b), when the watch receives the operation of opening the interface B1 of application B from the interface A1, it determines that it needs to enter the subtask B1 and determines to prepare the packageName of the subtask B1. The watch searches the horizontal task stack to see whether there is a task containing a subtask with the same packageName. After searching, it is determined that there is no such task, so task2 is created in the background, and subtask B1 is added to task2 and is located at the top of the stack, as shown in FIG. Figure 5 In (c), task2 is added to the horizontal task stack and is at the top of the stack, and the preindex of task2 in the horizontal task stack points to task1. Since task2 is added to the horizontal task stack and is at the top of the stack, that is, task2 is in the activated state, the watch foreground displays interface B1.
[0135] In the above process, the relationship between tasks in the horizontal task stack is: task2 is at the top of the stack, and the preindex of task2 points to task1, and the preindex of task1 points to the desktop.
[0136] Therefore, if a return operation is received when interface B1 is displayed in the foreground, the system will gradually return according to the direction of preindex in the horizontal task stack, that is, from interface B1 -> interface A1 -> desktop.
[0137] Optional, Figure 5 In (c), if task1 is destroyed (for example, the application corresponding to task1 exits), task1 is popped out of the horizontal task stack, and the preindex of task2 points to the desktop.
[0138] There are some cases where the interface B1 returns to the desktop directly. In this case, the relationship pointed to by preindex in the horizontal task stack can be left unchanged. For example Figure 5 In (d), after returning from interface B1 to the desktop, the relationship in the horizontal task stack remains unchanged. If the watch opens interface B1 from the desktop, the relationship of the tasks in the horizontal task stack needs to be updated to: task2 is at the top of the stack, and task2's preindex points to the desktop, such as Figure 5 Therefore, in this case, if you return from interface B1, you return to the desktop.
[0139] Embodiment 3
[0140] Considering that there are some reminder sub-services in the watch, such as abnormal heart rate reminder, mileage reminder, etc., in order to ensure timely reminders, the watch does not need to find the corresponding task in the horizontal task stack according to the packageName of the reminder sub-task, but can directly add the reminder sub-service to the currently active task and place it on the top of the stack. Moreover, no matter whether the currently active task is a resident task stack or a vertical task stack, the reminder sub-service can be added to the task and placed on the top of the stack.
[0141] For example, Figure 6 When the watch detects an abnormal heart rate or the mileage is about to end, it needs to enter the abnormal heart rate reminder subtask or the mileage reminder subtask, collectively referred to as the reminder subtask. The watch determines that the currently active task is task3 based on the horizontal task stack, so the reminder subtask is added to task3 and is located at the top of the task3 stack, so the watch displays the reminder interface, such as the abnormal heart rate reminder interface or the mileage reminder interface.
[0142] For example, Figure 7 In (a), the watch adds subtask A1 to task1, and task1 is at the top of the horizontal task stack, so interface A1 is displayed in the foreground. Suppose the watch detects an abnormal heart rate of the user at this time, such as Figure 7 In (b), the watch determines that the currently active task is task1 according to the horizontal task stack, so the abnormal heart rate reminder sub-service is added to task1 and is located at the top of the stack, so the abnormal heart rate reminder is displayed in the foreground, such as Figure 7 (b) in . Figure 7 In (b), the abnormal heart rate reminder interface may also include a "Go to Measure" button. When the watch receives an operation on the button, it determines that it needs to enter the ECG subtask and determines the packageName of the ECG subtask. The watch searches the horizontal task stack for a task containing a subtask with the same packageName. After searching, it is determined that there is no such task, so task2 is created in the background, and the ECG subtask is added to task2 and is located at the top of the stack. Therefore, task2 is at the top of the horizontal task stack, that is, task2 is in an activated state, so the ECG is displayed in the foreground.
[0143] Optional, Figure 7 In (c), task2 is at the top of the horizontal task stack, and task1 is no longer at the top of the stack, so the abnormal heart rate reminder subtask in task1 is destroyed. This is because the abnormal heart rate reminder sub-service is configured to be destroyed once it exits to the background. In other words, once the task where the abnormal heart rate reminder sub-service is located is no longer in an active state (i.e., no longer at the top of the horizontal and vertical task stacks), the abnormal heart rate reminder sub-service is destroyed.
[0144] Figure 7 In (c), when the watch displays the electrocardiogram in the foreground, if a return operation is received, the currently activated task is determined to be task2 according to the horizontal task stack, and in task2, it is determined whether there are other sub-services under the electrocardiogram subtask. If not, task2 is destroyed, and the preindex of task2 is determined to point to task1 according to the horizontal task stack, so task1 is at the top of the horizontal task stack, that is, it is in the activated state. Since the abnormal heart rate reminder in task1 has been destroyed, the interface A1 of subtask A1 in task1 in the foreground of the watch is shown as Figure 7 (d) in.
[0145] Embodiment 4
[0146] In some embodiments, when the watch is in the lock screen state, some reminder interfaces may also pop up. For example, when the watch is in the lock screen state, an abnormal heart rate reminder interface may pop up. And a "Go to Measure" button may be displayed in the interface. When an operation for the button is received, the watch may be unlocked first, and then the electrocardiogram may be opened.
[0147] like Figure 8 In (a), the watch is in the locked screen state. For example, the watch face is displayed when the watch is in the locked screen state. Figure 8 In (b), if the watch determines that the heart rate is abnormal, a heart rate abnormality reminder subtask is added to the resident task and is placed at the top of the stack, so the watch displays the heart rate abnormality reminder in the foreground. When the watch displays the heart rate abnormality reminder in the foreground, it can also display shortcut keys, such as "Go to measurement". When the watch receives an operation for the "Go to measurement" key, such as Figure 8 In (c), the unlock subtask is added to the resident task and is placed at the top of the stack, so the watch front-end displays the unlocking interface. For example, the interface includes information such as a password input box and fingerprint input. When the watch front-end displays the unlocking interface, the back-end can pre-run the ECG subtask in the cache. This cache can be pre-configured and used to pre-run the first subtask after unlocking during the unlocking process. Figure 8 In (d), when the watch receives the password entered by the user, it compares it with the stored password. If they are consistent, task1 is created, and the ECG subtask is added to task1 and is located at the top of the stack. Moreover, task1 is at the top of the stack in the horizontal task stack, that is, task1 is in the activated state, so the ECG is displayed on the front of the watch, as shown in Figure 8 (d) in.
[0148] Fig. 9 FIG. 1 shows a schematic diagram of the structure of an electronic device. The electronic device may be, for example, the watch mentioned above. Fig. 9As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0149] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Among them, different processing units may be independent devices or integrated into one or more processors. Among them, the controller may be the nerve center and command center of the electronic device. The controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. A memory may also be set in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a high-speed cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
[0150] Optionally, the processor 110 may include two processors, a main processor and an auxiliary processor or a coprocessor. Optionally, the main processor may be an application processor (AP) and the coprocessor may be a microcontroller unit (MCU).
[0151] Among them, the processor 110 can be used to execute the process of the task stack management method provided in the embodiment of the present application. For example, the processor 110 can create a first task stack, and add a first subtask in the first task stack, and the first subtask is located at the top of the first task stack; create a second task stack, and add the first task stack in the second task stack, and the first task stack is located at the top of the second task stack, wherein the task stack located at the top of the second task stack is configured to be activated, and the task stack in the activated state is configured to be displayed through the foreground; the processor 110 displays the first interface of the first subtask through the display screen 194. The processor 110 can also be used to create a third task stack, and add a second subtask in the third task stack, and the second subtask is located at the top of the third task stack; add the third task stack in the second task stack, and the third task stack is located at the top of the second task stack, so that the third task stack is in an activated state, and the preindex of the third task stack points to the first task stack, and the preindex is used to indicate that the previous task stack of the third task stack is the first task stack; the processor 110 displays the second interface of the second subtask through the display screen 194. For the specific implementation process, please refer to the previous description.
[0152] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0153] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0154] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0155] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0156] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0157] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0158] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0159] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0160] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0161] The wireless communication function of the electronic device can be implemented by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna. For example, antenna 1 can be reused as a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0162] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0163] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0164] In some embodiments, antenna 1 of the electronic device is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology.
[0165] The display screen 194 is used to display the display interface of the application, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device may include one or more display screens 194.
[0166] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor, etc. Among them, the ISP is used to process the data fed back by the camera 193.
[0167] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, and the software code of at least one application program, etc. The data storage area can store data (such as images, videos, etc.) generated during the use of the electronic device, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash memory, etc.
[0168] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as pictures and videos are stored in the external memory card.
[0169] The electronic device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0170] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0171] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to external speaker scenarios such as hands-free calls through one or more speakers 170A.
[0172] The receiver 170B, also called a "earpiece", may be one or more and is used to convert an audio electrical signal into a sound signal. When the electronic device 100 receives a call or a voice message, the voice can be received by placing the receiver 170B close to the ear.
[0173] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.
[0174] The earphone jack 170D is used to connect a wired earphone.
[0175] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194 .
[0176] The gyro sensor 180B can be used to determine the motion posture of the electronic device. In some embodiments, the angular velocity of the electronic device around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting.
[0177] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0178] The magnetic sensor 180D includes a Hall sensor. For example, the electronic device can use the magnetic sensor 180D to detect the opening and closing of the flip leather case.
[0179] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device in various directions (generally three axes), and can detect the magnitude and direction of gravity when the electronic device is stationary.
[0180] Distance sensor 180F, used to measure distance. Electronic devices can measure distance through infrared or laser.
[0181] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device emits infrared light outward through the light emitting diode. The electronic device uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device. When insufficient reflected light is detected, the electronic device can determine that there is no object near the electronic device.
[0182] The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device can adaptively adjust the brightness of the display screen 194 according to the sensed brightness of the ambient light.
[0183] The fingerprint sensor 180H is used to collect fingerprints.
[0184] The temperature sensor 180J is used to detect the temperature.
[0185] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
[0186] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of a human vocal part.
[0187] The button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The electronic device can receive the button input and generate a key signal input related to the user settings and function control of the electronic device. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device.
[0188] Understandably, Fig. 9 The components shown do not constitute a specific limitation on the electronic device. The electronic device in the embodiment of the present application may include Fig. 9 In addition, Fig. 9 The combination / connection relationship between the components can also be adjusted and modified.
[0189] Fig.10 The electronic device 1000 provided in the embodiment of the present application is a schematic diagram of the structure. The electronic device 1000 may be the watch mentioned above. Fig.10 As shown, the electronic device 1000 may include: one or more processors 1001; one or more memories 1002; a communication interface 1003, and one or more computer programs 1004, and the above-mentioned devices may be connected via one or more communication buses 1005. The one or more computer programs 1004 are stored in the above-mentioned memory 1002 and are configured to be executed by the one or more processors 1001, and the one or more computer programs 1004 include instructions. For example, when the electronic device 1000 is the watch mentioned above, the instruction can be used to execute the relevant steps of the watch in the corresponding embodiment above. The communication interface 1003 is used to realize the communication between the electronic device 1000 and other devices, for example, the communication interface can be a transceiver.
[0190] In the embodiments provided by the present application, the method provided by the embodiments of the present application is introduced from the perspective of an electronic device (e.g., a watch) as an execution subject. In order to implement the functions in the methods provided by the embodiments of the present application, the electronic device may include a hardware structure and / or a software module, and the functions are implemented in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a function of the above functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
[0191] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc. In the absence of conflict, the solutions of the above embodiments can be used in combination.
[0192] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0193] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0194] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0195] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0196] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A task stack management method, characterized in that: Applied to a wearable device, the method comprises: Creating a first task stack, and adding a first subtask to the first task stack, wherein the first subtask is located at the top of the first task stack; Creating a second task stack, and adding the first task stack to the second task stack, wherein the first task stack is located at the top of the second task stack, wherein the task stack located at the top of the second task stack is configured to be in an activated state, and the task stack in the activated state is configured to be displayed through the foreground; The first interface of the first subtask is displayed on the foreground; Creating a third task stack, and adding a second subtask to the third task stack, wherein the second subtask is located at the top of the third task stack; Adding the third task stack to the second task stack, and the third task stack is located at the top of the second task stack, so that the third task stack is in an activated state, and the preamble index of the third task stack points to the first task stack, and the preamble index is used to indicate that the previous task stack of the third task stack is the first task stack; The second interface of the second subtask is displayed on the foreground.
2. The method according to claim 1, characterized in that The method further comprises: Receiving a pop operation of the second subtask; Determining that no other subtask in the third task stack is located below the second subtask; Destroying the third task stack; Determine the first task stack according to the pre-order index of the third task stack, pop the third task stack from the second task stack, and move the first task stack to the top of the stack, so that the first task stack is in an activated state; The foreground displays the interface of the subtask at the top of the first task stack.
3. The method according to claim 1, characterized in that The method further comprises: receiving an operation for switching the second subtask to the background; Determining that no other subtask in the third task stack is located below the second subtask; Determine the first task stack according to the pre-order index of the third task stack, move the first task stack to the top of the second task stack, so that the first task stack is in an activated state, and the pre-order index of the first task stack points to the third task stack; The foreground displays the interface of the subtask at the top of the first task stack.
4. The method according to any one of claims 1 to 3, characterized in that: The first subtask and the second subtask are subtasks of different applications; and / or, The first subtask and the second subtask have different package names, where the package name is the name of the program package of the subtask.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determine the need to start the fourth subtask; Determining that the package names of the subtasks in the first task stack and the third task stack are different from the package name of the fourth subtask; Creating a fourth task stack, and adding the fourth subtask to the fourth task stack, with the fourth subtask being located at the top of the fourth task stack; Adding the fourth task stack to the second task stack and locating it at the top of the stack, so that the fourth task stack is in an activated state, and the pre-order index of the fourth task stack points to the third task stack, and the pre-order index of the third task stack points to the first task stack; The interface of the fourth subtask is displayed on the foreground.
6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determine the need to start the fourth subtask; Determine that the package name of the subtask in the third task stack is the same as the package name of the fourth subtask; Adding the fourth subtask to the third task stack, wherein the fourth subtask is located at the top of the third task stack; The interface of the fourth subtask is displayed on the foreground.
7. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Determine the need to start the fourth subtask; Determining that a package name of a subtask in the first task stack is the same as a package name of the fourth subtask; Adding the fourth subtask to the first task stack, with the fourth subtask being located at the top of the first task stack; Moving the first task stack to the top of the second task stack so that the first task stack is in an activated state and the leading index of the first task stack points to the third task stack; The foreground displays the interface of the subtask located at the top of the first task stack.
8. The method according to claim 1, characterized in that The first interface includes a countdown, and the countdown is a countdown for starting the fifth subtask; Before creating the third task stack, the method further includes: before the countdown reaches 0, an incoming call is received, the second subtask is an incoming call task, and the second interface is an incoming call interface; After the incoming call interface is displayed on the foreground, the countdown stops; When an operation for switching the incoming call interface to the background is received, the foreground returns to the first interface and the countdown starts again; When the countdown reaches 0, the interface of the fifth subtask is displayed on the foreground.
9. The method according to claim 8, characterized in that When an operation for switching the incoming call interface to the background is received, the foreground returns to the first interface, including: When receiving an operation for switching the incoming call interface to the background, determining that no other subtasks in the third task stack are located under the incoming call task; Determine the first task stack according to the pre-order index of the third task stack, move the first task stack to the top of the second task stack, so that the first task stack is in an activated state, and the pre-order index of the first task stack points to the third task stack; The foreground displays the interface of the subtask at the top of the first task stack, and the interface is the first interface.
10. The method according to claim 1, characterized in that The first interface includes a countdown, and the countdown is a countdown for starting the fifth subtask; Before creating the third task stack, the method further includes: before the countdown reaches 0, an incoming call is received, the second subtask is an incoming call task, and the second interface is an incoming call interface; After the incoming call interface is displayed on the foreground, the countdown continues; The countdown reaches 0; The interface of the fifth subtask is displayed on the foreground.
11. The method according to claim 10, characterized in that Before the foreground displays the interface of the fifth subtask, it also includes: When the countdown reaches 0, the fifth subtask is forcibly added to the first task stack and is located at the top of the first task stack; Receiving an operation for switching the incoming call interface to the background, determining that no other subtasks in the third task stack are located under the incoming call task; The first task stack is determined according to the pre-order index of the third task stack, and the first task stack is moved to the top of the second task stack, so that the first task stack is in an activated state.
12. The method according to claim 10, characterized in that Before the foreground displays the interface of the fifth subtask, it also includes: When receiving an operation for switching the incoming call interface to the background, determining that no other subtask in the third task stack is located below the second subtask; Determine the first task stack according to the pre-order index of the third task stack, and move the first task stack to the top of the second task stack so that the first task stack is in an activated state; The fifth subtask is forcibly added to the first task stack and is located at the top of the first task stack.
13. The method according to claim 10, characterized in that Before the foreground displays the interface of the fifth subtask, it also includes: When the countdown reaches 0, the fifth subtask is forcibly added to the first task stack and is located at the top of the first task stack; The first task stack in the second task stack is forcibly moved to the top of the stack, so that the first task stack is in an activated state.
14. The method according to any one of claims 1 to 13, characterized in that: Before creating the first task stack, it also includes: Display the resident interface, which includes the desktop, multi-tasking interface, negative one screen or dial; After creating a second task stack and adding the first task stack to the second task stack, the method further includes: a preamble index of the first task stack points to the resident interface.
15. The method according to claim 14, characterized in that The method further comprises: Determine that the abnormal reminder sub-service needs to be started; Adding the abnormal reminder sub-service to the third task stack and locating it at the top of the third task stack; The front desk displays the interface of the abnormal reminder sub-service.
16. The method according to claim 15, characterized in that The interface of the abnormal reminder sub-service includes a shortcut key, and the method further includes: An operation on the shortcut key is received, and it is determined that a sixth sub-service needs to be started; Determining that the package names of the subtasks in the first task stack and the third task stack are different from the package name of the sixth subtask; Creating a fifth task stack, and adding the sixth sub-service to the fifth task stack and locating it at the top of the fifth task stack; Add the fifth task stack to the second task stack and place it on the top of the stack, so that the fifth task stack is in an activated state, and the pre-order index of the fifth task stack points to the third task stack, and the pre-order index of the third task stack points to the first task stack; The interface of the sixth subtask is displayed on the foreground.
17. The method according to claim 15 or 16, characterized in that After the fifth task stack is in an activated state, the abnormal reminder sub-service in the third task stack is destroyed.
18. The method according to any one of claims 1 to 17, characterized in that: Adding the first task stack to the second task stack includes: Adding a first mark of the first task stack to the second task stack, wherein the first mark is located at the top of the second task stack; Adding the third task stack to the second task stack includes: Adding a second mark of the third task stack to the third task stack, wherein the second mark is located at the top of the second task stack; The leading index of the second tag points to the first tag.
19. An electronic device, characterized in that: include: a processor, a memory, and one or more programs; The one or more programs are stored in the memory, and the one or more programs include instructions, which, when executed by the processor, enable the electronic device to perform the method steps as described in any one of claims 1 to 18.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and when the computer program is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 18.