A method and related device for pop-up window based on OpenHarmony lightweight system

By setting up interface conversation components and view group containers on OpenHarmony lightweight system, the pop-up function is displayed, solving the problem that lightweight system does not support pop-ups, reducing resource consumption, and suitable for small resource devices.

CN118227004BActive Publication Date: 2024-11-01SHENZHEN XINGUODU TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410650387.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-11-01
Estimated Expiration
2044-05-24

AI Technical Summary

Technical Problem

OpenHarmony lightweight system does not support pop-up function. The existing technology implements pop-up windows by adding Windowmanager subsystem and IPC subsystem, but these components occupy a lot of memory resources and cannot meet the needs of small resource devices.

Method used

通过获取待弹窗展示的数据,设置界面对话组件,添加控制按钮和响应动作,初始化界面对话组件,并在终端屏幕上展示弹窗,采用新的界面视图组容器替代传统弹窗组件,避免依赖Windowmanager子系统和IPC子系统,减少资源消耗。

Benefits of technology

It realizes the simple pop-up function without dragging and moving on lightweight systems, eliminates dependence on the Windowmanager subsystem and IPC subsystem, meets the pop-up requirements of small resource devices, and avoids resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118227004B_ABST
    Figure CN118227004B_ABST
Patent Text Reader

Abstract

The present application discloses a method and related device for pop-up windows based on the OpenHarmony lightweight system, which are used to load pop-up window functions on the lightweight system. The present application discloses a method for pop-up windows based on the OpenHarmony lightweight system, which includes: obtaining data to be displayed in the pop-up window, the data to be displayed in the pop-up window includes pop-up window title information and pop-up window prompt information; setting an interface dialogue component according to the data to be displayed in the pop-up window; adding several control buttons and several response actions corresponding to the control buttons to the interface dialogue component; initializing the interface dialogue component according to the data, control buttons and response actions displayed in the pop-up window, and generating a pop-up window; and displaying the pop-up window on the terminal screen.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of human-computer interface interaction technology, and in particular to a method and related device for pop-up windows based on an OpenHarmony lightweight system. Background Art

[0002] With the continuous development of intelligent technology, people are increasingly using intelligent devices in their lives, work, and studies. To achieve full-scenario, full-connectivity, and full-intelligence, the open source Hongmeng (OpenHarmony) system was born. The OpenHarmony system adopts a componentized design solution, which can be flexibly tailored according to the resource capabilities and business characteristics of the device to meet the requirements of different forms of terminal devices for the operating system. Among them, the lightweight system in the OpenHarmony system can provide a variety of lightweight network protocols, lightweight graphics frameworks, and a wealth of IOT bus read and write components.

[0003] The lightweight system itself does not support the pop-up window function. The existing technology implements the pop-up window by adding components such as the Windowmanager subsystem and the IPC subsystem, and using these components to perform the pop-up window. However, the above-mentioned added components require more memory resources, which is not compatible with the small resource devices supported by the lightweight system. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a method and related devices for pop-up windows based on an OpenHarmony lightweight system, which are used to load a pop-up window function on a lightweight system.

[0005] The technical solution provided in this application is described below:

[0006] In a first aspect, the present application provides a method for pop-up windows based on an OpenHarmony lightweight system, comprising:

[0007] Obtaining data to be displayed in a pop-up window, wherein the data to be displayed in the pop-up window includes pop-up window title information and pop-up window prompt information;

[0008] Setting interface dialogue components according to the data to be displayed in the pop-up window;

[0009] Adding a number of control buttons and response actions corresponding to the control buttons in the interface dialogue component;

[0010] Initializing the interface dialogue component according to the data displayed in the pop-up window, the control button and the response action, and generating a pop-up window;

[0011] The pop-up window is displayed on the terminal screen.

[0012] Optionally, the initializing the interface dialogue component according to the data displayed in the pop-up window, the control button and the response action, and generating the pop-up window includes:

[0013] Get the terminal screen size;

[0014] Creating a first interface view group container according to the terminal screen size and the pop-up window title information, so that the pop-up window body is displayed in the area where the first interface view group container is located;

[0015] Creating a second interface view group container according to the pop-up window prompt information, the control button, and the response action, so that the pop-up window is displayed in the area where the second interface view group container is located;

[0016] Adding the second interface view group container to the first interface view group container;

[0017] The first interface view group container is added to the root view container, and a pop-up display page is generated, so that the pop-up body is displayed on the terminal screen, the pop-up window is displayed in the pop-up body, and the size of the pop-up window is smaller than the pop-up body.

[0018] Optionally, after creating the first interface view group container according to the terminal screen size and the pop-up window title information, the method further includes:

[0019] Setting the background color of the first interface view group container to gray;

[0020] The transparency of the first interface view group container is adjusted.

[0021] Optionally, adding the second interface view group container to the first interface view group container includes:

[0022] Setting the background color of the second interface view group container to white;

[0023] The second interface view group container is centered in the first interface view group container.

[0024] Optionally, the several control buttons include at least one of the following: an OK button, a cancel button, a power off button or a restart button.

[0025] Optionally, before setting the interface dialogue component according to the data to be displayed in the pop-up window, the method further includes:

[0026] Create interface dialogue components;

[0027] Create a scheduled task list;

[0028] When the preset time is reached, determining whether there is an element in the scheduled task list;

[0029] If so, the element is taken out and destroyed;

[0030] If not, restart the timer.

[0031] Optionally, after displaying the pop-up window on the terminal screen, the method further includes:

[0032] After the control button is selected by the user, a response action corresponding to the control button is completed;

[0033] Destroy the pop-up window and the pop-up window body;

[0034] The first interface view group container is transferred to the scheduled task list as an element in the scheduled task list that needs to be destroyed.

[0035] A second aspect of the present application provides a device for a pop-up window based on an OpenHarmony lightweight system, including:

[0036] An acquisition unit, used for acquiring data to be displayed in a pop-up window, wherein the data to be displayed in the pop-up window includes pop-up window title information and pop-up window prompt information;

[0037] A setting unit, used for setting an interface dialogue component according to the data to be displayed in the pop-up window;

[0038] An adding unit, used for adding a plurality of control buttons and response actions corresponding to the plurality of control buttons in the interface dialogue component;

[0039] An initialization unit, configured to initialize the interface dialogue component according to the data displayed in the pop-up window, the control button and the response action, and generate a pop-up window;

[0040] The display unit is used to display the pop-up window on the terminal screen.

[0041] Optionally, the initialization unit is specifically used for:

[0042] Get the terminal screen size;

[0043] Creating a first interface view group container according to the terminal screen size and the pop-up window title information, so that the pop-up window body is displayed in the area where the first interface view group container is located;

[0044] Creating a second interface view group container according to the pop-up window prompt information, the control button, and the response action, so that the pop-up window is displayed in the area where the second interface view group container is located;

[0045] Adding the second interface view group container to the first interface view group container;

[0046] The first interface view group container is added to the root view container, and a pop-up display page is generated, so that the pop-up body is displayed on the terminal screen, the pop-up window is displayed in the pop-up body, and the size of the pop-up window is smaller than the pop-up body.

[0047] Optionally, the initialization unit is specifically used for:

[0048] Setting the background color of the first interface view group container to gray;

[0049] The transparency of the first interface view group container is adjusted.

[0050] Optionally, the initialization unit is specifically used for:

[0051] Setting the background color of the second interface view group container to white;

[0052] The second interface view group container is centered in the first interface view group container.

[0053] Optionally, the several control buttons include at least one of the following: an OK button, a cancel button, a power off button or a restart button.

[0054] Optionally, before the setting unit, it also includes:

[0055] An interface dialogue component unit, used for creating an interface dialogue component;

[0056] Scheduled task list unit, used to create a scheduled task list;

[0057] A judging unit, used to judge whether there is an element in the scheduled task list when a preset time is reached;

[0058] An execution unit, used for taking out the element and destroying it;

[0059] Return unit for retiming.

[0060] Optionally, after the display unit, it further includes:

[0061] A response unit, used for completing a response action corresponding to the control button after the control button is selected by the user;

[0062] A destroying unit, used to destroy the pop-up window and the pop-up window body;

[0063] A transfer unit is used to transfer the first interface view group container to the scheduled task list as an element that needs to be destroyed in the scheduled task list.

[0064] A third aspect of the present application provides an electronic device, the electronic device comprising:

[0065] Processor, memory, input-output unit, and bus;

[0066] The processor is connected to the memory, the input and output unit, and the bus;

[0067] The memory stores a program, and the processor calls the program to execute the first aspect and the optional method based on the OpenHarmony lightweight system pop-up window in any one of the first aspects.

[0068] The fourth aspect of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the method based on the OpenHarmony lightweight system pop-up window of the first aspect and any optional item in the first aspect is executed.

[0069] It can be seen from the above technical solutions that this application has the following advantages:

[0070] The present application provides a method for pop-up windows based on the OpenHarmony lightweight system. First, the data to be displayed in the pop-up window is obtained, and the data to be displayed in the pop-up window includes pop-up window title information and pop-up window prompt information; then, the interface dialogue component is set according to the data to be displayed in the pop-up window; further, several control buttons and response actions corresponding to the control buttons are added to the interface dialogue component; further, the interface dialogue component is initialized according to the data, control buttons and response actions displayed in the pop-up window, and a pop-up window is generated; finally, the pop-up window is displayed on the terminal screen. The present application replaces other pop-up window components by creating and setting a new interface dialogue component, and generates a simple pop-up window that does not need to be dragged and moved, thereby eliminating the dependence on pop-up window components such as the Windowmanager subsystem and the IPC subsystem, preventing greater resource consumption, and meeting the demand for applying pop-up windows to small resource devices of lightweight systems. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0072] Figure 1 A flowchart of an embodiment of the method for pop-up window based on OpenHarmony lightweight system provided in this application;

[0073] Figure 2 A flowchart of another embodiment of the method for pop-up window based on OpenHarmony lightweight system provided in this application;

[0074] Figure 3 A flowchart of another embodiment of the method for pop-up window based on OpenHarmony lightweight system provided in this application;

[0075] Figure 4 A flowchart of another embodiment of the method for pop-up window based on OpenHarmony lightweight system provided in this application;

[0076] Figure 5 A flowchart of another embodiment of the method for pop-up window based on OpenHarmony lightweight system provided in this application;

[0077] Figure 6 A flowchart of another embodiment of the method for pop-up window based on OpenHarmony lightweight system provided in this application;

[0078] Figure 7 A schematic diagram of the structure of an embodiment of a device for a pop-up window based on the OpenHarmony lightweight system provided in this application;

[0079] Figure 8 A schematic diagram of the structure of an embodiment of an electronic device provided in this application. DETAILED DESCRIPTION

[0080] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0081] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0082] In the description of the present invention, it should be understood that descriptions involving orientation, such as up, down, left, right, front, back, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0083] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0084] In the description of the present invention, it should be noted that, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific content of the technical solution. In addition, the identification of specific steps below does not represent a limitation on the order of steps and execution logic, and the execution order and execution logic between each step should be understood and inferred with reference to the contents described in the embodiment.

[0085] The method provided in the present application can be applied to a terminal or a system, and can also be applied to a server. For example, the terminal can be a smart phone or a computer, a tablet computer, a smart TV, a smart watch, a portable computer terminal, or a fixed terminal such as a desktop computer.

[0086] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides a method and a related device for pop-up window based on OpenHarmony lightweight system, which are used to load the pop-up window function on the lightweight system.

[0087] See also Figure 1 According to the first aspect of the present invention, the method based on the OpenHarmony lightweight system pop-up window may include, but is not limited to, the following:

[0088] Step S101, obtaining data to be displayed in a pop-up window, where the data to be displayed in the pop-up window includes pop-up window title information and pop-up window prompt information;

[0089] Step S102, setting an interface dialogue component according to the data to be displayed in the pop-up window;

[0090] Step S103, adding a number of control buttons and a number of response actions corresponding to the control buttons in the interface dialogue component;

[0091] Step S104, initializing the interface dialogue component according to the data, control buttons and response actions displayed in the pop-up window, and generating a pop-up window;

[0092] Step S105, displaying the pop-up window on the terminal screen.

[0093] The present application provides a method for pop-up windows based on the OpenHarmony lightweight system. First, the data to be displayed in the pop-up window is obtained, and the data to be displayed in the pop-up window includes pop-up window title information and pop-up window prompt information; then, an interface dialogue component is set according to the data to be displayed in the pop-up window; further, several control buttons and response actions corresponding to the control buttons are added to the interface dialogue component; further, the interface dialogue component is initialized according to the data displayed in the pop-up window, the control buttons and the response actions, and a pop-up window is generated; finally, the pop-up window is displayed on the terminal screen. The present application replaces other pop-up window components by setting a new interface dialogue component, and generates a simple pop-up window that does not need to be dragged and moved, thereby eliminating the dependence on pop-up window components such as the Window manager subsystem and the IPC subsystem, preventing greater resource consumption, and meeting the demand for applying pop-up windows to small resource devices of lightweight systems.

[0094] In step S101 of some embodiments, data to be displayed in a pop-up window is obtained, and the data to be displayed in the pop-up window includes pop-up window title information and pop-up window prompt information. It should be noted that in order to make the pop-up window have a clear meaning and can cooperate to complete the work on the terminal, the data to be displayed in the pop-up window should be obtained. Among them, the pop-up window title information in the data to be displayed in the pop-up window is used to indicate the subject content of the pop-up window; the pop-up window prompt information is used to describe the function of the pop-up window and prompt the user to operate according to actual needs, such as selecting some buttons on the pop-up window.

[0095] In step S102 of some embodiments, an interface dialogue component is set according to the data to be displayed in the pop-up window. In order to clarify the theme of the interface dialogue component and the interactive function to be implemented, the interface dialogue component needs to be set according to actual needs, and the actual needs are the data to be displayed in the pop-up window obtained in step S101. The title of the interface dialogue component is set according to the pop-up window title information in the data to be displayed in the pop-up window, such as: prompt, warning or error. The interactive function to be implemented by the interface dialogue component is set according to the prompt information of the pop-up window, such as: whether to confirm the operation or whether to exit in case of program error.

[0096] In step S103 of some embodiments, several control buttons and response actions corresponding to the control buttons are added to the interface dialogue component. After the interactive function to be implemented by the interface dialogue component is set in step S102, it is also necessary to provide buttons for human-computer interaction and respond to operations according to the buttons selected by the user. Therefore, one or more control buttons are added to the interface dialogue component, and response actions corresponding to the control buttons are set. The several control buttons include at least one of the following: an OK button, a Cancel button, a Shutdown button, or a Restart button, which are not specifically limited here. For example, in an interface dialogue component titled "Confirm the Operation", control buttons of "Confirm" and "Cancel" are added. When the user selects the "Confirm" control button, a response action of continuing to execute the work is made; or when the user selects the "Cancel" control button, a response action of canceling the work is made.

[0097] In step S104 of some embodiments, the interface dialogue component is initialized according to the data, control buttons and response actions displayed in the pop-up window, and a pop-up window is generated. After the interface dialogue component is set in steps S101 to S103, the interface dialogue component needs to be further initialized to generate a pop-up window. The information displayed to the user in the pop-up window is determined by the data in step S101 and the control buttons and response actions in step S103.

[0098] Reference Figure 2 According to some embodiments of the present invention, the initialization of the interface dialog component according to the data, control buttons and response actions displayed in the pop-up window and the generation of the pop-up window in step S104 may specifically include, but not limited to, the following:

[0099] Step S201, obtaining the terminal screen size;

[0100] Step S202, creating a first interface view group container according to the terminal screen size and the pop-up window title information, so that the pop-up window body is displayed in the area where the first interface view group container is located;

[0101] Step S203, creating a second interface view group container according to the pop-up window prompt information, the control button, and the response action, so that the pop-up window is displayed in the area where the second interface view group container is located;

[0102] Step S204, adding the second interface view group container to the first interface view group container;

[0103] Step S205, adding the first interface view group container to the root view container, generating a pop-up display page, so that the pop-up body is displayed on the terminal screen, the pop-up window is displayed in the pop-up body, and the size of the pop-up window is smaller than the pop-up body.

[0104] In steps S201 to S202 of some embodiments, the terminal screen size is first obtained; then a first interface view group container is created according to the terminal screen size and the pop-up window title information, so that the pop-up window body is displayed in the area where the first interface view group container is located. In order to be able to generate a pop-up window through a newly created interface dialogue component, this application uses an interface view group container (UIViewGroup container) plus a root view (RootView) instead of a window plus a window root view (WindowRootView). It should be noted that an interface view group container is usually used to organize and layout UI elements. It is a container that contains and arranges other UI components. It can organize UI elements in a structured and manageable manner and create complex user interfaces.

[0105] The pop-up window includes a pop-up window body and a pop-up window. The first interface view group container of the present application is the carrier of the pop-up window body, and the display area of ​​the pop-up window body is the area where the first interface view group container is located. Therefore, it is necessary to use the size of the terminal screen as the size of the first interface view group container, that is, the pop-up window body fully covers the terminal screen, so as to ensure that when the pop-up window pops up and is displayed, the user touches the screen to respond only to the pop-up window.

[0106] Reference Figure 3 According to some embodiments of the present invention, after creating the first interface view group container according to the terminal screen size and the pop-up window title information in step S202, the first interface view group container needs to be set in detail to achieve a reasonable and beautiful layout of the pop-up window body on the terminal screen, which may include, but is not limited to, the following:

[0107] Step S301, setting the background color of the first interface view group container to gray;

[0108] Step S302: adjust the transparency of the first interface view group container.

[0109] In some embodiments, in step S301 to step S302, the background color of the first interface view group container is first set to gray; and then the transparency of the first interface view group container is adjusted. In order to highlight the title of the pop-up window body or other pop-up window information, such as the pop-up window in the subsequent steps, the background color and transparency of the first interface view group container need to be adjusted, so as to achieve a visual effect that the position outside the pop-up window area is not clickable.

[0110] In step S203 of some embodiments, a second interface view group container is created according to the pop-up window prompt information, control buttons, and response actions, so that the pop-up window is displayed in the area where the second interface view group container is located. The pop-up window is the main page for realizing human-computer interaction. Therefore, the pop-up window displays a title and specific prompt information text set according to the pop-up window prompt information, and a button for the user to click set according to the control buttons and response actions. The second interface view group container is the carrier of the pop-up window, and the display area of ​​the pop-up window is the area where the second interface view group container is located.

[0111] In step S204 of some embodiments, the second interface view group container is added to the first interface view group container. The second interface view group is loaded on the first interface view group container, so that the second interface view group floats above the first interface view group to prevent the pop-up window from being covered by the pop-up window body, so that the pop-up window body and the pop-up window are combined to form a pop-up window.

[0112] Reference Figure 4 According to some embodiments of the present invention, in step S204, adding the second interface view group container to the first interface view group container may specifically include, but not limited to, the following:

[0113] Step S401, setting the background color of the second interface view group container to white;

[0114] Step S402: center the second interface view group container in the first interface view group container.

[0115] In some embodiments, in step S401 to step S402, the background color of the second interface view group container is first set to white; then the second interface view group container is centered in the first interface view group container. In order to achieve a reasonable and beautiful visual effect of the pop-up window on the pop-up window body, it is necessary to set the background color of the second container interface view group container to white, so that the white pop-up window is highlighted on the gray pop-up window body set in step S301. Further adjust the position layout of the pop-up window, and center the second interface view group container in the first interface view group container, so that users can view and operate it easily.

[0116] In step S205 of some embodiments, the first interface view group container is added to the root view container, and a pop-up window display page is generated, so that the pop-up window body is displayed on the terminal screen, the pop-up window is displayed in the pop-up window body, and the size of the pop-up window is smaller than the pop-up window body. After setting the first interface view group container and the second interface view group container in steps S201 to S204, the first interface view group container needs to be added to the root view container to generate a pop-up window.

[0117] In step S105 of some embodiments, the pop-up window is displayed on the terminal screen. After completing the initialization of the interface dialogue component and generating the pop-up window in step S104, the pop-up window is displayed on the terminal screen for the user to operate on the terminal screen according to the information displayed in the pop-up window and actual needs.

[0118] Reference Figure 5 According to some embodiments of the present invention, in order to further reduce the resources occupied by the pop-up window function, a scheduled task list can be created to recycle the pop-up window resources that complete the response action, that is, when the pop-up window is closed, the memory used by the pop-up window application is released. To achieve the above recycling function, it is necessary to create a scheduled task list before step S102, which may include, but is not limited to, the following:

[0119] Step S501, creating an interface dialogue component;

[0120] Step S502, creating a scheduled task list;

[0121] Step S503, when the preset time is reached, determine whether there is an element in the scheduled task list; if so, execute step S504; if not, execute step S505;

[0122] Step S504, take out the element and destroy it;

[0123] Step S505, re-timing.

[0124] In step S501 of some embodiments, an interface dialogue component is created. It should be noted that in order to use the pop-up function on the OpenHarmony lightweight system without adding additional dependent components and preventing greater resource consumption, the present application achieves the above effect through a newly added interface dialogue component. Interface dialogue components (UIDialog components) are generally used to display dialog boxes or pop-up windows, which interrupt the user's current operation and require the user to perform some kind of interaction (such as confirmation, input information, selection, etc., which are not specifically limited here). The interface dialogue component may contain various UI elements, such as buttons, text boxes, images, etc., for interacting with the user, which are not specifically limited here. The interface dialogue component created in this application is used to create, display, hide or close pop-up windows in subsequent steps.

[0125] In some steps S502 to S505, a scheduled task list is created; when the preset time is reached, it is determined whether there are elements in the scheduled task list; if so, the elements are taken out and destroyed; if not, the time is reset; it should be noted that the preset time is the preset timing duration in the scheduled task list, which is used to complete the tasks in the scheduled task list on a scheduled basis, and the task of the scheduled task list of the present application is to regularly destroy the elements in the list. For example, if the timing duration is preset to 5 seconds, it is determined every 5 seconds whether there are elements in the scheduled task list for subsequent destruction. If so, the elements are taken out of the scheduled task list and destroyed; if not, the time is reset for 5 seconds and the determination is made again, and this is repeated.

[0126] Reference Figure 6 According to some embodiments of the present invention, steps S501 to S505 create a timed task list for resource recycling. Therefore, the following is a detailed description of the recycling operation based on the above steps. Specifically, it may include, but is not limited to, the following:

[0127] Step S601, after the control button is selected by the user, completing the response action of the corresponding control button;

[0128] Step S602, destroying the pop-up window and the pop-up window body;

[0129] Step S603: Transfer the first interface view group container to the scheduled task list as an element that needs to be destroyed in the scheduled task list.

[0130] In some steps S601 to S603, after the control button selected by the user, the response action of the corresponding control button is completed first; the pop-up window and the pop-up window body are destroyed; and then the first interface view group container is transferred to the scheduled task list as an element that needs to be destroyed in the scheduled task list; it should be noted that after step S106, the response action should be completed first, and then recycling should be performed to avoid invalid recycling. For example, when the user clicks the "OK" control button on the pop-up window, after the response confirmation action is completed, the pop-up window and the pop-up window body are closed and destroyed first, and then the first interface view group container is transferred to the scheduled task list in step S501, and the first interface view group container is taken out and destroyed when the timing duration is reached. Since step S204 has added the second interface view group container to the first interface view group container, when the first interface view group container is destroyed, the second interface view group container is also destroyed, thereby releasing the resources occupied by the pop-up window.

[0131] The above describes a method for a pop-up window based on an OpenHarmony lightweight system provided by the present application. The following describes a device and an electronic device based on a pop-up window based on an OpenHarmony lightweight system provided by the present application:

[0132] See also Figure 7 The present application also provides a device for a pop-up window based on an OpenHarmony lightweight system, the device comprising:

[0133] An acquisition unit 701 is used to acquire data to be displayed in a pop-up window, where the data to be displayed in the pop-up window includes pop-up window title information and pop-up window prompt information;

[0134] A setting unit 702, used to set an interface dialogue component according to the data to be displayed in the pop-up window;

[0135] An adding unit 703, used to add a number of control buttons and a number of response actions corresponding to the control buttons in the interface dialogue component;

[0136] Initialization unit 704, used to initialize the interface dialogue component according to the data, control buttons and response actions displayed in the pop-up window, and generate a pop-up window;

[0137] The display unit 705 is used to display the pop-up window on the terminal screen.

[0138] Optionally, the initialization unit 704 is specifically used for:

[0139] Get the terminal screen size;

[0140] Creating a first interface view group container according to the terminal screen size and the pop-up window title information, so that the pop-up window body is displayed in the area where the first interface view group container is located;

[0141] Creating a second interface view group container according to the pop-up window prompt information, the control button, and the response action, so that the pop-up window is displayed in the area where the second interface view group container is located;

[0142] Add the second interface view group container to the first interface view group container;

[0143] The first interface view group container is added to the root view container, and a pop-up display page is generated, so that the pop-up body is displayed on the terminal screen, the pop-up window is displayed in the pop-up body, and the size of the pop-up window is smaller than the pop-up body.

[0144] Optionally, the initialization unit 704 is specifically used for:

[0145] Set the background color of the first interface view group container to gray;

[0146] Adjust the transparency of the first interface view group container.

[0147] Optionally, the initialization unit 704 is specifically used for:

[0148] Set the background color of the second interface view group container to white;

[0149] The second interface view group container is centered within the first interface view group container.

[0150] Optionally, the plurality of control buttons include at least one of the following: an OK button, a Cancel button, a Power Off button or a Restart button.

[0151] Optionally, before the setting unit 702, the method further includes:

[0152] The interface dialogue component unit 706 is used to create an interface dialogue component;

[0153] Scheduled task list unit 707, used to create a scheduled task list;

[0154] A judging unit 708, configured to judge whether there is an element in the scheduled task list when a preset time is reached;

[0155] Execution unit 709, used to extract and destroy elements;

[0156] The return unit 710 is used to re-time.

[0157] Optionally, after the display unit 705, the following is further included:

[0158] A response unit 711, used to complete a response action of a corresponding control button after the control button is selected by the user;

[0159] A destroying unit 712, used to destroy the pop-up window and the pop-up window body;

[0160] The transfer unit 713 is used to transfer the first interface view group container to the scheduled task list as an element that needs to be destroyed in the scheduled task list.

[0161] This application also provides an electronic device, see Figure 8 , the electronic device comprises:

[0162] Processor 801, memory 802, input and output unit 803, bus 804;

[0163] The processor 801 is connected to the memory 802, the input and output unit 803 and the bus 804;

[0164] The memory 802 stores a program, and the processor 801 calls the program to execute the following steps: Figures 1 to 6 The method for pop-up window based on OpenHarmony lightweight system shown in any embodiment.

[0165] The present application also relates to a computer-readable storage medium, on which a program is stored, wherein when the program is run on a computer, the computer executes Figures 1 to 6 The method for pop-up window based on OpenHarmony lightweight system shown in any embodiment.

[0166] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0167] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0168] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0169] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0170] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A method for pop-up window based on OpenHarmony lightweight system, characterized in that: The method comprises: Obtaining data to be displayed in a pop-up window, wherein the data to be displayed in the pop-up window includes pop-up window title information and pop-up window prompt information; Create interface dialogue components; Create a scheduled task list; Setting interface dialogue components according to the data to be displayed in the pop-up window; Adding a plurality of control buttons and corresponding response actions of the plurality of control buttons in the interface dialogue component, wherein the plurality of control buttons include at least one of the following: an OK button, a Cancel button, a Shutdown button or a Restart button; Initializing the interface dialogue component according to the data displayed in the pop-up window, the control button and the response action, and generating a pop-up window, including: Get the terminal screen size; Creating a first interface view group container according to the terminal screen size and the pop-up window title information, so that the pop-up window body is displayed in the area where the first interface view group container is located; Creating a second interface view group container according to the pop-up window prompt information, the control button, and the response action, so that the pop-up window is displayed in the area where the second interface view group container is located; Adding the second interface view group container to the first interface view group container; Adding the first interface view group container to the root view container, generating a pop-up window display page, so that the pop-up window body is displayed on the terminal screen, the pop-up window is displayed in the pop-up window body, and the size of the pop-up window is smaller than the pop-up window body; Displaying the pop-up window on the terminal screen; After the control button is selected by the user, a response action corresponding to the control button is completed; Destroy the pop-up window and the pop-up window body; Transferring the first interface view group container to the scheduled task list as an element to be destroyed in the scheduled task list; When the preset time is reached, determining whether there is an element in the scheduled task list; If so, the element is taken out and destroyed; If not, restart the timer.

2. The method according to claim 1, characterized in that After creating the first interface view group container according to the terminal screen size and the pop-up window title information, the method further includes: Setting the background color of the first interface view group container to gray; The transparency of the first interface view group container is adjusted.

3. The method according to claim 1, characterized in that The adding the second interface view group container to the first interface view group container includes: Setting the background color of the second interface view group container to white; The second interface view group container is centered in the first interface view group container.

4. A device based on OpenHarmony lightweight system pop-up window, characterized in that: The device comprises: An acquisition unit, used for acquiring data to be displayed in a pop-up window, wherein the data to be displayed in the pop-up window includes pop-up window title information and pop-up window prompt information; An interface dialogue component unit, used for creating an interface dialogue component; Scheduled task list unit, used to create a scheduled task list; A setting unit, used for setting an interface dialogue component according to the data to be displayed in the pop-up window; An adding unit, used to add a plurality of control buttons and response actions corresponding to the plurality of control buttons in the interface dialogue component, wherein the plurality of control buttons include at least one of the following: an OK button, a Cancel button, a Shutdown button or a Restart button; An initialization unit, configured to initialize the interface dialogue component according to the data displayed in the pop-up window, the control button and the response action, and generate a pop-up window; The initialization unit is specifically used for: Get the terminal screen size; Creating a first interface view group container according to the terminal screen size and the pop-up window title information, so that the pop-up window body is displayed in the area where the first interface view group container is located; Creating a second interface view group container according to the pop-up window prompt information, the control button, and the response action, so that the pop-up window is displayed in the area where the second interface view group container is located; Adding the second interface view group container to the first interface view group container; Adding the first interface view group container to the root view container, generating a pop-up window display page, so that the pop-up window body is displayed on the terminal screen, the pop-up window is displayed in the pop-up window body, and the size of the pop-up window is smaller than the pop-up window body; A display unit, used to display the pop-up window on the terminal screen; A response unit, used for completing a response action corresponding to the control button after the control button is selected by the user; A destroying unit, used to destroy the pop-up window and the pop-up window body; A transfer unit, used for transferring the first interface view group container to the scheduled task list as an element to be destroyed in the scheduled task list; A judging unit, used for judging whether there is an element in the scheduled task list when a preset time is reached; An execution unit, used for taking out the element and destroying it; Returns the unit and is used to restart the timing.

5. An electronic device, characterized in that: The electronic device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method according to any one of claims 1 to 3.

6. A computer-readable storage medium having a program stored thereon, wherein the program, when executed on a computer, performs the method according to any one of claims 1 to 3.