Page display method and device, electronic equipment and storage medium
By detecting the preset option values of the BIOS Setup interface and directly setting the display properties of the options, the problems of large amount of code and logical changes in the existing technology are solved, and simplified interface display control is realized.
Patent Information
- Application Number
- CN202510352976.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-07-01
AI Technical Summary
The existing BIOS Setup interface display control scheme is complex, and variables and judgment conditions are needed to be added to each option, resulting in large amount of code and changing the page display logic.
By detecting the value of the preset option, directly set the display properties of each option on the page according to the preset display properties, such as hiding, graying or displaying, avoiding adding judgment conditions and variables.
It simplifies the interface display control process, reduces the amount of code, and implements the display control of options without changing the page display logic.
Smart Images

Figure CN120234080A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a page display method, apparatus, electronic device, and storage medium. Background Art
[0002] In order to optimize the user experience and improve the security of the 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 pages included in the BIOS Setup interface.
[0003] The current interface display control scheme is as follows: For the options that need to be hidden or grayed out, variables and judgment conditions are added. When the judgment condition is satisfied, the option is dynamically displayed. When the judgment condition is not satisfied, the option is hidden or grayed out. The above interface display control scheme is relatively complex and requires adding variables and judgment conditions for each option, resulting in a large amount of code to be added, and the added judgment conditions change the page display logic. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a page display method, apparatus, electronic device, and storage medium to more simply implement interface display control without changing the page display logic and reduce the code to be added. The specific technical solutions are as follows:
[0005] In a first aspect, the embodiments of this application provide a page display method applied to an electronic device, and the method includes:
[0006] Detect a preset option associated with the BIOS setup interface;
[0007] When it is detected that the value of the preset option indicates that the display attribute of the option in the page is set to a first preset display attribute, set the display attribute of each option in the first page according to the display attribute value of each option in the first page;
[0008] Display the set first page on the BIOS setup interface.
[0009] In some embodiments, the method further includes:
[0010] When it is detected that the value of the preset option indicates that the display attribute of the option in the page is set to a second preset display attribute, set the display attribute of each option in the first page to the second preset display attribute.
[0011] In some embodiments, after displaying the set first page on the BIOS setup interface, the method further includes:
[0012] In response to a shortcut key operation of the user on the BIOS setup interface, switch the value of the preset option;
[0013] Delete the first page after the setting, and re - execute the step of detecting the preset options associated with the BIOS setup interface.
[0014] In some embodiments, the attribute of the prompt word of each option indicates the display attribute value of each option; 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:
[0015] Set the display attribute of each option in the first page according to the attribute of the prompt word of each option in the first page.
[0016] 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:
[0017] Traverse each option in the first page;
[0018] If the display attribute value of the traversed option is a value indicating to hide, skip creating the traversed option;
[0019] If the display attribute value of the traversed option is a value indicating to be 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.
[0020] In a second aspect, an embodiment of the present application provides a page display device, which is applied to an electronic device. The device includes:
[0021] A detection module, configured to detect preset options associated with the BIOS setup interface;
[0022] A setting module, configured to, when it is detected that the value of the preset option indicates to set the display attribute of the options in the page to a first preset display attribute, set the display attribute of each option in the first page according to the display attribute value of each option in the first page;
[0023] A display module, configured to display the set first page on the BIOS setup interface.
[0024] In some embodiments, the setting module is further configured to:
[0025] When it is detected that the value of the preset option indicates to set the display attribute of the options in the page to a second preset display attribute, set the display attribute of each option in the first page to the second preset display attribute.
[0026] In some embodiments, the device further includes a switching module, configured to:
[0027] After displaying a first page after the settings on the BIOS setup interface, in response to a shortcut key operation by the user on the BIOS setup interface, switch the value of the preset option;
[0028] Delete the first page after the settings, and perform the step of detecting the preset option associated with the BIOS setup interface.
[0029] In some embodiments, the attribute of the prompt word of each option indicates the display attribute value of each option; the setting module is specifically configured to:
[0030] Set the display attribute of each option in the first page according to the attribute of the prompt word of each option in the first page.
[0031] In some embodiments, the setting module is specifically configured to:
[0032] Traverse each option in the first page;
[0033] If the display attribute value of the traversed option is a value indicating to hide, skip creating the traversed option;
[0034] If the display attribute value of the traversed option is a value indicating to be 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.
[0035] 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.
[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, it implements any method provided in the first aspect.
[0037] In a fifth aspect, an embodiment of the present application further provides a computer program product containing instructions, which when running on a computer, causes the computer to execute any method provided in the first aspect.
[0038] Advantageous effects of the embodiments of the present application:
[0039] In the technical solution provided by the embodiment of the present application, the BIOS setting interface is associated with preset options. The electronic device can detect the values of the preset options, and based on the values of the preset options and the display attribute values of each option in the first page to be displayed on the BIOS setting interface, set the display attributes of each option, such as setting each option to be displayed, hidden, or grayed out. The electronic device can display the set first page, thereby realizing the display of the first page. By applying the technical solution provided by the embodiment of the present application, it is not necessary to add variables and judgment conditions for each option, and the electronic device does not need to set the display attributes according to the judgment conditions. In this way, when the electronic device sets the display attributes of the options and generates the page, the page display logic is not changed, and the interface display control is realized more simply without changing the page display logic, simplifying the display process and reducing the code that needs to be added.
[0040] Of course, when implementing any product or method of the present application, it is not necessarily required to achieve all the above-mentioned advantages simultaneously. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] 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 drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can also obtain other embodiments according to these drawings.
[0042] Figure 1 It is the first flowchart of the page display method provided by the embodiment of the present application;
[0043] Figure 2 It is the second flowchart of the page display method provided by the embodiment of the present application;
[0044] Figure 3 It is the third flowchart of the page display method provided by the embodiment of the present application;
[0045] Figure 4 It is a schematic structural diagram of the page display device provided by the embodiment of the present application;
[0046] Figure 5 It is a schematic structural diagram of the electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application belong to the scope of protection of the present application.
[0048] 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.
[0049] 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 starts. 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 graphics or text.
[0050] 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.
[0051] At present, in order to support increasingly complex functions, a large number of options (also called configuration items) are available in the BIOS Setup interface, which involve various aspects such as hardware configuration, performance tuning, and security settings. In order to optimize the user experience and improve the security of system configuration, and to facilitate BIOS developers to diagnose problems, when developing the BIOS Setup interface based on LVGL, the electronic device executes the interface display control scheme, and provides a smarter user interface and simplifies the user interface by dynamically displaying (which can be referred to as display), hiding, and graying out the options in the pages included in the BIOS Setup interface.
[0052] The current interface display control solution is as follows: for options that need to be hidden or grayed out, variables and judgment conditions are added. When the judgment condition is met, the option is dynamically displayed; when the judgment condition is not met, the option is hidden or grayed out. That is, a global variable is created in the Non-Volatile Random Access Memory (NVRAM) using the flash operation software (such as FLASHROM), and a control expression is added before the code corresponding to the option that needs to be hidden or grayed out as the judgment condition. The value of this created variable is changed through the interactive command line interface (such as the EFI Shell) of the Unified Extensible Firmware Interface (UEFI) to perform dynamic display, hiding, and graying out of the option.
[0053] For example, if an option needs to be hidden (such as the Baseboard Management Controller (BMC) Self Test Status), the user can create a variable (named BmcSupport), set the initial value of BmcSupport to 0, and add the control expression suppressif ideqval SERVER_MGMT_CONFIGURATION_DATA.BmcSupport == 0 before the code corresponding to this option, and add endif after the code corresponding to this option. This control expression means that when the value of BmcSupport is 0, this option is hidden; when the value of BmcSupport is not 0, this option is dynamically displayed.
[0054] When the electronic device displays a page on the BIOS Setup interface, if it determines that the value of BmcSupport is 0, then this option is hidden. If this option needs to be dynamically displayed on the page, the user can modify the value of BmcSupport to be not 0, restart the system, and re-enter the BIOS Setup interface. The electronic device determines that the value of BmcSupport is not 0, then this option is dynamically displayed. Through the above method, the electronic device can achieve conditional hiding of options. If you want to directly hide an option, just add suppressif TRUE.
[0055] For another example, if it is necessary to gray out an option (such as the timeout of the Fault-Resilient Booting, Level 2 (FRB-2) timer), the user can create a variable (named Frb2Enable), set the initial value of Frb2Enable to 0, and add a control expression grayout if ideqval SERVER_MGMT_CONFIGURATION_DATA.Frb2Enable == 0 before the code corresponding to this option, and add endif after the code corresponding to this option. This control expression means that when the value of Frb2Enable is 0, this option is grayed out, and when the value of Frb2Enable is not 0, this option is dynamically displayed.
[0056] When the electronic device displays a page on the BIOS Setup interface, if it determines that the value of Frb2Enable is 0, this option is grayed out. If it is necessary to dynamically display this option on the page, the user modifies the value of Frb2Enable to be not 0, restarts the system, and re-enters the BIOS Setup interface. The electronic device determines that the value of Frb2Enable is not 0, and then dynamically displays this option. Through the above method, the electronic device can implement conditional graying out of options. If it is necessary to directly gray out an option, just add grayout if TRUE.
[0057] The above interface display control scheme is relatively complex. It is necessary to add variables and judgment conditions for each option, resulting in a relatively large amount of code to be added, and the added judgment conditions change the page display logic. In addition, it is necessary to modify the values of the variables corresponding to each option, and it takes effect only after restarting the system, which further increases the complexity of the above interface display control scheme.
[0058] To solve the above problems, an embodiment of the present application provides a page display method, as Figure 1 shown, which is applied to an electronic device. The method includes:
[0059] Step S101, detecting a preset option associated with the BIOS setting interface.
[0060] Step S102, when it is detected that the value of the preset option indicates that the option in the page is set to the first preset display attribute, set the display attribute of each option in the first page according to the display attribute value of each option in the first page.
[0061] Step S103, displaying the set first page on the BIOS setting interface.
[0062] In the technical solution provided by the embodiments of the present application, the BIOS setup interface is associated with preset options. The electronic device can detect the values of the preset options and set the display attributes of each option on the first page to be displayed on the BIOS setup interface based on the display attribute values of each option in the first page according to the values of the preset options, such as setting each option to be displayed, hidden, or grayed out. The electronic device can display the first page after setting, thus realizing the display of the first page. By applying the technical solution provided by the embodiments of the present application, there is no need to add variables and judgment conditions for each option, and the electronic device does not need to set the display attributes according to the judgment conditions. In this way, when the electronic device sets the display attributes of the options and generates the page, the page display logic is not changed, and the interface display control is realized more simply without changing the page display logic, simplifying the display process and reducing the code to be added.
[0063] In the embodiments 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.
[0064] Pages can be displayed on the BIOS setup interface. A page can include one or more options, and the display attributes of these options include display, hide, or gray, etc. For ease of description, the page to be displayed on the BIOS setup interface will be referred to as the first page hereinafter.
[0065] In the above step S101, the electronic device pre-sets options for adjusting the display attributes, that is, preset options. In the embodiments of the present application, the preset option can be a globally created variable.
[0066] The preset options are associated with all the options in the page, and the values of the preset options indicate that the display attributes of the options in the page are set to the preset display attributes. The preset display attributes can be the first preset display attribute or the second preset display attribute.
[0067] In one example, the first preset display attribute can be at least one of hide and gray, and the second preset display attribute can be display.
[0068] For example, the value of the preset option can be the first preset value or the second preset value. The first preset value indicates that the display attribute of the option in the page is set to the first preset display attribute, and the second preset value indicates that the display attribute of the option in the page is set to the first preset display attribute. The first preset value can be 0, and the second preset value can be 1. Similarly, the first preset value can also be 1, and the second preset value can also be 0. For ease of description, in the following, the case where the first preset value is 0 and the second preset value is 1 is taken as an example for illustration, which is not restrictive.
[0069] In the embodiments of the present application, the electronic device can define the first preset value and the second preset value by defining macros. For example, the electronic device can preset the first preset value as ITEM_CTRL_HIDEORGRAY and the second preset value as ITEM_CTRL_EXPOSE, and execute #define ITEM_CTRL_HIDEORGRAY 0x00 and #define ITEM_CTRL_EXPOSE 0x01 to define the value of ITEM_CTRL_HIDEORGRAY as 0 and the value of ITEM_CTRL_EXPOSE as 1. The method of defining the first preset value and the second preset value is not limited herein.
[0070] For another example, the value of the preset option can be the first preset value to the fourth preset value, and the first preset value to the fourth preset value respectively indicate that the display attribute of the option in the page is set to hidden, grayed out, hidden and grayed out, and displayed. In this case, the first preset value to the third preset value indicate that the display attribute of the option in the page is set to the first preset display attribute, and the second preset value indicates that the display attribute of the option in the page is set to the first preset display attribute. The first preset value to the fourth preset value can be 0, 1, 2, 3. The values of the first preset value to the fourth preset value are not limited herein.
[0071] In another example, the first preset display attribute can be hidden and grayed out, and the second preset display attribute can be one of displayed, hidden, or grayed out.
[0072] For example, the value of the preset option can be the first preset value to the fourth preset value, and the first preset value to the fourth preset value respectively indicate that the display attribute of the option in the page is set to hidden, grayed out, hidden and grayed out, and displayed. In this case, the third preset value indicates that the display attribute of the option in the page is set to the first preset display attribute, and the first preset value, the second preset value, and the fourth preset value indicate that the display attribute of the option in the page is set to the second preset display attribute.
[0073] The electronic device can detect a preset option in real time and determine the value of the preset option. When the electronic device determines that the value of the preset option indicates that the display attribute of the option in the page is set to the first preset display attribute, step S102 is executed.
[0074] In the above step S102, the display attribute value of the option is the value indicating the display attribute of the option. The display attribute value may include a value indicating hiding, a value indicating graying out, and a default value (i.e., a value indicating display). The value indicating hiding may be expressed as "HIDE", and the value indicating graying out may be expressed as "GRAY", which is not limited herein. In this case, when the display attribute value of the option is "HIDE", it indicates that the display attribute of the option is hidden; when the display attribute value of the option is "GRAY", it indicates that the display attribute of the option is grayed out; when the display attribute value does not exist or is the default value, it indicates that the display attribute of the option is display.
[0075] In the embodiments of the present application, the electronic device can set the display attribute 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.
[0076] For example, the first page includes option 1 to option 3. The electronic device traverses option 1 to option 3. When traversing option 1, if the display attribute value of option 1 is the default value or does not exist, 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 "HIDE", so the display attribute of option 2 is set to hidden, and at this time, option 2 is not displayed in page 1; continue to traverse the options. When traversing option 3, the display attribute value of option 3 is "GRAY", so the display attribute of option 3 is set to grayed out, and at this time, option 3 is displayed in page 1, but the user cannot configure or select option 3.
[0077] In some embodiments, each option corresponds to a prompt word, which is a string predefined in the #string.uni file. The prompt word of each option includes one or more attributes, and each attribute corresponds to an attribute label predefined in the #langdef.uni file. The attributes of the prompt word of each option can indicate the display attribute value of each option. Then, the above step S102 can be: setting the display attribute of each option in the first page according to the attributes of the prompt words of each option in the first page.
[0078] In the embodiments of the present application, an electronic device may preset a display attribute label corresponding to a display attribute, and set an attribute value corresponding to the display attribute label in the attributes of the prompt word of the option to be hidden or grayed out. For example, the electronic device may use #langdef x-ATTR "x-ATTR" to define the attribute label x-ATTR, indicating that the attribute label x-ATTR is a display attribute label. Then, the electronic device may use #language x-ATTR "HIDE" in the attributes of the prompt word of the option to be hidden, and set the attribute value corresponding to the display attribute label to the value "HIDE" indicating hiding, or use #language x-ATTR "GRAY" in the attributes of the prompt word of the option to be grayed out, and set the attribute value corresponding to the display attribute label to the value "GRAY" indicating graying out. The electronic device may also set the attribute value corresponding to the display attribute label to a default value in the above manner, and this is not limited.
[0079] The electronic device may traverse each option in the first page; read the attribute value corresponding to the display attribute label from the attributes of the prompt word of the traversed option, obtain the display attribute value of the traversed option, and set the display attribute of the traversed option. For example, for the traversed option, the electronic device may read the attribute value corresponding to the display attribute label x-ATTR from the attributes of the prompt word of the traversed option, obtain "HIDE", "GRAY" or the default value as the display attribute value of the traversed option, and correspondingly set the display attribute of the traversed option to hidden, grayed out, or displayed.
[0080] If the attributes of the prompt word of the traversed option do not include the attribute value corresponding to the display attribute label, indicating that the display attribute value does not exist, the electronic device may set the display attribute of the traversed option to displayed.
[0081] In the embodiments of the present application, the electronic device may call a UEFI interface function (such as HiiGetStringEx(HiiHandle, StringId, Language, TryBestLanguage)) to obtain the display attribute value of the option. Among them, HiiHandle represents the handle of the option, indicating the Human Interface Infrastructure (HII) database where the option is located; StringId represents the identifier of the prompt word of the option; Language represents the attribute label of the option, that is, when obtaining the display attribute value of the option, Language takes the value of x-ATTR; TryBestLanguage takes the value of false. The electronic device may use the result returned by the UEFI interface function as the display attribute value of the option.
[0082] Applying the technical solution provided by the embodiments of the present application, the electronic device only needs to set the display attribute of the option according to the attribute of the prompt word, instead of setting it according to the judgment condition, which greatly reduces the amount of added code and does not change the page display logic.
[0083] In some embodiments, the electronic device can set the display attribute of the option (i.e., execute the above step S102) through the following steps: traverse each option in the first page; if the display attribute value of the traversed option is a value indicating hiding, skip creating the traversed option; 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.
[0084] If the display attribute value of the traversed option is a value indicating hiding, that is, the display attribute value of the traversed option is "HIDE", the electronic device can skip the traversed option, that is, not create the traversed option. At this time, the traversed option is not displayed on the first page. In the embodiments of the present application, the electronic device does not create the option to be hidden, which simplifies the user interface while saving CPU resources and improving the page generation and display speed.
[0085] When the BIOS setting interface is a BIOS setting interface developed based on LVGL, the electronic device can also 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 achieve hiding of the traversed option.
[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 can be 50%, 60%, etc.
[0087] Taking the preset transparency of 50% as an example. When the BIOS setting interface is a BIOS setting interface developed based on LVGL, if the display attribute value of the traversed option is a value indicating graying out, that is, the display attribute value of the traversed option is "GRAY", 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 the traversed option to a disabled state (such as LV_STATE_DISABLED). In the embodiments of the present application, the electronic device sets the transparency and usage state of the option to be grayed out to provide a simplified user interface and achieve interface display control.
[0088] In an embodiment of the present application, if the display attribute value of the traversed option is the default value or does not exist, the electronic device can normally create the traversed option, and at this time, the user can configure or select the traversed option.
[0089] In step S103 above, the electronic device loads the set first page into the BIOS setup interface. The set first page is the newly created page, and at this time, the BIOS setup interface displays the newly created first page.
[0090] In some embodiments, as Figure 2 shown, there is also provided a page display method applied to an electronic device, and this method may include:
[0091] Step S201, detecting preset options associated with the BIOS setup interface.
[0092] Step S202, when it is detected that the value of the preset option indicates that the display attribute of the option in the page is set to the first preset display attribute, set the display attribute of each option in the first page according to the display attribute value of each option in the first page.
[0093] Step S203, when it is detected that the value of the preset option indicates that the display attribute of the option in the page is set to the second preset display attribute, set the display attribute of each option in the first page to the second preset display attribute.
[0094] Step S204, displaying the set first page on the BIOS setup interface.
[0095] The above step S201 to step S202 are the same as the above step S101 to step S102, and the above step S204 is the same as the above step S103.
[0096] The electronic device can execute step S201 (that is, step S101), detect the preset option in real time, and determine the value of the preset option. When the electronic device determines that the value of the preset option indicates that the display attribute of the option in the page is set to the second preset display attribute, it executes step S203.
[0097] In the above step S203, the electronic device can set the display attribute of each option in the first page according to the second preset display attribute. For example, it can traverse each option in the first page; set the display attribute of the traversed option to the second preset display attribute.
[0098] For example, if the second preset display attribute is display, the electronic device can set the display attribute of all options in the first page to display, and at this time, the user can configure or select all options in the first page.
[0099] For another example, the second preset display attribute is one of display, hide, or gray out. If the value of the preset option is the fourth preset value, indicating that the display attribute of the option in the page is set to display, the electronic device can set the display attributes of all options in the first page to display. At this time, the user can configure or select all options. If the value of the preset option is the second preset value, indicating that the display attribute of the option in the page is set to gray out, the electronic device can set the display attributes of all options in the first page to gray out. At this time, all options can be displayed in the first page, but the user cannot configure or select all options.
[0100] In the embodiments of the present application, when the value of the preset option indicates that the display attribute of the option in the page is set to the second preset display attribute, the electronic device can directly set the display attribute of the option without obtaining the display attribute value for setting, which improves the setting efficiency of the display attribute of the option and improves the page generation efficiency.
[0101] In some embodiments, as Figure 3 shown, a page display method is further provided, which is applied to an electronic device. The method may include:
[0102] Step S301, detecting a preset option associated with the BIOS setup interface.
[0103] Step S302, when it is detected that the value of the preset option indicates that the option in the page is set to the first preset display attribute, setting the display attribute of each option in the first page according to the display attribute value of each option in the first page.
[0104] Step S303, displaying the set first page on the BIOS setup interface.
[0105] Step S304, in response to a shortcut key operation of the user on the BIOS setup interface, switching the value of the preset option.
[0106] Step S305, deleting the set first page and returning to execute the above step S301.
[0107] In the embodiments of the present application, the electronic device associates the preset option with a preset shortcut key, so as to quickly change the value of the preset option by using the shortcut key and realize the quick switching of the display attribute of the option. Since it is not necessary to modify the value of the preset option through the EFI Shell, it is not necessary to restart the system to take effect, and only the page needs to be recreated.
[0108] In the above step S304, the electronic device can pre-associate the preset shortcut key with the preset option. The electronic device can switch the value of the preset option in response to the operation of the user on the preset shortcut key on the BIOS setup interface.
[0109] For example, the value of the preset option is the first preset value or the second preset value. When the value of the preset option is the first preset value, the electronic device responds to the user's operation on the preset shortcut key and switches the value of the preset option to the second preset value; when the value of the preset option is the second preset value, the electronic device responds to the user's operation on the preset shortcut key and switches the value of the preset option to the first preset value.
[0110] After switching the value of the preset option, the electronic device may execute step S305 above to delete the first page displayed on the current BIOS setting interface, and then re-execute step S301 above to detect the preset option associated with the BIOS setting interface, and continue to execute steps S302 and S303 to set the display attribute of the option using the switched value of the preset option, create and display a new first page, thereby realizing the switching of the display attribute of the option.
[0111] In the embodiment of the present application, the electronic device may also respond to the user's operation, modify the value of the preset option through the EFI Shell, restart the system, and re-enter the BIOS setting interface to realize the switching of the display attribute of the option.
[0112] Next, for the BIOS setting interface developed based on LVGL, the page display method provided by the embodiment of the present application will be described in detail. Taking the first preset display attribute as at least one of hidden and grayed out, the second preset display attribute as displayed, and the value of the preset option as the first preset value or the second preset value as an example.
[0113] (1) Define macros
[0114] The electronic device defines two preset values, ITEM_CTRL_HIDEORGRAY and ITEM_CTRL_EXPOSE (for example, execute #define ITEM_CTRL_HIDEORGRAY 0x00 and #define ITEM_CTRL_EXPOSE 0x01). ITEM_CTRL_HIDEORGRAY indicates that the option needs to be hidden or grayed out, and its value is 0; ITEM_CTRL_EXPOSE indicates that the option needs to be displayed, and its value is 1.
[0115] (2) Create a global variable
[0116] The electronic device responds to the user's operation of creating a global variable in the NVRAM using the FLASHROM, creates a global variable gItemCtrl (i.e., the preset option) to record the current control display method, and sets the initial value of gItemCtrl to ITEM_CTRL_HIDEORGRAY.
[0117] (3) Respond to the shortcut key to switch the value of gItemCtrl
[0118] The electronic device associates gItemCtrl with the combined shortcut key Ctrl+Shift+F12. In response to the user's operation on the combined shortcut key Ctrl+Shift+F12, the value of gItemCtrl is switched. For example, when the user presses the combined key in the BIOS Setup interface, if the value of gItemCtrl is ITEM_CTRL_HIDEORGRAY, the electronic device responds to the user's operation and switches the value of gItemCtrl to ITEM_CTRL_EXPOSE; if the value of gItemCtrl is ITEM_CTRL_EXPOSE, the electronic device responds to the user's operation and switches the value of gItemCtrl to ITEM_CTRL_HIDEORGRAY.
[0119] (4) Add attributes to the strings (prompt words) corresponding to the options that need to be hidden or grayed out
[0120] The user can add #langdef x-ATTR"x-ATTR" in the.uni file where the string resource is located to define the attribute label x-ATTR, and add #language x-ATTR"GRAY" or #language x-ATTR"HIDE" in the attributes of the prompt words corresponding to the options that need to be hidden or grayed out. Here, "HIDE" means to hide the option, and "GRAY" means to gray out the option. For example, if it is necessary to gray out the option with the prompt word STR_BIOS_FRB2_WD_TIMER, the user can add #language x-ATTR"GRAY" at the position corresponding to the string STR_BIOS_FRB2_WD_TIMER in the.uni file (i.e., #string STR_BIOS_FRB2_WD_TIMER). The attributes of the prompt words can also include #language en-US"FRB2WatchdogTimer", #language zh-CN"FRB2 timer", etc.
[0121] For another example, if it is necessary to hide the option with the prompt word STR_BOOT_TIMEOUT, the user can add #language x-ATTR"HIDE" at the position corresponding to #stringSTR_BOOT_TIMEOUT.
[0122] (5) Hide and gray out according to the attributes of the strings corresponding to the options
[0123] When an electronic device displays a page and creates options in the BIOS setup interface, it can set the display attributes of the options according to the value of gItemCtrl. If the value of gItemCtrl is ITEM_CTRL_HIDEORGRAY, the electronic device needs to check the attributes of the string corresponding to the option; if the value of gItemCtrl is ITEM_CTRL_EXPOSE, the electronic device does not need to check the attributes of the string corresponding to the option and can directly create the options in the page to be displayed.
[0124] The electronic device can obtain the attributes of the string corresponding to each option in the page to be displayed by calling the UEFI interface function HiiGetStringEx(HiiHandle, StringId, Language, TryBestLanguage). That is, use the handle of the option as the HiiHandle parameter, the identifier of the prompt word as the StringId parameter, and the attribute label x-ATTR as the Language. For each option, if the attribute value corresponding to x-ATTR is "HIDE", then do not create this option; if the attribute value corresponding to x-ATTR is "GRAY", then gray out the option, call the library function lv_obj_add_style provided by LVGL to set the transparency to 50%, and call the library function lv_obj_add_state provided by LVGL to set it to the disabled state LV_STATE_DISABLED.
[0125] (6) Respond to the shortcut key operation and refresh the current page
[0126] In step 3, when the electronic device responds to the user's operation of the combination shortcut key Ctrl+Shift+F12 and switches the value of gItemCtrl, it needs to refresh the current page, that is, first delete the current page and then recreate it. The recreated page includes the same options as the current page, but the display attributes are different.
[0127] Applying the technical solution provided by the embodiment of the present application, if a user needs to hide or gray out an option in the page, they only need to edit the.uni file and add the attribute of the prompt word of this option as "HIDE" or "GRAY". When the electronic device displays the page and creates options, it can directly set the display attributes of this option according to the attributes of the prompt word (when the value of gItemCtrl is ITEM_CTRL_HIDEORGRAY), greatly reducing the amount of code that needs to be added. In addition, the electronic device can also respond to the user's shortcut key operation and quickly switch between dynamic display and hiding or graying out, providing a more intelligent user interface, improving the user experience, improving the efficiency of BIOS developers in diagnosing problems, optimizing the user experience, and improving the security of system configuration.
[0128] Corresponding to the above page display method, an embodiment of the present application further provides a page display device, as Figure 4 shown, applied to an electronic device, the device includes:
[0129] A detection module 401, configured to detect a preset option associated with the BIOS setup interface;
[0130] A setting module 402, configured to, when detecting that the value of the preset option indicates that the display attribute of the option in the page is set to a first preset display attribute, set the display attribute of each option in the first page according to the display attribute value of each option in the first page;
[0131] A display module 403, configured to display the set first page on the BIOS setup interface.
[0132] In the technical solution provided by the embodiment of the present application, the BIOS setup interface is associated with a preset option, and the electronic device can detect the value of the preset option. Based on the value of the preset option, according to the display attribute value of each option in the first page to be displayed on the BIOS setup interface, set the display attribute of each option, such as setting each option to be displayed, hidden, or grayed out, etc. The electronic device can display the set first page to implement the display of the first page. Applying the technical solution provided by the embodiment of the present application, there is no need to add variables and judgment conditions for each option, and the electronic device does not need to set the display attribute according to the judgment conditions. In this way, when the electronic device sets the display attribute of the option and generates the page, the page display logic is not changed, and the interface display control is more simply implemented without changing the page display logic, simplifying the display process and reducing the code that needs to be added.
[0133] In some embodiments, the setting module 402 may further be configured to:
[0134] When detecting that the value of the preset option indicates that the display attribute of the option in the page is set to a second preset display attribute, set the display attribute of each option in the first page to the second preset display attribute.
[0135] In some embodiments, the device may further include a switching module, configured to:
[0136] After displaying the set first page on the BIOS setup interface, in response to a shortcut key operation of the user on the BIOS setup interface, switch the value of the preset option;
[0137] Delete the set first page, and execute the step of detecting the preset option associated with the BIOS setup interface.
[0138] In some embodiments, the attributes of the prompt words for each option may indicate the display attribute values of each option; the setting module 402 may specifically be configured to:
[0139] Set the display attributes of each option on the first page according to the attributes of the prompt words for each option on the first page.
[0140] In some embodiments, the setting module 402 may specifically be configured to:
[0141] Traverse each option on the first page;
[0142] If the display attribute value of the traversed option is a value indicating hidden, skip creating the traversed option;
[0143] 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.
[0144] An embodiment of the present application further provides an electronic device, 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 page display methods.
[0145] The machine-readable storage medium may include a Random Access Memory (RAM), and 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 far from the aforementioned processor.
[0146] 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.
[0147] In another embodiment provided by the present application, a computer-readable storage medium is further provided. A computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the above-mentioned any page display method is implemented.
[0148] In another embodiment provided by the present application, a computer program product including instructions is further provided. When it runs on a computer, the computer is caused to execute any page display method in the above embodiments.
[0149] 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. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). 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 (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
[0150] It should be noted that in this article, 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 variant 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 further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0151] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. 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 reference can be made to the corresponding parts of the method embodiments for the relevant content.
[0152] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are all included in the protection scope of the present application.
Claims
1. A page display method, characterized in that: Applied to electronic equipment, the method comprises: Detect the preset options associated with the BIOS setup interface; When it is detected that the value of the preset option indicates that the display attribute of the option in the page is set to the first preset display attribute, setting the display attribute of each option in the first page according to the display attribute value of each option in the first page; The first page after setting is displayed on the BIOS setting interface.
2. The method according to claim 1, characterized in that The method further comprises: When it is detected that the value of the preset option indicates that the display attribute of the options in the page is set to the second preset display attribute, the display attribute of each option in the first page is set to the second preset display attribute.
3. The method according to claim 2, characterized in that After displaying the first page after setting on the BIOS setting interface, the method further includes: In response to a user's shortcut key operation on the BIOS setup interface, switching the value of the preset option; The first page after the setting is deleted, and the step of detecting the preset options associated with the BIOS setting interface is re-executed.
4. The method according to claim 1, characterized in that: The attribute of the prompt word of each option indicates the display attribute value of each option; 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: According to the attribute of the prompt word of each option in the first page, the display attribute of each option in the first page is set.
5. The method according to claim 1, 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: Iterate through each option in the first page; If the display attribute value of the traversed option is a value indicating hidden, the creation of the traversed option is skipped; If the display property value of the traversed option is a value indicating graying out, the transparency of the traversed option is set to a preset transparency, and the state of the traversed option is set to a disabled state, wherein the preset transparency is greater than the minimum transparency and the preset transparency is less than the maximum transparency.
6. A page display device, characterized in that: Applied to electronic equipment, the device comprises: A detection module, used to detect preset options associated with the BIOS setup interface; A setting module, configured 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 when it is detected that the value of the preset option indicates that the display attribute of the option in the page is set to the first preset display attribute; The display module is used to display the first page after setting on the BIOS setting interface.
7. The device according to claim 6, characterized in that The setting module is also used for: When it is detected that the value of the preset option indicates that the display attribute of the options in the page is set to the second preset display attribute, the display attribute of each option in the first page is set to the second preset display attribute.
8. The device according to claim 7, characterized in that The device also includes a switching module, which is used to: After the first page after setting is displayed on the BIOS setting interface, in response to a shortcut key operation of the user on the BIOS setting interface, switching the value of the preset option; The first page after the setting is deleted, and the step of detecting the preset options associated with the BIOS setting interface is performed.
9. The device according to claim 6, characterized in that The attribute of the prompt word of each option indicates the display attribute value of each option; the setting module is specifically used to: According to the attribute of the prompt word of each option in the first page, the display attribute of each option in the first page is set.
10. The device according to claim 6, characterized in that The setting module is specifically used for: Iterate through each option in the first page; If the display attribute value of the traversed option is a value indicating hidden, the creation of the traversed option is skipped; If the display property value of the traversed option is a value indicating graying out, the transparency of the traversed option is set to a preset transparency, and the state of the traversed option is set to a disabled state, wherein the preset transparency is greater than the minimum transparency and the preset transparency is less than the maximum transparency.
11. 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 5.
12. 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 5 are implemented.
Citation Information
Patent Citations
Method for dynamically displaying and hiding BIOS SETUP options
CN106227548A
Setting method and system for basic input-output system
CN106933553A
Data processing method and apparatus based on layout engine
CN106951405A
Information processing method and electronic equipment
CN107621961A
Basic input output system setting interface display method and terminal device
CN107656785A