Disclosure of Invention
In view of this, embodiments of the present invention provide a method, a system, a computer device, and a computer readable storage medium for traversing dynamic options in an HII database, which introduce a traversal process for identifying dynamically generated options based on an existing traversal search framework, reserve an interface for identifying dynamic options, and effectively reduce the workload of newly added control options, and reduce the workload from nearly thousands of static table members covering all dynamic options to dozens of static table members, thereby reducing the time for traversing dynamic options and increasing the startup speed of a server.
Based on the above object, an aspect of the embodiments of the present invention provides a method for traversing dynamic options in an HII database, including the following steps: establishing a static table of dynamic options, taking one dynamic option in each type of dynamic options as a reference member, and determining the basic offset of the reference member; judging whether a dynamic option topology parameter exists or not, responding to the existence of the dynamic option topology parameter, and determining a corresponding static table according to the dynamic option topology parameter; determining a target HII page through a global unique identifier, acquiring the original offset of members of the target HII page, and determining a new offset according to the dynamic option topology parameter and the original offset; and matching the new offset with the basic offset, and setting a corresponding interface for the member to finish customizing content in response to the successful matching of the new offset and the basic offset.
In some embodiments, the creating a static table of dynamic options includes: and taking the initial global variable of each type of dynamic option as a mark, and establishing the relation between the mark and each dynamic option in the category to which the mark belongs.
In some embodiments, the determining the corresponding static table according to the topology parameter of the dynamic option includes: and determining a mark according to the topology parameters of the dynamic options, and finding each dynamic option in the category to which the dynamic option belongs according to the mark.
In some embodiments, the determining the corresponding static table according to the topology parameter of the dynamic option includes: and setting a Boolean type dynamic option mark according to the static table.
In some embodiments, the determining a new offset from the dynamic option topology parameter and the original offset comprises: and subtracting the product of the dynamic option topological parameter and the dynamic option mark from the original offset to obtain a new offset.
In some embodiments, the matching the new offset to the base offset comprises: and judging whether the difference value between the new offset and the basic offset in the static table is smaller than a threshold value, and responding to the fact that the difference value between the new offset and the basic offset in the static table is smaller than the threshold value, and then the matching is successful.
In some embodiments, the method further comprises: and judging whether each member in the static table completes the matching of the offset or not, and setting a completion identifier for the static table in response to that each member in the static table completes the matching of the offset.
In another aspect of the embodiments of the present invention, a system for traversing dynamic options in an HII database is provided, including: the establishing module is used for configuring a static table for establishing dynamic options, taking one dynamic option in each type of dynamic options as a reference member and determining the basic offset of the reference member; the judging module is configured to judge whether a dynamic option topology parameter exists or not, respond to the existence of the dynamic option topology parameter, and determine a corresponding static table according to the dynamic option topology parameter; the computing module is configured to determine a target HII page through a global unique identifier, obtain an original offset of a member of the target HII page, and determine a new offset according to the dynamic option topology parameter and the original offset; and the execution module is configured to match the new offset with the basic offset, and in response to successful matching of the new offset with the basic offset, set a corresponding interface to the member to complete customized content.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method as above.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has the following beneficial technical effects: by introducing the topological parameters established during the generation of the dynamic options, the corresponding options are quickly searched through the parameters in the traversal process, the traversal speed can be effectively improved, and the starting time is reduced; the patent also provides a configuration method of the optimized static table of the dynamic options, and all the dynamic options can be found only by setting the initial option in one type of dynamic options as reference, so that the workload of module development and maintenance is reduced, and the working efficiency is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In view of the above, a first aspect of the embodiments of the present invention provides an embodiment of a method for traversing dynamic options in an HII database. Fig. 1 is a schematic diagram illustrating an embodiment of a method for traversing dynamic options in an HII database according to the present invention. As shown in fig. 1, the embodiment of the present invention includes the following steps:
s1, establishing a static table of dynamic options, taking one dynamic option in each type of dynamic options as a reference member, and determining the basic offset of the reference member;
s2, judging whether a dynamic option topology parameter exists or not, responding to the existence of the dynamic option topology parameter, and determining a corresponding static table according to the dynamic option topology parameter;
s3, determining a target HII page through the global unique identifier, acquiring the original offset of the members of the target HII page, and determining a new offset according to the dynamic option topology parameters and the original offset; and
and S4, matching the new offset with the basic offset, and setting a corresponding interface for the member to finish the customized content in response to the successful matching of the new offset and the basic offset.
Briefly, the HII database is comprised of a number of HII pages, each of which contains a number of members, each member having a corresponding attribute. These attributes determine whether the member is visible in the BIOS control interface, selectable, and displayed. The hierarchical relationship between the HII page and the members is basically the same as the hierarchical level displayed by the BIOS control interface, so that the traversal time can be reduced by searching the HII page first and then searching the HII members.
In this patent, HII pages are mainly searched by globally unique identifiers, and HII members corresponding to each HII page are mainly searched by variable ID (identification), offset address and TOKEN (a section of hexadecimal number stated in the HII specification for identifying HII members). And after the corresponding member is found, providing a corresponding operation interface to realize the customization requirement of the option.
And establishing a static table of the dynamic options, taking one dynamic option in each type of dynamic options as a reference member, and determining the basic offset of the reference member. The static table accurately describes the attributes of each option, including variable ID, offset address, and TOKEN. For dynamically generated options, the static table needs to list all possible dynamically generated options as far as possible and describe the attributes of the options. The static table in the embodiment of the invention also needs to declare one of each type of dynamic options as a reference member, the variable name of the dynamic options uses an array form, the array length is the length of the topological parameter of the dynamic options, the default is the maximum value supported by a hardware theory, and the number of the supported dynamic options is updated to the number supported by actual hardware after the computer is started. The topology parameters are derived from identification and link of a source code for hardware in the startup process, and a group of variables which are dynamically updated include a memory topology, a hard disk topology, a PCIe (Peripheral component interconnect express) topology, a VMD (Volume Management Device) topology, and the like.
In some embodiments, the creating a static table of dynamic options includes: and taking the initial global variable of each type of dynamic option as a mark, and establishing the relation between the mark and each dynamic option in the category to which the mark belongs. Specifically, the static table of the dynamic options is established by taking the starting global variables of each type of dynamic options, that is, the first processor, the first memory, and the first PCIe interface that satisfy the host boot condition, that is, the corresponding first dynamic option. When the traversal function is transferred for processing, the topology parameters when the dynamic options are established are transmitted, and then the traversal function searches all the dynamic options related to the dynamic options according to the topology parameters. Therefore, different configuration conditions of the host can be ignored, and all the dynamic options can be found as long as one of the dynamic options can be found.
And judging whether the dynamic option topology parameters exist or not, responding to the existence of the dynamic option topology parameters, and determining a corresponding static table according to the dynamic option topology parameters.
In some embodiments, the determining the corresponding static table according to the topology parameter of the dynamic option includes: and determining a mark according to the topology parameters of the dynamic options, and finding each dynamic option in the category to which the dynamic option belongs according to the mark. The embodiment of the invention adds an input parameter, namely a dynamic option topology parameter, to the traversal function. After the parameter is introduced, the original loop structure for traversing the HII members is adjusted, when each member in the HII page is traversed, one member is not searched, one member is marked, a member strategy is executed, all dynamic options related to the dynamic options are searched instead through the marks of the dynamic options, jump search is carried out according to the topology parameter during traversal, and after all the dynamic options related to the dynamic options are searched, the dynamic options are marked to be completed.
In some embodiments, the determining the corresponding static table according to the topology parameter of the dynamic option includes: and setting a Boolean type dynamic option mark according to the static table. And if the traversal function receives the topology parameters of the dynamic options, marking the static table corresponding to the topology parameters, and setting a Boolean type dynamic option mark.
And determining a target HII page through the global unique identifier, acquiring the original offset of the members of the target HII page, and determining a new offset according to the dynamic option topology parameter and the original offset. The target HII page is searched for by the globally unique identifier, which belongs to the prior art and will not be described herein. After traversing to a target HII page, searching the members in the current HII page, acquiring the external attributes of the HII members, and then acquiring the member attributes declared in the static table.
In some embodiments, the determining a new offset from the dynamic option topology parameter and the original offset comprises: and subtracting the product of the dynamic option topological parameter and the dynamic option mark from the original offset to obtain a new offset. New offset-original offset-dynamic option topology parameter.
And matching the new offset with the basic offset, and setting a corresponding interface for the member to finish the customized content in response to the successful matching of the new offset and the basic offset.
In some embodiments, the matching the new offset to the base offset comprises: and judging whether the difference value between the new offset and the basic offset in the static table is smaller than a threshold value, and responding to the fact that the difference value between the new offset and the basic offset in the static table is smaller than the threshold value, and then the matching is successful.
In some embodiments, the method further comprises: and judging whether each member in the static table completes the matching of the offset or not, and setting a completion identifier for the static table in response to that each member in the static table completes the matching of the offset. The static table corresponding to the target HII page is searched for, and the static table with the completion identifier is firstly excluded.
And after the matching is successful, providing an HII member setting interface to finish the customized content. After the HII member is set, judging whether the topology parameters of the dynamic options are used completely, if so, marking the dynamic options in the static table as completed, and ignoring the member in the subsequent traversal; if not, point to the next member in the topology parameters of the dynamic option, and then continue to traverse the remaining HII members. The above search process of the dynamic options can be performed synchronously, and if there are multiple dynamic options defined in the corresponding static table in one HII page, the dynamic options can be found.
The embodiment of the invention introduces the traversal flow for identifying the dynamically generated options on the basis of the existing traversal search framework, reserves the interfaces for identifying the dynamic options, can effectively reduce the workload of newly added control options, and reduces the workload from nearly thousands of static list members covering all dynamic options to dozens of static list members. The time for traversing the dynamic options is reduced, and the starting speed of the server is improved.
It should be particularly noted that, the steps in the embodiments of the method for traversing dynamic options in the HII database may be intersected, replaced, added, or deleted, and therefore, these reasonable permutation and combination transformations should also belong to the scope of the present invention for the method for traversing dynamic options in the HII database, and should not limit the scope of the present invention to the embodiments.
In view of the above object, a second aspect of the embodiments of the present invention provides a system for traversing dynamic options in an HII database, including: the establishing module is used for configuring a static table for establishing dynamic options, taking one dynamic option in each type of dynamic options as a reference member and determining the basic offset of the reference member; the judging module is configured to judge whether a dynamic option topology parameter exists or not, respond to the existence of the dynamic option topology parameter, and determine a corresponding static table according to the dynamic option topology parameter; the computing module is configured to determine a target HII page through a global unique identifier, obtain an original offset of a member of the target HII page, and determine a new offset according to the dynamic option topology parameter and the original offset; and the execution module is configured to match the new offset with the basic offset, and in response to successful matching of the new offset with the basic offset, set a corresponding interface to the member to complete customized content.
In some embodiments, the establishing module is configured to: and taking the initial global variable of each type of dynamic option as a mark, and establishing the relation between the mark and each dynamic option in the category to which the mark belongs.
In some embodiments, the determining module is configured to: and determining a mark according to the topology parameters of the dynamic options, and finding each dynamic option in the category to which the dynamic option belongs according to the mark.
In some embodiments, the determining module is configured to: and setting a Boolean type dynamic option mark according to the static table.
In some embodiments, the computing module is configured to: and subtracting the product of the dynamic option topological parameter and the dynamic option mark from the original offset to obtain a new offset.
In some embodiments, the execution module is configured to: and judging whether the difference value between the new offset and the basic offset in the static table is smaller than a threshold value, and responding to the fact that the difference value between the new offset and the basic offset in the static table is smaller than the threshold value, and then the matching is successful.
In some embodiments, the system further comprises an identification module configured to: and judging whether each member in the static table completes the matching of the offset or not, and setting a completion identifier for the static table in response to that each member in the static table completes the matching of the offset.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: s1, establishing a static table of dynamic options, taking one dynamic option in each type of dynamic options as a reference member, and determining the basic offset of the reference member; s2, judging whether a dynamic option topology parameter exists or not, responding to the existence of the dynamic option topology parameter, and determining a corresponding static table according to the dynamic option topology parameter; s3, determining a target HII page through the global unique identifier, acquiring the original offset of the members of the target HII page, and determining a new offset according to the dynamic option topology parameters and the original offset; and S4, matching the new offset with the basic offset, and setting a corresponding interface for the member to complete the customized content in response to the successful matching of the new offset and the basic offset.
In some embodiments, the creating a static table of dynamic options includes: and taking the initial global variable of each type of dynamic option as a mark, and establishing the relation between the mark and each dynamic option in the category to which the mark belongs.
In some embodiments, the determining the corresponding static table according to the topology parameter of the dynamic option includes: and determining a mark according to the topology parameters of the dynamic options, and finding each dynamic option in the category to which the dynamic option belongs according to the mark.
In some embodiments, the determining the corresponding static table according to the topology parameter of the dynamic option includes: and setting a Boolean type dynamic option mark according to the static table.
In some embodiments, the determining a new offset from the dynamic option topology parameter and the original offset comprises: and subtracting the product of the dynamic option topological parameter and the dynamic option mark from the original offset to obtain a new offset.
In some embodiments, the matching the new offset to the base offset comprises: and judging whether the difference value between the new offset and the basic offset in the static table is smaller than a threshold value, and responding to the fact that the difference value between the new offset and the basic offset in the static table is smaller than the threshold value, and then the matching is successful.
In some embodiments, the steps further comprise: and judging whether each member in the static table completes the matching of the offset or not, and setting a completion identifier for the static table in response to that each member in the static table completes the matching of the offset.
Fig. 2 is a schematic hardware structural diagram of an embodiment of the computer device for traversing dynamic options in the HII database according to the present invention.
Taking the apparatus shown in fig. 2 as an example, the apparatus includes a processor 201 and a memory 202, and may further include: an input device 203 and an output device 204.
The processor 201, the memory 202, the input device 203 and the output device 204 may be connected by a bus or other means, and fig. 2 illustrates the connection by a bus as an example.
The memory 202, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method of traversing dynamic options in a HII database in the embodiments of the present application. The processor 201 executes various functional applications of the server and data processing, i.e., the method of traversing dynamic options in the HII database of the above-described method embodiments, by running non-volatile software programs, instructions, and modules stored in the memory 202.
The memory 202 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of a method of traversing dynamic options in the HII database, and the like. Further, the memory 202 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 202 may optionally include memory located remotely from processor 201, which may be connected to local modules via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 203 may receive information such as a user name and a password that are input. The output device 204 may include a display device such as a display screen.
Program instructions/modules corresponding to one or more methods of traversing dynamic options in the HII database are stored in the memory 202 and, when executed by the processor 201, perform the method of traversing dynamic options in the HII database in any of the method embodiments described above.
Any embodiment of a computer device implementing the method for traversing dynamic options in an HII database described above may achieve the same or similar effects as any of the preceding method embodiments corresponding thereto.
The invention also provides a computer readable storage medium storing a computer program which, when executed by a processor, performs the method as above.
Fig. 3 is a schematic diagram of an embodiment of a computer storage medium for traversing dynamic options in an HII database according to the present invention. Taking the computer storage medium as shown in fig. 3 as an example, the computer readable storage medium 3 stores a computer program 31 which, when executed by a processor, performs the method as described above.
Finally, it should be noted that, as one of ordinary skill in the art can appreciate that all or part of the processes of the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the program of the method for traversing dynamic options in the HII database can be stored in a computer-readable storage medium, and when executed, the program can include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.