Application control method, system and device, storage medium and program product
By dynamically managing interface status and resources, the problems of high power consumption and complex logic in traditional embedded applications are solved, and low power consumption is achieved, simplified data management and improved code maintenance is improved.
Patent Information
- Application Number
- CN202510348419.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-07-11
AI Technical Summary
The lack of backend system management interface status and data in traditional embedded and mobile application development leads to high power consumption, complex interface logic and difficult-to-maintain code problems.
The dynamic interface management method is adopted to query the number of interfaces in the background management system, interface association and state conversion are performed, including active, paused and destroyed states, and interface switching and resource usage are optimized.
Reduces power consumption, simplifies data management, improves code maintainability, and optimizes user experience and resource utilization.
Smart Images

Figure CN120295626A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of embedded development, and particularly to an application control method, system, device, storage medium and program product. Background Art
[0002] In traditional embedded and mobile application development, the interface management system usually adopts a linear structure, that is, the navigation of the user interface (UI) follows a fixed order, and each time the interface jumps, it involves re-rendering the entire new interface.
[0003] This prior art lacks a background system to manage and save the interface state and related data, resulting in several significant problems. First, without the interface management of the background system, it is necessary to re-render the interface every time the interface jumps, and the power consumption is relatively high. If the interface needs to record relevant data, additional logic code needs to be written to store the data, making the logic of a single interface relatively complex, which is not conducive to code maintenance, and when problems occur, it becomes more difficult to locate errors. Summary of the Invention
[0004] The main purpose of this application is to provide an application control method, system, device, storage medium and program product, aiming to solve the technical problem of how to reduce power consumption, simplify data management and improve code maintainability under the condition that multiple interfaces coexist and are controllable.
[0005] To achieve the above object, this application proposes an application control method, which is applied to a background management system. The background management system includes at least one application program, and the application program includes at least one interface. The method includes:
[0006] When the current interface of the current application program is in an active state and a next interface jump instruction is received, query whether the number of interfaces existing simultaneously in the current application program reaches a preset number;
[0007] If the number of interfaces existing simultaneously in the current application program does not reach the preset number, create the next interface, associate the current interface with the next interface, set the current interface from the active state to the paused state, set the next interface to the active state, and use it as the current interface;
[0008] If the number of interfaces existing simultaneously in the current application program does not reach the preset number, delete the next interface of the first interface, create the next interface, and reset the states and re-associate the interfaces currently existing in the current application program.
[0009] In one embodiment, the interface includes a successor pointer and a predecessor pointer. The step of associating the current interface with the next interface includes:
[0010] Point the successor pointer of the current interface to the next interface. At the same time, point the predecessor pointer of the next interface to the current interface to complete the association between the current interface and the next interface.
[0011] In one embodiment, the step of, if the number of interfaces existing simultaneously in the current application reaches the preset number, deleting the interface next to the first interface, creating the next interface, and resetting the status and re-associating the interfaces currently existing in the current application includes:
[0012] If the number of interfaces existing simultaneously in the current application reaches the preset number, disconnect the association between the first interface and the interface next to the first interface, clear the interface resources under the node of the interface next to the first interface, and set the pointer variable of the interface next to the first interface to null;
[0013] Create the next interface and re-associate the interfaces currently existing in the current application in sequence;
[0014] Set the status of the next interface to the active state, at the same time set the next interface as the current interface, and set the status of all interfaces before the next interface to the paused state.
[0015] In one embodiment, after the step of setting the status of the next interface to the active state, at the same time setting the next interface as the current interface, and setting the status of all interfaces before the next interface to the paused state, further includes:
[0016] If a return instruction from the previous interface is received, set the current interface to the destroyed state, set the previous interface as the current interface, and set the status of the current interface to the active state;
[0017] If it is recognized that the current interface is the first interface, when the return instruction from the previous interface is received, destroy the current application and switch to the next application.
[0018] In one embodiment, after the step of, if the number of interfaces existing simultaneously in the current application reaches the preset number, deleting the interface next to the first interface, creating the next interface, and resetting the status and re-associating the interfaces currently existing in the current application, further includes:
[0019] Judge whether the number of existing current applications reaches the preset number of applications and whether a switch application instruction is received;
[0020] If the number of existing instances of the current application reaches the preset number of applications and the application switching instruction is received, the last application in the current application is deleted, and a new application is created and switched to.
[0021] In one embodiment, the step of deleting the last application in the current application, creating and switching to a new application includes:
[0022] Setting the last application in the current application to a destroyed state, creating a new application, and setting the interface state in the new application to an active state.
[0023] In addition, to achieve the above object, the present application also provides a background management system, which includes:
[0024] An interface query module, configured to query whether the number of interfaces existing simultaneously in the current application reaches a preset number when the current interface in the current application is in an active state and the next interface jump instruction is received;
[0025] An interface management module, configured to create the next interface if the number of interfaces existing simultaneously in the current application does not reach the preset number, associate the current interface and the next interface, set the current interface from the active state to a paused state, and set the next interface to the active state as the current interface;
[0026] The interface management module is further configured to delete the interface next to the first interface, create the next interface, and perform status reset and re - association on the interfaces currently existing in the current application if the number of interfaces existing simultaneously in the current application reaches the preset number
[0027] In addition, to achieve the above object, the present application also provides an application control device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the application control method as described above.
[0028] In addition, to achieve the above object, the present application also provides a storage medium, which is a computer - readable storage medium, and a computer program is stored on the storage medium, and when the computer program is executed by a processor, it implements the steps of the application control method as described above.
[0029] In addition, to achieve the above object, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the application control method as described above.
[0030] An embodiment of the present application provides an application control method, system, device, storage medium, and program product. The method is applied to a background management system, which at least includes one application program. The application program at least includes one interface. The method includes: when the current interface of the current application program is in an active state and a next interface jump instruction is received, querying whether the number of interfaces existing simultaneously in the current application program reaches a preset number; if the number of interfaces existing simultaneously in the current application program does not reach the preset number, creating the next interface, associating the current interface and the next interface, setting the current interface from the active state to the paused state, setting the next interface to the active state, and using it as the current interface; if the number of interfaces existing simultaneously in the current application program reaches the preset number, deleting the next interface of the first interface, creating the next interface, and resetting the states and re-associating the currently existing interfaces in the current application program. By the way that when the current interface of the current application program is in an active state and an instruction to jump to another interface is received, the system associates the current interface and the next interface, this method can help maintain the context environment of user operations and also reduce the need to completely re-render the interface; by adopting the method of dynamically deleting unnecessary interfaces and re-associating the existing interfaces when the number of interfaces existing simultaneously in the application program exceeds the preset number, the memory usage is effectively controlled; in addition, a background management system is introduced to achieve fast interface switching and optimize the user experience; at the same time, by automatically managing the state transition and data association of the interface, the power consumption and the complexity of the code are reduced, which is beneficial to code maintenance and problem location. Description of the Drawings
[0031] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0033] Figure 1 It is a schematic flowchart provided for the first embodiment of the application control method of the present application;
[0034] Figure 2 It is a schematic diagram of the states of the application and the active interface involved in the first embodiment of the present application;
[0035] Figure 3 It is a schematic diagram of the state for controlling the current interface to jump to the second interface involved in the first embodiment of the present application.
[0036] Figure 4 Schematic diagram of the state for controlling the current interface to jump to the third interface involved in the first embodiment of this application;
[0037] Figure 5 Schematic diagram of the process for controlling the current interface to jump to the fourth interface involved in the first embodiment of this application;
[0038] Figure 6 Schematic diagram of the result for controlling the current interface to jump to the fourth interface involved in the first embodiment of this application;
[0039] Figure 7 Schematic flow diagram provided by the second embodiment of the application control method of this application;
[0040] Figure 8 Schematic diagram of the process for controlling the current interface to return to the previous interface involved in the second embodiment of this application;
[0041] Figure 9 Schematic diagram of the result for controlling the current interface to return to the previous interface involved in the second embodiment of this application;
[0042] Figure 10 Schematic diagram of the process for the conversion of the current application and interface states involved in the second embodiment of this application;
[0043] Figure 11 Schematic diagram of the result for the conversion of the current application and interface states involved in the second embodiment of this application;
[0044] Figure 12 Schematic flow diagram provided by the third embodiment of the application control method of this application;
[0045] Figure 13 Schematic diagram of the switching between application programs involved in the third embodiment of this application;
[0046] Figure 14 Schematic flow diagram of the process for controlling the increase and decrease of application programs involved in the third embodiment of this application;
[0047] Figure 15 Schematic diagram of the system structure of the application control method of this application;
[0048] Figure 16 Schematic diagram of the life cycle of the application program of the application control method of this application;
[0049] Figure 17 Schematic diagram of the life cycle of the interface of the application control method of this application;
[0050] Figure 18 Schematic diagram of the module structure of the background management system in the embodiment of this application;
[0051] Figure 19 The device structure diagram of the hardware operating environment involved in the application control method in the embodiment of the present application.
[0052] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. Detailed implementation manners
[0053] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application, and are not used to limit the present application.
[0054] In order to better understand the technical solutions of the present application, the following will be described in detail with reference to the accompanying drawings of the specification and specific implementation manners.
[0055] The main solution of the embodiment of the present application is: when the current interface of the current application is in an active state and a next interface jump instruction is received, query whether the number of interfaces existing simultaneously in the current application reaches a preset number; if the number of interfaces existing simultaneously in the current application does not reach the preset number, create the next interface, associate the current interface and the next interface, set the current interface from the active state to the paused state, set the next interface to the active state, and use it as the current interface; if the number of interfaces existing simultaneously in the current application reaches the preset number, delete the next interface of the first interface, create the next interface, and perform status reset and re - association on the interfaces currently existing in the current application.
[0056] In traditional embedded and mobile application development, the interface management system usually adopts a linear structure, that is, the navigation of the user interface (UI) follows a fixed order, and each time the interface jumps, it involves re - rendering the entire new interface. This design lacks a background system to manage and save the interface state and related data, resulting in several significant problems.
[0057] First, since it is necessary to reload and render each time the interface is switched, this not only increases the processing burden on the system, but also increases the power consumption of the device, which is particularly disadvantageous for portable devices powered by batteries. Second, when it is necessary to record or maintain certain data on the interface, developers must write additional data storage logic for each individual interface. This not only makes the interface logic complex, but also makes the code difficult to maintain, and when problems occur, it becomes more difficult to locate errors. In addition, the interface management method without a background system limits the smoothness of the user experience and the flexibility of interaction.
[0058] The present application provides a solution, which always keeps the simultaneously existing interfaces within a controllable range by means of dynamic deletion, saving memory overhead. And background management is introduced. When the user switches the application, it can quickly return to the previous interface instead of starting to load from the first interface again, optimizing the user experience and reducing power consumption. When designing the code, there is no need to add variables and logic to record the information of the previous interface, reducing the complexity of the code and facilitating code maintenance and problem location.
[0059] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of implementing the above functions. Hereinafter, a personal computer is taken as an example to illustrate this embodiment and the following embodiments.
[0060] Based on this, the embodiment of the present application provides an application control method, referring to Figure 1 , Figure 1 which is a schematic flowchart of the first embodiment of the application control method of the present application.
[0061] In this embodiment, the application control method includes steps S10 to S30:
[0062] Step S10, when the current interface of the current application is in an active state and a next interface jump instruction is received, query whether the number of simultaneously existing interfaces in the current application reaches a preset number.
[0063] It should be noted that the embodiment of the present application is applied to an application program. Each application program includes several interfaces to implement a complete functional module. And the control of the application program in this embodiment is implemented based on LVGL (Light and Versatile Graphics Library). Among them, LVGL is an image library applicable to various embedded platforms and displays. It provides rich controls, themes, animations, fonts, images and other elements, as well as a flexible layout and event processing mechanism. It is widely used in fields such as wearable devices, industrial control, household devices, and Internet of Things devices.
[0064] Moreover, each application program in this embodiment includes at least one interface. If there are multiple interfaces existing simultaneously, the multiple interfaces are arranged in sequence. The interface ranked first is called the first interface, and so on.
[0065] Specifically, when the current interface of the current application is in the active state and a next interface jump instruction is received from the user, it is necessary to query whether the number of interfaces existing simultaneously in the current application reaches a preset number. For example, in order to save memory, this embodiment stipulates that in an application, at most 3 interfaces can exist simultaneously. The maximum number of interfaces to exist needs to be calculated according to the actual project situation.
[0066] Step S20, if the number of interfaces existing simultaneously in the current application does not reach the preset number, then create the next interface, associate the current interface and the next interface, set the current interface from the active state to the paused state, set the next interface to the active state, and use it as the current interface;
[0067] It should be noted that the active state of an interface means that the interface is currently being displayed in the foreground and can interact with the user. An interface in the active state is fully loaded and initialized, and all components are ready to receive user input. The paused state of an interface means that the interface is temporarily not displayed in the foreground, but still retains its state information and data. An interface in the paused state usually no longer processes user input or updates the UI, but can be quickly restored to the active state when needed without having to be reloaded.
[0068] Before executing this step, it is necessary to register an application in the background management system. The application includes, but is not limited to, information such as the application name, application ID, chart, predecessor application pointer, successor application pointer, starting interface pointer, etc. and initialize it. Its structure is as follows:
[0069]
[0070] Then, set a starting interface for the initialized application. The interface includes, but is not limited to, information such as the interface name, interface ID, predecessor interface pointer, successor interface pointer, interface object, etc. and initialize it. Pass the pointer of this interface to the application to make it the entry of the application. Its structure is as follows:
[0071]
[0072]
[0073] After setting the starting interface for the application, the user operates to enter an application (such as application A), create and display the current interface (such as interface 1), and then set the current application to the active state and the current interface to the active state. Please refer to Figure 2 , Figure 2 for the state schematic diagram of the application and the active interface.
[0074] For example, assume that the user starts a music player application. First, the application control system creates the main interface of the music player, including elements such as play control buttons and song lists, and displays it on the screen. Then, the system sets the overall state of the music player application to active, indicating that it is the application currently being used by the user. Finally, the system sets the state of the main interface of the music player to active so that it can respond to user operations such as touch and click.
[0075] After completing the initialization of the current interface as described above, further, in a feasible embodiment, step S20 may further include step S21:
[0076] Step S21, pointing the successor pointer of the current interface to the next interface, and at the same time, pointing the predecessor pointer of the next interface to the current interface, to complete the association between the current interface and the next interface.
[0077] It should be noted that successor pointers and predecessor pointers are usually used in doubly linked lists, tree structures, and other data structures that require forward and backward node associations. They point to the next node and the previous node of a node respectively. Among them, the successor pointer points to the next node after the current node, and the predecessor pointer points to the previous node before the current node.
[0078] Specifically, when the user performs an operation (such as clicking a button, selecting a menu item, etc.), or the program logic determines that it is necessary to switch from the current interface to another interface, an interface jump instruction can be triggered. Based on this interface jump instruction, the application control system first associates the current interface (such as interface 1) and the next interface (such as interface 2). Specifically, it points the successor pointer of interface 1 to interface 2, and points the predecessor pointer of interface 2 to the current interface. When the successor pointer of interface 1 saves the address of interface 2. Then, it converts the state of interface 1 from active to paused, and saves the state information of the current interface (such as input data, scroll position, etc.) so that it can be restored when the user returns. At the same time, it sets the state of interface 2 to the current interface and sets the state of interface 2 to active, and prepares to display it to the user. As Figure 3 shown, Figure 3 is a schematic diagram of the state for controlling the current interface to jump to the second interface.
[0079] And so on, when the user needs to jump from interface 2 to the third interface (such as interface 3), similarly, it points the successor pointer of interface 2 to interface 3, and at the same time points the predecessor pointer of interface 3 to interface 2, thereby associating interface 2 and interface 3. Then, it sets interface 3 as the current interface, and sets the state of interface 3 to the active state. And the states of interface 1 and interface 2 are both set to the paused state. As Figure 4 shown, Figure 4Schematic diagram of the state for controlling the current interface to jump to the third interface.
[0080] Through the above steps, the successor pointer of the current interface is pointed to the next interface, and the predecessor pointer of the next interface is pointed to the current interface. Then, the state of the interface is set to paused or active as needed. This can not only achieve efficient interface navigation and management, but also provide a smoother and more convenient user experience, while optimizing the performance and resource usage efficiency of the application.
[0081] Step S30: If the number of interfaces existing simultaneously in the current application reaches the preset number, delete the interface next to the first interface, create the next interface, and reset the states and re-associate the interfaces currently existing in the current application.
[0082] It should be noted that in application design, the first interface usually refers to the first interface that the user sees when entering the application for the first time, or the bottommost interface in the navigation stack.
[0083] It is worth noting that in order to avoid excessive interfaces occupying system resources and save memory, performing step S30 can effectively manage and optimize the performance and resource usage of the application during runtime.
[0084] In a feasible implementation, step S30 may include steps S31 to S33:
[0085] Step S31: If the number of interfaces existing simultaneously in the current application reaches the preset number, disconnect the association between the first interface and the interface next to the first interface, clear the interface resources under the node of the interface next to the first interface, and set the pointer variable of the interface next to the first interface to null.
[0086] It should be noted that the setting of the preset number needs to be calculated according to the actual project situation. In this embodiment, since 32M of memory is used, 16M of memory is used for interface display. After testing, an interface that occupies a relatively large amount of memory requires 1M of memory space. Then, theoretically, a maximum of 16 interfaces can be stored simultaneously. In order to prevent memory overflow, about 7M of memory is reserved as redundant space, and a maximum of 9 interfaces can be stored simultaneously. It is designed that a maximum of 3 applications exist simultaneously, and each application can store a maximum of 3 interfaces. That is, in this embodiment, it is stipulated that in an application, a maximum of 3 interfaces can exist simultaneously.
[0087] Specifically, before the current interface jumps to the next interface, first traverse all interface nodes in the current application to query the number of interfaces currently existing. For design requirements, usually the first interface is required to be retained.
[0088] If it is queried that there are already 3 interfaces in the current application, when jumping to the next interface, first delete one interface after the first interface, including deleting the interface resources under one interface node after the first interface and setting the pointer variable of itself to null.
[0089] In this embodiment, before the current interface jumps to the fourth interface (such as interface 4), it is necessary to first delete the next interface (such as interface 2) of the first interface (such as interface 2). Interface 2 enters the destroyed state, where the destroyed state means that the interface has been removed from the memory and all the resources it occupies have been released. If an interface in the destroyed state needs to be displayed again, it must be recreated and initialized. First, disconnect the association between interface 2 and interface 1 and interface 3, and set the predecessor pointer and successor pointer of interface 2 to null. Then, clear the interface resources (including information such as interface name, interface ID, and interface object) under the node of interface 2 itself, and at the same time set the pointer of node 2 itself to null.
[0090] Step S32, create the next interface, and re-associate the interfaces that currently exist in the current application in sequence;
[0091] Specifically, when, through step S31, the destruction of the next interface of the first interface is completed, create another new next interface, and for the interfaces that have not been deleted, update the relationship of their front and back pointers. For example, set the successor pointer of each interface to point to the next interface, and set the predecessor pointer of each interface to point to the previous interface, to ensure that the last interface has no successor pointer and the first interface has no predecessor pointer.
[0092] Step S33, set the state of the next interface to the active state, at the same time set the next interface as the current interface, and set the states of all interfaces before the next interface to the paused state.
[0093] Specifically, set the state of the next interface to the active state, at the same time set the next interface as the new current interface, and set the states of the remaining interfaces to the paused state.
[0094] For example, please refer to Figure 5 , Figure 5 which is a schematic diagram of the process of controlling the current interface to jump to the fourth interface. After the destruction of interface 2 is completed, create a new interface 4, and this new interface 4 is the next interface. Then, associate the remaining interfaces in the application in sequence. That is, associate interface 3 with interface 1 and interface 3 with the new interface 4.
[0095] Subsequently, set interface 4 as the latest current interface, at the same time set its state to the active state, and set the states of interface 1 and interface 3 to the paused state. The final result is Figure 6 as shown.Figure 6 Schematic diagram of the result for controlling the current interface to jump to the fourth interface.
[0096] Through the above steps, the number of interfaces in the application can be effectively managed and optimized, ensuring that even when the upper limit of interfaces is exceeded, a good user experience and efficient resource utilization can be provided.
[0097] Through the method of the above embodiments, when the current interface of the current application is in an active state and a next interface jump instruction is received, query whether the number of interfaces existing simultaneously in the current application reaches a preset number; if the number of interfaces existing simultaneously in the current application does not reach the preset number, create the next interface, associate the current interface and the next interface, set the current interface from the active state to the paused state, set the next interface to the active state, and use it as the current interface; if the number of interfaces existing simultaneously in the current application reaches the preset number, delete the next interface of the first interface, create the next interface, and perform status reset and re - association on the interfaces currently existing in the current application. This method adopts a dynamic deletion method to ensure efficient and controllable memory usage of the application. At the same time, background management is introduced to achieve fast interface switching, optimizing the user experience while also reducing power consumption and the complexity of the code, which is conducive to code maintenance and problem location.
[0098] Based on the first embodiment of the present application, in the second embodiment of the present application, for the same or similar content as in the above - mentioned embodiment one, reference can be made to the above introduction and will not be elaborated hereinafter. On this basis, please refer to Figure 7 , after step S33, the application management and control method further includes steps S330 - S331:
[0099] Step S330, if a previous interface return instruction is received, set the current interface to the destroyed state, set the previous interface as the current interface, and set the state of the current interface to the active state;
[0100] Specifically, when the system receives the user - input instruction to return to the previous interface, first confirm whether the current interface is the first interface and whether there is a previous interface. If not, convert the state of the current interface from active to destroyed, then set the previous interface as the current interface and set its state to the active state.
[0101] For example, if the original current interface is interface 4, and when the instruction to return to the previous interface (i.e., interface 3) is received, destroy interface 4, set interface 3 as the new current interface and set its state to the active state. Interface 1 is in the paused state. Finally, associate interface 3 and interface 1. As Figure 8 and Figure 9 shown,Figure 8 Schematic diagram of the process for controlling the current interface to return to the previous interface Figure 9 Schematic diagram of the result for controlling the current interface to return to the previous interface
[0102] Step S331: If it is recognized that the current interface is the home interface, when receiving the return instruction of the previous interface, destroy the current application program and switch to the next application program
[0103] Specifically, when the system detects that the current interface is the home interface and performs the operation of returning to the previous interface at this time, it is considered that the user wants to exit the current application, and the current application needs to be destroyed and switched to the next one. When destroying the application, all interface nodes under its name should also be destroyed together
[0104] Suppose the current application is Application A. When the system receives the return instruction of the previous interface, first detect whether the current interface of Application A is the home interface. If so, destroy Application A, including releasing all resources, saving necessary user data, clearing the cache, and clearing the interfaces under its name, etc., to ensure that the application is completely closed. Then switch to the next application B and activate the current interface of Application B at the same time to make it show an active state. As Figure 10 and Figure 11 shown Figure 10 Schematic diagram of the process of the current application and interface state conversion Figure 11 Schematic diagram of the result of the current application and interface state conversion
[0105] Through the method of the above embodiments, the application program can effectively manage the interface and resources when the user returns, and at the same time ensure a smooth user experience. Especially for the return processing of the home interface, a clear exit mechanism is provided, enhancing the user's sense of control and satisfaction
[0106] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar content as in the above-mentioned first embodiment can be referred to the above introduction and will not be repeated hereinafter. On this basis, please refer to Figure 12 , after step S30, the application management method further includes steps S301 to S302
[0107] Step S301: Judge whether the existing quantity of the current application program reaches the preset application quantity and whether a switch application instruction is received
[0108] Step S302: If the existing quantity of the current application program reaches the preset application quantity and the switch application instruction is received, delete the last application program in the current application program and create and switch to a new application program
[0109] In this embodiment, the user can use preset physical buttons (such as the back button, home button, etc.) to perform application-level switching. By setting up a listener specifically for listening for whether a button is pressed, if a preset button is pressed, a switching application instruction is sent to the system. When the system receives this instruction, the current application is switched to the next application. For example, when switching from Application A to Application B, first set the states of all interfaces of Application A to the paused state, and then set the state of the current interface of Application B to the active state. As Figure 13 shown, Figure 13 it is a schematic diagram of the switching between application programs.
[0110] Specifically, first, determine whether the number of existing application programs exceeds the preset number, and whether the system receives a switching application instruction input by the user through the preset button.
[0111] If the number of existing application programs exceeds the preset number, and the system receives a switching application instruction input by the user through the preset button, then delete the last application, and then create a new application.
[0112] For example, in order to save memory space, this embodiment stipulates that only three applications can exist simultaneously. Each time an application program is entered, if it is detected that there are already three applications existing simultaneously, then the last application needs to be deleted, and a new application needs to be created. For example, when it is checked that Application A, Application B, and Application C exist simultaneously, and Application C is the last application, then Application C needs to be set to the destroyed state, and a new Application D needs to be created and set to the active state, and other applications are set to the paused state. As Figure 14 shown, Figure 14 it is a schematic diagram of the process for controlling the increase and decrease of application programs.
[0113] Exemplarily, in order to help understand the implementation process of the application control method obtained by combining this embodiment with the above Embodiment 1, please refer to Figure 15 , Figure 15 which provides a schematic diagram of the system structure of an application control method. Specifically:
[0114] This embodiment is applied to an application program control system, which consists of several applications, and each application consists of several interfaces.
[0115] Regarding the life cycle and function description of the application, as Figure 16 shown, Figure 16It is a schematic diagram of the life cycle of an application. Specifically, an application consists of 4 states to form its complete life cycle. First, before creating the application, the application is initialized, including setting information such as the application name, application ID, icon, predecessor application pointer, successor application pointer, starting interface pointer, etc. and initializing them. This initial state is only executed once in the entire life cycle.
[0116] After initialization is completed, the application is set to the active state. In this state, it is also necessary to set the current interface of the current application to the active state. Users may switch back and forth between multiple applications, and the active state may be executed multiple times in the entire life cycle.
[0117] When switching to a new application, the old application enters the paused state and the new application enters the active state. In this state, it is necessary to set the current interface of the current application to the paused state. Users may switch back and forth between multiple applications, and the paused state may be executed multiple times in the entire life cycle.
[0118] When the user exits the application or creates a new application, it enters the application destruction state. In this state, it is necessary to destroy the resources of all interface nodes under the application name and set their pointers to null. The destruction state is only executed once in the entire life cycle.
[0119] Regarding the life cycle and function description of the interface, as Figure 17 shown, Figure 17 It is a schematic diagram of the life cycle of the interface. Specifically, before creating the interface, the application first initializes the interface, including setting information such as the interface name, interface ID, predecessor application pointer, successor application pointer, etc. and initializing them. This interface initialization state is only executed once in the entire life cycle.
[0120] After initializing the interface is completed, it is set to the active state. In this state, it is necessary to write an interface refresh function to obtain the latest interface information and update the interface. This active state may be executed multiple times in the entire life cycle.
[0121] When switching interfaces, the old interface enters the paused state and the new interface enters the active state. In this paused state, it is necessary to pause all operations being performed on the old interface. This paused state may be executed multiple times in the entire life cycle.
[0122] When the interface enters the destruction state, it is necessary to destroy the resources of its corresponding interface and set its pointer to null. This destruction state is only executed once in the entire life cycle.
[0123] It should be noted that the above examples are only for understanding the present application and do not constitute a limitation on the application control method of the present application. Based on this technical concept, more forms of simple transformations are within the protection scope of the present application.
[0124] The present application also provides a background management system. Please refer to Figure 18 , and the background management system includes:
[0125] An interface query module 10, configured to query whether the number of interfaces existing simultaneously in the current application reaches a preset number when the current interface of the current application is in an active state and a next interface jump instruction is received;
[0126] An interface management module 20, configured to create the next interface if the number of interfaces existing simultaneously in the current application does not reach the preset number, associate the current interface and the next interface, set the current interface from the active state to the paused state, and set the next interface to the active state as the current interface;
[0127] The interface management module 20 is further configured to delete the interface next to the first interface, create the next interface, and perform status reset and re - association on the interfaces currently existing in the current application if the number of interfaces existing simultaneously in the current application reaches the preset number.
[0128] The background management system provided by the present application adopts the application control method in the above - mentioned embodiment, and can solve the technical problem of how to ensure that multiple interfaces exist simultaneously and are controllable, while reducing power consumption, simplifying data management, and improving code maintainability. Compared with the prior art, the beneficial effects of the background management system provided by the present application are the same as those of the application control method provided by the above - mentioned embodiment, and other technical features in the background management system are the same as those disclosed in the method of the above - mentioned embodiment, and will not be elaborated here.
[0129] The present application provides an application control device. The application control device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the application control method in the first embodiment above.
[0130] Next, refer to Figure 19, which shows a schematic structural diagram of an application control device suitable for implementing the embodiments of the present application. The application control device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 19 The application control device shown is only an example and should not impose any restrictions on the functions and usage scope of the embodiments of the present application.
[0131] As Figure 19 shown, the application control device may include a processing system 1001 (such as a central processing unit, a graphics processing unit, etc.), which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage system 1003 into the random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the application control device are also stored. The processing system 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input system 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output system 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage system 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication system 1009. The communication system 1009 may allow the application control device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows an application control device with various systems, it should be understood that it is not required to implement or have all the systems shown. Instead, more or fewer systems may be implemented or had.
[0132] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication system, or installed from a storage system 1003, or installed from a ROM 1002. When the computer program is executed by a processing system 1001, the above functions defined in the methods of the embodiments disclosed in the present application are executed.
[0133] The application control device provided by the present application adopts the application control method in the above embodiment, and can solve the technical problem of how to reduce power consumption, simplify data management and improve code maintainability while ensuring that multiple interfaces exist and are controllable at the same time. Compared with the prior art, the beneficial effects of the application control device provided by the present application are the same as those of the application control method provided by the above embodiment, and other technical features in the application control device are the same as those disclosed in the method of the previous embodiment, which will not be elaborated here.
[0134] It should be understood that each part disclosed in the present application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0135] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all of them should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0136] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the application control method in the above embodiment.
[0137] The computer-readable storage medium provided by this application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, device, or component. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0138] The above computer-readable storage medium can be included in the application management device; it can also exist independently and not be assembled into the application management device.
[0139] The above computer-readable storage medium carries one or more programs. When the one or more programs are executed by the application management device, the application management device is caused to: when the current interface of the current application is in an active state and a next interface jump instruction is received, query whether the number of interfaces existing simultaneously in the current application reaches a preset number; if the number of interfaces existing simultaneously in the current application does not reach the preset number, create the next interface, associate the current interface and the next interface, set the current interface from the active state to the paused state, set the next interface to the active state, and use it as the current interface; if the number of interfaces existing simultaneously in the current application reaches the preset number, delete the next interface after the first interface, create the next interface, and reset the states and re-associate the interfaces currently existing in the current application.
[0140] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by connecting through the Internet using an Internet service provider).
[0141] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0142] The modules described in the embodiments of this application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation to the unit itself in some cases.
[0143] The readable storage medium provided by this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for performing the above-mentioned application control method, and can solve the technical problem of how to ensure that multiple interfaces exist and are controllable simultaneously, while reducing power consumption, simplifying data management, and improving code maintainability. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the application control method provided by the above embodiments, and will not be elaborated here.
[0144] The present application also provides a computer program product, including a computer program which, when executed by a processor, implements the steps of the application control method as described above.
[0145] The computer program product provided by the present application can solve the technical problem of how to reduce power consumption, simplify data management and improve code maintainability while ensuring the coexistence and controllability of multiple interfaces. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the application control method provided by the above embodiments, and will not be elaborated herein.
[0146] The above are only some embodiments of the present application, and thus do not limit the patent scope of the present application. Any equivalent structural transformation made under the technical concept of the present application by using the content of the specification and drawings of the present application, or direct / indirect application in other related technical fields, is included in the patent protection scope of the present application.
Claims
1. An application control method, characterized in that, The method is applied to a background management system, which at least includes one application program, and the application program at least includes one interface. The method includes: When the current interface of the current application program is in an active state and a next interface jump instruction is received, query whether the number of interfaces existing simultaneously in the current application program reaches a preset number; If the number of interfaces existing simultaneously in the current application program does not reach the preset number, create the next interface, associate the current interface and the next interface, set the current interface from the active state to the paused state, and set the next interface to the active state as the current interface; If the number of interfaces existing simultaneously in the current application program reaches the preset number, delete the interface next to the first interface, create the next interface, and reset the status and re-associate the interfaces currently existing in the current application program.
2. The method according to claim 1, wherein The interface includes a successor pointer and a predecessor pointer. The step of associating the current interface and the next interface includes: Point the successor pointer of the current interface to the next interface. At the same time, point the predecessor pointer of the next interface to the current interface to complete the association between the current interface and the next interface.
3. The method according to claim 1, wherein The step of, if the number of interfaces existing simultaneously in the current application program reaches the preset number, deleting the interface next to the first interface, creating the next interface, and resetting the status and re-associating the interfaces currently existing in the current application program includes: If the number of interfaces existing simultaneously in the current application program reaches the preset number, disconnect the association between the first interface and the interface next to the first interface, clear the interface resources under the interface node of the interface next to the first interface, and set the pointer variable of the interface next to the first interface to null; Create the next interface and re-associate the interfaces currently existing in the current application program in sequence; Set the status of the next interface to the active state, at the same time set the next interface as the current interface, and set the status of all interfaces before the next interface to the paused state.
4. The method according to claim 3, wherein After the step of setting the status of the next interface to the active state, at the same time setting the next interface as the current interface, and setting the status of all interfaces before the next interface to the paused state, it further includes: If a previous interface return instruction is received, set the current interface to the destroyed state, set the previous interface as the current interface, and set the status of the current interface to the active state; If it is recognized that the current interface is the first interface, when the previous interface return instruction is received, destroy the current application program and switch to the next application program.
5. The method according to claim 1, characterized in that, After the step of, if the number of interfaces existing simultaneously in the current application program reaches the preset number, deleting the interface next to the first interface, creating the next interface, and resetting the status and re-associating the interfaces currently existing in the current application program, it further includes: Determine whether the existing number of the current application reaches a preset application number and whether a switching application instruction is received; If the existing number of the current application reaches the preset application number and the switching application instruction is received, delete the last application in the current application, create and switch to a new application.
6. The method according to claim 5, wherein The steps of deleting the last application in the current application, creating and switching to a new application include: Set the last application in the current application to a destroyed state, create a new application, and set the interface state in the new application to an active state.
7. A background management system, characterized in that, The system includes: An interface query module, configured to query whether the number of interfaces existing simultaneously in the current application reaches a preset number when the current interface of the current application is in an active state and a next interface jump instruction is received; An interface management module, configured to create the next interface if the number of interfaces existing simultaneously in the current application does not reach the preset number, associate the current interface and the next interface, set the current interface from the active state to a paused state, and set the next interface to the active state for use as the current interface; The interface management module is further configured to delete the interface next to the first interface, create the next interface, and perform state reset and re - association on the interfaces currently existing in the current application if the number of interfaces existing simultaneously in the current application reaches the preset number.
8. An application control device, characterized in that, The device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the application control method according to any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium is a computer - readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the application control method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps of the application control method according to any one of claims 1 to 6.