Configuration option synchronization method and electronic equipment
Through nested loops and data structure construction, efficient synchronization between BIOS and BMC is achieved, solving the problems of inaccurate synchronization of BIOS configuration options and BMC and low operating efficiency, and improving the accuracy of configuration option management and the operating experience.
Patent Information
- Application Number
- CN202511223457.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-08-29
AI Technical Summary
In the prior art, the synchronization method of BIOS configuration options with BMC has problems of inaccurate synchronization and low operation efficiency, especially in large data centers or remote areas, resulting in high labor costs, high time costs and easy misoperation.
Through nested loops, each page and control in the BIOS configuration options is traversed, the option name, optional value and current value of the modifiable control are extracted, a first object is constructed, and the target directory name of the control is extracted to construct a second object, forming a data structure of the configuration options and achieving efficient synchronization between the BIOS and the BMC.
The accuracy and reliability of configuration option synchronization are improved. Users can quickly and clearly locate target options through the BMC interface, reducing misoperations and improving operational efficiency and ease of use.
Smart Images

Figure CN120743382A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of basic input / output system configuration options, and in particular to a configuration option synchronization method and an electronic device. Background Art
[0002] To meet different application scenarios, different configuration options can be selected for the Basic Input Output System (BIOS). The Baseboard Management Controller (BMC) can remotely set the BIOS configuration options. However, the prerequisite for the BMC to remotely configure the BIOS configuration options is that the BIOS configuration options must be highly synchronized with the BMC.
[0003] Therefore, how to synchronize the configuration options of BIOS with BMC is an urgent problem to be solved. Summary of the Invention
[0004] The present application provides a configuration option synchronization method and an electronic device, which can realize the synchronization of configuration options.
[0005] This application provides a configuration option synchronization method, including:
[0006] Extract each page of the system's configuration options based on an outer loop of a nested loop, and extract controls in each page based on an inner loop of the nested loop; determine a first control that can be modified based on the page status of the page where each control is located and the control status of the corresponding control; construct a first object of the first control based on the option name, optional value and current value of the first control; extract the target directory name of the page where the corresponding control is located based on the parent page of the page where each control is located, and construct a second object of each control based on the target directory name of each control; construct a data structure of the configuration options based on the second object of each control and the first object of the first control, and synchronize the configuration options based on the data structure of the configuration options.
[0007] The present application also provides a configuration option synchronization device, including: a traversal module, used to extract each page in the configuration options of the system based on the outer loop of the nested loop, and extract the controls in each page based on the inner loop of the nested loop; a first control determination module, used to determine the first control that can be modified based on the page status of the page where each control is located and the control status of the corresponding control; a first object determination module, used to construct the first object of the first control based on the option name, optional value and current value of the first control; a second object determination module, used to extract the target directory name of the page where the corresponding control is located based on the parent page of the page where each control is located, and construct the second object of each control based on the target directory name of each control; a synchronization data acquisition module, used to construct the data structure of the configuration option based on the second object of each control and the first object of the first control, and realize the synchronization of the configuration option based on the data structure of the configuration option.
[0008] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned configuration option synchronization methods when executing the computer program.
[0009] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned configuration option synchronization methods are implemented.
[0010] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned configuration option synchronization methods when executed by a processor.
[0011] Through the present application, each page and control in the configuration options is traversed through a nested loop to avoid missing the controls of the configuration options. At the same time, the option name, optional value and current value of the first control that can be modified in the configuration options are extracted to construct a first object, which indicates the option data of the modifiable control; and the target directory name of each control is extracted to construct a second object, which can present the directory hierarchical structure of each control. In this way, the data structure of the configuration options constructed by the first object and the second object can accurately describe the option information of the first control in the configuration options and the hierarchical structure of each control. In this way, the structured data of the configuration options can be synchronized through the data structure of the configuration options, thereby improving the accuracy and reliability of the configuration option synchronization. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0013] Figure 1 An implementation scenario diagram provided for an embodiment of the present application;
[0014] Figure 2 Schematic diagram of the process of synchronizing the configuration options provided in the embodiment of the present application Figure 1 ;
[0015] Figure 3 Schematic diagram of the process of synchronizing configuration options provided in the embodiment of the present application Figure 2 ;
[0016] Figure 4 Schematic diagram of the process of synchronizing configuration options provided in the embodiment of the present application Figure 3 ;
[0017] Figure 5 A schematic diagram of the structure of the configuration option synchronization device subject provided in an embodiment of the present application;
[0018] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, other embodiments obtained by ordinary technicians in this field without making any creative work are all within the scope of protection of this application.
[0020] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0021] Servers are the core infrastructure for data processing and storage. Flexible configuration of their functions can meet the needs of diverse application scenarios. Adjusting the BIOS configuration options within the server is a common and critical operation for achieving customized server functions.
[0022] Some BIOS configuration options require accessing the BIOS Setup interface or using operating system (OS) tools. However, this method requires physical access to the server, which can be extremely inconvenient for large data centers with centralized server deployments or servers located in remote areas. This increases labor and time costs and can also increase the risk of hardware damage due to frequent physical manipulation. Furthermore, this method is relatively cumbersome, making it difficult for non-professionals to understand and operate the complex options within the BIOS Setup interface, making it prone to errors that can affect server operation.
[0023] Other BIOS configuration options are set through the BMC's remote management interface. As an important component of server management, BMC provides a convenient remote management platform. Without physical contact with the server, BIOS configuration options can be configured and monitored remotely on the BMC platform. This significantly improves operational convenience, greatly saves time and labor costs, and reduces the risk of hardware damage caused by physical contact with the server.
[0024] However, the key to enabling efficient remote configuration of BIOS configuration options by the BMC lies in the structured synchronization of BIOS configuration option data. The BIOS needs to accurately synchronize the complete configuration option data to the BMC. Some BMC and BIOS configuration option synchronization methods can only provide a flat list of BIOS configuration options on the BMC. As a result, when these configuration options are displayed on the BMC control interface, the options in the configuration options are listed together indiscriminately. When staff are looking for options related to specific functions, they have difficulty finding the corresponding options, which is extremely inefficient and easily leads to incorrect selections, affecting the accuracy of server configuration.
[0025] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0026] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the configuration option synchronization method depends, the specific application environment architecture or specific hardware architecture is described here. Figure 1 , Figure 1 An implementation scenario diagram provided for an embodiment of the present application.
[0027] like Figure 1 As shown, the implementation scenario includes a client 10 and a server 11, and the client 10 and the server 11 are connected via network communication.
[0028] In this embodiment, the client 10 is an electronic device on the user side, which can be a wired terminal with a visual structure or a wireless terminal. In other embodiments, the terminal can be an electronic device with a visual structure such as a mobile phone, computer, tablet, and vehicle-mounted equipment.
[0029] The server 11 can be an edge environment and a cloud environment, such as a physical server, a server cluster, and a cloud server, etc., and no specific restrictions are made here.
[0030] The server 11 is provided with a BIOS system, which provides a function of extracting configuration options in the BIOS and obtaining a data structure of the configuration options, thereby transmitting the data structure of the configuration options to the BMC to achieve synchronization of the configuration options between the BMC and the BIOS.
[0031] The execution entity of the method of the embodiment of the present application is the server 11, and the client 10 can receive a request for synchronization of configuration options. The client 10 sends the request for synchronization of configuration options to the server 11 through the network. The server 11 synchronizes the configuration options, obtains the data structure of the configuration options, and can feed back the data structure of the configuration options to the client 10 through the network. The client 10 has a graphic user interface, and the data structure of the configuration options can be displayed on the graphic interface.
[0032] In some embodiments, the server 11 extracts each page in the configuration options based on the outer loop of the nested loop, and extracts the controls in each page based on the inner loop of the nested loop; determines the first control that can be modified based on the page status of the page where each control is located and the control status of the corresponding control; constructs the first object of the first control based on the option name, optional value and current value of the first control; extracts the target directory name of the page where the corresponding control is located based on the parent page of the page where each control is located, and constructs the second object of each control based on the target directory name of each control; constructs the data structure of the configuration options based on the second object of each control and the first object of the first control, and the data structure of the configuration options is used to achieve synchronization of the configuration options.
[0033] It is understood that the configuration option synchronization device can be set at Figure 1 In the server 11, but the example shown in this embodiment Figure 1 The implementation environment shown is only exemplary. In other embodiments, the configuration option synchronization determination method can also be applied to other implementation environments, and the configuration option synchronization device can also be set in other structures in other implementation environments. No specific limitations are made here.
[0034] Figure 2 Schematic diagram of the process of synchronizing configuration options provided in the embodiment of the present application Figure 1 ,like Figure 2As shown, an embodiment of the present application provides a configuration option synchronization method, which is described in detail as follows:
[0035] S201 . Extracting each page in the configuration options of the system based on an outer loop of the nested loop, and extracting controls in each page based on an inner loop of the nested loop.
[0036] In some embodiments, the configuration options of the system are configuration options of the BIOS.
[0037] BIOS configuration options are used to determine hardware initialization, boot process, security policy, power consumption and performance before the operating system is loaded.
[0038] Controls are interactive elements on the BIOS interface that are used to receive user input, display information, or trigger certain operations.
[0039] In some embodiments, the configuration options of the BIOS include multiple pages, each page of which is provided with multiple controls. When the BMC synchronizes with the BIOS, it is necessary to synchronize the various controls in the BIOS configuration options, the pages where the controls are located, the directory relationships between the pages, etc. to the BMC. In this way, the configuration options of the BIOS can be synchronized in the BMC, and the arrangement of the various pages and controls in the configuration options synchronized in the BMC is the same as that in the BIOS, which facilitates the configuration of the BIOS configuration options through the BMC.
[0040] In some embodiments, a loop structure is used to poll each page in the configuration options and each control under each page.
[0041] In some embodiments, in order to ensure complete traversal of the pages in the configuration options and the controls on each page, a nested loop is used. The outer loop traverses the pages of the configuration options, and the inner loop traverses the controls under the current page traversed by the outer loop. In this way, each control on each page can be traversed.
[0042] Using nested loops to iterate through all pages and controls under each page in turn can ensure that all elements of the configuration options are fully visited and no controls are missed.
[0043] In some embodiments, when extracting pages and controls in a loop, a data structure may be set to store page and control information, such as a list storing pages, and each page element containing a sublist storing the controls thereunder to support loop traversal operations.
[0044] S202: Determine a first control that can be modified based on the extracted page status of the page where each control is located and the control status of the corresponding control.
[0045] In some embodiments, after a control is extracted, it is determined whether the control is a modifiable control, that is, whether the control is in a modifiable state.
[0046] In some embodiments, when a control is traversed, it is determined whether the control is the first control that can be modified based on the state of the page where the control is located and the control state of the control.
[0047] In some embodiments, if a control is a modifiable control, the control has data such as option names and optional values. In order to achieve complete synchronization of configuration options, the data corresponding to the first control needs to be extracted subsequently.
[0048] In some embodiments, it is determined that the page state of the page is a second control that is not hidden, and it is determined whether the control state of the second control is a target state; the target state includes at least one of a grayed-out state and a disabled state; if the state of the second control is not the target state, it is determined that the second control is the first control; if the state of the second control is the target state, it is determined that the second control is not the first control.
[0049] S203: Construct a first object of the first control based on the option name, optional value, and current value of the first control.
[0050] In some embodiments, the first control is a modifiable control, so the option name, optional value and current value of the first control can be extracted, and the first object of the first control can be constructed according to the option name, optional value and current value of the first control.
[0051] In some embodiments, there is a corresponding first object for each different first control, and the first object contains the option name, optional value, and current value of the corresponding first control.
[0052] S204: Based on the parent page of the page where each control is located, extract the target directory name of the page where the corresponding control is located, and construct the second object of each control based on the target directory name of each control.
[0053] In some embodiments, for each extracted control, the target directory name of the page where the corresponding control is located is extracted based on the parent page of the page where the control is located.
[0054] In some embodiments, different controls correspond to target directory names, which include the directory name of the page where the control is located and the directory name of the outer page of the page where the control is located, that is, the target directory name indicates the directory level of the page where the corresponding control is located.
[0055] According to the target directory name, the second object of each control can be constructed.
[0056] In this way, each control has a corresponding second object, and for the first control, there is also a first object of the first control.
[0057] That is, the first control has a first object and a second object, and the other controls in the configuration options except the first control have second objects.
[0058] S205: Construct a data structure of the configuration options based on the second object of each control and the first object of the first control, and synchronize the configuration options based on the data structure of the configuration options.
[0059] In this way, a data structure of the configuration options can be constructed based on the second object of each control and the first object of the first control. The data structure includes the first object of the first control, that is, the option name, optional value, and current value of the first control in the configuration options, and also includes the second object of each control, that is, the directory hierarchy of each control in the configuration options. In this way, the data structure of the configuration options can clearly reflect the organizational structure of the selected controls and the modifiable data of the first control in the BMC, thereby improving the efficiency and accuracy of configuration option synchronization.
[0060] In an embodiment of the present application, a nested loop is used to traverse each page and control in the configuration options to avoid missing controls of the configuration options. At the same time, the option name, optional value and current value of the first control that can be modified in the configuration options are extracted to construct a first object, which indicates the option data of the modifiable control; and the target directory name of each control is extracted to construct a second object, which can present the directory hierarchical structure of each control. In this way, the data structure of the configuration options constructed by the first object and the second object can accurately describe the option information of the first control in the configuration options and the hierarchical structure of each control. In this way, the structured data of the configuration options can be synchronized through the data structure of the configuration options, thereby improving the accuracy and reliability of the synchronization of the configuration options.
[0061] The data structure of this configuration option is applied to the BMC. The BMC can display the structured data of the configuration option. In this way, when the user controls the BIOS through the BMC, he can quickly and clearly locate the target option in the configuration option.
[0062] Figure 3 Schematic diagram of the process of synchronizing configuration options provided in the embodiment of the present application Figure 2 ,like Figure 3 As shown, an embodiment of the present application provides a method for determining a first control, which is described in detail as follows:
[0063] S301: Determine whether the page state of the page where the second control is located is a non-hidden state, and determine whether the control state of the second control is a target state; the target state includes at least one of a grayed-out state and a disabled state.
[0064] In some embodiments, when extracting a page of configuration options through an outer loop, a page whose page status is not hidden may be determined, and a control in the page whose page status is not hidden may be the second control.
[0065] In some embodiments, the state of a page, whether it is a hidden state or an unhidden state, can be determined by a tag of the page.
[0066] In some embodiments, for the second control, it is determined whether the control state of the second control is the target state.
[0067] In some embodiments, the target state includes at least one of a grayed-out state and a disabled state.
[0068] In some embodiments, a control in a grayed-out state may be visible on the page but cannot be operated, such as cannot be selected or modified.
[0069] In some embodiments, a control whose control state is disabled is not effective in the configuration options.
[0070] S302: When the control state of the second control is not the target state, determine that the second control is the first control.
[0071] In some embodiments, if the state of the second control is not the target state, the second control can be operated or is in an activated state, so that the second control can be modified and can be regarded as the first control.
[0072] S303: When the control state of the second control is the target state, determine that the second control is not the first control.
[0073] In some embodiments, if the control state of the second control is the target state, the second control is inoperable or ineffective, and the second control cannot be modified. Therefore, the second control can be regarded as not being the first control.
[0074] In an embodiment of the present application, the first control that can be modified is accurately screened out through the page state and control state of the control. As a result, detailed information such as option name, optional value, and current value can be obtained only for the first control in the future, avoiding the steps of obtaining option name, optional value, and current value for non-modifiable controls, thereby improving the efficiency of data acquisition in configuration options.
[0075] In some embodiments, after determining the first control, the option name, optional value and current value of the first control are obtained, the option name of the first control is used as the key, and the optional value and current value of the first control are used as the value to construct a key-value pair of the first control; the initial first object of the first control is constructed, and the key-value pair of the first control is added to the initial first object to obtain the first object.
[0076] In some embodiments, each first control has a corresponding key-value pair (key:value), and the option name, optional value, and current value of the first control are added to the initial first object in the format of the key-value pair to obtain the first object.
[0077] In some embodiments, the option information of the first control is stored in the first object in the form of a key-value pair to facilitate subsequent processing and transmission of the option information of the first control.
[0078] In some embodiments, for a first control, the option name, optional value, and current value of the corresponding first control may be extracted through a control handle of the first control.
[0079] In some embodiments, a control handle of the first control is obtained, and an extraction function is constructed based on the control handle of the first control; and the option name, optional value, and current value of the first control are extracted based on the extraction function.
[0080] In some embodiments, the control handle is an identifier of the control in the configuration options.
[0081] In some embodiments, the extraction function may be a HiiGetString function, which is a function in UEFI / HII (Human-Machine Interface Infrastructure) and is used to obtain the text content of the control handle in the current language based on the control handle and language, and obtain the option name, optional value, and current value of the first control corresponding to the control handle.
[0082] In some embodiments, the server can automatically obtain the control handle of the first control, and an extraction function template is stored in the server. The control handle of the first control is substituted into the extraction function template to obtain the extraction function.
[0083] In other embodiments, the control handle of the first control can also be manually obtained, and an extraction function can be manually constructed based on the control handle of the first control. The extraction function can be manually input into the server, and the server extracts the option name, optional value and current value of the first control in response to the received extraction function.
[0084] It can be understood that the extraction function includes the control handle of the first control, so that the first control whose option name, optional value and current value need to be extracted can be accurately located through the control handle in the extraction function.
[0085] Figure 4 Schematic diagram of the process of synchronizing configuration options provided in the embodiment of the present application Figure 3 ,like Figure 4 As shown, an embodiment of the present application provides a method for determining the name of a target directory, which is described in detail as follows:
[0086] S401: Extract the parent page of the page where each control is located, and determine whether the page where the corresponding control is located is a root page based on the page identifier of the parent page of the page where the control is located.
[0087] In some embodiments, there is a hierarchical relationship between the various pages in the configuration options.
[0088] In some embodiments, for a page where a control is located, the parent page of the page where the control is located is increased, and based on the page identifier of the parent page of the page where the control is located, it is determined whether the page where the corresponding control is located is a root page.
[0089] If the page ID (pageparentid) of the parent page of the page where the control is located is 0, it means that the page where the control is located does not have a parent page, that is, the page where the control is located is the outermost page of the hierarchical relationship between the pages in the configuration options, that is, the page where the control is located is the root page.
[0090] S402: If the page where the corresponding control is located is a root page, determine the directory name of the page where the corresponding control is located as the target directory name.
[0091] If the page where the corresponding control is located is the root page, that is, the page where the control is located does not have a page at the previous level, the directory name of the page where the control is located is determined as the target directory name.
[0092] S403. If the page where the corresponding control is located is not the root page, traverse upward based on the parent page of the page where the corresponding control is located until the root page of the page where the corresponding control is located is obtained, and determine the directory name of the pages contained between the page where the corresponding control is located and the root page of the page where the corresponding control is located as the target directory name.
[0093] If the page where the corresponding control is located is not the root page, it means that there is a page of the upper level where the control is located. Based on the parent page of the page where the corresponding control is located, traverse upward until the root page of the page where the corresponding control is located is obtained. The root page of the page where the control is located is the outermost page. There can be N pages between the root page of the page where the control is located and the page where the control is located, where N is an integer greater than or equal to 0.
[0094] The directory name of the pages contained between the page where the control is located and the root page of the page where the control is located is determined as the target directory name. The target directory name includes the directory name of the page where the control is located, the directory name of N pages between the root page of the page where the control is located and the page where the control is located, and the directory name of the root page of the page where the control is located.
[0095] In some embodiments, a method for determining the root page of the page where a control is located is proposed: the parent page of the page where the corresponding control is located is determined as the first page, and whether the first page is the root page is determined based on the page identifier of the parent page of the first page; if the first page is the root page, the first page is determined to be the root page of the page where the corresponding control is located; if the first page is not the root page, the steps of setting the parent page of the first page as the first page and determining whether the first page is the root page based on the page identifier of the parent page of the first page are executed in a loop until the first page is the root page.
[0096] In some embodiments, if the page where the corresponding control is located is not the root page, the parent page of the page where the corresponding control is located is determined to be the first page, and whether the first page is the root page is determined based on the page identifier of the parent page of the first page.
[0097] If the page identifier of the parent page of the first page is 0, the parent page of the first page is the root page, and the first page can be determined as the root page of the page where the corresponding control is located.
[0098] If the page identifier of the parent page of the first page is not 0, the parent page of the first page is not the root page, and the steps of determining the parent page of the first page as the new first page and judging whether the first page is the root page are executed in a loop until the first page is the root page, and the first page that is the root page is determined as the root page of the page where the corresponding control is located.
[0099] For example, in some embodiments, for control A, the page where control A is located is not the root page, the parent page of the page where control A is located is determined to be the first page, the identifier of the parent page of the page where control A is located is set to a, and it is determined whether the first page a is the root page. If the first page a is the root page, then the first page a is the root page of the page where control A is located. If the first page a is not the root page, the parent page of the first page a is determined to be the first page, and the parent page of the first page a is identified as b. It is determined whether the first page b is the root page through the page identifier of the parent page of the first page b. If the first page b is the root page, then the first page b is the root page of the page where control A is located. If the first page b is not the root page, the parent page of the first page b is determined to be the first page. In this way, the step of using the parent page of the first page as the new first page is repeated until the first page is the root page, and the first page that is the root page is used as the root page of the page where control A is located.
[0100] The root page of the page where the control is located is the outermost page.
[0101] In this method, the target directory name of the control is extracted. The target directory name includes the directory name of each layer of pages between the page where the control is located and the root page of the page where the control is located, providing a basis for accurately displaying the directory hierarchy of configuration options on the BMC interface later.
[0102] In some embodiments, in order to make the target directory name of each control better reflect the hierarchy of the page where the control is located, the directory name of each page is recorded in sequence according to the order of the pages involved in traversing the root page of the page where the control is located to obtain the target directory name of the control, so that the target directory name of the control can clearly reflect the hierarchical relationship between each layer of pages from the page where the control is located to the root page of the page where the control is located.
[0103] In some embodiments, based on the order of the page where each control is located to the root page of the page where each control is located, the directory names of the pages contained between the page where each control is located and the root page of the page where the corresponding control is located are recorded in sequence to obtain the target directory name corresponding to each control.
[0104] For example, for the above-mentioned control A, when traversing to obtain the root page of the page where control A is located, the directory name of the page where control A is located is recorded, and the directory name of each first page in the traversal is recorded in sequence until the root page of the control A page is recorded. The directory names recorded in sequence finally obtain the target directory name. For example, for control A, the first page b is the root page, then the first page b is the root page of the page where control A is located, and the target directory name of control A is the directory name of the page where control A is located, the directory name of the first page a, and the directory name of the first page b recorded in sequence.
[0105] In some embodiments, the first object and the second object of the first control and the second object of the third control are added to a linked list according to a hierarchical structure to obtain a data structure of configuration options; wherein the third control is a control other than the first control.
[0106] In some embodiments, the linked list is a JSON (JavaScript Object Notation) linked list.
[0107] The first object and the second object of the first control and the second object of the third control are added to the JSON linked list according to the hierarchical structure to obtain the data structure of the configuration options.
[0108] In some embodiments, a list may be used to represent a JSON linked list, with each element representing information at one level.
[0109] In some embodiments, after obtaining the data structure of the configuration options, the data in the data structure of the configuration options is sent to the BMC via a uniform resource locator (URL) specific to Redfish (an open standard management interface for data center servers and management hardware), and the BMC displays the data in the data structure of the configuration options on the BMC interface according to the directory hierarchy of the data structure of the configuration options.
[0110] The data in the configuration option data structure is sent to the BMC through a Redfish-specific URL, achieving efficient data interaction between the system and the BMC. This enables the BMC to intuitively display the directory hierarchy of the control on the BMC interface according to the second object, making it easier for users to view and operate.
[0111] After BMC parses the data structure file of this configuration option, it dynamically constructs a tree-like directory structure on the management interface that is completely consistent with the native BIOS Setup. Users can navigate step by step through the familiar classification path to clearly and quickly locate the target option.
[0112] Finally, users can directly view all configurable items of configuration options according to logical grouping in the BMC interface, achieving the accuracy and efficiency of configuration option synchronization, and significantly improving the usability and operation experience of configuration option management. Configuration options can be configured through BMC.
[0113] In an embodiment of the present application, the data structure of the configuration options includes option information of the modifiable control (including option name, current value, and optional value range) and the directory hierarchy relationship (target directory name) in the BIOS Setup interface. After the BMC parses the data structure of this configuration option, it dynamically constructs a tree-like directory structure on the management interface that is completely consistent with the native BIOS Setup. Through the intuitive directory structure, the required options in the configuration options can be quickly located, which greatly improves the operational efficiency of the BMC controlling the BIOS, reduces the possibility of misoperation, and provides users with a more convenient, efficient, and accurate BIOS configuration experience.
[0114] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0115] Figure 5 This is a structural diagram of the configuration option synchronization device theme provided in the embodiment of the present application. Figure 5 As shown, an embodiment of the present application further provides a configuration option synchronization device, comprising:
[0116] The traversal module 510 is configured to extract each page in the configuration options of the system based on an outer loop of the nested loop, and to extract controls in each page based on an inner loop of the nested loop.
[0117] The first control determination module 530 is configured to determine a first control that can be modified based on the extracted page status of the page where each control is located and the control status of the corresponding control.
[0118] The first object determining module 550 is configured to construct a first object of the first control based on the option name, optional value, and current value of the first control.
[0119] The second object determination module 570 is configured to extract the target directory name of the page where each control is located based on the parent page of the page where each control is located, and construct the second object of each control based on the target directory name of each control.
[0120] The synchronization data acquisition module 590 is used to construct a data structure of configuration options based on the second object of each control and the first object of the first control, and to synchronize the configuration options based on the data structure of the configuration options.
[0121] In some embodiments, the first control determination module 530 includes:
[0122] The page state processing unit is used to determine that the page state of the page is the second control in the non-hidden state, and determine whether the control state of the second control is the target state; the target state includes at least one of the grayed-out state and the disabled state.
[0123] The first judgment unit is configured to determine that the second control is the first control when the control state of the second control is not the target state.
[0124] The second judgment unit is configured to determine that the second control is not the first control when the control state of the second control is the target state.
[0125] In some embodiments, the first object determination module 550 includes:
[0126] The information extraction unit is used to obtain the option name, optional value and current value of the first control, and construct a key-value pair of the first control using the option name of the first control as a key and the optional value and current value of the first control as values.
[0127] The object construction unit is used to construct an initial first object of the first control, and add the key-value pair of the first control to the initial first object to obtain the first object.
[0128] In some embodiments, the information extraction unit includes:
[0129] The function construction section is used to obtain the control handle of the first control and construct an extraction function based on the control handle of the first control.
[0130] The information extraction section is used to extract the option name, optional value and current value of the first control based on the extraction function.
[0131] In some embodiments, the information extraction unit includes: a function processing section for extracting the option name, optional value and current value of the first control in response to a received extraction function, where the extraction function includes a control handle of the first control.
[0132] In some embodiments, the second object determination module 570 includes:
[0133] The root page determination unit is configured to extract the parent page of the page where each control is located, and determine whether the page where the corresponding control is located is a root page based on the page identifier of the parent page of the page where the control is located.
[0134] The first target directory name determining unit is configured to determine the directory name of the page where the corresponding control is located as the target directory name if the page where the corresponding control is located is the root page.
[0135] The second target directory name unit is used to traverse upward based on the parent page of the page where the corresponding control is located, if the page where the corresponding control is located is not the root page, until the root page of the page where the corresponding control is located is obtained, and determine the directory name of the pages contained between the page where the corresponding control is located and the root page of the page where the corresponding control is located as the target directory name.
[0136] In some embodiments, the second target directory name unit includes:
[0137] The judgment section is used to determine the parent page of the page where the corresponding control is located as the first page, and determine whether the first page is the root page based on the page identifier of the parent page of the first page.
[0138] The root page determination section is used to determine that the first page is the root page of the page where the corresponding control is located if the first page is the root page.
[0139] The loop section is used to loop through the steps of taking the parent page of the first page as the first page and determining whether the first page is the root page based on the page identifier of the parent page of the first page if the first page is not the root page, until the first page is the root page.
[0140] In some embodiments, the second target directory name unit includes: a target directory name section, which is used to record the directory names of the pages contained between the page where each control is located and the root page of the page where the corresponding control is located, based on the order of the page where each control is located to the root page of the page where each control is located, to obtain the target directory name corresponding to each control.
[0141] In some embodiments, the synchronization data acquisition module 590 includes:
[0142] The synchronous data acquisition unit is used to add the first object and the second object of the first control and the second object of the third control to the linked list according to the hierarchical structure to obtain the data structure of the configuration options; wherein the third control is a control other than the first control.
[0143] For the description of the features in the embodiment corresponding to the configuration option synchronization device, please refer to the relevant description of the embodiment corresponding to the configuration option synchronization method, which will not be repeated here.
[0144] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 6 As shown, the electronic device 60 provided in this embodiment includes: at least one processor 601 and a memory 602. Optionally, the electronic device 60 further includes a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected via a bus.
[0145] During the specific implementation process, at least one processor 601 executes the computer program stored in the memory 602, so that the at least one processor 601 executes the above-mentioned configuration option synchronization method embodiment.
[0146] The specific implementation process of the processor 601 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0147] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.
[0148] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.
[0149] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0150] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above configuration option synchronization method embodiments when running.
[0151] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0152] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above configuration option synchronization method embodiments are implemented.
[0153] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned configuration option synchronization method embodiments are implemented.
[0154] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0155] The above is a detailed introduction to a configuration option synchronization method and electronic device provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A configuration option synchronization method, characterized in that: include: Extracting each page of the system configuration options based on an outer loop of the nested loop, and extracting controls in each page based on an inner loop of the nested loop; Determining a first control that can be modified based on the extracted page status of the page where each control is located and the control status of the corresponding control; Construct a first object of the first control based on the option name, optional value and current value of the first control; Based on the parent page of the page where each control is located, extract the target directory name of the page where the corresponding control is located, and construct the second object of each control based on the target directory name of each control; A data structure of the configuration options is constructed based on the second object of each control and the first object of the first control, and synchronization of the configuration options is achieved based on the data structure of the configuration options.
2. The method according to claim 1, characterized in that The determining, based on the extracted page status of the page where each control is located and the control status of the corresponding control, a first control that can be modified includes: Determine a second control whose page state is a non-hidden state, and determine whether the control state of the second control is a target state; the target state includes at least one of a grayed-out state and a disabled state; When the control state of the second control is not the target state, determining that the second control is the first control; When the control state of the second control is the target state, it is determined that the second control is not the first control.
3. The method according to claim 1 or 2, characterized in that The constructing the first object of the first control based on the option name, optional value, and current value of the first control includes: Obtain the option name, optional value, and current value of the first control, and construct a key-value pair of the first control using the option name of the first control as a key and the optional value and current value of the first control as values; An initial first object of the first control is constructed, and a key-value pair of the first control is added to the initial first object to obtain the first object.
4. The method according to claim 3, characterized in that The obtaining of the option name, optional value, and current value of the first control includes: Obtaining a control handle of the first control, and constructing an extraction function based on the control handle of the first control; The option name, optional value and current value of the first control are extracted based on the extraction function.
5. The method according to claim 3, characterized in that The obtaining of the option name, optional value, and current value of the first control includes: The option name, selectable value, and current value of the first control are extracted in response to the received extraction function, the extraction function including the control handle of the first control.
6. The method according to claim 1, wherein The step of extracting the target directory name of the page where the corresponding control is located based on the parent page of the page where the control is located includes: Extracting the parent page of the page where each control is located, and determining whether the page where the corresponding control is located is a root page based on the page identifier of the parent page of the page where the control is located; If the page where the corresponding control is located is the root page, the directory name of the page where the corresponding control is located is determined as the target directory name; If the page where the corresponding control is located is not the root page, traverse upward based on the parent page of the page where the corresponding control is located until the root page of the page where the corresponding control is located is obtained, and determine the directory name of the pages contained between the page where the corresponding control is located and the root page of the page where the corresponding control is located as the target directory name.
7. The method according to claim 6, characterized in that The traversal upwards based on the parent page of the page where the corresponding control is located until the root page of the page where the corresponding control is located is obtained includes: Determine the parent page of the page where the corresponding control is located as the first page, and determine whether the first page is a root page based on the page identifier of the parent page of the first page; If the first page is a root page, determining that the first page is the root page of the page where the corresponding control is located; If the first page is not the root page, the steps of taking the parent page of the first page as the first page and determining whether the first page is the root page based on the page identifier of the parent page of the first page are executed in a loop until the first page is the root page.
8. The method according to claim 6, characterized in that The step of determining the directory name of the pages between the page where the corresponding control is located and the root page of the page where the corresponding control is located as the target directory name includes: Based on the order from the page where each control is located to the root page of the page where each control is located, the directory names of the pages included between the page where each control is located and the root page of the page where the corresponding control is located are recorded in sequence to obtain the target directory name corresponding to each control.
9. The method according to claim 1, characterized in that The step of constructing the data structure of the configuration options based on the second object of each control and the first object of the first control includes: The first object and the second object of the first control and the second object of the third control are added to a linked list according to a hierarchical structure to obtain a data structure of the configuration option; wherein the third control is a control other than the first control.
10. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the method according to any one of claims 1 to 9 when executing the computer program.
Citation Information
Patent Citations
Method and device for modifying server configuration file
CN104298686A
Complex parameter-based configuration display control system
CN106569801A
Traversal test path generation method and device, electronic equipment and readable storage medium
CN114721925A
Web control element management method and device, electronic equipment and medium
CN116431950A
Page content display control method, system and equipment and medium
CN116483360A