A method, apparatus, electronic device and storage medium for controlling interface display
Patent Information
- Application Number
- CN202510350608.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2045-03-24
AI Technical Summary
[0004]由于预先创建BIOS Setup界面包括的所有页面,且选项的隐藏或置灰的条件发生变化时需要重新创建多个页面,这需要耗费大量中央处理器(Central Processing Unit,CPU)资源,且造成了内存空间的浪费
[0050] In the technical solution provided in this application embodiment, when the first page is displayed on the BIOS settings interface, the electronic device loads the second page onto the BIOS settings interface. Then, the electronic device can modify the display attributes of each option on the first page, such as changing whether each option is displayed, hidden, or grayed out. After setting each option on the first page, the electronic device loads the modified first page onto the BIOS settings interface, causing the BIOS settings interface to redisplay the first page, thus refreshing the first page. In this application embodiment, when the display attributes of the options on the first page change, only the first page needs to be recreated. Furthermore, when recreating the first page, only one additional second page needs to be created, reducing the number of pages created during page refresh. The electronic device does not need to store many pages, saving CPU resources and memory space.
Smart Images

Figure CN120234079B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an interface display control method, device, electronic device, and storage medium. Background Technology
[0002] To optimize user experience and improve system configuration security, when developing the Basic Input Output System (BIOS) setup interface based on the Light and Versatile Graphics Library (LVGL), electronic devices execute an interface display control scheme to provide a more intelligent user interface by dynamically showing, hiding, and graying out options in the BIOS Setup interface.
[0003] The current interface display control scheme is as follows: the BIOS Setup interface consists of multiple pages. Electronic devices pre-create all pages included in the BIOS Setup interface. When the conditions for hiding or graying out an option change, the affected options may be scattered across multiple pages, requiring the re-creation of these pages.
[0004] Because all pages of the BIOS Setup interface are pre-created, and multiple pages need to be recreated when the conditions for hiding or graying out options change, this consumes a lot of central processing unit (CPU) resources and wastes memory space. Summary of the Invention
[0005] The purpose of this application is to provide an interface display control method, device, electronic device, and storage medium to save CPU resources and memory space. The specific technical solution is as follows:
[0006] In a first aspect, embodiments of this application provide an interface display control method applied to an electronic device, wherein a first page is displayed on the BIOS settings interface of the electronic device, and the method includes:
[0007] Load the second page into the BIOS setup interface to make the first page editable;
[0008] Set the display attributes of each option on the first page according to the display attribute value of each option on the first page;
[0009] The first page after settings will load into the BIOS setup interface.
[0010] In some embodiments, the method further includes:
[0011] Before loading the second page into the BIOS setup interface, create an empty screen object as the second page;
[0012] After loading the first page with the settings into the BIOS setup interface, delete the second page.
[0013] In some embodiments, the method further includes, before loading the second page to the BIOS setup interface:
[0014] Detect the default options associated with the BIOS setup interface;
[0015] When a change in the value of the preset option is detected, the first display attribute value of each option in the first page is determined according to the control expression of each option in the first page and the current value of the preset option. The control expression of each option indicates the value of the preset option when the preset display attribute is set.
[0016] If the first display attribute value and the second display attribute value of each option in the first page are different, then the second display attribute value of each option in the first page is updated to the first display attribute value, and the step of loading the second page to the BIOS settings interface is executed, wherein the second display attribute value is the recorded display attribute value of each option in the first page.
[0017] In some embodiments, the preset options include at least one of permission options and toggle options; the preset display attributes include at least one of hidden and grayed-out.
[0018] In some embodiments, the preset options include permission options; the method further includes:
[0019] Retrieve user permission information to be verified;
[0020] Verify the user permission information;
[0021] Once the user permission information is verified, the value of the permission option is set to the permission value associated with the user permission information.
[0022] In some embodiments, the step of setting the display attribute of each option in the first page according to the display attribute value of each option in the first page includes:
[0023] Iterate through each option on the first page;
[0024] If the display attribute value of the traversed option is a value indicating that it is hidden, then set the hidden flag for the traversed option; if the display attribute value of the traversed option is a value indicating that it is displayed, and the display attribute of the traversed option is hidden, then delete the hidden flag of the traversed option.
[0025] If the display attribute value of the traversed option is a value indicating graying out, then the transparency of the traversed option is set to the preset transparency, and the state of the traversed option is set to disabled. The preset transparency is greater than the minimum transparency and less than the maximum transparency. If the display attribute value of the traversed option is a value indicating display, and the display attribute of the traversed option is grayed out, then the transparency of the traversed option is set to the minimum transparency, and the state of the traversed option is set to enabled.
[0026] Secondly, embodiments of this application provide an interface display control device applied to an electronic device, wherein a first page is displayed on the BIOS settings interface of the electronic device, and the device includes:
[0027] The first loading module is used to load the second page into the BIOS settings interface so that the first page is in an editable state;
[0028] The first setting module is used to set the display attribute of each option on the first page according to the display attribute value of each option on the first page;
[0029] The second loading module is used to load the first page after settings into the BIOS setup interface.
[0030] In some embodiments, the apparatus further includes:
[0031] A module is created to create an empty screen object as the second page before loading the second page into the BIOS setup interface;
[0032] The delete module is used to delete the second page after the first page of settings has been loaded into the BIOS setup interface.
[0033] In some embodiments, the apparatus further includes a detection module for:
[0034] Before loading the second page to the BIOS setup interface, check the default options associated with the BIOS setup interface;
[0035] When a change in the value of the preset option is detected, the first display attribute value of each option in the first page is determined according to the control expression of each option in the first page and the current value of the preset option. The control expression of each option indicates the value of the preset option when the preset display attribute is set.
[0036] If the first display attribute value and the second display attribute value of each option on the first page are different, then the second display attribute value of each option on the first page is updated to the first display attribute value, triggering the first loading module. The second display attribute value is the recorded display attribute value of each option on the first page.
[0037] In some embodiments, the preset options include at least one of permission options and toggle options; the preset display attributes include at least one of hidden and grayed-out.
[0038] In some embodiments, the preset options include permission options; the device further includes:
[0039] The acquisition module is used to obtain the user permission information to be verified.
[0040] The verification module is used to verify the user permission information;
[0041] The second setting module is used to set the value of the permission option to the permission value associated with the user permission information after the user permission information has been verified.
[0042] In some embodiments, the first setting module is specifically used for:
[0043] Iterate through each option on the first page;
[0044] If the display attribute value of the traversed option is a value indicating that it is hidden, then set the hidden flag for the traversed option; if the display attribute value of the traversed option is a value indicating that it is displayed, and the display attribute of the traversed option is hidden, then delete the hidden flag of the traversed option.
[0045] If the display attribute value of the traversed option is a value indicating graying out, then the transparency of the traversed option is set to the preset transparency, and the state of the traversed option is set to disabled. The preset transparency is greater than the minimum transparency and less than the maximum transparency. If the display attribute value of the traversed option is a value indicating display, and the display attribute of the traversed option is grayed out, then the transparency of the traversed option is set to the minimum transparency, and the state of the traversed option is set to enabled.
[0046] Thirdly, embodiments of this application provide an electronic device including a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being prompted by the machine-executable instructions to implement any of the methods provided in the first aspect.
[0047] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the methods provided in the first aspect.
[0048] Fifthly, embodiments of this application also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods provided in the first aspect.
[0049] Beneficial effects of the embodiments in this application:
[0050] In the technical solution provided in this application embodiment, when the first page is displayed on the BIOS settings interface, the electronic device loads the second page onto the BIOS settings interface. Then, the electronic device can modify the display attributes of each option on the first page, such as changing whether each option is displayed, hidden, or grayed out. After setting each option on the first page, the electronic device loads the modified first page onto the BIOS settings interface, causing the BIOS settings interface to redisplay the first page, thus refreshing the first page. In this application embodiment, when the display attributes of the options on the first page change, only the first page needs to be recreated. Furthermore, when recreating the first page, only one additional second page needs to be created, reducing the number of pages created during page refresh. The electronic device does not need to store many pages, saving CPU resources and memory space.
[0051] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0053] Figure 1 This is a schematic diagram of a first type of interface display control method provided in an embodiment of this application;
[0054] Figure 2 This is a second flowchart illustrating the interface display control method provided in an embodiment of this application.
[0055] Figure 3 A third flowchart illustrating the interface display control method provided in this application embodiment;
[0056] Figure 4 A schematic diagram of the interface display control device provided in the embodiments of this application;
[0057] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0059] The Basic Input Output System (BIOS) is a set of programs embedded in a read-only memory (ROM) chip on the computer's motherboard. These include programs for the computer's most important basic input / output operations, the power-on self-test (POST) program, and the system boot program. The BIOS can read and write specific system settings information from Complementary Metal-Oxide Semiconductor (CMOS). The main function of the BIOS is to provide the lowest-level, most direct hardware settings and control for the computer.
[0060] The BIOS Setup interface is a user interface provided by the firmware embedded on the computer's motherboard, used to manage and configure the computer's hardware settings. Pressing a specific key combination (such as the Delete key, Esc key, etc.) during computer startup will enter the BIOS Setup interface. The BIOS Setup interface can have a text-based menu structure or a modern graphical interface, displaying various setting options in either graphical or textual format.
[0061] The Light and Versatile Graphics Library (LVGL) is a novel graphical user interface (GUI) system framework. LVGL boasts advantages such as small code size and ease of user interface development. As an open-source embedded graphics library, LVGL is renowned for its lightweight, feature-rich, flexible, and portable characteristics, helping developers quickly and easily create beautiful and feature-rich graphical user interfaces.
[0062] The display controls of the BIOS Setup interface typically include the following:
[0063] Hide: The BIOS Setup interface dynamically displays or hides relevant options based on changes in system status or configuration.
[0064] For example, a feature might contain a series of options. For these options, the control provides a toggle switch with two values: disabled and enabled. When the user selects disabled, the control hides the relevant options; when the user selects enabled, the control displays them. Hiding relevant options simplifies the user interface and improves system security, allowing the user to see only options relevant to the current system configuration.
[0065] Grayed out: An option in the BIOS Setup interface is grayed out, indicating that the option is currently unconfigurable or unselectable.
[0066] For example, some advanced options require specific permissions or authorization to configure. In this case, these advanced options may be grayed out to indicate to the user that specific permissions or authorization are required to configure them.
[0067] To optimize user experience and improve system configuration security, when developing a BIOS Setup interface based on LVGL, electronic devices implement an interface display control scheme that dynamically displays, hides, and grays out options in the BIOS Setup interface to provide a more intelligent user interface.
[0068] The current interface display control scheme is as follows: the BIOS Setup interface consists of multiple pages. Electronic devices pre-create all pages included in the BIOS Setup interface. When the conditions for hiding or graying out an option change, the affected options may be scattered across multiple pages, requiring the re-creation of these pages.
[0069] For example, when the management permissions for an electronic device are changed from ordinary user permissions to advanced user permissions, since advanced users have full access to all options, hidden or grayed-out options need to be displayed normally. That is, those hidden or grayed-out options need to be displayed and configurable or selectable. However, these hidden or grayed-out options are scattered across various pages. Therefore, when management permissions change, many pages need to be recreated.
[0070] Because all pages of the BIOS Setup interface are pre-created, and multiple pages need to be recreated when the conditions for hiding or graying out options change, this consumes a lot of CPU resources and wastes memory space.
[0071] To address the aforementioned problems, embodiments of this application provide an interface display control method, such as... Figure 1 As shown, this method, applied to an electronic device whose BIOS setup interface displays a first page, includes:
[0072] Step S101: Load the second page into the BIOS settings interface so that the first page is in an editable state;
[0073] Step S102: Set the display attribute of each option on the first page according to the display attribute value of each option on the first page;
[0074] Step S103: Load the first page after settings into the BIOS settings interface.
[0075] In the technical solution provided in this application embodiment, when the first page is displayed on the BIOS settings interface, the electronic device loads the second page onto the BIOS settings interface. Then, the electronic device can modify the display attributes of each option on the first page, such as changing whether each option is displayed, hidden, or grayed out. After setting each option on the first page, the electronic device loads the modified first page onto the BIOS settings interface, causing the BIOS settings interface to redisplay the first page, thus refreshing the first page. In this application embodiment, when the display attributes of the options on the first page change, only the first page needs to be recreated. Furthermore, when recreating the first page, only one additional second page needs to be created, reducing the number of pages created during page refresh. The electronic device does not need to store many pages, saving CPU resources and memory space.
[0076] In this embodiment, the electronic device can be a personal computer (PC), a server, or other device that supports a BIOS setup interface. The BIOS setup interface can be a BIOS Setup interface developed based on LVGL, or it can be other types of BIOS setup interfaces; there is no limitation on this.
[0077] The first page is the currently displayed page in the BIOS setup interface. The first page may include one or more options, whose display attributes include showing, hiding, or graying out.
[0078] In step S101 above, the second page can be a page pre-created by the electronic device, or a page created when the first page needs to be refreshed. The second page can be an empty screen object (i.e., the second page includes or excludes options), or a non-empty screen object (i.e., the second page includes options).
[0079] In this embodiment, the currently displayed page of the BIOS settings interface (such as the first page mentioned above) is not editable. When it is necessary to refresh the first page, the electronic device can obtain the second page and load it into the BIOS settings interface. At this time, the BIOS settings interface displays the second page, and the first page is no longer displayed on the BIOS settings interface. The first page switches from an uneditable state to an editable state, that is, the electronic device can edit the options in the first page, such as setting the display attributes of each option in the first page.
[0080] In step S102 above, the display attribute value of the option is the value indicating the display attribute of the option. In this embodiment of the application, the option is used as a basic object, and the user data (user_data) field of each basic object can be used to record the display attribute value.
[0081] After the electronic device loads the second page into the BIOS setup interface, it can edit the first page and set the display attributes of each option on the first page. For example, it can iterate through each option on the first page, read the display attribute value of the iterated option, and set the display attribute of the iterated option according to the display attribute value.
[0082] For example, display attribute value 1 indicates that the option's display attribute is displayed, display attribute value 2 indicates that the option's display attribute is hidden, and display attribute value 3 indicates that the option's display attribute is grayed out. Page 1 includes options 1 to 3. The electronic device iterates through options 1 to 3. When it reaches option 1, its display attribute value is 1, so it sets the display attribute of option 1 to displayed, and the user can configure or select option 1. Continuing to iterate through the options, when it reaches option 2, its display attribute value is 2, so it sets the display attribute of option 2 to hidden, and option 2 is not displayed on page 1. Continuing to iterate through the options, when it reaches option 3, its display attribute value is 3, so it sets the display attribute of option 3 to grayed out, and option 3 is displayed on page 1, but the user cannot configure or select option 3.
[0083] In some embodiments, step S102 may be: traversing each option in the first page; if the display attribute value of the traversed option is a value indicating that it is hidden, then setting a hidden flag for the traversed option; if the display attribute value of the traversed option is a value indicating that it is displayed, and the display attribute of the traversed option is hidden, then deleting the hidden flag of the traversed option.
[0084] When the BIOS setup interface is based on LVGL, if the display attribute of an option being iterated over is a value indicating it's hidden, the electronic device can call the LVGL library function `lv_obj_add_flag` to add a hidden flag (such as the `LV_OBJ_FLAG_HIDDEN` flag) to the iterated option, thus hiding it. Similarly, if the display attribute of an option being iterated over is a value indicating it's displayed, and the display attribute of the iterated option is hidden, the electronic device can call the LVGL library function `lv_obj_clear_flag` to clear the `LV_OBJ_FLAG_HIDDEN` flag, thus displaying the iterated option normally.
[0085] In some embodiments, step S102 may be: traversing each option in the first page; if the display attribute value of the traversed option is a value indicating graying out, then setting the transparency of the traversed option to a preset transparency, and setting the state of the traversed option to a disabled state, wherein the preset transparency is greater than the minimum transparency and less than the maximum transparency; if the display attribute value of the traversed option is a value indicating display, and the display attribute of the traversed option is grayed out, then setting the transparency of the traversed option to the minimum transparency, and setting the state of the traversed option to an enabled state.
[0086] In this embodiment, the minimum transparency is 0 and the maximum transparency is 100%. The preset transparency is greater than 0 and less than 100%. For example, the preset transparency can be 50%, 60%, etc.
[0087] Taking a preset transparency of 50% as an example: In a BIOS Setup interface based on LVGL, if the display attribute of an option being iterated over is a value indicating graying out, the electronic device can call the LVGL library function `lv_obj_add_style` to set the transparency of the iterated option to 50%, and call the LVGL library function `lv_obj_add_state` to set it to a disabled state (e.g., `LV_STATE_DISABLED`). If the display attribute of an option being iterated over is a value indicating display, and the display attribute of the iterated option is grayed out, the electronic device can call the LVGL library function `lv_obj_add_style` to set the transparency of the iterated option to 0, and call the LVGL library function `lv_obj_add_state` to set it to an enabled state (e.g., `LV_STATE_ENABLED`).
[0088] After all options on the first page have been traversed, step S103 is executed electronically to load the configured first page into the BIOS setup interface. The configured first page is the newly created page, and the BIOS setup interface displays this newly created first page.
[0089] In some embodiments, to further save memory space, such as Figure 2 As shown, an interface display control method is also provided, applied to an electronic device, which displays a first page on its BIOS settings interface. The method includes:
[0090] Step S201: Create an empty screen object as the second page;
[0091] Step S202: Load the second page into the BIOS setup interface so that the first page is editable;
[0092] Step S203: Set the display attribute of each option on the first page according to the display attribute value of each option on the first page;
[0093] Step S204: Load the first page after settings to the BIOS setup interface;
[0094] Step S205: Delete the second page.
[0095] Steps S202 to S204 are the same as steps S101 to S103.
[0096] In this embodiment, when refreshing the first page, the electronic device creates an empty screen object (null_scr) as the second page, replacing the first page and displaying it in the BIOS settings interface. After the newly created first page is loaded into the BIOS settings interface, the second page is deleted, completing the first page refresh. Throughout the process, the electronic device only needs to create one empty screen object. Because it is an empty screen object, the creation efficiency is high, and the electronic device can quickly begin editing the first page. Furthermore, the second page is stored in the electronic device only during the first page refresh process. After the first page refresh is completed, the electronic device deletes the second page. That is, the electronic device only stores one page, namely the first page, further saving the memory space of the electronic device.
[0097] To refresh the page promptly and accurately, in some embodiments, such as Figure 3 As shown, an interface display control method is also provided, applied to electronic devices, where a first page is displayed on the BIOS settings interface of the electronic device. This method may include the following steps:
[0098] Step S301: Detect the preset options associated with the BIOS setup interface;
[0099] In this embodiment, the electronic device pre-sets options for adjusting display attributes, i.e., preset options. These preset options are associated with options on the page. For ease of understanding, the options on the page associated with the preset options are simply referred to as associated options. Preset options may include at least one of permission options and toggle options. Preset options may also include other options, without limitation.
[0100] The value of the permission option indicates the user permissions of the electronic device. User permissions for an electronic device can include general permissions (GENERAL_AUTHORITY) and advanced permissions (ADVANCED_AUTHORITY), and may also include other permissions without limitation. Users with general permissions typically only have access to basic settings options, such as date and time settings, and boot order. Users with advanced permissions have access to more settings options, including CPU frequency, memory settings, hard drive parameters, and security options. Differentiating user permissions ensures system security and prevents users with general permissions from accidentally changing important settings.
[0101] Taking user permissions, including normal permissions and advanced permissions, as an example, the value of the permission option can be 0 or 1. When the value of the permission option is 0, it indicates that the user permission is normal; when the value of the permission option is 1, it indicates that the user permission is advanced. In this embodiment of the application, the electronic device can default to normal permissions or advanced permissions.
[0102] The value of the switch option indicates the function status. The function status can include enabled or disabled, and may include other function statuses, which are not limited thereto.
[0103] Taking the functional state as either enabled or disabled as an example, the value of the switch option can be 0 or 1. When the value of the switch option is 0, it indicates that the functional state is disabled; when the value of the permission option is 1, it indicates that the user permission is enabled. In the embodiments of this application, the electronic device can default to the functional state being disabled or enabled.
[0104] In this embodiment, the electronic device can detect each preset option in real time so as to trigger a page refresh in a timely manner and adjust the display attributes of the associated options.
[0105] Step S302: When a change in the value of a preset option is detected, the first display attribute value of each option on the first page is determined based on the control expression of each option on the first page and the current value of the preset option. The control expression of each option indicates the value of the preset option when it is set as the preset display attribute.
[0106] In this embodiment, the preset display attribute may include at least one of hidden and grayed-out. The preset display attribute may also include display attributes such as display (i.e., normal display), and is not limited thereto. A control expression for an associated option is the condition for setting the associated option to a preset display attribute. An associated option may include one or more control expressions.
[0107] For example, electronic devices define the values of permission options, such as a value of 0 for normal permission (GENERAL_AUTHORITY) and a value of 1 for advanced permission (ADVANCED_AUTHORITY). The electronic device creates a variable for the permission options, named gAuthority, with an initial value of 0, meaning the user's default permission is GENERAL_AUTHORITY.
[0108] The control expression for associated option 1 can be `suppressif ideqval gAuthority == 0`. This expression indicates that the display attribute of associated option 1 is set to hidden only when the value of the permission option is 0. When the value of the permission option is 0, the display attribute of associated option 1 is set to hidden. When the value of the permission option is 1, the display attribute of associated option 1 is set to visible.
[0109] The control expression for associated option 1 can also be `grayoutif ideqval gAuthority == 0`. This expression indicates that the condition for setting the display attribute of associated option 1 to grayed out is that the value of the permission option is 0. When the value of the permission option is 0, the display attribute of associated option 1 is set to grayed out. When the value of the permission option is 1, the display attribute of associated option 1 is set to displayed.
[0110] For example, an electronic device defines the values of switch options, such as an enabled value of 1 and a disabled value of 0. The electronic device creates a variable for the switch option, named gUsbSupport, with an initial value of 0, meaning the function state is disabled by default.
[0111] The control expression for associated option 1 can be `suppressif ideqval gUsbSupport == 0`. This expression indicates that the display attribute of associated option 1 is set to hidden when the value of the toggle option is 0. When the value of the toggle option is 0, the display attribute of associated option 1 is set to hidden. When the value of the toggle option is 1, the display attribute of associated option 1 is set to displayed.
[0112] The control expression for associated option 1 can also be `grayoutif ideqval gUsbSupport == 0`. This expression indicates that the condition for setting the display attribute of associated option 1 to grayed out is that the value of the toggle option is 0. When the value of the toggle option is 0, the display attribute of associated option 1 is set to grayed out. When the value of the toggle option is 1, the display attribute of associated option 1 is set to displayed.
[0113] In this embodiment of the application, when the value of a preset option changes, the electronic device can generate an LV_EVENT_VALUE_CHANGED event. In response to the LV_EVENT_VALUE_CHANGED event, the electronic device traverses each option in the first page; and calculates the display attribute value of the traversed option, i.e., the first display attribute value, based on the control expression of the traversed option and the current value of the preset option.
[0114] For example, there are three control expressions for associated option 1: one is `suppressif ideqvalgAuthority == 0`, another is `suppressif ideqvalgUsbSupport == 0`. If the value of the permission option is 0 and the value of the toggle option is 0, or if the value of the permission option is 1 and the value of the toggle option is 0, or if the value of the permission option is 0 and the value of the toggle option is 1, then the electronic device can calculate that the display attribute value of associated option 1 is 0, which indicates a hidden attribute. If the value of the permission option is 1 and the value of the toggle option is 1, then the electronic device can calculate that the display attribute value of associated option 1 is 1, which indicates a displayed attribute.
[0115] Step S303: If the first display attribute value and the second display attribute value of each option on the first page are different, then update the second display attribute value of each option on the first page to the first display attribute value. The second display attribute value is the recorded display attribute value of each option on the first page.
[0116] In this embodiment of the application, the electronic device records the display attribute value (such as the second display attribute value) of each option on the first page. For example, the electronic device records the second display attribute value in the user_data field of each option on the first page.
[0117] Upon obtaining the first display attribute value for each option on the first page, the electronic device compares the first display attribute value with the second display attribute value for each option. If the first and second display attribute values differ, the second display attribute value is updated to the first display attribute value, such as by writing the first display attribute value into the option's user_data field. Then, the electronic device refreshes the page and executes step S304.
[0118] In this embodiment, the first page includes multiple options. Whenever the first display attribute value and the second display attribute value of any one option differ, the electronic device refreshes the page and executes step S304. If the first display attribute value and the second display attribute value of every option on the first page are the same, the current processing operation ends, and the page refresh operation is terminated.
[0119] Step S304: Load the second page into the BIOS setup interface so that the first page is editable;
[0120] Step S305: Set the display attribute of each option on the first page according to the display attribute value of each option on the first page;
[0121] Step S306: Load the first page after settings into the BIOS setup interface.
[0122] Steps S304 to S306 are the same as steps S101 to S103.
[0123] In this embodiment, the electronic device detects external changes affecting the display of the BIOS settings page. Upon detecting a change, the electronic device can promptly update the display attribute values, thereby refreshing the page accurately and efficiently. Furthermore, after detecting a change, the electronic device only triggers a refresh of the current first page, reducing the number of pages refreshed and conserving CPU resources.
[0124] In some embodiments, the preset options include permission options. In this case, the value of the permission option can be updated in the following way: obtain the user permission information to be verified; verify the user permission information; and when the user permission information is verified, set the value of the permission option to the permission value associated with the user permission information.
[0125] User permission information may include a username and password. Users can input this information into the electronic device, which then verifies it. If the user permission information is verified successfully, such as with a correct username and password, the electronic device sets the permission option value to the associated permission value. For example, if the user permission information is associated with a "higher-level" permission value of 1, then after successful verification, the electronic device will set the permission option value to 1.
[0126] In this embodiment of the application, the value of the permission option can also be changed by a shortcut key or other means. For example, if the electronic device detects that the user has clicked the shortcut key for switching permissions, the electronic device will set the value of the permission option to the user permission specified by the shortcut key.
[0127] The following section provides a detailed description of the interface display control method provided in this application embodiment, specifically for the BIOS Setup interface developed based on LVGL.
[0128] In this embodiment of the application, a page refresh library function (such as lv_scr_page_refresh) can be added to the LVGL library. This page refresh library function is used to update the options (i.e., lv_obj_t) in the current page (i.e., the screen object scr). At this time, the page refresh library function can be represented as lv_scr_page_refresh(lv_obj_t*scr).
[0129] The electronic device also includes a detection module that detects changes that affect the current page display, triggering a call to lv_scr_page_refresh to refresh the page.
[0130] (1) The detection module detects a change in permissions and triggers a page refresh.
[0131] The BIOS Setup interface has two different permission levels: normal users and advanced users. The normal permission value (GENERAL_AUTHORITY) is 0, and the advanced permission value (ADVANCED_AUTHORITY) is 1. For options that advanced users can set, the electronic device adds a control expression to that option, such as `suppressif ideqvalgAuthority == 0`.
[0132] The electronic device defaults to normal user permissions. When a user enters the correct password for advanced permissions, the electronic device adjusts the user's permissions to advanced permissions. The detection module can detect the change in user permissions, thus generating an LV_EVENT_VALUE_CHANGED event. In response to the LV_EVENT_VALUE_CHANGED event, the electronic device iterates through each option on the current page; based on the control expression of the iterated option and the current value of the permission option (i.e., advanced permission value 1), it calculates the display attribute value of the iterated option. If the calculated display attribute value differs from the recorded display attribute value, the calculated display attribute value is written to the user_data field of the iterated option. Then, the electronic device runs lv_scr_page_refresh to refresh the page.
[0133] (2) The detection module detects a configuration change and triggers a page refresh.
[0134] The BIOS Setup interface configures switch options, which have two values: enable (1) and disable (0). For options associated with a switch option, the electronic device adds a control expression to that option, such as `suppressifideqval gUsbSupport == 0`.
[0135] When a user changes the value of a toggle option from 0 to 1, or vice versa, the detection module detects the configuration change and generates an LV_EVENT_VALUE_CHANGED event. In response to the LV_EVENT_VALUE_CHANGED event, the electronic device iterates through each option on the current page. Based on the control expression of the iterated option and the current value of the toggle option (e.g., 1 or 0), it calculates the display attribute value of the iterated option. If the calculated display attribute value differs from the recorded display attribute value, the calculated display attribute value is written to the user_data field of the iterated option. The electronic device then runs lv_scr_page_refresh to refresh the page.
[0136] (3) Implement the page refresh library function in the LVGL library.
[0137] The electronic device runs the page refresh library function to perform a page refresh. The specific process is as follows.
[0138] 1) The page refresh library function creates an empty screen object null_scr (as in the second page) and calls the screen object loading function lv_scr_load to load null_scr into the BIOS Setup interface.
[0139] 2) The page refresh library function repeatedly calls the child object lv_obj_get_child function to traverse all components (i.e., options) in the current screen object scr (such as the first page). Based on the user_data field in the corresponding lv_obj_t of the component, the display attributes of the option are set, such as show, hide or gray out.
[0140] For example, if the value of the `user_data` field in `lv_obj_t` indicates that the display attribute is hidden, then the page refresh library function calls the LVGL-provided library function `lv_obj_add_flag` to add the `LV_OBJ_FLAG_HIDDEN` flag to the component. Similarly, if the value of the `user_data` field in `lv_obj_t` indicates that the display attribute is visible, then the page refresh library function calls the LVGL-provided library function `lv_obj_clear_flag` to clear the `LV_OBJ_FLAG_HIDDEN` flag.
[0141] For example, if the value of the `user_data` field in `lv_obj_t` indicates that the display attribute is grayed out, then the page refresh library function calls the LVGL library function `lv_obj_add_style` to set the component's opacity to 50%, and calls the LVGL library function `lv_obj_add_state` to set it to the disabled state `LV_STATE_DISABLED`. Similarly, if the value of the `user_data` field in `lv_obj_t` indicates that the display attribute is displayed, then the page refresh library function calls the LVGL library function `lv_obj_add_style` to set the component's opacity to 0%, and calls the LVGL library function `lv_obj_add_state` to set it to `LV_STATE_ENABLED`.
[0142] 3) The page refresh library function calls lv_scr_load to load the current screen object scr;
[0143] 4) The page refresh library function deletes the empty screen object null_scr.
[0144] In this embodiment, a page refresh function `lv_scr_page_refresh` is added to the LVGL library, enriching the library functions for LVGL page management. Furthermore, display control functionality is implemented on the BIOS Setup interface developed based on LVGL, optimizing user experience and improving system configuration security. A more intelligent user interface is provided through dynamically showing, hiding, and graying out options. Additionally, detection modules are set up to detect external changes affecting the BIOS Setup page control display; upon detecting a change, only the current page is refreshed, saving CPU resources.
[0145] Corresponding to the above-described interface display control method, this application also provides an interface display control device, such as... Figure 4 As shown, this device is applied to electronic devices, and the first page is displayed on the BIOS setup interface of the electronic device. The device includes:
[0146] The first loading module 401 is used to load the second page into the BIOS setup interface so that the first page is in an editable state.
[0147] The first setting module 402 is used to set the display attributes of each option on the first page according to the display attribute value of each option on the first page;
[0148] The second loading module 403 is used to load the configured first page into the BIOS setup interface.
[0149] In some embodiments, the interface display control device may further include:
[0150] Create a module to create an empty screen object as the second page before loading the second page into the BIOS setup interface;
[0151] The delete module is used to delete the second page after the first page of settings has been loaded into the BIOS setup interface.
[0152] In some embodiments, the interface display control device may further include a detection module for:
[0153] Before loading the second page to the BIOS setup interface, check the default options associated with the BIOS setup interface;
[0154] When a change in the value of a preset option is detected, the first display attribute value of each option on the first page is determined based on the control expression of each option on the first page and the current value of the preset option. The control expression of each option indicates the value of the preset option when the preset display attribute is set.
[0155] If the first display attribute value and the second display attribute value of each option on the first page are different, then the second display attribute value of each option on the first page is updated to the first display attribute value, triggering the first loading module. The second display attribute value is the display attribute value of each option on the first page that has been recorded.
[0156] In some embodiments, preset options include at least one of permission options and toggle options; preset display attributes include at least one of hidden and grayed-out.
[0157] In some embodiments, the preset options include permission options; the interface display control device may further include:
[0158] The acquisition module is used to obtain the user permission information to be verified.
[0159] The verification module is used to verify user permission information;
[0160] The second settings module is used to set the value of the permission option to the permission value associated with the user permission information after the user permission information has been verified.
[0161] In some embodiments, the first setting module 402 is specifically used for:
[0162] Iterate through each option on the first page;
[0163] If the display attribute value of the traversed option is a value indicating that it is hidden, then set the hidden flag for the traversed option; if the display attribute value of the traversed option is a value indicating that it is displayed, and the display attribute of the traversed option is hidden, then delete the hidden flag of the traversed option.
[0164] If the display attribute value of the traversed option is a value indicating graying out, then the transparency of the traversed option is set to the preset transparency, and the status of the traversed option is set to disabled. The preset transparency is greater than the minimum transparency and less than the maximum transparency. If the display attribute value of the traversed option is a value indicating display, and the display attribute of the traversed option is grayed out, then the transparency of the traversed option is set to the minimum transparency, and the status of the traversed option is set to enabled.
[0165] In the technical solution provided in this application embodiment, when the first page is displayed on the BIOS settings interface, the electronic device loads the second page onto the BIOS settings interface. Then, the electronic device can modify the display attributes of each option on the first page, such as changing whether each option is displayed, hidden, or grayed out. After setting each option on the first page, the electronic device loads the modified first page onto the BIOS settings interface, causing the BIOS settings interface to redisplay the first page, thus refreshing the first page. In this application embodiment, when the display attributes of the options on the first page change, only the first page needs to be recreated. Furthermore, when recreating the first page, only one additional second page needs to be created, reducing the number of pages created during page refresh. The electronic device does not need to store many pages, saving CPU resources and memory space.
[0166] This application also provides an electronic device, such as... Figure 5 As shown, it includes a processor 501 and a machine-readable storage medium 502, the machine-readable storage medium 502 storing machine-executable instructions that can be executed by the processor 501, the processor 501 being prompted by the machine-executable instructions to implement any of the above-described interface display control methods.
[0167] Machine-readable storage media may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the machine-readable storage medium may also be at least one storage device located remotely from the aforementioned processor.
[0168] The 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.
[0169] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements any of the above-described interface display control methods.
[0170] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the above-described interface display control methods.
[0171] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0172] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0173] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, storage media, and program products are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0174] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method for controlling interface display, characterized in that, Applied to an electronic device, wherein a first page is displayed on the BIOS setup interface of the electronic device, the method includes: Load the second page into the BIOS setup interface so that the first page is editable and the second page is an empty screen object, or the second page is a non-empty screen object; Set the display attributes of each option on the first page according to the display attribute value of each option on the first page; The first page after settings will load into the BIOS setup interface.
2. The method according to claim 1, characterized in that, The method further includes: Before loading the second page into the BIOS setup interface, create an empty screen object as the second page; After loading the first page with the settings into the BIOS setup interface, delete the second page.
3. The method according to claim 1, characterized in that, Before loading the second page into the BIOS setup interface, the method further includes: Detect the default options associated with the BIOS setup interface; When a change in the value of the preset option is detected, the first display attribute value of each option in the first page is determined according to the control expression of each option in the first page and the current value of the preset option. The control expression of each option indicates the value of the preset option when the preset display attribute is set. If the first display attribute value and the second display attribute value of each option in the first page are different, then the second display attribute value of each option in the first page is updated to the first display attribute value, and the step of loading the second page to the BIOS settings interface is executed, wherein the second display attribute value is the recorded display attribute value of each option in the first page.
4. The method according to claim 3, characterized in that, The preset options include at least one of permission options and toggle options; the preset display attributes include at least one of hidden and grayed-out.
5. The method according to claim 3, characterized in that, The preset options include permission options; The method further includes: Retrieve user permission information to be verified; Verify the user permission information; Once the user permission information is verified, the value of the permission option is set to the permission value associated with the user permission information.
6. The method according to any one of claims 1-5, characterized in that, The step of setting the display attribute of each option on the first page according to the display attribute value of each option on the first page includes: Iterate through each option on the first page; If the display attribute value of the traversed option is a value indicating that it is hidden, then set the hidden flag for the traversed option; if the display attribute value of the traversed option is a value indicating that it is displayed, and the display attribute of the traversed option is hidden, then delete the hidden flag of the traversed option. If the display attribute value of the traversed option is a value indicating graying out, then the transparency of the traversed option is set to the preset transparency, and the state of the traversed option is set to disabled. The preset transparency is greater than the minimum transparency and less than the maximum transparency. If the display attribute value of the traversed option is a value indicating display, and the display attribute of the traversed option is grayed out, then the transparency of the traversed option is set to the minimum transparency, and the state of the traversed option is set to enabled.
7. An interface display control device, characterized in that, Applied to an electronic device, wherein the BIOS setup interface of the electronic device displays a first page, the device includes: The first loading module is used to load the second page into the BIOS settings interface so that the first page is in an editable state, and the second page is an empty screen object, or the second page is a non-empty screen object; The first setting module is used to set the display attribute of each option on the first page according to the display attribute value of each option on the first page; The second loading module is used to load the first page after settings into the BIOS setup interface.
8. The apparatus according to claim 7, characterized in that, The device further includes: A module is created to create an empty screen object as the second page before loading the second page into the BIOS setup interface; The delete module is used to delete the second page after the first page of settings has been loaded into the BIOS setup interface.
9. The apparatus according to claim 7, characterized in that, The device further includes a detection module for: Before loading the second page to the BIOS setup interface, check the default options associated with the BIOS setup interface; When a change in the value of the preset option is detected, the first display attribute value of each option in the first page is determined according to the control expression of each option in the first page and the current value of the preset option. The control expression of each option indicates the value of the preset option when the preset display attribute is set. If the first display attribute value and the second display attribute value of each option on the first page are different, then the second display attribute value of each option on the first page is updated to the first display attribute value, triggering the first loading module. The second display attribute value is the recorded display attribute value of each option on the first page.
10. The apparatus according to claim 9, characterized in that, The preset options include at least one of permission options and toggle options; the preset display attributes include at least one of hidden and grayed-out.
11. The apparatus according to claim 9, characterized in that, The preset options include permission options; the device further includes: The acquisition module is used to obtain the user permission information to be verified. The verification module is used to verify the user permission information; The second setting module is used to set the value of the permission option to the permission value associated with the user permission information after the user permission information has been verified.
12. The apparatus according to any one of claims 7-11, characterized in that, The first setting module is specifically used for: Iterate through each option on the first page; If the display attribute value of the traversed option is a value indicating that it is hidden, then set the hidden flag for the traversed option; If the display attribute of the traversed option is the value that indicates it to be displayed, and the display attribute of the traversed option is hidden, then remove the hidden flag of the traversed option. If the display attribute value of the traversed option is a value indicating graying out, then the transparency of the traversed option is set to the preset transparency, and the state of the traversed option is set to disabled. The preset transparency is greater than the minimum transparency and less than the maximum transparency. If the display attribute value of the traversed option is a value indicating display, and the display attribute of the traversed option is grayed out, then the transparency of the traversed option is set to the minimum transparency, and the state of the traversed option is set to enabled.
13. An electronic device, characterized in that, The method includes a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the processor being prompted by the machine-executable instructions to perform the steps of the method according to any one of claims 1-6.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-6.
Citation Information
Patent Citations
Page generation method and device and storage medium
CN108228766A
Page loading method and device, equipment, medium and program product
CN115048596A