Method and device for starting display interface, electronic equipment and storage medium
By creating multiple instances of sub-display interfaces in the first target process of the target display interface in the Android system, and managing the state using instance proxy objects and mapping relationship tables, the problems of multi-process resource waste and low efficiency are solved, achieving efficient utilization of system resources and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DOUYIN VISION CO LTD
- Filing Date
- 2021-09-02
- Publication Date
- 2026-08-04
AI Technical Summary
In multi-process scenarios, child processes of the same nature lead to resource waste and reduced system execution efficiency. This is especially true in Android systems, where frequent startup of child processes and cross-process communication increase the system burden.
Multiple instances of sub-display interfaces are created in the first target process of the target display interface. Data isolation is achieved through instance proxy objects, and the startup status of the display interface is determined and managed by identity identifiers and mapping relationship tables, thereby reducing the number of sub-processes and improving system efficiency.
By reducing the number of child processes launched and their resource consumption, system scheduling time is saved, CPU execution time is avoided, and system execution efficiency and user experience are improved.
Smart Images

Figure CN115729650B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a method, apparatus, electronic device, and computer-readable storage medium for launching a display interface. Background Technology
[0002] Currently, most applications use a multi-process mechanism, meaning that in addition to the main process, multiple child processes can be launched to complete other tasks. Typically, different child processes have different design goals; however, in some scenarios, some child processes simply serve as a carrier to perform the same type of work. For example, the child processes of a certain application (APP) are all mini-program processes, with the same process execution logic, only the mini-programs are different.
[0003] In multi-process scenarios where different processes perform the same tasks, using multiple child processes to complete other tasks will not only waste resources but also reduce the system's execution efficiency. Summary of the Invention
[0004] This disclosure provides at least one method, apparatus, electronic device, and storage medium for launching a display interface, which can solve at least one of the above problems.
[0005] This disclosure provides a method for launching a display interface, including:
[0006] In response to a user's trigger operation on a target sub-display interface, the target display interface where the target sub-display interface is located is determined; the target display interface includes multiple sub-display interfaces, and the launch mode of the sub-display interfaces is a standard launch mode; the target sub-display interface is one of the multiple sub-display interfaces.
[0007] In the first target process corresponding to the target display interface, multiple instances corresponding to the multiple sub-display interfaces are created respectively; wherein, the multiple instances include the target instance corresponding to the target sub-display interface;
[0008] Based on the target instance, the target sub-display interface is displayed.
[0009] In this embodiment of the disclosure, since the target display interface includes multiple sub-display interfaces and the startup mode of the sub-display interfaces is the standard startup mode, multiple instances corresponding to the multiple sub-display interfaces can be created in the first target process. That is, compared with the prior art, the instances corresponding to each sub-display interface that originally needed to be created in multiple sub-processes are now created in the first target process, reducing the number of sub-processes to be started. This can save system scheduling time, avoid occupying the execution time and resources of the central processing unit, and thus improve the system execution efficiency.
[0010] In one optional implementation, creating multiple instances corresponding to the multiple sub-display interfaces in the first target process corresponding to the target display interface includes:
[0011] In the first target process corresponding to the target display interface, multiple instances corresponding to the multiple sub-display interfaces are created through instance proxy objects.
[0012] In this embodiment of the disclosure, by creating instances corresponding to the multiple sub-display interfaces through instance proxy objects, data isolation can be achieved between the multiple instances, thereby avoiding data read / write errors.
[0013] In one optional implementation, the method further includes:
[0014] Add a target parameter to the startup parameters corresponding to the target display interface so that the multiple instances are in different task stacks.
[0015] In this embodiment of the disclosure, by adding a target parameter to the startup parameters so that the multiple instances are in different task stacks, multiple sub-display interfaces can be displayed in the multi-task window to achieve the same display effect as the multi-process mechanism.
[0016] In one optional implementation, displaying the target sub-display interface based on the target instance includes:
[0017] The target sub-display interface is displayed based on the startup status of the target instance corresponding to the target sub-display interface.
[0018] In this embodiment of the disclosure, different startup states of the target sub-display interface can be displayed, thereby improving the system's execution efficiency.
[0019] In one optional implementation, each instance corresponds to an identity identifier; displaying the target sub-display interface based on the startup state of the target sub-display interface corresponding to the target instance includes:
[0020] The startup status of the target sub-display interface is determined based on the target identity identifier corresponding to the target instance and the mapping relationship table between the identity identifier and the display interface.
[0021] When the target sub-display interface is already running, the running target sub-display interface is displayed.
[0022] In this embodiment of the disclosure, the accuracy of determining the startup status of the target sub-display interface can be improved by using the target identity identifier corresponding to the target instance and the mapping relationship table between the identity identifier and the display interface.
[0023] In one optional implementation, the method further includes:
[0024] When the target sub-display interface is not running, create and display the target sub-display interface.
[0025] In one optional implementation, determining the startup status of the target sub-display interface based on the target identity identifier corresponding to the target instance and the mapping table between the identity identifier and the display interface includes:
[0026] Based on the target identity identifier, determine whether there is a target display interface associated with the target identity identifier in the mapping table;
[0027] If a target sub-display interface exists in the mapping table that is associated with the target identity, then the target sub-display interface is determined to be in an activated state.
[0028] In this embodiment of the disclosure, the accuracy of determining whether a target display interface associated with the target identity exists in the mapping table can be improved by using the target identity identifier.
[0029] In one optional implementation, the method further includes:
[0030] The mapping relationship between the created target sub-display interface and the target identity is stored in the mapping relationship table.
[0031] In this embodiment of the disclosure, the mapping relationship is stored in a mapping relationship table, which facilitates system maintenance and retrieval of the mapping relationship, thereby improving the system's execution efficiency.
[0032] In one optional implementation, the method further includes:
[0033] In response to the user's closing operation on the target sub-display interface, the mapping relationship between the target sub-display interface and the target identity is deleted from the mapping relationship table.
[0034] In this embodiment of the disclosure, when the target sub-display interface is closed, the mapping relationship between the target sub-display interface and the target identity is deleted from the mapping relationship table, which can avoid the system maintaining invalid information and help save system resources.
[0035] This disclosure also provides a device for launching a display interface, the device comprising:
[0036] The determination module is used to respond to the user's trigger operation on the target sub-display interface and determine the target display interface where the target sub-display interface is located; the target display interface includes multiple sub-display interfaces, and the launch mode of the sub-display interfaces is the standard launch mode; the target sub-display interface is one of the multiple sub-display interfaces.
[0037] A creation module is used to create multiple instances corresponding to the multiple sub-display interfaces in the first target process corresponding to the target display interface; wherein, the multiple instances include the target instance corresponding to the target sub-display interface;
[0038] The display module is used to display the target sub-display interface based on the target instance.
[0039] In one optional implementation, the creation module is specifically used for:
[0040] In the first target process corresponding to the target display interface, multiple instances corresponding to the multiple sub-display interfaces are created through instance proxy objects.
[0041] In one optional embodiment, the apparatus further includes an adding module, the adding module being used for:
[0042] Add a target parameter to the startup parameters corresponding to the target display interface so that the multiple instances are in different task stacks.
[0043] In one optional implementation, the display module is specifically used for:
[0044] The target sub-display interface is displayed based on the startup status of the target instance corresponding to the target sub-display interface.
[0045] In one optional implementation, the display module is specifically used for:
[0046] The startup status of the target sub-display interface is determined based on the target identity identifier corresponding to the target instance and the mapping relationship table between the identity identifier and the display interface.
[0047] When the target sub-display interface is already running, the running target sub-display interface is displayed.
[0048] In one optional implementation, the display module is further configured to:
[0049] When the target sub-display interface is not running, create and display the target sub-display interface.
[0050] In one optional implementation, the display module is specifically used for:
[0051] Based on the target identity identifier, determine whether there is a target display interface associated with the target identity identifier in the mapping table;
[0052] If a target sub-display interface exists in the mapping table that is associated with the target identity, then the target sub-display interface is determined to be in an activated state.
[0053] In one optional implementation, the display module is further configured to:
[0054] The mapping relationship between the created target sub-display interface and the target identity is stored in the mapping relationship table.
[0055] In one optional implementation, the display module is further configured to:
[0056] In response to the user's closing operation on the target sub-display interface, the mapping relationship between the target sub-display interface and the target identity is deleted from the mapping relationship table.
[0057] This disclosure also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the above-described display interface startup method are performed.
[0058] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described method for starting the display interface.
[0059] For a description of the effects of the aforementioned display interface startup device, electronic device, and computer-readable storage medium, please refer to the description of the aforementioned display interface startup method; it will not be repeated here.
[0060] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0061] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.
[0062] Figure 1 A flowchart illustrating a method for launching a display interface as provided in an embodiment of this disclosure;
[0063] Figure 2 This is a schematic diagram illustrating a multi-process single-instance data isolation method provided in an embodiment of this disclosure;
[0064] Figure 3 This is a schematic diagram illustrating a single-process, multi-instance data isolation anomaly provided in an embodiment of this disclosure.
[0065] Figure 4 This is a schematic diagram illustrating a single-process, multi-instance data isolation method provided in an embodiment of this disclosure.
[0066] Figure 5 A flowchart illustrating another method for launching a display interface provided in an embodiment of this disclosure;
[0067] Figure 6 A flowchart illustrating a method for determining the startup state of a target sub-display interface, provided in an embodiment of this disclosure;
[0068] Figure 7 A schematic diagram of the structure of a startup device for a display interface provided in an embodiment of this disclosure;
[0069] Figure 8 A schematic diagram of the structure of another display interface startup device provided in an embodiment of this disclosure;
[0070] Figure 9 This is a schematic diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation
[0071] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
[0072] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0073] In this document, the term "and / or" merely describes a mapping relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A exists alone, A and B exist simultaneously, and B exists alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0074] Most applications use a multi-process mechanism, meaning that in addition to the main process, multiple child processes can be launched to complete other tasks. Typically, different child processes have different design goals. However, in some scenarios, some child processes simply serve as a carrier to perform the same type of work. For example, the child processes of a certain application (APP) are all mini-program processes; their process execution logic is the same, only the mini-programs differ.
[0075] In multi-process scenarios where different processes perform the same tasks, using multiple child processes to complete other tasks will not only waste resources but also reduce the system's execution efficiency.
[0076] The specific reasons for the low system execution efficiency are as follows:
[0077] 1) Since starting a new child process requires scheduling by the Android system, additional time overhead will be incurred for each newly started child process;
[0078] 2) Each child process will compete for CPU time and resources. If the child process has heavy computing tasks, it will affect the execution efficiency of the main process.
[0079] 3) In most business scenarios, cross-process communication is required between the main process and child processes, and multiple child processes also need to be managed through the main process. On the one hand, the overhead of cross-process communication is much greater than that of intra-process communication. On the other hand, the main process needs to manage multiple child processes, which also increases the complexity of the business.
[0080] 4) In some extreme scenarios, it may be necessary to start a large number of child processes, which will not only affect the user experience, but may also be subject to the control of the Android system.
[0081] The user interface (also known as an Activity) displayed when an electronic device running the Android system is active is one of the four main components of Android. These four components are: Activity, Service, ContentProvider, and Broadcast Receiver. The manifest file entries for all four Android components support the `android:process` attribute, which specifies the process in which the component runs.
[0082] Based on the above research, this disclosure provides a method for launching a display interface, responding to a user's trigger operation on a target sub-display interface, determining the target display interface where the target sub-display interface is located; the target display interface includes multiple sub-display interfaces, and the launch mode of the sub-display interfaces is a standard launch mode; the target sub-display interface is one of the multiple sub-display interfaces; multiple instances corresponding to the multiple sub-display interfaces are created in a first target process corresponding to the target display interface; wherein, the multiple instances include a target instance corresponding to the target sub-display interface; based on the target instance, the target sub-display interface is displayed.
[0083] In this embodiment of the disclosure, since the target display interface includes multiple sub-display interfaces and the startup mode of the sub-display interfaces is a standard startup mode, multiple instances corresponding to the multiple sub-display interfaces can be created in the first target process. That is, compared with the prior art, the instances corresponding to each sub-display interface that originally needed to be created in multiple sub-processes are now created in the first target process, reducing the number of sub-processes to be started. This can save system scheduling time, avoid occupying the execution time and resources of the central processing unit, and thus improve the system execution efficiency.
[0084] To facilitate understanding of this embodiment, a method for launching a display interface disclosed in this disclosure will first be described in detail. The execution entity of the method for launching a display interface provided in this disclosure is generally an electronic device with a certain computing power. This electronic device may include, for example, a terminal device, a server, or other processing devices. The terminal device may include mobile phones, tablets, in-vehicle devices, and wearable devices. The server may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, big data, and artificial intelligence platforms. Other processing devices may include devices including processors and memory, and are not limited here.
[0085] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for launching a display interface according to an embodiment of this disclosure. Figure 1 As shown, the method for starting a display interface provided in this embodiment includes the following steps S101 to S103:
[0086] S101, responding to the user's trigger operation on the target sub-display interface, determine the target display interface where the target sub-display interface is located; the target display interface includes multiple sub-display interfaces, the startup mode of the sub-display interfaces is the standard startup mode; the target sub-display interface is one of the multiple sub-display interfaces.
[0087] The triggering operation can be a user's single-click, double-click, or swipe operation on the target sub-display interface, and is not limited here.
[0088] The target display interface is the parent class of the multiple sub-display interfaces. That is, the target display interface is an Activity class structure, and the multiple sub-display interfaces are multiple instances of the Activity class structure.
[0089] There are four launch modes for an Activity: standard, singletop, singletask, and singleinstance.
[0090] To run multiple Activities within the same process, the configuration information of these Activities needs to be modified. For example, please refer to Table 1, which shows key configuration information for running multiple display interfaces in a single process. As shown in Table 1, Activity1, Activity2, and Activity3 are the sub-display interfaces, and the target sub-display interface can be one of Activity1, Activity2, and Activity3. Configuring the configuration information of each Activity according to android:process=":process1" allows Activity1, Activity2, and Activity3 to run within the same process, process1.
[0091] Additionally, the launch mode of the three target sub-display interfaces needs to be set to the standard launch mode (i.e., standard mode). That is, set android:launchMode="standard". Activities launched in the standard launch mode will not appear in the new task stack. In other words, only one task card can be displayed in the multitasking window. The multitasking window can refer to a task window that is displayed in response to the user's operation on the Android directory key, such as a click operation.
[0092] The task stack is a stack structure, meaning that the system can manage at least one Activity through the stack structure.
[0093] Table 1
[0094]
[0095] S102, in the first target process corresponding to the target display interface, create multiple instances corresponding to the multiple sub-display interfaces respectively; the multiple instances include the target instance corresponding to the target sub-display interface.
[0096] The instance is a running object in the first target process. For example, based on the configuration information in Table 1, the first target process can be the Process1 process, and Activity1, Activity2, and Activity3 can each correspond to an instance.
[0097] S103, Based on the target instance, display the target sub-display interface.
[0098] Since the target instance corresponds one-to-one with the target sub-display interface, the target sub-display interface can be placed in the foreground based on the target instance, that is, the target sub-display interface can be displayed.
[0099] The phrase "putting the target sub-display interface in the foreground" can be understood as: switching the target sub-display interface to the current display interface of the electronic device to which it belongs. For example, when switching from the display interface Activity-A2 of application A to the current display interface Activity-B1 of application B, Activity-B1 will correspond to a task stack. The foreground Activity task stack in this task stack includes Activity-B1, that is, Activity-B1 is in the foreground state at this time.
[0100] In this embodiment, since the target display interface includes multiple sub-display interfaces, and the startup mode of the sub-display interfaces is a standard startup mode, multiple instances corresponding to the multiple sub-display interfaces can be created in the first target process. That is, compared with the prior art, the instances corresponding to each sub-display interface, which originally needed to be created separately in multiple sub-processes, are now created uniformly in the first target process, reducing the number of sub-processes launched. This saves system scheduling time, avoids occupying the execution time and resources of the central processing unit, and thus improves system execution efficiency. The above step S102 will be described in detail below with reference to specific embodiments.
[0101] In some implementations, for step S102 above, multiple instances corresponding to the multiple sub-display interfaces can be created in the first target process corresponding to the target display interface through an instance proxy object.
[0102] The instance proxy object (InstanceProxy) is used to create multiple instances and establishes a mapping relationship between the multiple sub-display interfaces and the multiple instances.
[0103] Please see Figure 2 and Figure 3 , Figure 2 This is a schematic diagram illustrating a multi-process single-instance data isolation method provided in an embodiment of this disclosure. Figure 3 This is a schematic diagram illustrating a data isolation anomaly in a single-process, multi-instance environment provided by an embodiment of this disclosure. Figure 2 As shown, under the multi-process mechanism, different Activities run in different processes—that is, Activity1 runs in Process1, Activity2 runs in Process2, and ActivityN runs in ProcessN. Therefore, the associated data read by Activity1, Activity2, and ActivityN from the SingleInstance are isolated from each other. Figure 3As shown, when Activity1, Activity2, and ActivityN run in the same process (Process1), reading or writing data in one Activity will affect the data reading and writing of other Activities. For example, in single-instance mode, when Activity1 and Activity2 are in the same process, there is only one instance of SingleInstance in the process, which is shared by Activity1 and Activity2. When Activity1 reads or writes data in SingleInstance, it will affect the data reading and writing of Activity2.
[0104] Therefore, in order to make multiple Activities in the same process independent of each other and to isolate their data so that they do not affect each other, the multiple instances can be created through instance proxy objects.
[0105] For example, please refer to Figure 4 , Figure 4 This is a schematic diagram illustrating a single-process, multi-instance data isolation method provided in an embodiment of this disclosure. For example... Figure 4 As shown, through the instance proxy object (InstanceProxy), multiple instances of the SingleInstance object, Instance1, Instance2, and InstanceN, can be created in the same process (Process1) based on the SingleInstance object. Correspondingly, the data associated with Activity1 is Instance1, the data associated with Activity2 is Instance2, and the data associated with ActivityN is InstanceN, thereby achieving data isolation between multiple instances in the same process.
[0106] In some implementations, for step S103 above, the target sub-display interface can also be displayed based on the startup state of the target sub-display interface corresponding to the target instance.
[0107] The startup status includes a startup status and a non-start status.
[0108] Specifically, the "started" state can be understood as the Activity being in the background, at which point the Activity can be displayed in the multitasking window; the "not started" state can be understood as the Activity not being created, and therefore not existing in the multitasking window.
[0109] Please see Figure 5 , Figure 5A flowchart illustrating another method for launching a display interface provided in an embodiment of this disclosure. Figure 5 As shown, another method for launching a display interface provided in this embodiment includes the following steps S501 to S507:
[0110] S501, responding to the user's trigger operation on the target sub-display interface, determine the target display interface where the target sub-display interface is located.
[0111] This step is similar to step S101 in the previous embodiment, and will not be described again here.
[0112] S502, create multiple instances in the first target process corresponding to the target display interface, each corresponding to one of the multiple sub-display interfaces.
[0113] This step is similar to step S102 in the previous embodiment, and will not be described again here.
[0114] S503, add target parameters to the startup parameters corresponding to the target display interface so that the multiple instances are in different task stacks.
[0115] In this embodiment of the disclosure, the target parameter is FLAG_ACTIVITY_NEW_DOCUMENT.
[0116] Specifically, you can add FLAG_ACTIVITY_NEW_DOCUMENT to the startup parameters using the Intent.addFlags(int flags) function.
[0117] Since Activities launched in the standard launch mode will not appear in a new task stack, meaning only one task card can be displayed in a multi-tasking window, to make the display effect of the single-process mechanism consistent with that of the multi-process mechanism and to improve the user experience, the target parameter FLAG_ACTIVITY_NEW_DOCUMENT can be added to place the multiple instances in different task stacks, thereby allowing multiple task cards to be displayed in a multi-tasking window.
[0118] S504, each instance corresponds to an identity identifier; based on the target identity identifier corresponding to the target instance and the mapping relationship table between identity identifiers and display interfaces, determine whether the startup status of the target sub-display interface is already started. If yes, proceed to S505; if no, proceed to S506.
[0119] Please refer to Table 1 again, according to the labels of each target sub-display interface. <activity>Configured sub-tags <meta-data>As can be seen from the content, in the sub-tag <meta-data>The "instance" attribute is defined, and its value is defined as "instanceId". The attribute value is the identity identifier, which can uniquely identify an instance.
[0120] Since each identity corresponds to one instance, in a multi-instance scenario, multiple identities and multiple display interfaces will form multiple mapping relationships. These mapping relationships are stored in the mapping relationship table in the form of binary information (instanceId, Activity). In this embodiment of the disclosure, the mapping relationship table is maintained by the main process, and the content of the mapping relationship table will change when the startup state of the display interface changes.
[0121] S505, Display the target sub-display interface that has been started.
[0122] If the target sub-display interface is determined to be in an already started state, it means that the target sub-display interface is already in the background, and the already started target sub-display interface can be displayed directly.
[0123] S506, Create and display the target sub-display interface.
[0124] If the target sub-display interface is determined to be in an inactive state, then the target sub-display interface needs to be created. After creation, the target sub-display interface will be in an active state. As mentioned above, it can be understood that the active target sub-display interface is in the background, and therefore, the active target sub-display interface can be displayed.
[0125] S507, the mapping relationship between the created target sub-display interface and the target identity is stored in the mapping relationship table.
[0126] Since the startup status of the created target sub-display interface changes from non-started to started, the mapping relationship between the created target sub-display interface and the target identity needs to be stored in the mapping relationship table to notify the main process that the startup status of the target sub-display interface is started.
[0127] In some implementations, regarding step S504 above, when determining the startup state of the target sub-display interface based on the target identity identifier corresponding to the target instance and the mapping relationship table between the identity identifier and the display interface, such as... Figure 6 As shown, it may include the following S5041 to S5042:
[0128] S5041, Based on the target identity identifier, determine whether there is a mapping relationship between the target identity identifier and the target display interface associated with the target identity identifier in the mapping relationship table.
[0129] S5042, if the mapping relationship exists in the mapping relationship table, determine that the target sub-display interface is in an already started state.
[0130] After generating multiple instances, in order to more accurately determine the startup status of the target sub-display interface, the target instance corresponding to it can be determined based on the instanceId, and it can be determined whether the mapping table records (instanceId, Activity), where Activity refers to the target sub-display interface, to determine whether the startup status of the target sub-display interface is already started.
[0131] In some implementations, when the target sub-display interface is closed, that is, when the target sub-display interface is destroyed from the background or the foreground, the mapping relationship between the target sub-display interface and the target identity identifier needs to be deleted from the mapping relationship table to avoid the system maintaining invalid information, thereby saving system overhead.
[0132] The closing operation can be a user's click or swipe operation on the target sub-display interface, and is not limited here.
[0133] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0134] Based on the same inventive concept, this disclosure also provides a display interface startup device corresponding to the display interface startup method. Since the principle of the device in this disclosure for solving the problem is similar to the display interface startup method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0135] Please see Figure 7 This is a schematic diagram of a startup device for a display interface provided in an embodiment of this disclosure. The device includes: a determining module 710, a creating module 720, and a display module 730; wherein,
[0136] The determination module 710 is used to respond to the user's trigger operation on the target sub-display interface and determine the target display interface where the target sub-display interface is located; the target display interface includes multiple sub-display interfaces, the startup mode of the sub-display interfaces is a standard startup mode; the target sub-display interface is one of the multiple sub-display interfaces;
[0137] A creation module 720 is used to create multiple instances corresponding to the multiple sub-display interfaces in the first target process corresponding to the target display interface; wherein, the multiple instances include target instances corresponding to the target sub-display interfaces;
[0138] The display module 730 is used to display the target sub-display interface based on the target instance.
[0139] Please see Figure 8 This is a schematic diagram of another display interface startup device provided in an embodiment of the present disclosure. The device further includes: an adding module 740, which is used for:
[0140] Add a target parameter to the startup parameters corresponding to the target display interface so that the multiple instances are in different task stacks.
[0141] In one optional implementation, the creation module 720 is specifically used for:
[0142] In the first target process corresponding to the target display interface, multiple instances corresponding to the multiple sub-display interfaces are created through instance proxy objects.
[0143] In one optional implementation, the display module 730 is specifically used for:
[0144] The target sub-display interface is displayed based on the startup status of the target instance corresponding to the target sub-display interface.
[0145] In one optional implementation, the display module 730 is specifically used for:
[0146] The startup status of the target sub-display interface is determined based on the target identity identifier corresponding to the target instance and the mapping relationship table between the identity identifier and the display interface.
[0147] When the target sub-display interface is already running, the running target sub-display interface is displayed.
[0148] In one optional implementation, the display module 730 is further configured to:
[0149] When the target sub-display interface is not running, create and display the target sub-display interface.
[0150] In one optional implementation, the display module 730 is specifically used for:
[0151] Based on the target identity identifier, determine whether there exists a mapping relationship between the target identity identifier and the target display interface associated with the target identity identifier in the mapping relationship table;
[0152] If the mapping relationship exists in the mapping table, it is determined that the target sub-display interface is in an already started state.
[0153] In one optional implementation, the display module 730 is further configured to:
[0154] The mapping relationship between the created target sub-display interface and the target identity is stored in the mapping relationship table.
[0155] In one optional implementation, the display module 730 is further configured to:
[0156] In response to the user's closing operation on the target sub-display interface, the mapping relationship between the target sub-display interface and the target identity is deleted from the mapping relationship table.
[0157] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0158] Based on the same technical concept, this disclosure also provides an electronic device. (See also...) Figure 9 The diagram shown is a structural schematic of an electronic device 800 provided in an embodiment of this disclosure, including a processor 801, a memory 802, and a bus 803. The memory 802 is used to store execution instructions and includes a main memory 8021 and an external memory 8022. The main memory 8021, also called internal memory, is used to temporarily store computational data in the processor 801, as well as data exchanged with external memory 8022 such as a hard disk. The processor 801 exchanges data with the external memory 8022 through the main memory 8021.
[0159] In this embodiment, the memory 802 is specifically used to store application code that executes the solution of this application, and its execution is controlled by the processor 801. That is, when the electronic device 800 is running, the processor 801 communicates with the memory 802 through the bus 803, so that the processor 801 executes the application code stored in the memory 802, thereby executing the method in any of the foregoing embodiments.
[0160] Processor 801 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor.
[0161] The memory 802 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0162] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 800. In other embodiments of this application, the electronic device 800 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0163] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the display interface startup method described in the above method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0164] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the display interface startup method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0165] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0166] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and terminals described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, terminals, and methods can be implemented in other ways. The terminal embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces, or indirect coupling or communication connection between units, and may be electrical, mechanical, or other forms.
[0167] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0168] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0169] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0170] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims. < / activity>
Claims
1. A method for starting a display interface, characterized in that, include: In response to a user's trigger operation on a target sub-display interface, determine the target display interface where the target sub-display interface is located; The target display interface includes multiple sub-display interfaces, and the startup mode of the multiple sub-display interfaces is a standard startup mode; the target sub-display interface is one of the multiple sub-display interfaces; In the first target process corresponding to the target display interface, multiple instances corresponding to the multiple sub-display interfaces are created respectively; wherein, the multiple instances include the target instance corresponding to the target sub-display interface, and the instance is a running object in the first target process; Based on the target instance, the target sub-display interface is displayed. The step of creating multiple instances corresponding to the multiple sub-display interfaces in the first target process corresponding to the target display interface includes: In the first target process corresponding to the target display interface, multiple instances corresponding to the multiple sub-display interfaces are created through instance proxy objects.
2. The method of claim 1, wherein, The method further includes: Add a target parameter to the startup parameters corresponding to the target display interface so that the multiple instances are in different task stacks.
3. The method of claim 1, wherein, The step of displaying the target sub-display interface based on the target instance includes: The target sub-display interface is displayed based on the startup status of the target instance corresponding to the target sub-display interface.
4. The method of claim 3, wherein, Each instance corresponds to an identity identifier; displaying the target sub-display interface based on the startup state of the target instance includes: The startup status of the target sub-display interface is determined based on the target identity identifier corresponding to the target instance and the mapping relationship table between the identity identifier and the display interface. When the target sub-display interface is already running, the running target sub-display interface is displayed.
5. The method of claim 4, wherein, The method further includes: When the target sub-display interface is not running, create and display the target sub-display interface.
6. The method of claim 4, wherein, The step of determining the startup status of the target sub-display interface based on the target identity identifier corresponding to the target instance and the mapping relationship table between the identity identifier and the display interface includes: Based on the target identity identifier, determine whether there is a target display interface associated with the target identity identifier in the mapping table; If a target sub-display interface exists in the mapping table that is associated with the target identity, then the target sub-display interface is determined to be in an activated state.
7. The method of claim 5, wherein, The method further includes: The mapping relationship between the created target sub-display interface and the target identity is stored in the mapping relationship table.
8. The method according to claim 6 or 7, characterized in that, The method further includes: In response to the user's closing operation on the target sub-display interface, the mapping relationship between the target sub-display interface and the target identity is deleted from the mapping relationship table.
9. A startup device for a display interface, characterized in that, include: The determination module is used to respond to the user's trigger operation on the target sub-display interface and determine the target display interface where the target sub-display interface is located; The target display interface includes multiple sub-display interfaces, and the startup mode of the multiple sub-display interfaces is a standard startup mode; the target sub-display interface is one of the multiple sub-display interfaces; A creation module is used to create multiple instances corresponding to the multiple sub-display interfaces in the first target process corresponding to the target display interface; wherein, the multiple instances include a target instance corresponding to the target sub-display interface, and the instance is a running object in the first target process; The display module is used to display the target sub-display interface based on the target instance. The step of creating multiple instances corresponding to the multiple sub-display interfaces in the first target process corresponding to the target display interface includes: In the first target process corresponding to the target display interface, multiple instances corresponding to the multiple sub-display interfaces are created through instance proxy objects.
10. An electronic device, comprising: include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the startup method for the display interface as described in any one of claims 1 to 8 are performed.
11. A computer readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method for launching a display interface as described in any one of claims 1 to 8.