A method, device, electronic device and medium for saving BIOS storage space
By obtaining the static configuration difference data table and dynamically calling the initial data in the default static configuration data table according to its content for hardware initialization, the problems of limited BIOS storage space and large human resources investment are solved, and the effective reduction of BIOS storage space and manpower are achieved. Reduced resources.
Patent Information
- Application Number
- CN202111442875.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2041-11-30
AI Technical Summary
The prior art has limited BIOS storage space, resulting in large investment in human resources, making it difficult to effectively reduce the use of BIOS storage space and human resources investment.
By obtaining the static configuration difference data table, determine whether it is empty. If it is empty, use the initial data in the default static configuration data table for hardware initialization; if it is not empty, the first data in the static configuration difference data table is based on the static configuration difference data table. and the default static configuration data table does not require hardware initialization of the initial data that is updated by the first data.
It effectively reduces the use of BIOS storage space, reduces human resources investment, ensures the implementation of BIOS normalized design, and ensures the accuracy of data calls.
Smart Images

Figure CN114327472B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data storage, and in particular to a method, device, electronic device and medium for saving BIOS storage space. Background Art
[0002] As the progress of the information age continues to deepen, data and video carriers are getting larger and larger. The business in the fields of communication intelligence, artificial intelligence, and the Internet has more and more demands for data storage and processing. At the same time, the deployment and use of server systems, the key infrastructure of these businesses, are becoming more and more extensive. With the increase in business scope, customer groups, and product sales, server manufacturers have put forward higher and higher requirements for the efficiency, cost, and quality of product development. From hardware motherboards to software codes, and then to firmware image files, normalization and reuse have become a trend. At present, the normalization design in the field of basic input and output systems (BIOS) mainly integrates the static data of the hardware configuration of all server product projects in a set of BIOS codes, and then dynamically loads the corresponding static data according to different motherboard identifiers in the early initialization (PEI) stage of the extensible firmware interface during the power-on self-test (POST) process, and then performs corresponding hardware adaptation and initialization. Since each project corresponds to a set of static data, if you want to add support for a new project in the code, you need to add a set of static data accordingly and store these data in the read-only memory (ROM) of the BIOS. Although the standardized design of one set of code being compatible with multiple product projects has many benefits, the ROM storage space of BIOS is limited. When the static data size is fixed, the number of product projects that can be compatible with the standardized design is limited. Currently, the method of grouping all product projects by type and sharing one set of BIOS code for each group reduces the space occupied by BIOS.
[0003] The current method groups all product projects, which will result in multiple sets of code branches and require more human resources for code maintenance.
[0004] It can be seen that how to reduce the investment in human resources is an urgent problem to be solved by technical personnel in this field. Summary of the invention
[0005] The purpose of this application is to provide a method, device, electronic device and medium for saving BIOS storage space, so as to reduce the occupation of BIOS storage space and reduce the investment of human resources.
[0006] To solve the above technical problems, the present application provides a method for saving BIOS storage space, including:
[0007] Obtain a static configuration difference data table, and determine whether the static configuration difference data table is empty;
[0008] If it is empty, the initial data in the default static configuration data table is obtained and used to initialize the hardware;
[0009] If it is not empty, hardware initialization is performed according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data; wherein the initial data is all the unupdated data used for initialization, and the static configuration difference data table includes the first data for updating and the second data representing the position of the initial data that needs to be updated in the default static configuration data table.
[0010] Preferably, performing hardware initialization according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data includes:
[0011] Determine whether each initial data in the default static configuration data table needs to be updated;
[0012] If the current initial data needs to be updated, the hardware is initialized using the first data in the static configuration difference data table corresponding to the initial data that needs to be updated;
[0013] If the current initial data does not need to be updated, the current initial data is used to initialize the hardware.
[0014] Preferably, determining whether each initial data in the default static configuration data table needs to be updated includes:
[0015] Read the value Loc# in the first column of the first row in the static configuration difference data table, assign Loc# minus 1 to Line#, and set Line to 1;
[0016] Determine that the initial data from Line to Line# in the default static configuration data table does not need to be updated;
[0017] Read the value Mask in the second column of the static configuration difference data table and convert it into binary representation, where Mask and Loc# are in the same row of the static configuration difference data table;
[0018] Extract the first bit value of the converted Mask;
[0019] Set the number of bits of the Bit value to Bit#, and determine whether the Bit value is 0;
[0020] If it is 0, it is determined that the initial data in the Loc#th row and the Bit#th column in the default static configuration data table does not need to be updated;
[0021] If it is not 0, it is determined that the initial data in the Loc#th row and the Bit#th column in the default static configuration data table needs to be updated, and the first data used to update the initial data in the Loc#th row and the Bit#th column in the default static configuration data table is the data in the Loc#th row and the Col#th column in the static configuration difference data table, where Col# corresponds to Bit# and the count starts from three;
[0022] Determine whether Bit is the last bit of Mask;
[0023] If it is not the last bit, read the next bit, enter the step of setting the number of bits of the Bit value to Bit#, and determine whether the Bit value is 0;
[0024] If it is the last digit, determine whether the static configuration difference data table has been read completely;
[0025] If all the data have been read, it is determined that the initial data of each row after the Loc# row in the default static configuration data table does not need to be updated;
[0026] If not all data have been read, Loc# is incremented by 1 and assigned to Line, a new Loc# in the first column of the next row in the static configuration difference data table is read, the new Loc# is decremented by 1 and assigned to Line#, and the step of determining that the initial data from the Line row to the Line# row in the default static configuration data table does not need to be updated is entered;
[0027] Wherein, Loc# represents the row number of the default static configuration data table and is a positive integer.
[0028] Preferably, before obtaining the default static configuration data table, if the product items are increased or decreased, it also includes:
[0029] Determine whether the initial data in the default static configuration data table needs to be updated according to the added or reduced product items;
[0030] If necessary, update the initial data in the default static configuration data table.
[0031] Preferably, the method further comprises: reporting an error when hardware initialization fails.
[0032] In order to solve the above technical problems, the present invention further provides a device for saving BIOS storage space, comprising:
[0033] A first acquisition module 10 is used to acquire a static configuration difference data table;
[0034] A judging module 11 is used to judge whether the static configuration difference data table is empty;
[0035] The second acquisition module 12 is used to acquire a default static configuration data table;
[0036] An initialization module 13 is used to perform hardware initialization according to the initial data in the default static configuration data table when the static configuration difference data table is empty, and to perform hardware initialization according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data when the static configuration difference data table is not empty;
[0037] The initial data is all the unupdated data used for initialization, and the static configuration difference data table includes first data for updating and second data representing the position of the initial data that needs to be updated in the default static configuration data table.
[0038] In order to solve the above technical problems, the present invention further provides an electronic device, comprising:
[0039] A memory 20, for storing computer programs;
[0040] The processor 21 is used to implement the steps of the above-mentioned method for saving BIOS storage space when executing a computer program.
[0041] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method for saving BIOS storage space are implemented.
[0042] The present application proposes a method for saving BIOS storage space, the method first obtains a static configuration difference data table, and determines whether the static configuration difference data table is empty; if it is empty, the initial data in the default static configuration data table is obtained and used for hardware initialization; if it is not empty, the hardware is initialized according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data; wherein the initial data is all the unupdated data used for initialization, and the static configuration difference data table includes the first data for updating and the second data representing the position of the initial data that needs to be updated in the default static configuration data table. It can be seen that compared with the traditional method of grouping all product items and each group sharing a set of BIOS codes, the method proposed in the present application only needs to use a default static configuration data table for all items to dynamically call during hardware initialization, which effectively reduces the occupation of BIOS storage space, ensures the realization of BIOS normalization design, reduces the investment in human resources, and each product item has its corresponding static configuration difference data table, which ensures the accuracy of data calling.
[0043] In addition, the device, electronic device and medium for saving BIOS storage space provided by the present invention correspond to the method for saving BIOS storage space, and the effects are as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] 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 paying any creative work.
[0045] Figure 1 A flowchart of a method for saving BIOS storage space provided by the present application;
[0046] Figure 2 A structural diagram of a device for saving BIOS storage space provided by the present application;
[0047] Figure 3 A structural diagram of an electronic device provided in this application. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] The core of this application is to provide a method for saving BIOS storage space. After obtaining the static configuration difference data table, the method determines whether the static configuration difference data table is empty; if it is empty, the initial data in the default static configuration data table is obtained and used for hardware initialization; if it is not empty, the hardware is initialized according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data; wherein the initial data is all the unupdated data used for initialization, and the static configuration difference data table includes the first data for updating and the second data representing the position of the initial data that needs to be updated in the default static configuration data table. It can be seen that the method provided by this application only uses one default static configuration data table, and by designing a static configuration difference data table and related logic, it is dynamically called by all projects during hardware initialization, which effectively reduces the occupation of BIOS storage space and reduces the investment in human resources.
[0050] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0051] Figure 1 A flowchart of a method for saving BIOS storage space provided by this application. Figure 1As shown, the method includes:
[0052] S1: Obtain a static configuration difference data table, and determine whether the static configuration difference data table is empty.
[0053] In this embodiment, each product project will create a corresponding static configuration difference data table. The first column of data in the static configuration difference data table is a 1-byte hexadecimal number, which is used to represent the row number in the default static configuration data table; the second column of data is a 1-byte hexadecimal number represented by bits, wherein a bit set to 1 indicates that compared with the default static configuration data table, the static configuration difference data table of the project, the data corresponding to the bit in the row represented by the first column of data needs to be updated; the data starting from the third column is the data for updating, and there are several bit positions 1 in the second column, and there are several columns of data starting from the third column. For example, assuming that the data in the second column of the mth row is 0x1C, it is converted to a binary number represented as 00011100. Since the right side of the binary number is the low bit, counting starts from 0, it can be seen that Bit2, Bit3 and Bit4 have a total of 3 bit positions 1, which means that there are a total of 3 columns of data starting from the third column in the mth row, which are used to update the 2nd, 3rd and 4th columns of data in the mth row in the default static configuration data table, wherein the number of columns in the default static configuration data table starts from 0.
[0054] After obtaining a static configuration difference data table corresponding to a product item, it is determined whether the initial data in the default static configuration data table needs to be updated by judging whether the static configuration difference data table is empty. If the static configuration difference data table is empty, it means that the initial data in the default static configuration data table does not need to be updated. If the static configuration difference data table is not empty, it means that the initial data in the default static configuration data table needs to be updated according to the data in the static configuration difference data table.
[0055] S2: If it is empty, obtain and use the initial data in the default static configuration data table to initialize the hardware.
[0056] After determining that the static configuration difference data table is empty, that is, the initial data in the default static configuration data table does not need to be updated, the default static configuration data table in the BIOS storage space is obtained, and the initial data in the default static configuration data table is used to initialize the hardware.
[0057] S3: If it is not empty, perform hardware initialization according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data; wherein the initial data is all the unupdated data used for initialization, and the static configuration difference data table includes the first data for updating and the second data representing the position of the initial data that needs to be updated in the default static configuration data table.
[0058] In this embodiment, the static configuration difference data table includes first data for updating and second data representing the location of the initial data that needs to be updated in the default static configuration data table. For example, the first column data and the second column data in the above static configuration difference data table are the second data representing the location of the initial data that needs to be updated in the default static configuration data table, and the data starting from the third column are the first data for updating. The initial data in the default static configuration data table is all the unupdated data used for initialization. According to statistics based on product development experience, about 70% of the static data between different projects are the same, so the initial data can be all the static data of any project, among which the static data that is the same as the current product project is the initial data that does not need to be updated, and the static data that is different from the current product project needs to be updated by the first data in the static configuration difference data table corresponding to the current product project in order to perform hardware initialization.
[0059] When it is determined that the static configuration difference data table is not empty, that is, the initial data in the default static configuration data table needs to be updated according to the data in the static configuration difference data table, the position of the initial data that needs to be updated in the default static configuration data table is obtained through the second data in the static configuration difference data table, and the corresponding first data in the static configuration difference data table is used to perform hardware initialization.
[0060] This embodiment proposes a method for saving BIOS storage space, which first obtains a static configuration difference data table and determines whether it is empty; if it is empty, the initial data in the default static configuration data table is obtained and used for hardware initialization; if it is not empty, the hardware is initialized according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data; wherein the initial data is all the unupdated data used for initialization, and the static configuration difference data table includes the first data for updating and the second data representing the position of the initial data that needs to be updated in the default static configuration data table. It can be seen that compared with the traditional method of grouping all product items and sharing a set of BIOS codes for each group, the method proposed in this application only needs to use a default static configuration data table for all items to be dynamically called during hardware initialization, and effectively reduces the BIOS storage space occupation by optimizing data storage, especially when the number of product items is very large. The effect is significant. In addition, the method also ensures the implementation of BIOS normalization design, reduces the investment in human resources, and each product item has its corresponding static configuration difference data table, which ensures the accuracy of data calling.
[0061] In the above embodiment, when the static configuration difference data table is not empty, hardware initialization is performed according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data. This embodiment further explains this. This step includes:
[0062] Determine whether each initial data in the default static configuration data table needs to be updated;
[0063] If the current initial data needs to be updated, the hardware is initialized using the first data in the static configuration difference data table corresponding to the initial data that needs to be updated;
[0064] If the current initial data does not need to be updated, the current initial data is used to initialize the hardware.
[0065] In this embodiment, since the static configuration difference data table is not empty, it means that there are initial data that need to be updated in the default static configuration data table, so it is first determined whether the initial data in the default static configuration data table needs to be updated. If the current initial data needs to be updated, the first data corresponding to the initial data that needs to be updated in the static configuration difference data table is used to initialize the hardware; if the current initial data does not need to be updated, the current initial data is used to initialize the hardware, so as to accurately call the static data for hardware initialization.
[0066] In the above embodiment, it is mentioned that it is necessary to determine whether the initial data in the default static configuration data table needs to be updated, but the above embodiment does not specifically describe the determination step, and this embodiment provides a supplementary description of this. This step includes:
[0067] Read the value Loc# in the first column of the first row in the static configuration difference data table, assign Loc# minus 1 to Line#, and set Line to 1;
[0068] Determine that the initial data from Line to Line# in the default static configuration data table does not need to be updated;
[0069] Read the value Mask in the second column of the static configuration difference data table and convert it into binary representation, where Mask and Loc# are in the same row of the static configuration difference data table;
[0070] Extract the first bit value of the converted Mask;
[0071] Set the number of bits of the Bit value to Bit#, and determine whether the Bit value is 0;
[0072] If it is 0, it is determined that the initial data in the Loc#th row and the Bit#th column in the default static configuration data table does not need to be updated;
[0073] If it is not 0, it is determined that the initial data in the Loc#th row and the Bit#th column in the default static configuration data table needs to be updated, and the first data used to update the initial data in the Loc#th row and the Bit#th column in the default static configuration data table is the data in the Loc#th row and the Col#th column in the static configuration difference data table, where Col# corresponds to Bit# and the count starts from three;
[0074] Determine whether Bit is the last bit of Mask;
[0075] If it is not the last bit, read the next bit, enter the step of setting the number of bits of the Bit value to Bit#, and determine whether the Bit value is 0;
[0076] If it is the last digit, determine whether the static configuration difference data table has been read completely;
[0077] If all the data have been read, it is determined that the initial data of each row after the Loc# row in the default static configuration data table does not need to be updated;
[0078] If not all data have been read, Loc# is incremented by 1 and assigned to Line, a new Loc# in the first column of the next row in the static configuration difference data table is read, the new Loc# is decremented by 1 and assigned to Line#, and the step of determining that the initial data from the Line row to the Line# row in the default static configuration data table does not need to be updated is entered;
[0079] Wherein, Loc# represents the row number of the default static configuration data table and is a positive integer.
[0080] In this embodiment, Loc# and Mask are second data that characterize the location of the initial data that needs to be updated in the default static configuration data table, and the data in the Col# column in the static configuration difference data table is the first data for updating, wherein Col# starts counting from three. In a specific implementation, not every row in the default static configuration data table often needs to be updated. For example, assuming that the default static configuration data table has a total of 15 rows of initial data, only the initial data in the 3rd, 5th, 7th, and 9th rows may need to be updated, while the initial data in other rows do not need to be updated. According to the data in the first column of each row in the static configuration difference data table, the row numbers of each row of initial data that needs to be updated in the default static configuration data table can be obtained as 3, 5, 7, and 9. At this time, it can be directly determined that the initial data of each row in the default static configuration data table except the 3rd, 5th, 7th, and 9th rows do not need to be updated, and there is no need to judge them, which simplifies the steps. Obviously, when reading the data in the first column in the static configuration difference data table, read from the first row in order. That is to say, when reading, 3 is read first. At this time, it can be determined that the initial data in the 1st and 2nd rows before the 3rd row do not need to be updated. Then 5 is read to determine that the 4th row between the 3rd and 5th rows does not need to be updated. And so on, the result of whether the initial data of each row in the default static configuration data table needs to be updated is obtained, so that the data can be called for hardware initialization according to the result.
[0081] This embodiment provides a detailed description of the steps for determining whether the initial data in the default static configuration data table needs to be updated. In the specific implementation, the initial data that does not need to be updated in the default static configuration data table and the first data in the static configuration difference data table are used to initialize the hardware, thereby ensuring the accuracy of the data called during hardware initialization.
[0082] Before obtaining the default static configuration data table in the above embodiment, if the product items increase or decrease, the initial data in the default static configuration data table may change. Therefore, when the product items increase or decrease, it is necessary to determine whether the initial data in the default static configuration data table needs to be updated. This step includes:
[0083] Determine whether the initial data in the default static configuration data table needs to be updated according to the added or reduced product items;
[0084] If necessary, update the initial data in the default static configuration data table.
[0085] This embodiment describes the situation where product items are increased or decreased before obtaining the default static configuration data table. When product items are increased or decreased, it is determined whether the initial data in the default static configuration data table needs to be updated according to the increased or decreased product items. If necessary, the initial data in the default static configuration data table is updated to ensure the accuracy of the initial data in the default static configuration data table.
[0086] When calling data to perform hardware initialization in the above embodiment, since the hardware initialization may fail, an alarm mode may be added to report an error when the hardware initialization fails.
[0087] This embodiment reports an error when hardware initialization fails, so as to prompt the user that the hardware initialization fails and to call data again to perform hardware initialization.
[0088] In the above embodiments, the method for saving BIOS storage space is described in detail, and the present application also provides an embodiment corresponding to the device for saving BIOS storage space. It should be noted that the present application describes the embodiments of the device part from two perspectives, one is based on the perspective of functional modules, and the other is based on the perspective of hardware.
[0089] Figure 2 This is a structural diagram of a device for saving BIOS storage space provided by this application. Figure 2 As shown, the device comprises:
[0090] A first acquisition module 10 is used to acquire a static configuration difference data table;
[0091] A judging module 11 is used to judge whether the static configuration difference data table is empty;
[0092] The second acquisition module 12 is used to acquire a default static configuration data table;
[0093] An initialization module 13 is used to perform hardware initialization according to the initial data in the default static configuration data table when the static configuration difference data table is empty, and to perform hardware initialization according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data when the static configuration difference data table is not empty;
[0094] The initial data is all the unupdated data used for initialization, and the static configuration difference data table includes first data for updating and second data representing the position of the initial data that needs to be updated in the default static configuration data table.
[0095] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0096] Figure 3 A structural diagram of an electronic device provided in another embodiment of the present application, such as Figure 3 As shown, the electronic device includes: a memory 20 for storing a computer program;
[0097] The processor 21 is used to implement the steps of the method for saving BIOS storage space mentioned in the above embodiment when executing a computer program.
[0098] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.
[0099] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0100] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, the relevant steps of the method for saving BIOS storage space disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to the initial data in the default static configuration data table, the first data in the static configuration difference data table, etc.
[0101] In some embodiments, the electronic device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power source 25 , and a communication bus 26 .
[0102] Those skilled in the art will understand that Figure 3 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than those shown in the figure.
[0103] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for saving BIOS storage space as described in the above method embodiment are implemented.
[0104] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0105] The above is a detailed introduction to the method, device, electronic device and medium for saving BIOS storage space provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. 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.
[0106] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for saving BIOS storage space, characterized in that: include: Obtaining a static configuration difference data table, and determining whether the static configuration difference data table is empty; If it is empty, the initial data in the default static configuration data table is obtained and used to initialize the hardware; If it is not empty, the hardware initialization is performed according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data; wherein the initial data is all the unupdated data used for initialization, and the static configuration difference data table includes the first data for updating and the second data representing the position of the initial data that needs to be updated in the default static configuration data table; The performing of hardware initialization according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data comprises: Determine whether each of the initial data in the default static configuration data table needs to be updated; Wherein, the determining whether each of the initial data in the default static configuration data table needs to be updated includes: Read the value Loc# in the first row and first column of the static configuration difference data table, subtract 1 from Loc# and assign it to Line#, and set Line to 1; Determine that the initial data in the Line row to the Line# row in the default static configuration data table does not need to be updated; Read the value Mask in the second column of the static configuration difference data table and convert it into a binary representation, wherein the Mask and the Loc# are in the same row of the static configuration difference data table; Extract the first bit value of the converted Mask; Set the number of bits of the Bit value to Bit#, and determine whether the Bit value is 0; If it is 0, it is determined that the initial data in the Loc#th row and the Bit#th column in the default static configuration data table does not need to be updated; If it is not 0, it is determined that the initial data in the Loc#th row and the Bit#th column in the default static configuration data table needs to be updated, and the first data used to update the initial data in the Loc#th row and the Bit#th column in the default static configuration data table is the data in the Loc#th row and the Col#th column in the static configuration difference data table, where the Col# corresponds to the Bit# and the count starts from three; Determine whether the Bit is the last bit of the Mask; If it is not the last bit, read the next bit, enter the step of setting the number of bits of the bit value to Bit#, and determine whether the bit value is 0; If it is the last digit, determining whether the static configuration difference data table has been read completely; If all the data have been read, it is determined that the initial data in each row after the Loc# row in the default static configuration data table does not need to be updated; If not all the data have been read, the Loc# is added by 1 and assigned to the Line, the new Loc# in the first column of the next row of the static configuration difference data table is read, the new Loc# is subtracted by 1 and assigned to the Line#, and the step of determining that the initial data from the Line to the Line# in the default static configuration data table does not need to be updated is entered; The Loc# represents the row number of the default static configuration data table and is a positive integer.
2. The method for saving BIOS storage space according to claim 1, characterized in that: The performing the hardware initialization according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data comprises: Determine whether each of the initial data in the default static configuration data table needs to be updated; If the current initial data needs to be updated, the hardware is initialized using the first data in the static configuration difference data table corresponding to the initial data that currently needs to be updated; If the current initial data does not need to be updated, the hardware initialization is performed using the current initial data.
3. The method for saving BIOS storage space according to claim 1, characterized in that: Before obtaining the default static configuration data table, if the product items are increased or decreased, it also includes: Determine whether each of the initial data in the default static configuration data table needs to be updated according to the added or reduced product items; If necessary, the initial data in the default static configuration data table is updated.
4. The method for saving BIOS storage space according to claim 1, characterized in that: Also includes: When the hardware initialization fails, an error is reported.
5. A device for saving BIOS storage space, characterized in that: include: A first acquisition module is used to acquire a static configuration difference data table; A judging module, used to judge whether the static configuration difference data table is empty; The second acquisition module is used to obtain a default static configuration data table; an initialization module, configured to perform hardware initialization according to the initial data in the default static configuration data table when the static configuration difference data table is empty, and to perform hardware initialization according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data when the static configuration difference data table is not empty; The initial data is all the unupdated data used for initialization, and the static configuration difference data table includes the first data used for updating and the second data representing the position of the initial data that needs to be updated in the default static configuration data table; The initialization module performs the hardware initialization according to the first data in the static configuration difference data table and the initial data in the default static configuration data table that does not need to be updated by the first data, including: determining whether each of the initial data in the default static configuration data table needs to be updated; Among them, the initialization module determines whether the initial data in the default static configuration data table needs to be updated, including: reading the numerical value Loc# in the first row and first column of the static configuration difference data table, assigning the Loc# minus 1 to Line#, and setting Line to 1; determining that the initial data from the Lineth row to the Line#th row in the default static configuration data table does not need to be updated; reading the numerical value Mask in the second column of the static configuration difference data table and converting it into binary representation, wherein the Mask and the Loc# are in the same row of the static configuration difference data table; extracting the first Bit value of the converted Mask; setting the number of bits of the Bit value to Bit#, and determining whether the Bit value is 0; if it is 0, determining that the initial data in the Loc#th row and Bit#th column in the default static configuration data table does not need to be updated; if it is not 0, determining that the initial data in the Loc#th row and Bit#th column in the default static configuration data table needs to be updated, and is used to update the initial data in the Loc#th row and Bit#th column in the default static configuration data table. The first data of the initial data is the data of the Loc#th row and the Col#th column of the static configuration difference data table, wherein the Col# corresponds to the Bit# and counts from three; determine whether the Bit is the last bit of the Mask; if it is not the last bit, read the next Bit, enter the step of setting the number of bits of the Bit value to Bit#, and determine whether the Bit value is 0; if it is the last bit, determine whether the static configuration difference data table has been read completely; if it has been read completely, determine that the initial data of each row after the Loc#th row in the default static configuration data table does not need to be updated; if it has not been read completely, assign the Loc# plus 1 to the Line, read the new Loc# in the first column of the next row in the static configuration difference data table, assign the new Loc# minus 1 to the Line#, and enter the step of determining that the initial data from the Lineth row to the Line#th row in the default static configuration data table does not need to be updated; wherein, the Loc# represents the row number of the default static configuration data table and is a positive integer.
6. An electronic device, characterized in that: comprising a memory for storing a computer program; A processor, configured to implement the steps of the method for saving BIOS storage space as described in any one of claims 1 to 4 when executing the computer program.
7. 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 steps of the method for saving BIOS storage space as claimed in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Configuration object updating method and apparatus
CN107547239A
Information processing apparatus, system setting method, and computer program
JP2016157245A