Interface display control method and device, electronic equipment and storage medium
By loading the second page on the BIOS setting interface and setting option attributes, the problem of CPU resource and memory waste caused by option changes in the prior art is solved, and efficient interface refresh and resource conservation are achieved.
Patent Information
- Application Number
- CN202510350608.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2045-03-24
AI Technical Summary
In the prior art, when the hidden or graying conditions of options in the BIOS Setup interface change, multiple pages need to be recreated, resulting in large CPU resources consumption and waste of memory space.
By loading the second page to the BIOS setting interface, the first page is in an editable state, and setting its properties according to the display attribute value of the option, just recreate one second page to refresh the interface.
Reduces the number of pages created when page refreshes, saves CPU resources and memory space, and improves the efficiency of interface display.
Smart Images

Figure CN120234079A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to an interface display control method, apparatus, electronic device, and storage medium. Background Art
[0002] In order to optimize the user experience and improve the security of system configuration, when developing a Basic Input Output System (BIOS) Setup interface based on the Light and Versatile Graphics Library (LVGL), an electronic device executes an interface display control solution to provide a more intelligent user interface by dynamically displaying, hiding, and graying out options in the BIOS Setup interface.
[0003] The current interface display control solution is as follows: The BIOS Setup interface includes multiple pages. The electronic device pre-creates all the pages included in the BIOS Setup interface. When the conditions for hiding or graying out an option change, the options whose conditions have changed may be scattered across multiple pages, which requires re-creating these multiple pages.
[0004] Since all the pages included in the BIOS Setup interface are pre-created and multiple pages need to be re-created when the conditions for hiding or graying out an option change, this consumes a large amount of Central Processing Unit (CPU) resources and causes waste of memory space. Summary of the Invention
[0005] The purpose of the embodiments of this application is to provide an interface display control method, apparatus, electronic device, and storage medium to save CPU resources and memory space. The specific technical solutions are as follows:
[0006] In a first aspect, the embodiments of this application provide an interface display control method applied to an electronic device. A first page is displayed on the BIOS setup interface of the electronic device. The method includes:
[0007] Loading a second page onto the BIOS setup interface to make the first page in an editable state;
[0008] Setting the display attributes of each option in the first page according to the display attribute values of each option in the first page;
[0009] Loading the first page with the settings onto 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 settings into the BIOS setup interface, delete the second page.
[0013] In some embodiments, before loading the second page into the BIOS setup interface, the method further includes:
[0014] Detect a preset option associated with the BIOS setup interface;
[0015] When it is detected that the value of the preset option changes, according to the control expression of each option in the first page and the current value of the preset option, determine the first display attribute value of each option in the first page, where the control expression of each option indicates the value of the preset option when the setting of each option is the preset display attribute;
[0016] If the first display attribute value of each option in the first page is different from the second display attribute value, update the second display attribute value of each option in the first page to the first display attribute value, and perform the step of loading the second page into the BIOS setup interface, where the second display attribute value is the recorded display attribute value of each option in the first page.
[0017] In some embodiments, the preset option includes at least one of a permission option and a switch-type option; the preset display attribute includes at least one of hidden and grayed out.
[0018] In some embodiments, the preset option includes a permission option; the method further includes:
[0019] Obtain user permission information to be verified;
[0020] Verify the user permission information;
[0021] After the user permission information is verified, set the value of the permission option 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] Traverse each option in the first page;
[0024] If the display attribute value of the option traversed is a value indicating hiding, set a hiding flag for the traversed option; if the display attribute value of the traversed option is a value indicating display and the display attribute of the traversed option is hiding, remove the hiding flag of the traversed option.
[0025] If the display attribute value of the option traversed is a value indicating graying out, set the transparency of the traversed option to a preset transparency and set the state of the traversed option to a disabled state, where 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 graying out, set the transparency of the traversed option to the minimum transparency and set the state of the traversed option to an enabled state.
[0026] In a second aspect, an embodiment of the present application provides an interface display control device applied to an electronic device. A first page is displayed on the BIOS setup interface of the electronic device. The device includes:
[0027] A first loading module, configured to load a second page onto the BIOS setup interface to make the first page in an editable state;
[0028] A first setting module, configured to set the display attributes of each option in the first page according to the display attribute values of each option in the first page;
[0029] A second loading module, configured to load the set first page onto the BIOS setup interface.
[0030] In some embodiments, the device further includes:
[0031] A creation module, configured to create an empty screen object as the second page before loading the second page onto the BIOS setup interface;
[0032] A deletion module, configured to delete the second page after loading the set first page onto the BIOS setup interface.
[0033] In some embodiments, the device further includes a detection module, configured to:
[0034] Before loading the second page onto the BIOS setup interface, detect preset options associated with the BIOS setup interface;
[0035] When detecting a change in the value of the preset option, determine the first display attribute value of each option in the first page according to the control expression of each option in the first page and the current value of the preset option, where the control expression of each option indicates the value of the preset option when each option is set to a preset display attribute.
[0036] If the first display attribute value of each option in the first page is different from the second display attribute value, update the second display attribute value of each option in the first page to the first display attribute value, and trigger the first loading module, where the second display attribute value is the recorded display attribute value of each option in the first page.
[0037] In some embodiments, the preset options include at least one of a permission option and a switch-type option; the preset display attributes include at least one of hidden and grayed out.
[0038] In some embodiments, the preset option includes a permission option; the apparatus further includes:
[0039] An obtaining module, configured to obtain user permission information to be verified;
[0040] A verification module, configured to verify the user permission information;
[0041] A second setting module, configured to, after the user permission information is verified, set the value of the permission option to the permission value associated with the user permission information.
[0042] In some embodiments, the first setting module is specifically configured to:
[0043] Traverse each option in the first page;
[0044] If the display attribute value of the traversed option is a value indicating hidden, set a hidden flag for the traversed option; if the display attribute value of the traversed option is a value indicating display and the display attribute of the traversed option is hidden, delete the hidden flag of the traversed option;
[0045] If the display attribute value of the traversed option is a value indicating grayed out, set the transparency of the traversed option to a preset transparency and set the state of the traversed option to a disabled state, where 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, set the transparency of the traversed option to the minimum transparency and set the state of the traversed option to an enabled state.
[0046] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement any method provided in the first aspect.
[0047] Fourthly, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, any method provided in the first aspect is implemented.
[0048] Fifthly, an embodiment of the present application further provides a computer program product containing instructions, which when running on a computer, enables the computer to execute any method provided in the first aspect.
[0049] Advantages of the embodiments of the present application:
[0050] In the technical solution provided by the embodiment of the present application, when the first page is displayed on the BIOS setup interface, the electronic device loads the second page to the BIOS setup interface. After that, the electronic device can modify the display attributes of each option in the first page, such as modifying each option to be displayed, hidden, or grayed out, etc. After setting each option in the first page, the electronic device loads the set first page to the BIOS setup interface, so that the BIOS setup interface redisplay the first page, realizing the refresh of the first page. In the embodiment of the present application, when the display attribute of the option in the first page changes, only the first page needs to be recreated, and when recreating the first page, only one more second page needs to be created, reducing the number of pages created during page refresh. The electronic device does not need to store a lot of pages, saving CPU resources and memory space.
[0051] Of course, implementing any product or method of the present application does not necessarily require achieving all the above-mentioned advantages simultaneously. Description of the Drawings
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following-described drawings are only some embodiments of the present application, and those of ordinary skill in the art can also obtain other embodiments based on these drawings.
[0053] Figure 1 It is the first flowchart of the interface display control method provided by the embodiment of the present application;
[0054] Figure 2 It is the second flowchart of the interface display control method provided by the embodiment of the present application;
[0055] Figure 3 It is the third flowchart of the interface display control method provided by the embodiment of the present application;
[0056] Figure 4 It is a structural schematic diagram of the interface display control device provided by the embodiment of the present application;
[0057] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0059] The Basic Input Output System (BIOS) is a set of programs that are fixed on a Read-Only Memory (ROM) chip on the computer motherboard, such as the most important basic input and output programs of the computer, the self-test program after powering on, and the system self-starting program. BIOS can read and write specific information of system settings from the Complementary Metal Oxide Semiconductor (CMOS). The main function of BIOS is to provide the lowest-level and most direct hardware settings and control for the computer.
[0060] The BIOS Setup interface is a user interface provided by the firmware program embedded on the computer motherboard, which is used to manage and configure the computer's hardware settings. The BIOS Setup interface can be entered by pressing a specific key combination (such as the Delete key, the Esc key, etc.) when the computer is started. The appearance of the BIOS Setup interface can be a text-based menu structure or a modern graphical interface that displays various setting options in the form of graphics or text.
[0061] Light and Versatile Graphics Library (LVGL) is a new graphical user interface (GUI) system framework. LVGL has the advantages of small code size and easy user interface development. As an open source embedded graphics library, LVGL is known for its lightweight, feature-rich, flexible, and portable features, which can help developers quickly and easily create beautiful and feature-rich graphical user interfaces.
[0062] The display controls on the BIOS Setup interface are usually as follows:
[0063] Hide: The BIOS Setup interface dynamically displays or hides related options based on system status or configuration changes.
[0064] For example, a certain feature function includes a series of options. For the relevant options of this feature function, the control provides a toggle option, and this toggle option includes two option values: disabled and enabled. When the user selects the value of the toggle option as disabled, the control hides the relevant options of this feature function; when the user selects the value of the toggle option as enabled, the control displays the relevant options of this feature function. The hiding of relevant options helps to simplify the user interface and improve system security, enabling the user to only see the options related to the current system configuration.
[0065] Graying out: The options in the BIOS Setup interface are grayed out, indicating that the option is currently not configurable or selectable.
[0066] For example, some advanced options require specific permissions or authorizations to be configured. In this case, these advanced options may be grayed out to indicate that the user needs specific permissions or authorizations to configure them.
[0067] To optimize the user experience and improve the security of system configuration, when developing the BIOS Setup interface based on LVGL, the electronic device executes an interface display control scheme to provide a more intelligent user interface by dynamically displaying, hiding, and graying out the options in the BIOS Setup interface.
[0068] The current interface display control scheme is as follows: The BIOS Setup interface includes multiple pages. The electronic device pre-creates all the pages included in the BIOS Setup interface. When the conditions for hiding or graying out the options change, the options whose conditions have changed may be scattered across multiple pages, which requires re-creating these multiple pages.
[0069] For example, when the management permission of the electronic device changes from the ordinary user permission to the advanced user permission, since the advanced user has full access to all options, the options that were hidden or grayed out need to be displayed normally, that is, those hidden or grayed out options need to be displayed and configurable or selectable. And these hidden or grayed out options are scattered across various pages. Therefore, when the management permission changes, many pages need to be re-created.
[0070] Since all the pages included in the BIOS Setup interface are pre-created and multiple pages need to be re-created when the conditions for hiding or graying out the options change, this requires a large amount of CPU resources and causes waste of memory space.
[0071] To solve the above problems, the embodiments of the present application provide an interface display control method, as Figure 1 shown, applied to an electronic device, on which a first page is displayed in the BIOS setup interface of the electronic device, and the method includes:
[0072] Step S101: Load the second page to the BIOS setup interface to make the first page editable.
[0073] Step S102: Set the display attributes of each option in the first page according to the display attribute values of each option in the first page.
[0074] Step S103: Load the set first page to the BIOS setup interface.
[0075] In the technical solution provided by the embodiment of the present application, when the first page is displayed on the BIOS setup interface, the electronic device loads the second page to the BIOS setup interface. After that, the electronic device can modify the display attributes of each option in the first page, such as modifying each option to be displayed, hidden, or grayed out, etc. After setting each option of the first page, the electronic device loads the set first page to the BIOS setup interface, so that the BIOS setup interface redisplay the first page, realizing the refresh of the first page. In the embodiment of the present application, when the display attribute of the option in the first page changes, only the first page needs to be recreated, and when recreating the first page, only one more second page needs to be created, reducing the number of pages created during page refresh. The electronic device does not need to store a lot of pages, saving CPU resources and memory space.
[0076] In the embodiment of the present application, the electronic device can be a personal computer (PC), a server, or other devices supporting the BIOS setup interface. The BIOS setup interface can be a BIOS Setup interface developed based on LVGL, or other types of BIOS setup interfaces, which are not limited herein.
[0077] The first page is the page currently displayed on the BIOS setup interface. The first page can include one or more options, and the display attributes of these options include being displayed, hidden, or grayed out, etc.
[0078] In the above step S101, 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 (that is, the second page does not include options), or a non-empty screen object (that is, the second page includes options).
[0079] In the embodiments of the present application, the page currently displayed in the BIOS setup interface (such as the above-mentioned first page) is not editable. When it is necessary to refresh the first page, the electronic device can obtain the second page and load the second page into the BIOS setup interface. At this time, the BIOS setup interface displays the second page, and the first page is not displayed on the BIOS setup interface. The first page switches from the non-editable state to the 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 the above step S102, the display attribute value of the option is the value indicating the display attribute of the option. In the embodiments of the present application, the option is used as a basic object, and the 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, the electronic device can edit the first page and set the display attributes of each option in the first page. For example, it can traverse each option in the first page; read the display attribute value of the traversed option, and set the display attribute of the traversed option according to the display attribute value.
[0082] For example, the display attribute value 1 indicates that the display attribute of the option is display, the display attribute value 2 indicates that the display attribute of the option is hidden, and the display attribute value 3 indicates that the display attribute of the option is grayed out. Page 1 includes Option 1 to Option 3. The electronic device traverses Option 1 to Option 3. When traversing Option 1, the display attribute value of Option 1 is 1, so the display attribute of Option 1 is set to display, and at this time the user can configure or select Option 1; continue to traverse the options. When traversing Option 2, the display attribute value of Option 2 is 2, so the display attribute of Option 2 is set to hidden, and at this time Option 2 is not displayed on Page 1; continue to traverse the options. When traversing Option 3, the display attribute value of Option 3 is 3, so the display attribute of Option 3 is set to grayed out, and at this time Option 3 is displayed on Page 1, but the user cannot configure or select Option 3.
[0083] In some embodiments, the above step S102 may be: traverse each option in the first page; if the display attribute value of the traversed option is the value indicating hidden, set a hidden flag for the traversed option; if the display attribute value of the traversed option is the value indicating display and the display attribute of the traversed option is hidden, delete the hidden flag of the traversed option.
[0084] When the BIOS setup interface is the BIOS Setup interface developed based on LVGL, if the display attribute value of the traversed option indicates a hidden value, the electronic device can call the library function lv_obj_add_flag provided by LVGL to add a hidden flag (such as the LV_OBJ_FLAG_HIDDEN flag) to the traversed option to hide the traversed option. Similarly, if the display attribute value of the traversed option indicates a display value and the display attribute of the traversed option is hidden, the electronic device can call the library function lv_obj_clear_flag provided by LVGL to clear the LV_OBJ_FLAG_HIDDEN flag and realize the normal display of the traversed option.
[0085] In some embodiments, the above step S102 may be: traverse each option in the first page; if the display attribute value of the traversed option indicates a grayed-out value, set the transparency of the traversed option to a preset transparency and set the state of the traversed option to a disabled state, where the preset transparency is greater than the minimum transparency and less than the maximum transparency; if the display attribute value of the traversed option indicates a display value and the display attribute of the traversed option is grayed out, set the transparency of the traversed option to the minimum transparency and set the state of the traversed option to an enabled state.
[0086] In the embodiments of the present application, 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 may be 50%, 60%, etc.
[0087] Taking the preset transparency of 50% as an example. When the BIOS setup interface is the BIOS Setup interface developed based on LVGL, if the display attribute value of the traversed option indicates a grayed-out value, the electronic device can call the library function lv_obj_add_style provided by LVGL to set the transparency of the traversed option to 50% and call the library function lv_obj_add_state provided by LVGL to set it to a disabled state (such as LV_STATE_DISABLED). If the display attribute value of the traversed option indicates a display value and the display attribute of the traversed option is grayed out, the electronic device can call the library function lv_obj_add_style provided by LVGL to set the transparency of the traversed option to 0 and call the library function lv_obj_add_state provided by LVGL to set it to an enabled state (such as LV_STATE_ENABLED).
[0088] When all options in the first page are traversed and completed, the electronic device executes step S103 to load the set first page into the BIOS setup interface. The set first page is the recreated page. At this time, the BIOS setup interface displays the recreated first page.
[0089] In some embodiments, to further save memory space, as Figure 2 shown, there is also provided an interface display control method applied to an electronic device. The first page is displayed on the BIOS setup interface of the electronic device. 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 to make the first page in an editable state;
[0092] Step S203, set the display attributes of each option in the first page according to the display attribute values of each option in the first page;
[0093] Step S204, load the set first page into the BIOS setup interface;
[0094] Step S205, delete the second page.
[0095] The above steps S202 to S204 are the same as the above steps S101 to S103.
[0096] In the embodiments of the present application, when refreshing the first page, the electronic device creates an empty screen object (null_scr) as the second page to replace the first page and display it in the BIOS setup interface. After the recreated first page is loaded into the BIOS setup interface, the second page is deleted to complete the refresh of the first page. Throughout the process, the electronic device only needs to create an empty screen object. Since it is an empty screen object, the creation efficiency is relatively high, and the electronic device can quickly start editing the first page. In addition, only during the process of refreshing the first page, the second page is stored in the electronic device. After the refresh of the first page is completed, the electronic device will delete the second page, that is, only one page, namely the first page, is stored in the electronic device, further saving the memory space of the electronic device.
[0097] To refresh the page in a timely and accurate manner, in some embodiments, as Figure 3 shown, there is also provided an interface display control method applied to an electronic device. The first page is displayed on the BIOS setup interface of the electronic device. The method may include the following steps:
[0098] Step S301, detect the preset options associated with the BIOS setup interface;
[0099] In the embodiments of the present application, the electronic device pre-sets options for adjusting display attributes, i.e., preset options. The preset options are associated with the options in the page. For ease of understanding, the options in the page associated with the preset options are simply referred to as associated options. The preset options may include at least one of permission options and switch-type options. The preset options may also include other options, which are not limited herein.
[0100] Among them, the value of the permission option indicates the user permission of the electronic device. The user permission of the electronic device may include general permission (GENERAL_AUTHORITY) and advanced permission (ADVANCED_AUTHORITY), and may also include other permissions, which are not limited herein. Users with general permissions can usually only access basic setting options, such as date and time settings, startup order, etc. Users with advanced permissions can access more setting options, including CPU frequency, memory settings, hard disk parameters, security options, etc. By differentiating user permissions, system security can be ensured, and it can be avoided that users with general permissions incorrectly change important settings.
[0101] Taking the user permission including general permission and advanced permission 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 general permission; when the value of the permission option is 1, it indicates that the user permission is advanced permission. In the embodiments of the present application, the electronic device can default the user permission to general permission or default the user permission to advanced permission.
[0102] The value of the switch-type option indicates the function state. The function state may include enabled (Enabled) or disabled (Disabled), and may also include other function states, which are not limited herein.
[0103] Taking the function state including enabled or disabled as an example. The value of the switch-type option can be 0 or 1. When the value of the switch-type option is 0, it indicates that the function state is disabled; when the value of the permission option is 1, it indicates that the user permission is enabled. In the embodiments of the present application, the electronic device can default the function state to disabled or default the function state to enabled.
[0104] In the embodiments of the present application, the electronic device can detect each preset option in real time, so as to trigger page refresh in time and adjust the display attributes of the associated options.
[0105] Step S302, when it is detected that the value of the preset option changes, determine the first display attribute value of each option in the first page according to the control expression of each option in the first page and the current value of the preset option. Among them, the control expression of each option indicates the value of the preset option when each option is set to the preset display attribute;
[0106] In the embodiments of the present application, the preset display attribute may include at least one of hiding and graying out. The preset display attribute may also include display attributes such as display (i.e., normal display), and the like, which are not limited herein. The control expression of an associated option is the condition for setting the associated option to the preset display attribute. An associated option may include one or more control expressions.
[0107] For example, the electronic device defines the values of the permission options. For example, the value of the general permission (GENERAL_AUTHORITY) is 0, and the value of the advanced permission (ADVANCED_AUTHORITY) is 1. The electronic device creates a variable of the permission option, which is named gAuthority, and the initial value of gAuthority is 0, that is, the user permission is defaulted to GENERAL_AUTHORITY.
[0108] The control expression of the associated option 1 can be suppressif ideqval gAuthority == 0. This control expression indicates that the condition for setting the display attribute of the associated option 1 to hidden is that the value of the permission option is 0. When the value of the permission option is 0, the display attribute of the associated option 1 is set to hidden. When the value of the permission option is 1, the display attribute of the associated option 1 is set to display.
[0109] The control expression of the associated option 1 can also be grayoutif ideqval gAuthority == 0. This control expression indicates that the condition for setting the display attribute of the associated option 1 to grayscale is that the value of the permission option is 0. When the value of the permission option is 0, the display attribute of the associated option 1 is set to grayscale. When the value of the permission option is 1, the display attribute of the associated option 1 is set to display.
[0110] For another example, the electronic device defines the values of the switch-type options. For example, the value of enabled (Enabled) is 1, and the value of disabled (Disabled) is 0. The electronic device creates a variable of the switch-type option, which is named gUsbSupport, and the initial value of gUsbSupport is 0, that is, the function status is defaulted to Disabled.
[0111] The control expression of the associated option 1 can be suppressif ideqval gUsbSupport == 0. This control expression indicates that the condition for setting the display attribute of the associated option 1 to hidden is that the value of the switch-type option is 0. When the value of the switch-type option is 0, the display attribute of the associated option 1 is set to hidden. When the value of the switch-type option is 1, the display attribute of the associated option 1 is set to display.
[0112] The control expression for associated option 1 can also be "grayout if ideqval gUsbSupport == 0". This control expression means that the condition for setting the display attribute of associated option 1 to be grayed out is that the value of the switch option is 0. When the value of the switch option is 0, the display attribute of associated option 1 is set to be grayed out. When the value of the switch option is 1, the display attribute of associated option 1 is set to be displayed.
[0113] In an embodiment of this 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; according to the control expression of the traversed option and the current value of the preset option, it calculates the display attribute value of the traversed option, that is, the first display attribute value.
[0114] For example, there are three control expressions for associated option 1. One control expression is "suppress if ideqvalgAuthority == 0", and another control expression is "suppress if ideqval gUsbSupport == 0". If the value of the permission option is 0, the value of the switch option is 0, or, the value of the permission option is 1, the value of the switch option is 0, or, the value of the permission option is 0, the value of the switch option is 1, then the electronic device can calculate that the display attribute value of associated option 1 is 0, and the display attribute value 0 represents the hidden attribute. If the value of the permission option is 1 and the value of the switch option is 1, then the electronic device can calculate that the display attribute value of associated option 1 is 1, and the display attribute value 1 represents the displayed attribute.
[0115] Step S303, if the first display attribute value of each option in the first page is different from the second display attribute value, then update the second display attribute value of each option in the first page to the first display attribute value. Among them, the second display attribute value is the recorded display attribute value of each option in the first page;
[0116] In an embodiment of this application, the electronic device records the display attribute value (such as the second display attribute value) of each option in the first page. For example, the user_data field of each option in the first page in the electronic device records the second display attribute value.
[0117] When obtaining the first display attribute value of each option in the first page, for each option in the first page, the electronic device compares the first display attribute value of the option with the second display attribute value. If the first display attribute value of the option is different from the second display attribute value, the electronic device updates the second display attribute value of the option to the first display attribute value, such as writing the first display attribute value into the user_data field of the option. Further, the electronic device performs a page refresh and executes step S304.
[0118] In the embodiments of the present application, the first page includes multiple options. As long as the first display attribute value of one of the options is different from the second display attribute value, the electronic device performs a page refresh and executes step S304. If the first display attribute value of each option in the first page is the same as the second display attribute value, this processing operation is ended and the page refresh operation is ended.
[0119] Step S304: Load the second page into the BIOS setup interface to make the first page in an editable state;
[0120] Step S305: Set the display attributes of each option in the first page according to the display attribute values of each option in the first page;
[0121] Step S306: Load the set first page into the BIOS setup interface.
[0122] The above steps S304 to S306 are the same as the above steps S101 to S103.
[0123] In the embodiments of the present application, the electronic device detects external changes that affect the display of the BIOS setup page. After detecting the changes, the electronic device can update the display attribute values in a timely manner, and then refresh the page in a timely and accurate manner, improving the efficiency of page refresh. In addition, after detecting the changes, the electronic device only triggers the refresh of the current first page, reducing the number of refreshed pages and saving CPU resources.
[0124] In some embodiments, the preset option includes a permission option. In this case, the value of the permission option can be updated in the following manner: obtain the user permission information to be verified; verify the user permission information; when the user permission information is verified to be passed, set the value of the permission option to the permission value associated with the user permission information.
[0125] Among them, the user permission information may include a username, a password, etc. The user can input the user permission information into the electronic device. Then, the electronic device verifies the user permission information. When the verification of the user permission information is passed, such as the username and password are correct, the electronic device sets the value of the permission option to the permission value associated with the user permission information. For example, if the value of the advanced permission associated with the user permission information is 1, then when the verification of the user permission information is passed, the electronic device sets the value of the permission option to 1.
[0126] In the embodiment of the present 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 clicks the shortcut key for permission switching, the electronic device sets the value of the permission option to the user permission specified by the shortcut key.
[0127] Next, for the BIOS Setup interface developed based on LVGL, the interface display control method provided in the embodiment of the present application will be described in detail.
[0128] In the embodiment of the present 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 expressed as lv_scr_page_refresh(lv_obj_t*scr).
[0129] A detection module is also set in the electronic device. This detection module is used to detect the changes that affect the display of the current page, so as to trigger the call of lv_scr_page_refresh to refresh the page.
[0130] (1) The detection module detects a permission change and triggers a page refresh.
[0131] The BIOS Setup interface has two different permission levels for users with ordinary permissions and users with advanced permissions. The value of the ordinary permission (GENERAL_AUTHORITY) is 0, and the value of the advanced permission (ADVANCED_AUTHORITY) is 1. For the options that can be set by users with advanced permissions, the electronic device adds a control expression to this option, such as suppressif ideqvalgAuthority == 0.
[0132] The default user permission of the electronic device is the normal permission. When the user enters the correct user password for the advanced permission, the electronic device adjusts the user permission to the advanced permission. The detection module can detect the change of the user permission and then generate the LV_EVENT_VALUE_CHANGED event. In response to the LV_EVENT_VALUE_CHANGED event, the electronic device traverses each option in the current page; according to the control expression of the traversed option and the current value of the permission option (i.e., the advanced permission value 1), it calculates the display attribute value of the traversed option. If the calculated display attribute value is different from the recorded display attribute value, it writes the calculated display attribute value into the user_data field of the traversed option. Then the electronic device runs lv_scr_page_refresh to refresh the page.
[0133] (2) The detection module detects the configuration change and triggers the page refresh.
[0134] The BIOS Setup interface configures the switch-type option, and the values of the switch-type option are two option values: enable (1) and disable (0). For the option associated with the switch-type option, the electronic device adds a control expression to this option, such as suppressifideqval gUsbSupport == 0.
[0135] When the user sets the value of the switch-type option from 0 to 1, or when the user sets the value of the switch-type option from 1 to 0, the detection module can detect the configuration change and then generate the LV_EVENT_VALUE_CHANGED event. In response to the LV_EVENT_VALUE_CHANGED event, the electronic device traverses each option in the current page; according to the control expression of the traversed option and the current value of the switch-type option (such as value 1 or 0), it calculates the display attribute value of the traversed option. If the calculated display attribute value is different from the recorded display attribute value, it writes the calculated display attribute value into the user_data field of the traversed option. Then the electronic device 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 the page refresh, and the specific process is as follows.
[0138] 1) The page refresh library function creates an empty screen object null_scr (such as 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 function lv_obj_get_child to obtain child objects, traversing all components (i.e., options) in the current screen object scr (such as the first page). According to the user_data field in the corresponding lv_obj_t of the component, the display attributes of the option are set, such as display, hide, or gray out.
[0140] For example, if the display attribute indicated by the value of the user_data field in lv_obj_t is hide, the page refresh library function calls the library function lv_obj_add_flag provided by LVGL to add the LV_OBJ_FLAG_HIDDEN flag to the component. Similarly, if the display attribute indicated by the value of the user_data field in lv_obj_t is display, the page refresh library function calls the library function lv_obj_clear_flag provided by LVGL to clear the LV_OBJ_FLAG_HIDDEN flag.
[0141] For another example, if the display attribute indicated by the value of the user_data field in lv_obj_t is gray out, the page refresh library function calls the library function lv_obj_add_style provided by LVGL to set the transparency of the component to 50%, and calls the library function lv_obj_add_state provided by LVGL to set it to the disabled state LV_STATE_DISABLED. Similarly, if the display attribute indicated by the value of the user_data field in lv_obj_t is display, the page refresh library function calls the library function lv_obj_add_style provided by LVGL to set the transparency of the component to 0, and calls the library function lv_obj_add_state provided by LVGL 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 the embodiments of this application, a page refresh function lv_scr_page_refresh is added to the LVGL library, enriching the library functions for LVGL page management. Moreover, on the BIOS Setup interface developed based on LVGL, the control display function is implemented to optimize the user experience and improve the security of system configuration. By dynamically displaying, hiding, and graying out options, a more intelligent user interface is provided. Additionally, detection modules are respectively set for external changes that affect the control display of the BIOS Setup page. After detecting a change, only the current page is refreshed, saving CPU resources.
[0145] Corresponding to the above interface display control method, an embodiment of the present application further provides an interface display control device, such as Figure 4 shown, which is applied to an electronic device. A first page is displayed on the BIOS setup interface of the electronic device. The device includes:
[0146] A first loading module 401, configured to load a second page to the BIOS setup interface so that the first page is in an editable state;
[0147] A first setting module 402, configured to set the display attributes of each option in the first page according to the display attribute values of each option in the first page;
[0148] A second loading module 403, configured to load the set first page to the BIOS setup interface.
[0149] In some embodiments, the above interface display control device may further include:
[0150] A creation module, configured to create an empty screen object as the second page before loading the second page to the BIOS setup interface;
[0151] A deletion module, configured to delete the second page after loading the set first page to the BIOS setup interface.
[0152] In some embodiments, the above interface display control device may further include a detection module, configured to:
[0153] Before loading the second page to the BIOS setup interface, detect preset options associated with the BIOS setup interface;
[0154] When it is detected that the value of the preset option changes, determine the first display attribute values of each option in the first page according to the control expressions 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 each option is set to a preset display attribute;
[0155] If the first display attribute values of each option in the first page are different from the second display attribute values, update the second display attribute values of each option in the first page to the first display attribute values, and trigger the first loading module. The second display attribute values are the recorded display attribute values of each option in the first page.
[0156] In some embodiments, the preset options include at least one of a permission option and a switch-type option; the preset display attributes include at least one of hidden and grayed out.
[0157] In some embodiments, the preset option includes a permission option; the above interface display control device may further include:
[0158] An acquisition module, configured to acquire user permission information to be verified;
[0159] A verification module, configured to verify the user permission information;
[0160] A second setting module, configured to, when the user permission information is verified, set the value of the permission option to the permission value associated with the user permission information.
[0161] In some embodiments, the first setting module 402 is specifically configured to:
[0162] Traverse each option in the first page;
[0163] If the display attribute value of the traversed option is a value indicating hiding, set a hiding flag for the traversed option; if the display attribute value of the traversed option is a value indicating display, and the display attribute of the traversed option is hiding, delete the hiding flag of the traversed option;
[0164] If the display attribute value of the traversed option is a value indicating graying out, set the transparency of the traversed option to a preset transparency, and set the state of the traversed option to a disabled state, where 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 graying out, set the transparency of the traversed option to the minimum transparency, and set the state of the traversed option to an enabled state.
[0165] In the technical solution provided by the embodiment of the present application, when the first page is displayed on the BIOS setting interface, the electronic device loads the second page to the BIOS setting interface. After that, the electronic device can modify the display attributes of each option in the first page, such as modifying each option to be displayed, hidden, or grayed out, etc. After setting each option in the first page, the electronic device loads the set first page to the BIOS setting interface, so that the BIOS setting interface redisplay the first page, realizing the refresh of the first page. In the embodiment of the present application, when the display attribute of the option in the first page changes, only the first page needs to be recreated, and when recreating the first page, only one more second page needs to be created, reducing the number of pages created during page refresh. The electronic device does not need to store a lot of pages, saving CPU resources and memory space.
[0166] The embodiment of the present application also provides an electronic device, such as Figure 5 shown, including a processor 501 and a machine-readable storage medium 502, the machine-readable storage medium 502 stores machine-executable instructions that can be executed by the processor 501, and the processor 501 is prompted by the machine-executable instructions to: implement any of the above interface display control methods.
[0167] The machine-readable storage medium may include a Random Access Memory (RAM), or may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the machine-readable storage medium may also be at least one storage device located away from the aforementioned processor.
[0168] The processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may 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, discrete hardware components.
[0169] In another embodiment provided by the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned any interface display control method is implemented.
[0170] In another embodiment provided by the present application, there is also provided a computer program product containing instructions, which when running on a computer, causes the computer to execute the above-mentioned any interface display control method.
[0171] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (such as coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0172] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0173] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for the embodiments of the device, electronic device, storage medium, and program product, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments.
[0174] The above are only the preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application are all included in the protection scope of the present application.
Claims
1. An interface display control method, characterized in that: Applied to an electronic device, a first page is displayed on a BIOS setting interface of the electronic device, and the method includes: Loading the second page into the BIOS setup interface to make the first page editable; Setting the display attribute of each option in the first page according to the display attribute value of each option in the first page; Load the first page after setting to the BIOS setting interface.
2. The method according to claim 1, characterized in that: The method further comprises: Before loading the second page into the BIOS setup interface, creating an empty screen object as the second page; After loading the set first page into the BIOS setting interface, deleting 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 preset options associated with the BIOS setup interface; When a change in the value of the preset option is detected, determining a first display attribute value of each option in the first page according to a control expression of each option in the first page and a current value of the preset option, the control expression of each option indicating the value of the preset option when each option is set to the preset display attribute; If the first display attribute value and the second display attribute value of each option in the first page are different, 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 setup interface is performed, and 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 option includes at least one of a permission option and a switch option; the preset display attribute includes at least one of hiding and graying out.
5. The method according to claim 3, characterized in that: The preset options include permission options; The method further comprises: Get the user permission information to be verified; Verifying the user authority information; When the user authority information is verified, the value of the authority option is set to the authority value associated with the user authority information.
6. The method according to any one of claims 1 to 5, characterized in that: 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: Traverse each option in the first page; If the display attribute value of the traversed option is a value indicating hidden, set a hidden flag for the traversed option; if the display attribute value of the traversed option is a value indicating display, and the display attribute of the traversed option is hidden, delete the hidden flag of the traversed option; If the display attribute value of the traversed option is a value indicating graying out, the transparency of the traversed option is set to the preset transparency, and the state of the traversed option is set to a disabled state, and the preset transparency is greater than the minimum transparency, and the preset transparency is 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 graying out, the transparency of the traversed option is set to the minimum transparency, and the state of the traversed option is set to an enabled state.
7. An interface display control device, characterized in that: Applied to an electronic device, a first page is displayed on a BIOS setting interface of the electronic device, and the device comprises: A first loading module, used for loading the second page into the BIOS setting interface, so that the first page is in an editable state; A first setting module, used to set the display attribute of each option in the first page according to the display attribute value of each option in the first page; The second loading module is used to load the set first page into the BIOS setting interface.
8. The device according to claim 7, characterized in that The device also includes: A creation module, used for creating an empty screen object as the second page before loading the second page into the BIOS setting interface; The deleting module is used to delete the second page after the set first page is loaded into the BIOS setting interface.
9. The device according to claim 7, characterized in that The device also includes a detection module, which is used to: Before loading the second page into the BIOS setup interface, detecting a preset option associated with the BIOS setup interface; When a change in the value of the preset option is detected, determining a first display attribute value of each option in the first page according to a control expression of each option in the first page and a current value of the preset option, the control expression of each option indicating the value of the preset option when each option is set to the preset display attribute; If the first display attribute value and the second display attribute value of each option in the first page are different, the second display attribute value of each option in the first page is updated to the first display attribute value, triggering the first loading module, and the second display attribute value is the recorded display attribute value of each option in the first page.
10. The device according to claim 9, characterized in that The preset option includes at least one of a permission option and a switch option; the preset display attribute includes at least one of hiding and graying out.
11. The device according to claim 9, characterized in that The preset options include permission options; the device also includes: The acquisition module is used to obtain the user authority information to be verified; A verification module, used to verify the user authority 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 when the user permission information is verified.
12. The device according to any one of claims 7 to 11, characterized in that: The first setting module is specifically used to: Traverse each option in the first page; If the display attribute value of the traversed option is a value indicating hidden, a hidden flag is set for the traversed option; If the display attribute value of the traversed option is a value indicating display, 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, the transparency of the traversed option is set to the preset transparency, and the state of the traversed option is set to a disabled state, and the preset transparency is greater than the minimum transparency, and the preset transparency is 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 graying out, the transparency of the traversed option is set to the minimum transparency, and the state of the traversed option is set to an enabled state.
13. An electronic device, characterized in that: The method comprises a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method steps described in any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Updating method and updating system for basic input output system
CN101655800A
Page generation method and device and storage medium
CN108228766A
Dynamic updating method and device for startup interaction interface, equipment and medium
CN114327733A
Page loading method and device, equipment, medium and program product
CN115048596A
Page loading method, page loading device, electronic equipment and storage medium
CN119440662A