WO2022228500A1 - 一种bios的数据存储方法、装置、设备及存储介质 - Google Patents

一种bios的数据存储方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022228500A1
WO2022228500A1 PCT/CN2022/089755 CN2022089755W WO2022228500A1 WO 2022228500 A1 WO2022228500 A1 WO 2022228500A1 CN 2022089755 W CN2022089755 W CN 2022089755W WO 2022228500 A1 WO2022228500 A1 WO 2022228500A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
duplicate
storage area
variable
current target
Prior art date
Application number
PCT/CN2022/089755
Other languages
English (en)
French (fr)
Inventor
王晓
Original Assignee
山东英信计算机技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 山东英信计算机技术有限公司 filed Critical 山东英信计算机技术有限公司
Publication of WO2022228500A1 publication Critical patent/WO2022228500A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • G06F3/0641De-duplication techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Definitions

  • the present application relates to the field of computer technology, and in particular, to a BIOS data storage method, device, BIOS device, and computer-readable storage medium.
  • UEFI Unified Extensible Firmware Interface, Unified Extensible Firmware Interface
  • Nvram non-volatile random access memory
  • BIOS Basic Input Output System
  • UEFI variables have fixed attribute descriptions in UEFI SPEC (a standard industry specification), and specify the interface function GetVariable() to obtain the content of the variable, and SetVariable() to generate or modify the content of a UEFI variable.
  • UEFI variables are usually stored in the FLASH memory (flash memory) of the BIOS.
  • FLASH memory flash memory
  • the UEFI variables have an external interface defined in the UEFI SPEC standard industry specification, the format of saving to FLASH is not required, and the implementation methods are different.
  • each UEFI variable data (such as variables 1-N) is generally stored sequentially in a fixed area divided in FLASH; each UEFI variable data is aggregated in a fixed format in FLASH as a unit, respectively,
  • the basic unit of variable (Variable), each variable basic unit includes storage attribute data (ie variable header, Variable header), UEFI variable data name data (ie variable name, Variable name), UEFI variable data GUID (Globally Unique Identifier) data and UEFI variable data specific user data (ie variable data, Variable data). Due to the large amount of UEFI variable data in the BIOS, the FLASH occupied by the UEFI variable data is finally stored. Therefore, how to reduce the space occupied by UEFI variable data storage in the BIOS is an urgent problem to be solved today.
  • the purpose of this application is to provide a BIOS data storage method, device, BIOS device and computer-readable storage medium, so as to reduce the space occupied by UEFI variable data storage in the BIOS.
  • BIOS a data storage method of BIOS, including:
  • BIOS obtains UEFI variable data to be stored
  • the target data includes name data and/or GUID data
  • the index of the current duplicate data is obtained, and in the process of storing the UEFI variable data to be stored in the variable data storage area, the current duplicate data is stored in the variable data storage area.
  • the target data is replaced with an index of the current duplicate data for storage; wherein, the current target data is any of the target data, and the data size of the current target data is larger than the data size of the index of the current duplicate data.
  • the method further includes:
  • the current target data is stored in the duplicate data storage area, and an index of the current target data in the duplicate data storage area is generated;
  • the current target data is replaced with the index of the current target data for storage.
  • the method further includes:
  • the duplicate data corresponding to the current target data is not detected in the duplicate data storage area, then detect whether there is duplicate data corresponding to the current target data in the stored UEFI variable data in the variable data storage area;
  • the current target data is stored in the variable data storage area.
  • replace the current target data with the index of the current repeated data for storage including:
  • the current target data is replaced with the index of the current repeated data for storage, and the stored attribute data corresponding to the UEFI variable data to be stored is stored.
  • the duplicate attribute corresponding to the current target data of is adjusted to the duplicate state.
  • the duplicate data storage area includes a duplicate name data storage area and a duplicate GUID data storage area.
  • the method further includes: obtaining the process of UEFI variable data to be read from the variable data storage area;
  • the process of obtaining the UEFI variable data to be read from the variable data storage area includes:
  • the current target data is acquired from the repeated data storage area.
  • the index of the current target data in the UEFI variable data to be read is stored in the variable data storage area, the index of the current target data is obtained, including:
  • the application also provides a BIOS data storage device, including:
  • each of the binary menu data to be stored is allowed state data or disabled state data
  • a detection module configured to detect the duplicate data corresponding to the target data in the UEFI variable data to be stored in the duplicate data storage area; wherein, the target data includes name data and/or GUID data;
  • the repeated data storage module is configured to obtain the index of the current repeated data if the current repeated data corresponding to the current target data is detected in the repeated data storage area, and store the UEFI variable data to be stored in the variable data storage In the process of storing the area, the current target data is replaced with the index of the current duplicate data for storage; wherein, the current target data is any of the target data, and the data size of the current target data is larger than the data size of the index of the current duplicate data.
  • the application also provides a BIOS device, including:
  • the processor is configured to implement the steps of the above-mentioned BIOS data storage method when executing the computer program.
  • the present application also provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned BIOS data storage method are implemented.
  • a BIOS data storage method provided by the present application includes: the BIOS obtains UEFI variable data to be stored; detects duplicate data corresponding to target data in the UEFI variable data to be stored in the duplicate data storage area; wherein the target data includes name data and/or GUID data; if the current duplicate data corresponding to the current target data is detected in the duplicate data storage area, the index of the current duplicate data is obtained, and in the process of storing the UEFI variable data to be stored in the variable data storage area, Replace the current target data with the index of the current duplicate data for storage; wherein, the current target data is any target data, and the data size of the current target data is greater than the data size of the index of the current duplicate data;
  • the present application replaces the current target data with the index of the current repeated data for storage, so that the repeated data storage area can be used to save the repetition of each UEFI variable data.
  • the target data can reduce the space occupied by the duplicate target data stored in the BIOS, thereby reducing the space occupied by the UEFI variable data stored in the BIOS.
  • the present application also provides a BIOS data storage device, a BIOS device and a computer-readable storage medium, which also have the above beneficial effects.
  • Fig. 1 is the schematic diagram of the storage mode of UEFI variable data in the BIOS FLASH in the prior art
  • Fig. 2 is the schematic diagram of the storage basic unit of UEFI variable data in the prior art in BIOS FLASH;
  • Fig. 3 is the schematic diagram of the storage attribute data of storage basic unit of UEFI variable data in the prior art in BIOS FLASH;
  • FIG. 4 is a flowchart of a data storage method for a BIOS provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a storage mode of UEFI variable data of another BIOS data storage method provided by an embodiment of the application;
  • FIG. 6 is a schematic diagram of index storage of another BIOS data storage method provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of storage attribute data of another BIOS data storage method provided by an embodiment of the application.
  • FIG. 8 is a schematic flowchart of name data storage of another data storage method for BIOS provided by an embodiment of the present application.
  • BIOS data reading of another BIOS data storage method provided by an embodiment of the present application.
  • FIG. 10 is a structural block diagram of a BIOS data storage device according to an embodiment of the application.
  • FIG. 4 is a flowchart of a method for storing data in a BIOS provided by an embodiment of the present application.
  • the method can include:
  • Step 101 The BIOS obtains UEFI variable data to be stored.
  • the UEFI variable data to be stored in this step may be UEFI variable data that needs to be stored.
  • This embodiment does not limit the specific content of the UEFI variable data to be stored.
  • it can be implemented in the same or similar manner as the data content of the UEFI variable in the prior art.
  • the UEFI variable data to be stored may include name data, GUID data and specific data. User data.
  • the specific way for a BIOS device (such as a BIOS chip) to obtain the UEFI variable data to be stored can be set by the designer according to practical scenarios and user requirements.
  • the method for obtaining the UEFI variable data is the same or implemented in a similar manner.
  • the BIOS device can use the SetVariable() interface function to obtain the UEFI variable data to be stored.
  • Step 102 Detect the duplicate data corresponding to the target data in the UEFI variable data to be stored in the duplicate data storage area; wherein, the target data includes name data and/or GUID data.
  • the target data in this step may be part of the data (such as name data and/or GUID data) that may be repeated in each UEFI variable data, that is, the UEFI variable data to be stored can be stored in the repeated data storage area. Part of the data stored.
  • the duplicate data storage area in this step may be an Nvram area for storing duplicate target data.
  • the specific settings of the target data can be set by the designer according to practical scenarios and user requirements.
  • the target data may include name data or GUID data, that is, the duplicate data storage area may include a storage area for storing data.
  • Duplicate name data save area for duplicate name data (repeat variable name save area in Figure 5) or duplicate GUID data save area for storing duplicate GUID data (repeat variable GUID save area in Figure 5);
  • target The data may also include name data and GUID data, that is, the duplicate data storage area may include a duplicate name data storage area and a duplicate GUID data storage area.
  • the duplicate data corresponding to the target data in this step may be the same data stored in the duplicate data storage area as the target data in the UEFI variable data to be stored.
  • the BIOS device can detect the same data (ie, duplicate data) stored in the duplicate data storage area as the target data, such as target data
  • this step can sequentially or separately detect the same data as the name data in the UEFI variable data to be stored in the duplicate name data storage area (that is, duplicate name data) and the duplicate GUID data storage area.
  • the name data in the UEFI variable data is the same data (ie duplicate GUID data).
  • Step 103 If the current duplicate data corresponding to the current target data is detected in the duplicate data storage area, the index of the current duplicate data is obtained, and in the process of storing the UEFI variable data to be stored in the variable data storage area, the current target data is stored in the variable data storage area.
  • the data is replaced with the index of the current duplicate data for storage; wherein, the current target data is any target data, and the data size of the current target data is larger than the data size of the index of the current duplicate data.
  • the current duplicate data in this step can be the duplicate data corresponding to the current target data (such as name data or GUID data) in the UEFI variable data to be stored stored in the duplicate data storage area, that is, in the duplicate data storage area.
  • the index of the current duplicate data in this step may be information used to indicate the storage location of the current duplicate data in the duplicate data storage area, such as the offset of the current duplicate data in the duplicate data storage area, that is, the BIOS device can use The index of the current duplicate data finds the current duplicate data in the duplicate data storage area.
  • the variable data storage area in this step may be an Nvram area for storing UEFI variable data (such as the single variable storage area in FIG. 5 ).
  • the BIOS device when the BIOS device stores the current target data in the UEFI variable data to be stored in the repeated data storage area, it can obtain the index of the current target data (that is, the current repeated data) in the repeated data storage area, so as to store the current target data in the repeated data storage area.
  • the current target data is replaced with the index of the current repeated data for storage, so that the variable data storage area does not need to store the current target data again, but takes up less space. index, thereby reducing the occupied space of the UEFI variable data to be stored without affecting the read usage of the UEFI variable data to be stored. As shown in FIG.
  • the BIOS device can store the UEFI variable data to be stored in the single variable storage area in the process of storing the UEFI variable data in the variable 1.
  • the variable name of the current target data is replaced by the index NAME INDEX 1 of Name 1 (that is, the current repeated data) in the duplicate variable name storage area corresponding to the current target data, and the actual current target data is replaced, so that the variable name in the variable 1 in the single variable storage area is located at the position of the variable name.
  • the storage of the actual ASCII string of the current target data can be replaced by the NAME INDEX 1 (that is, the index) that occupies less storage space; correspondingly, when the current target data is GUID data, in this step, the UEFI variable data to be stored is stored in the In the process of the variable data storage area, in this step, the BIOS device can use the GUID of the variable basic unit (variable 1-N in FIG. 6 ) corresponding to the UEFI variable data to be stored in the variable data storage area to occupy a smaller index ( As shown in Figure 6, GUID INDEX 1-N) replaces the actual 16-byte hexadecimal data of the current target data.
  • this step is shown by taking the storage processing of any target data (ie, current target data) to be stored by the BIOS device to store UEFI variable data as an example, that is, the UEFI variable data to be stored includes two or more targets.
  • UEFI variable data to be stored includes two or more targets.
  • data such as name data and GUID data
  • each target data can be stored in the same or similar way as this step.
  • the BIOS device in the process of storing the UEFI variable data to be stored in the variable data storage area, can not only replace the current target data with the index of the current repeated data for storage, but also store the UEFI variable data to be stored corresponding to the data.
  • the duplicate attribute corresponding to the current target data in the stored attribute data is adjusted to a duplicate state, so that when the current target data of the UEFI variable data to be stored is subsequently read, it can be determined by detecting the duplicate attribute corresponding to the current target data in the stored attribute data.
  • the variable data storage area stores the current target data or the index corresponding to the current target data.
  • the storage attribute data of the variable basic unit may include not only the size attribute for describing the sum size of the variable basic unit, the size attribute for describing the offset of the next variable basic unit
  • the existing attributes such as the next attribute and the flags attribute used to describe the attributes of the basic unit of this variable may also include repeated attributes corresponding to each target data.
  • the storage attribute data (ie, the variable header) of the variable basic unit corresponding to the UEFI variable data to be stored can be stored Add the duplicate attribute corresponding to the name data (ie variable name duplicate attribute, variable name duplicate attribute) and GUID data corresponding duplicate attribute (ie variable GUID duplicate attribute, variable GUID duplicate attribute) these two attributes to identify the basic unit of the variable respectively Whether the name data and GUID data are stored in the corresponding duplicate data storage area; for example, when the duplicate attribute corresponding to the name data is 1 (that is, the duplicate state), it can indicate the index corresponding to the name data stored in the basic unit of the variable, the actual name data (such as ASCII string) is stored in the repeated name data storage area; when the repeated attribute corresponding to the name data is 0 (ie, non-repetitive state), it can indicate that the actual name data (such as an ASCII string) is stored in the basic unit of the
  • the method provided in this embodiment may further include, if the duplicate data corresponding to the current target data is not detected in the duplicate data storage area, storing the current target data in the duplicate data storage area, and generating duplicate data.
  • the index of the current target data in the storage area; in the process of storing the UEFI variable data to be stored in the variable data storage area, the current target data is replaced with the index of the current target data for storage. That is to say, in this embodiment, the BIOS device can directly store the current target data in the duplicate data storage area when the duplicate data corresponding to the current target data cannot be detected in the duplicate data storage area, and use the duplicate data storage area to store the current target data.
  • the index of the current target data is stored in the variable data storage area to replace the current target data.
  • the duplicate data storage area can store the actual target data in all UEFI variable data, so that only the index corresponding to the target data is stored in the variable data storage area; correspondingly, because only the target data is stored in the variable data storage area For the corresponding index, it is not necessary to set the duplicate attribute corresponding to the target data in the storage attribute data of the variable basic unit corresponding to the UEFI variable data in the variable data storage area.
  • the BIOS device can find out whether the variable name exists in the repeated variable name storage area according to the variable name passed by SetVariable(); if not, then The ACSII data of the name data will be stored in the repeated variable name storage area, the index (index) of the ACSII data of the variable name in the repeated variable name storage area will be generated, and the variable header of the variable base unit corresponding to the variable name will be set.
  • variable name repetition attribute is 1, and the variable name of the variable basic unit is set to the generated index (such as a hexadecimal value), and then other steps of SetVariable() can be executed to complete the storage of the variable basic unit in the variable data storage area; if , then directly obtain the index (index) of the ACSII data of the variable name stored in the repeated name data storage area, and set the variable name repetition attribute in the variable header of the variable basic unit corresponding to the variable name to 1, and set the variable basic
  • the variable name of the unit is set as the obtained index, and then other steps of SetVariable() can be executed to complete the storage of the basic unit of the variable in the variable data storage area.
  • the current target data is GUID data
  • a method similar to the process shown in FIG. 8 can be used to realize the utilization of the index of the GUID data in the repeated GUID data storage area, the setting of the variable name repetition attribute in the variable basic unit, and the corresponding GUID data. Index storage.
  • the method provided in this embodiment may further include, if the duplicate data corresponding to the current target data is not detected in the duplicate data storage area, detecting whether there is current data in the stored UEFI variable data in the variable data storage area. Duplicate data corresponding to the target data; if so, store the current target data in the duplicate data storage area, and generate an index of the current target data in the duplicate data storage area, in the process of storing the UEFI variable data to be stored in the variable data storage area , replace the current target data with the index of the current target data for storage; if not, store the current target data in the variable data storage area during the process of storing the UEFI variable data to be stored in the variable data storage area.
  • the BIOS device may continue to detect the stored UEFI variable data (that is, the stored UEFI variable data in the variable data storage area) when the duplicate data corresponding to the current target data cannot be detected in the duplicate data storage area.
  • the current target data is stored in the variable data storage area, so that the target data that does not appear repeatedly does not need to be stored in the repeated data storage area, thereby reducing the storage quantity of indexes corresponding to the target data in the variable
  • the BIOS device can store the current target data.
  • Store in the duplicate data storage area and generate the index of the current target data in the duplicate data storage area.
  • replace the current target data with the index of the current target data.
  • the BIOS device can also adjust the duplicate data corresponding to the current target data in the variable data storage area to the index of the current target data, and the current target data in the storage attribute data corresponding to the stored UEFI variable data where the duplicate data is located.
  • the corresponding duplicate attribute is adjusted to the duplicate state, so as to realize the storage adjustment of the duplicate target data in the variable data storage area, thereby further reducing the occupied space of the duplicate target data.
  • the present application replaces the current target data with the index of the current repeated data for storage, so that the repeated data storage area can be used to save each UEFI
  • the variable data has duplicate target data, so as to reduce the space occupied by the duplicate target data stored in the BIOS, thereby reducing the space occupied by the UEFI variable data stored in the BIOS.
  • the BIOS data storage method provided in this embodiment may further include a process of obtaining UEFI variable data to be read from the variable data storage area, so as to ensure that the BIOS device can obtain complete UEFI variable data from the variable data storage area (such as UEFI variable data to be stored in the above embodiment).
  • the process of obtaining the UEFI variable data to be read from the variable data storage area may include the following steps:
  • Step 201 When the index of the current target data in the UEFI variable data to be read is stored in the variable data storage area, the index of the current target data is acquired.
  • the UEFI variable data to be read in this step can be the stored UEFI variable data that needs to be read;
  • the current target data in this step can be any target data in the UEFI variable data to be read (such as name data or GUID data).
  • the BIOS device can store the index of the current target data in the UEFI variable data to be read in the determined duplicate data storage area, that is, when the current target data is stored in the duplicate data storage area, from the variable data storage area corresponding to the current target data index, so as to use the index to obtain the current target data from the duplicate data storage area.
  • the specific manner in which the BIOS device determines the index of the current target data in the UEFI variable data to be read in the variable data storage area can be set by the designer according to practical scenarios and user requirements. Only the index corresponding to the target data is stored in the data storage area, that is, when the actual target data in the stored UEFI variable data is stored in the duplicate data storage area, in this step, the BIOS can store the variable data storage area to be read by default. The index of the current target data in UEFI variable data.
  • the BIOS device can also detect whether the duplicate attribute corresponding to the current target data in the storage attribute data of the UEFI variable data to be read in the variable data storage area is The repetition state is used to determine whether the index of the current target data in the UEFI variable data to be read is stored in the variable data storage area; thus, when the repetition attribute is the repetition state, the index of the current target data can be obtained, and the process proceeds to step 202 to save the data from the repeated data.
  • the current target data is obtained from the variable data storage area; when the repetition attribute is in the non-repetitive state, the current target data is directly obtained from the variable data storage area.
  • the BIOS device when the current target data is name data, when the BIOS device can use GetVariable() to read the current target data, it can first check the variable name repetition attribute in the variable basic unit corresponding to the UEFI variable data to be read; If it is 1 (that is, repeating state), the area of the variable name in the basic unit of the variable in the variable data storage area (that is, the variable name area) is the index corresponding to the name data (index), not the actual ASCII string of the name data.
  • the ASCII string of the actual name data can be read from the repeated variable name storage area, and then other processes of GetVariable() can be executed to complete the reading of the UEFI variable data to be read; if it is 0 (that is, not Repeat state), the variable name area in the basic unit of the variable in the variable data storage area is the ASCII string of the actual name data, you can directly read the ASCII string of the name data from the variable name area, and then you can execute GetVariable() The other processes complete the reading of the UEFI variable data to be read.
  • the current target data is GUID data
  • the stored GUID data may be read in a manner similar to the process shown in FIG. 9 .
  • Step 202 Acquire the current target data from the duplicate data storage area according to the index of the current target data.
  • the BIOS device can use the index of the current target data obtained from the variable data storage area to obtain the current target data from the repeated data storage area; if the current target data is the name data, the BIOS device can use the variable data.
  • the index corresponding to the current target data in the data storage area reads the actual current target data (such as an ASCII string) from the offset area corresponding to the index in the duplicate name data storage area.
  • the embodiments of the present application further provide a BIOS data storage device, and the BIOS data storage device described below and the BIOS data storage method described above can refer to each other correspondingly.
  • FIG. 10 is a structural block diagram of a BIOS data storage device provided by an embodiment of the present application.
  • the apparatus may include:
  • the acquiring module 10 is used for acquiring each binary menu data to be stored; wherein, each binary menu data to be stored is allowed state data or disabled state data;
  • the detection module 20 is used to detect the duplicate data corresponding to the target data in the UEFI variable data to be stored in the duplicate data storage area; wherein, the target data includes name data and/or GUID data;
  • the duplicate data storage module 30 is used for obtaining the index of the current duplicate data if the current duplicate data corresponding to the current target data is detected in the duplicate data storage area, and in the process of storing the UEFI variable data to be stored in the variable data storage area , replace the current target data with the index of the current duplicate data for storage; wherein, the current target data is any target data, and the data size of the current target data is larger than the data size of the index of the current duplicate data.
  • the device may also include:
  • the index generation module is used to store the current target data in the duplicate data storage area if the duplicate data corresponding to the current target data is not detected in the duplicate data storage area, and generate an index of the current target data in the duplicate data storage area;
  • the index storage module is used for replacing the current target data with the index of the current target data for storage in the process of storing the UEFI variable data to be stored in the variable data storage area.
  • the device may also include:
  • the variable detection module is used to detect whether there is duplicate data corresponding to the current target data in the stored UEFI variable data in the variable data storage area if the duplicate data corresponding to the current target data is not detected in the duplicate data storage area;
  • the duplicate storage module is used to store the current target data in the duplicate data storage area if there is duplicate data corresponding to the current target data, and generate an index of the current target data in the duplicate data storage area; after storing the UEFI variable data to be stored In the process of going to the variable data storage area, replace the current target data with the index of the current target data for storage;
  • the variable storage module is used to store the current target data in the variable data storage area in the process of storing the UEFI variable data to be stored in the variable data storage area if there is no duplicate data corresponding to the current target data.
  • the duplicate data storage module 30 may include:
  • the attribute adjustment sub-module is used to replace the current target data with the index of the current repeated data for storage in the process of storing the UEFI variable data to be stored in the variable data storage area, and store the stored attribute data of the UEFI variable data to be stored in the attribute data.
  • the duplicate attribute corresponding to the current target data of is adjusted to the duplicate state.
  • the duplicate data storage area includes a duplicate name data storage area and a duplicate GUID data storage area.
  • the device may further include: a reading module for acquiring UEFI variable data to be read from the variable data storage area;
  • the reading module can include:
  • the index obtaining submodule is used to obtain the index of the current target data when the index of the current target data in the UEFI variable data to be read is stored in the repeated data storage area;
  • the repeated reading submodule is used to obtain the current target data from the repeated data storage area according to the index of the current target data.
  • the index acquisition submodule can include:
  • a detection unit configured to detect whether the duplicate attribute corresponding to the current target data in the storage attribute data of the UEFI variable data to be read in the variable data storage area is a duplicate state
  • the index obtaining unit is used to obtain the index of the current target data if it is in a repeated state, and send a start signal to the repeated reading submodule;
  • the variable reading unit is used to obtain the current target data from the variable data storage area if it is in a non-repetitive state.
  • the present application replaces the current target data with the index of the current repeated data for storage, and can use the repeated data to save To save the duplicate target data of each UEFI variable data, the space occupied by the duplicate target data stored in the BIOS is reduced, thereby reducing the space occupied by the UEFI variable data stored in the BIOS.
  • the embodiments of the present application further provide a BIOS device, and the BIOS device described below and the BIOS data storage method described above may refer to each other correspondingly.
  • the embodiment of the present application also provides a BIOS device, including:
  • the processor is configured to implement the steps of the data storage method of the BIOS provided by the above embodiments when executing the computer program.
  • the embodiments of the present application further provide a computer-readable storage medium, and the computer-readable storage medium described below and the data storage method of the BIOS described above may refer to each other correspondingly.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, implements the steps of the device testing method provided by the foregoing embodiments.
  • the storage medium may include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other various storage media that can store program codes medium.
  • U disk mobile hard disk
  • read-only memory Read-Only Memory
  • RAM random access memory
  • magnetic disk or optical disk and other various storage media that can store program codes medium.
  • BIOS device The data storage method, device, BIOS device, and computer-readable storage medium of a BIOS provided by the present application have been described in detail above. Specific examples are used herein to illustrate the principles and implementations of the present application, and the descriptions of the above embodiments are only used to help understand the methods and core ideas of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of the present application, several improvements and modifications can also be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

本申请公开了一种BIOS的数据存储方法、装置、BIOS设备及计算机可读存储介质,该方法包括:BIOS获取待存储UEFI变量数据;检测重复数据保存区中待存储UEFI变量数据中的目标数据对应的重复数据;若在重复数据保存区中检测到当前目标数据对应的当前重复数据,则获取当前重复数据的索引,并在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储;本申请通过将当前目标数据替换为当前重复数据的索引进行存储,能够利用重复数据保存区来保存各个UEFI变量数据发生重复的目标数据,减少了重复的目标数据的存储所占用的空间,从而减少UEFI变量数据的存储所占用的空间。

Description

一种BIOS的数据存储方法、装置、设备及存储介质
本申请要求在2021年04月29日提交中国专利局、申请号为202110476040.3、发明名称为“一种BIOS的数据存储方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别涉及一种BIOS的数据存储方法、装置、BIOS设备及计算机可读存储介质。
背景技术
UEFI(Unified Extensible Firmware Interface,统一可扩展固件接口)变量是指UEFI BIOS(Basic Input Output System,基本输入输出系统)中使用的保存在BIOS芯片中的Nvram(非易失性随机访问存储器)变量,BIOS中提供运行时的接口函数可以对它们进行获取或设置的操作。
UEFI变量在UEFI SPEC(一种标准工业规范)中有固定的属性描述,并且规定了接口函数GetVariable()可以获得变量的内容,SetVariable()可以产生或者修改一个UEFI变量的内容。UEFI变量通常保存在BIOS的FLASH存储器(闪存)中,UEFI变量在UEFI SPEC标准工业规范中虽然定义了外部接口,但是保存到FLASH中的格式未做要求,实现方式不尽相同。
现有技术中,如图1所示,各个UEFI变量数据(如变量1-N)一般在FLASH中划分的固定区域中顺序保存;各个UEFI变量数据在FLASH中分别以一个固定格式聚合为单位,如图2所示的变量(Variable)基本单位,每个变量基本单位包括存储属性数据(即变量标头,Variable header)、UEFI变量数据的名称数据(即变量名称,Variable name)、UEFI变量数据的GUID(全局唯一标识符)数据和UEFI变量数据的具体用户数据(即变量数据,Variable data)。由于BIOS中UEFI变量数据的数量较多,使得UEFI变量数据最终存储时占用的FLASH较大。因此,如何能够减少UEFI变量数据在BIOS中存储所占用的空间,是现今亟需解决的问题。
发明内容
本申请的目的是提供一种BIOS的数据存储方法、装置、BIOS设备及计算机可读存储介质,以减小UEFI变量数据在BIOS中存储所占用的空间。
为解决上述技术问题,本申请提供一种BIOS的数据存储方法,包括:
BIOS获取待存储UEFI变量数据;
检测重复数据保存区中所述待存储UEFI变量数据中的目标数据对应的重复数据;其中,所述目标数据包括名称数据和/或GUID数据;
若在所述重复数据保存区中检测到当前目标数据对应的当前重复数据,则获取当前重复数据的索引,并在将所述待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储;其中,当前目标数据为任一所述目标数据,当前目标数据的数据大小大于当前重复数据的索引的数据大小。
可选的,该方法还包括:
若在所述重复数据保存区中未检测到当前目标数据对应的重复数据,则将当前目标数据存储到所述重复数据保存区中,并生成所述重复数据保存区中当前目标数据的索引;
在将所述待存储UEFI变量数据存储到所述变量数据保存区的过程中,将当前目标数据替换为当前目标数据的索引进行存储。
可选的,该方法还包括:
若在所述重复数据保存区中未检测到当前目标数据对应的重复数据,则检测所述变量数据保存区中的已存储UEFI变量数据中是否存在当前目标数据对应的重复数据;
若是,则将当前目标数据存储到所述重复数据保存区中,并生成所述重复数据保存区中当前目标数据的索引;在将所述待存储UEFI变量数据存储到所述变量数据保存区的过程中,将当前目标数据替换为当前目标数据的索引进行存储;
若否,则在将所述待存储UEFI变量数据存储到所述变量数据保存区的过程中,在所述变量数据保存区中存储当前目标数据。
可选的,所述在将所述待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储,包括:
在将所述待存储UEFI变量数据存储到所述变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储,并将所述待存储UEFI变量数据对应的存储属性数据中的当前目标数据对应的重复属性调整为重复状态。
可选的,所述目标数据包括所述名称数据和所述GUID数据时,所述重复数据保存区包括重复名称数据保存区和重复GUID数据保存区。
可选的,该方法还包括:从所述变量数据保存区获取待读取UEFI变量数据的过程;
其中,所述从所述变量数据保存区获取待读取UEFI变量数据的过程,包括:
所述变量数据保存区中存储所述待读取UEFI变量数据中当前目标数据的索引时,获取当前目标数据的索引;
根据当前目标数据的索引,从所述重复数据保存区中获取当前目标数据。
可选的,所述变量数据保存区中存储所述待读取UEFI变量数据中当前目标数据的索引时,获取当前目标数据的索引,包括:
检测所述变量数据保存区中所述待读取UEFI变量数据对应的存储属性数据中当前目标数据对应的重复属性是否为重复状态;
若是,则获取当前目标数据的索引,并执行所述根据当前目标数据的索引,从所述重复数据保存区中获取当前目标数据的步骤;
若否,则从所述变量数据保存区中获取当前目标数据。
本申请还提供了一种BIOS的数据存储装置,包括:
获取模块,用于获取每个待存储二值菜单数据;其中,每个所述待存储二值菜单数据为允许状态数据或禁用状态数据;
检测模块,用于检测重复数据保存区中所述待存储UEFI变量数据中的目标数据对应的重复数据;其中,所述目标数据包括名称数据和/或GUID数据;
重复数据存储模块,用于若在所述重复数据保存区中检测到当前目标数据对应的当前重复数据,则获取当前重复数据的索引,并在将所述待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储;其中,当前目标数据为任一所述目标数据,当前目标数据的数据大小大于当前重复数据的索引的数据大小。
本申请还提供了一种BIOS设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行所述计算机程序时实现如上述所述的BIOS的数据存储方法的步骤。
本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述所述的BIOS的数据存储方法的步骤。
本申请所提供的一种BIOS的数据存储方法,包括:BIOS获取待存储UEFI变量数据;检测重复数据保存区中待存储UEFI变量数据中的目标数据对应的重复数据;其中,目标数据包括名称数据和/或GUID数据;若在重复数据保存区中检测到当前目标数据对应的当前重复数据,则获取当前重复数据的索引,并在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储;其中,当前目标数据为任一目标数据,当前目标数据的数据大小大于当前重复数据的索引的数据大小;
可见,本申请通过在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储,能够利用重复数据保存区来保存各个UEFI变量数据发生重复的目标数据,减少了重复的目标数据在BIOS中存储所占用的空间,从而减少UEFI变量数据在BIOS中存储所占用的空间。此外,本申请还提供了一种BIOS的数据存储装置、BIOS设备及计算机可读存储介质,同样具有上述有益效果。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为现有技术中的UEFI变量数据在BIOS FLASH中的存储方式的示意图;
图2为现有技术中的UEFI变量数据在BIOS FLASH中的存放基本单位的示意图;
图3为现有技术中的UEFI变量数据在BIOS FLASH中的存放基本单位的存储属性数据的示意图;
图4为本申请实施例所提供的一种BIOS的数据存储方法的流程图;
图5为本申请实施例所提供的另一种BIOS的数据存储方法的UEFI变量数据的存储方式的示意图;
图6为本申请实施例所提供的另一种BIOS的数据存储方法的索引存储的示意图;
图7为本申请实施例所提供的另一种BIOS的数据存储方法的存储属性数据的示意图;
图8为本申请实施例所提供的另一种BIOS的数据存储方法的名称数据存储的流程示意图;
图9为本申请实施例所提供的另一种BIOS的数据存储方法的名称数据读取的流程示意图;
图10为本申请实施例所提供的一种BIOS的数据存储装置的结构框图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参考图4,图4为本申请实施例所提供的一种BIOS的数据存储方法的流程图。该方法可以包括:
步骤101:BIOS获取待存储UEFI变量数据。
可以理解的是,本步骤中的待存储UEFI变量数据可以为需要存储的UEFI变量数据。本实施例并不限定待存储UEFI变量数据的具体内容,如可以采用 与现有技术中UEFI变量的数据内容相同或相似的方式实现,例如待存储UEFI变量数据可以包括名称数据、GUID数据和具体用户数据。
具体的,在本实施例中,对于BIOS设备(如BIOS芯片)获取待存储UEFI变量数据的具体方式,可以由设计人员根据实用场景和用户需求自行设置,如可以采用与现有技术中需要存储的UEFI变量数据的获取方法相同或相似的方式实现,例如BIOS设备可以利用SetVariable()接口函数,获取待存储UEFI变量数据。
步骤102:检测重复数据保存区中待存储UEFI变量数据中的目标数据对应的重复数据;其中,目标数据包括名称数据和/或GUID数据。
可以理解的是,本步骤中的目标数据可以为各个UEFI变量数据中会发生重复情况的部分数据(如名称数据和/或GUID数据),即待存储UEFI变量数据中能够在重复数据保存区中存储的部分数据。本步骤中的重复数据保存区可以为用于存储重复的目标数据的Nvram区域。
具体的,在本实施例中,对于目标数据的具体设置,可以由设计人员根据实用场景和用户需求自行设置,如目标数据可以包括名称数据或GUID数据,即重复数据保存区可以包括用于存储重复的名称数据的重复名称数据保存区(如图5中的重复变量名称保存区)或者用于存储重复的GUID数据的重复GUID数据保存区(如图5中的重复变量GUID保存区);目标数据也可以包括名称数据和GUID数据,即重复数据保存区可以包括重复名称数据保存区和重复GUID数据保存区。
需要说明的是,本步骤中目标数据对应的重复数据可以为重复数据保存区中存储的与待存储UEFI变量数据中的目标数据相同的数据。本步骤中BIOS设备通过检测重复数据保存区中待存储UEFI变量数据中的目标数据对应的重复数据,可以检测重复数据保存区中存储的与目标数据相同的数据(即重复数据),如目标数据包括名称数据和GUID数据时,本步骤可以依次或分别检测重复名称数据保存区中与待存储UEFI变量数据中的名称数据相同的数据(即重复名称数据)和重复GUID数据保存区中与待存储UEFI变量数据中的名称数据相同的数据(即重复GUID数据)。
步骤103:若在重复数据保存区中检测到当前目标数据对应的当前重复数据,则获取当前重复数据的索引,并在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储;其中,当前目标数据为任一目标数据,当前目标数据的数据大小大于当前重复数据的索引的数据大小。
可以理解的是,本步骤中的当前重复数据可以为重复数据保存区中存储的待存储UEFI变量数据中的当前目标数据(如名称数据或GUID数据)对应的重复数据,即重复数据保存区中与当前目标数据相同的数据。本步骤中当前重复数据的索引(index)可以为用于指示重复数据保存区中当前重复数据的存储位置的信息,如当前重复数据在重复数据保存区中的偏移量,即BIOS 设备可以利用当前重复数据的索引在重复数据保存区中查找到当前重复数据。本步骤中的变量数据保存区可以为用于存储UEFI变量数据的Nvram区域(如图5中的单一变量保存区)。
对应的,本步骤中BIOS设备可以在重复数据保存区中存储有待存储UEFI变量数据中的当前目标数据时,获取重复数据保存区中的当前目标数据(即当前重复数据)的索引,从而在待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储,使得变量数据保存区中不需要再次存储当前目标数据,而是存储占用空间更小的索引,从而在不影响待存储UEFI变量数据的读取使用的情况下,减少待存储UEFI变量数据存储的占用空间。如图6所示,当前目标数据为变量1对应的待存储UEFI变量数据中的名称数据时,本步骤中BIOS设备可以在单一变量保存区存储该待存储UEFI变量数据过程中,在变量1中的变量名称处以当前目标数据对应的重复变量名称保存区中Name 1(即当前重复数据)的索引NAME INDEX 1,替换实际的当前目标数据,从而使单一变量保存区中的变量1中变量名称处能够以占用存储空间更小的NAME INDEX 1(即索引)代替当前目标数据的实际ASCII字符串的存储;相应的,当前目标数据为GUID数据时,本步骤中在将待存储UEFI变量数据存储到变量数据保存区的过程中,本步骤中BIOS设备可以在变量数据保存区中待存储UEFI变量数据对应的变量基本单位(如图6中变量1-N)的GUID处以占用存储空间更小索引(如图6中GUID INDEX 1-N)代替当前目标数据的实际16字节长度的十六进制数据。
需要说明的是,本步骤是以BIOS设备对待存储UEFI变量数据的任一目标数据(即当前目标数据)的存储处理为例进行展示的,即待存储UEFI变量数据包括两个或更多个目标数据(如名称数据和GUID数据)时,每个目标数据均可以通过与本步骤相同或相似的方式进行存储。
对应的,本步骤中BIOS设备在将待存储UEFI变量数据存储到变量数据保存区的过程中,不仅可以将当前目标数据替换为当前重复数据的索引进行存储,还可以将待存储UEFI变量数据对应的存储属性数据中的当前目标数据对应的重复属性调整为重复状态,以使后续读取待存储UEFI变量数据的当前目标数据时,可以通过检测存储属性数据中当前目标数据对应的重复属性来确定变量数据保存区中存储的是当前目标数据还是当前目标数据对应的索引。也就是说,在本实施例中,变量基本单位的存储属性数据(即变量标头)不仅可以包括用于描述变量基本单位总和大小的size属性、用于描述下一个变量基本单位偏移量的next属性和用于描述本变量基本单位的属性的flags属性等现有属性,还可以包括各目标数据对应的重复属性。
具体的,目标数据包括名称数据和GUID数据时,如图3和图7所示,在本实施例中,可以在待存储UEFI变量数据对应的变量基本单位的存储属性数据(即变量标头)中加入名称数据对应的重复属性(即变量名称重复属性,variable name duplicate attribute)和GUID数据对应的重复属性(即变量GUID 重复属性,variable GUID duplicate attribute)这两个属性,以分别标识变量基本单位中名称数据和GUID数据各自是否存放在对应的重复数据保存区;例如名称数据对应的重复属性为1(即重复状态)时,可以表明变量基本单位中存储名称数据对应的索引,实际的名称数据(如ASCII字串)保存在重复名称数据保存区;名称数据对应的重复属性为0(即非重复状态)时,可以表明变量基本单位中存储实际的名称数据(如ASCII字串)。
需要说明的是,本实施例所提供的方法还可以包括若在重复数据保存区中未检测到当前目标数据对应的重复数据,则将当前目标数据存储到重复数据保存区中,并生成重复数据保存区中当前目标数据的索引;在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前目标数据的索引进行存储。也就是说,在本实施例中,BIOS设备可以在重复数据保存区中检测不到当前目标数据对应的重复数据时,直接将当前目标数据存储到重复数据保存区中,利用重复数据保存区中当前目标数据的索引替换当前目标数据存储在变量数据保存区中。例如在本实施例中,重复数据保存区可以存储全部UEFI变量数据中实际的目标数据,使得变量数据保存区中仅存储目标数据对应的索引;对应的,由于变量数据保存区中仅存储目标数据对应的索引,可以不必在变量数据保存区中UEFI变量数据对应的变量基本单位的存储属性数据设置目标数据对应的重复属性。
具体的,如图8所示,当前目标数据为变量名称(即名称数据)时,BIOS设备可以根据SetVariable()传递的变量名称来查找重复变量名称保存区是否存在该变量名称;若否,则将在重复变量名称保存区存储该名称数据的ACSII数据,生成重复变量名称保存区中该变量名称的ACSII数据的索引(index),并设置该变量名称对应的变量基本单位的变量标头中的变量名称重复属性为1,将变量基本单位的变量名称设置为生成的索引(如十六进制数值),之后可以执行SetVariable()的其它步骤完成变量基本单位在变量数据保存区的存储;若是,则直接获取重复名称数据保存区中存储的该变量名称的ACSII数据的索引(index),并设置该变量名称对应的变量基本单位的变量标头中的变量名称重复属性为1,将变量基本单位的变量名称设置为获取的索引,之后可以执行SetVariable()的其它步骤完成变量基本单位在变量数据保存区的存储。相应的,当前目标数据为GUID数据可以采用与图8所示过程相似的方式,实现重复GUID数据保存区中GUID数据的索引的利用、变量基本单位中变量名称重复属性的设置以及GUID数据对应的索引的存储。
可以理解的是,本实施例所提供的方法还可以包括若在重复数据保存区中未检测到当前目标数据对应的重复数据,则检测变量数据保存区中的已存储UEFI变量数据中是否存在当前目标数据对应的重复数据;若是,则将当前目标数据存储到重复数据保存区中,并生成重复数据保存区中当前目标数据的索引,在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前目标数据的索引进行存储;若否,则在将待存储UEFI 变量数据存储到变量数据保存区的过程中,在变量数据保存区中存储当前目标数据。
也就是说,在本实施例中,BIOS设备可以在重复数据保存区中检测不到当前目标数据对应的重复数据时,继续检测变量数据保存区中的所存储的UEFI变量数据(即已存储UEFI变量数据)中是否存在当前目标数据对应的重复数据,即当前目标数据是否与变量数据保存区中的数据重复,从而在当前目标数据与变量数据保存区中的数据重复时,将当前目标数据存储到重复数据保存区中,以使后续再次需要存储与当前目标数据相同的目标数据时能够存储当前目标数据对应的索引;而在当前目标数据不与变量数据保存区中的数据重复时,可以在变量数据保存区中存储当前目标数据,使并未重复出现的目标数据不需存储到重复数据保存区,减少了变量数据保存区中目标数据对应的索引的存储数量。
对应的,在重复数据保存区中未检测到当前目标数据对应的重复数据,并且变量数据保存区中的已存储UEFI变量数据中存在当前目标数据对应的重复数据时,BIOS设备可以将当前目标数据存储到重复数据保存区中,并生成重复数据保存区中当前目标数据的索引,在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前目标数据的索引进行存储,并将待存储UEFI变量数据对应的存储属性数据中的当前目标数据对应的重复属性调整为重复状态。对应的,BIOS设备还可以将变量数据保存区中当前目标数据对应的重复数据调整为当前目标数据的索引,并且将该重复数据所在的已存储UEFI变量数据对应的存储属性数据中的当前目标数据对应的重复属性调整为重复状态,以实现对变量数据保存区中出现重复的目标数据的存储调整,从而进一步减少重复的目标数据的占用空间。
在本实施例中,本申请通过在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储,能够利用重复数据保存区来保存各个UEFI变量数据发生重复的目标数据,以减少重复的目标数据在BIOS中存储所占用的空间,从而减少UEFI变量数据在BIOS中存储所占用的空间。
基于上述实施例,本实施例所提供的BIOS的数据存储方法还可以包括从变量数据保存区获取待读取UEFI变量数据的过程,以保证BIOS设备可以从变量数据保存区获取完整的UEFI变量数据(如上述实施例中的待存储UEFI变量数据)。具体的,从变量数据保存区获取待读取UEFI变量数据的过程可以包括如下步骤:
步骤201:变量数据保存区中存储待读取UEFI变量数据中当前目标数据的索引时,获取当前目标数据的索引。
可以理解的是,本步骤中的待读取UEFI变量数据可以为需要读取的已存储的UEFI变量数据;本步骤中的当前目标数据可以为待读取UEFI变量数据 中的任一目标数据(如名称数据或GUID数据)。本步骤中BIOS设备可以在确定重复数据保存区中存储待读取UEFI变量数据中当前目标数据的索引,即当前目标数据存储在重复数据保存区时,从变量数据保存区中当前目标数据对应的索引,从而利用该索引从重复数据保存区获取当前目标数据。
具体的,在本实施例中,对于BIOS设备确定变量数据保存区中存储待读取UEFI变量数据中当前目标数据的索引的具体方式,可以由设计人员根据实用场景和用户需求自行设置,如变量数据保存区中仅存储目标数据对应的索引,即已存储的UEFI变量数据中的实际的目标数据均在重复数据保存区中存储时,本步骤中BIOS可以默认变量数据保存区中存储有待读取UEFI变量数据中当前目标数据的索引。
对应的,变量数据保存区中能够存储实际的目标数据时,本步骤中BIOS设备也可以通过检测变量数据保存区中待读取UEFI变量数据的存储属性数据中当前目标数据对应的重复属性是否为重复状态来确定变量数据保存区中是否存储有待读取UEFI变量数据中当前目标数据的索引;从而在重复属性为重复状态时,可以获取当前目标数据的索引,并进入步骤202,从重复数据保存区中获取当前目标数据;在重复属性为非重复状态时,直接从变量数据保存区中获取当前目标数据。如图9所示,当前目标数据为名称数据时,BIOS设备可以在利用GetVariable()读取当前目标数据时,可以先检查待读取UEFI变量数据对应的变量基本单位中的变量名称重复属性;如果为1(即重复状态),则变量数据保存区中该变量基本单位中变量名称的区域(即变量名称区域)为名称数据对应的索引(index),而非实际的名称数据的ASCII字串,可以根据该索引,从重复变量名称保存区中读取实际的名称数据的ASCII字串,之后可以执行GetVariable()的其它流程完成待读取UEFI变量数据的读取;如果为0(即非重复状态),则变量数据保存区中该变量基本单位中变量名称区域为实际的名称数据的ASCII字串,可以直接从变量名称区域中读取名称数据的ASCII字串,之后可以执行GetVariable()的其它流程完成待读取UEFI变量数据的读取。相应的,当前目标数据为GUID数据可以采用与图9所示过程相似的方式,实现存储的GUID数据的读取。
步骤202:根据当前目标数据的索引,从重复数据保存区中获取当前目标数据。
可以理解的是,本步骤中BIOS设备可以利用从变量数据保存区中获取的当前目标数据的索引从重复数据保存区中获取当前目标数据;如当前目标数据为名称数据时,BIOS设备可以利用变量数据保存区中当前目标数据对应的索引从重复名称数据保存区中该索引对应的偏移量区域中读取实际的当前目标数据(如ASCII字串)。
相应于上面的方法实施例,本申请实施例还提供了一种BIOS的数据存储装置,下文描述的BIOS的数据存储装置与上文描述的BIOS的数据存储方法可相互对应参照。
请参考图10,图10为本申请实施例所提供的一种BIOS的数据存储装置的结构框图。该装置可以包括:
获取模块10,用于获取每个待存储二值菜单数据;其中,每个待存储二值菜单数据为允许状态数据或禁用状态数据;
检测模块20,用于检测重复数据保存区中待存储UEFI变量数据中的目标数据对应的重复数据;其中,目标数据包括名称数据和/或GUID数据;
重复数据存储模块30,用于若在重复数据保存区中检测到当前目标数据对应的当前重复数据,则获取当前重复数据的索引,并在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储;其中,当前目标数据为任一目标数据,当前目标数据的数据大小大于当前重复数据的索引的数据大小。
可选的,该装置还可以包括:
索引生成模块,用于若在重复数据保存区中未检测到当前目标数据对应的重复数据,则将当前目标数据存储到重复数据保存区中,并生成重复数据保存区中当前目标数据的索引;
索引存储模块,用于在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前目标数据的索引进行存储。
可选的,该装置还可以包括:
变量检测模块,用于若在重复数据保存区中未检测到当前目标数据对应的重复数据,则检测变量数据保存区中的已存储UEFI变量数据中是否存在当前目标数据对应的重复数据;
重复存储模块,用于若存在当前目标数据对应的重复数据,则将当前目标数据存储到重复数据保存区中,并生成重复数据保存区中当前目标数据的索引;在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前目标数据的索引进行存储;
变量存储模块,用于若不存在当前目标数据对应的重复数据,则在将待存储UEFI变量数据存储到变量数据保存区的过程中,在变量数据保存区中存储当前目标数据。
可选的,重复数据存储模块30可以包括:
属性调整子模块,用于在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储,并将待存储UEFI变量数据的存储属性数据中的当前目标数据对应的重复属性调整为重复状态。
可选的,目标数据包括名称数据和GUID数据时,重复数据保存区包括重复名称数据保存区和重复GUID数据保存区。
可选的,该装置还可以包括:读取模块,用于从变量数据保存区获取待读取UEFI变量数据;
其中,读取模块可以包括:
索引获取子模块,用于重复数据保存区中存储有待读取UEFI变量数据中当前目标数据的索引时,获取当前目标数据的索引;
重复读取子模块,用于根据当前目标数据的索引,从重复数据保存区中获取当前目标数据。
可选的,索引获取子模块,可以包括:
检测单元,用于检测变量数据保存区中待读取UEFI变量数据的存储属性数据中当前目标数据对应的重复属性是否为重复状态;
索引获取单元,用于若为重复状态,则获取当前目标数据的索引,并向重复读取子模块发送启动信号;
变量读取单元,用于若为非重复状态,则从变量数据保存区中获取当前目标数据。
在本实施例中,本申请通过重复数据存储模块30在将待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储,能够利用重复数据保存区来保存各个UEFI变量数据发生重复的目标数据,减少了重复的目标数据在BIOS中存储所占用的空间,从而减少UEFI变量数据在BIOS中存储所占用的空间。
相应于上面的方法实施例,本申请实施例还提供了一种BIOS设备,下文描述的BIOS设备与上文描述的BIOS的数据存储方法可相互对应参照。
本申请实施例还提供了一种BIOS设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行计算机程序时实现如上述实施例所提供的BIOS的数据存储方法的步骤。
相应于上面的方法实施例,本申请实施例还提供了一种计算机可读存储介质,下文描述的计算机可读存储介质与上文描述的BIOS的数据存储方法可相互对应参照。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现如上述实施例所提供的设备测试方法的步骤。
其中,该存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是 与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置、BIOS设备及计算机可读存储介质而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
以上对本申请所提供的一种BIOS的数据存储方法、装置、BIOS设备及计算机可读存储介质进行了详细介绍。本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。

Claims (10)

  1. 一种BIOS的数据存储方法,其特征在于,包括:
    BIOS获取待存储UEFI变量数据;
    检测重复数据保存区中所述待存储UEFI变量数据中的目标数据对应的重复数据;其中,所述目标数据包括名称数据和/或GUID数据;
    若在所述重复数据保存区中检测到当前目标数据对应的当前重复数据,则获取当前重复数据的索引,并在将所述待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储;其中,当前目标数据为任一所述目标数据,当前目标数据的数据大小大于当前重复数据的索引的数据大小。
  2. 根据权利要求1所述的BIOS的数据存储方法,其特征在于,还包括:
    若在所述重复数据保存区中未检测到当前目标数据对应的重复数据,则将当前目标数据存储到所述重复数据保存区中,并生成所述重复数据保存区中当前目标数据的索引;
    在将所述待存储UEFI变量数据存储到所述变量数据保存区的过程中,将当前目标数据替换为当前目标数据的索引进行存储。
  3. 根据权利要求1所述的BIOS的数据存储方法,其特征在于,还包括:
    若在所述重复数据保存区中未检测到当前目标数据对应的重复数据,则检测所述变量数据保存区中的已存储UEFI变量数据中是否存在当前目标数据对应的重复数据;
    若是,则将当前目标数据存储到所述重复数据保存区中,并生成所述重复数据保存区中当前目标数据的索引;在将所述待存储UEFI变量数据存储到所述变量数据保存区的过程中,将当前目标数据替换为当前目标数据的索引进行存储;
    若否,则在将所述待存储UEFI变量数据存储到所述变量数据保存区的过程中,在所述变量数据保存区中存储当前目标数据。
  4. 根据权利要求1所述的BIOS的数据存储方法,其特征在于,所述在将所述待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储,包括:
    在将所述待存储UEFI变量数据存储到所述变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储,并将所述待存储UEFI变量数据对应的存储属性数据中的当前目标数据对应的重复属性调整为重复状态。
  5. 根据权利要求1所述的BIOS的数据存储方法,其特征在于,所述目标数据包括所述名称数据和所述GUID数据时,所述重复数据保存区包括重复名称数据保存区和重复GUID数据保存区。
  6. 根据权利要求1至5任一项所述的BIOS的数据存储方法,其特征在于,还包括:从所述变量数据保存区获取待读取UEFI变量数据的过程;
    其中,所述从所述变量数据保存区获取待读取UEFI变量数据的过程,包括:
    所述变量数据保存区中存储所述待读取UEFI变量数据中当前目标数据的索引时,获取当前目标数据的索引;
    根据当前目标数据的索引,从所述重复数据保存区中获取当前目标数据。
  7. 根据权利要求6所述的BIOS的数据存储方法,其特征在于,所述变量数据保存区中存储所述待读取UEFI变量数据中当前目标数据的索引时,获取当前目标数据的索引,包括:
    检测所述变量数据保存区中所述待读取UEFI变量数据对应的存储属性数据中当前目标数据对应的重复属性是否为重复状态;
    若是,则获取当前目标数据的索引,并执行所述根据当前目标数据的索引,从所述重复数据保存区中获取当前目标数据的步骤;
    若否,则从所述变量数据保存区中获取当前目标数据。
  8. 一种BIOS的数据存储装置,其特征在于,包括:
    获取模块,用于获取每个待存储二值菜单数据;其中,每个所述待存储二值菜单数据为允许状态数据或禁用状态数据;
    检测模块,用于检测重复数据保存区中所述待存储UEFI变量数据中的目标数据对应的重复数据;其中,所述目标数据包括名称数据和/或GUID数据;
    重复数据存储模块,用于若在所述重复数据保存区中检测到当前目标数据对应的当前重复数据,则获取当前重复数据的索引,并在将所述待存储UEFI变量数据存储到变量数据保存区的过程中,将当前目标数据替换为当前重复数据的索引进行存储;其中,当前目标数据为任一所述目标数据,当前目标数据的数据大小大于当前重复数据的索引的数据大小。
  9. 一种BIOS设备,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序时实现如权利要求1至7任一项所述的BIOS的数据存储方法的步骤。
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的BIOS的数据存储方法的步骤。
PCT/CN2022/089755 2021-04-29 2022-04-28 一种bios的数据存储方法、装置、设备及存储介质 WO2022228500A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110476040.3A CN113064556A (zh) 2021-04-29 2021-04-29 一种bios的数据存储方法、装置、设备及存储介质
CN202110476040.3 2021-04-29

Publications (1)

Publication Number Publication Date
WO2022228500A1 true WO2022228500A1 (zh) 2022-11-03

Family

ID=76567911

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/089755 WO2022228500A1 (zh) 2021-04-29 2022-04-28 一种bios的数据存储方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN113064556A (zh)
WO (1) WO2022228500A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113064556A (zh) * 2021-04-29 2021-07-02 山东英信计算机技术有限公司 一种bios的数据存储方法、装置、设备及存储介质
CN117667788B (zh) * 2024-01-30 2024-04-19 苏州元脑智能科技有限公司 数据的交互方法、计算机系统、电子设备和存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101236525A (zh) * 2008-01-24 2008-08-06 创新科存储技术(深圳)有限公司 文件存储、读取、删除及复制方法及其相关系统
US20180293061A1 (en) * 2017-04-05 2018-10-11 Dell Products, Lp System and method for automatically managing updated uefi variables
CN109002330A (zh) * 2018-07-27 2018-12-14 郑州云海信息技术有限公司 一种识别uefi os启动项的方法、装置及设备
CN110944040A (zh) * 2019-10-31 2020-03-31 浙江工商大学 一种数据压缩过程中的编码方法
CN111949629A (zh) * 2020-07-22 2020-11-17 金钱猫科技股份有限公司 一种面向边缘云的文件存储方法及终端
CN113064556A (zh) * 2021-04-29 2021-07-02 山东英信计算机技术有限公司 一种bios的数据存储方法、装置、设备及存储介质

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103838765B (zh) * 2012-11-26 2018-01-23 比亚迪股份有限公司 联系人信息存储方法及装置、电子设备
WO2016091282A1 (en) * 2014-12-09 2016-06-16 Huawei Technologies Co., Ltd. Apparatus and method for de-duplication of data
CN106611035A (zh) * 2016-06-12 2017-05-03 四川用联信息技术有限公司 一种云存储中重复数据删除的检索算法
US10235396B2 (en) * 2016-08-29 2019-03-19 International Business Machines Corporation Workload optimized data deduplication using ghost fingerprints
CN109947731A (zh) * 2017-07-31 2019-06-28 星辰天合(北京)数据科技有限公司 重复数据的删除方法和装置
CN107885619A (zh) * 2017-11-16 2018-04-06 郑州云海信息技术有限公司 一种数据精简去重和镜像异地备份保护的方法及系统
CN108052291A (zh) * 2017-12-14 2018-05-18 郑州云海信息技术有限公司 一种云服务器的存储方法、系统、装置及可读存储介质
CN109241023A (zh) * 2018-09-21 2019-01-18 郑州云海信息技术有限公司 分布式存储系统数据存储方法、装置、系统及存储介质
CN111125033B (zh) * 2018-10-31 2024-04-09 深信服科技股份有限公司 一种基于全闪存阵列的空间回收方法及系统
CN111026327B (zh) * 2019-10-22 2022-12-23 苏州浪潮智能科技有限公司 一种基于重删的磁带归档系统及方法
CN111143288A (zh) * 2019-12-22 2020-05-12 北京浪潮数据技术有限公司 一种数据存储方法、系统及相关装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101236525A (zh) * 2008-01-24 2008-08-06 创新科存储技术(深圳)有限公司 文件存储、读取、删除及复制方法及其相关系统
US20180293061A1 (en) * 2017-04-05 2018-10-11 Dell Products, Lp System and method for automatically managing updated uefi variables
CN109002330A (zh) * 2018-07-27 2018-12-14 郑州云海信息技术有限公司 一种识别uefi os启动项的方法、装置及设备
CN110944040A (zh) * 2019-10-31 2020-03-31 浙江工商大学 一种数据压缩过程中的编码方法
CN111949629A (zh) * 2020-07-22 2020-11-17 金钱猫科技股份有限公司 一种面向边缘云的文件存储方法及终端
CN113064556A (zh) * 2021-04-29 2021-07-02 山东英信计算机技术有限公司 一种bios的数据存储方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN113064556A (zh) 2021-07-02

Similar Documents

Publication Publication Date Title
WO2022228500A1 (zh) 一种bios的数据存储方法、装置、设备及存储介质
CN105760292B (zh) 一种用于单元测试的断言验证方法和装置
US8984486B2 (en) System, method, and computer program product for automated stability testing of device firmware
WO2012041110A1 (zh) 数据比对方法和装置
CN110096541B (zh) 一种数据库间的数据交换方法及装置
WO2021169280A1 (zh) 虚拟磁盘校验码生成方法、装置、设备及存储介质
US11650875B2 (en) Abnormal inode dynamic repair method and system, and related component
US11176634B2 (en) Methods and devices of picture processing based on external storage device and user interface display
CN116501415B (zh) 命令执行方法及装置、电子设备、计算机可读存储介质
WO2023197851A1 (zh) 异常组件的识别方法、装置、设备、存储介质及程序产品
US20150055169A1 (en) Extendable system for preprocessing print document and method for the same
CN114861003A (zh) 一种指定目录下的对象列举方法、装置及其介质
CN115577689A (zh) 一种表格组件的生成方法、装置、设备及介质
JP2018535495A (ja) アプリケーションユーザーインターフェース自動テスト方法、電子装置、システム及び記憶媒体
CN113282256A (zh) Android系统显示器管理的方法、装置、设备及存储介质
US8359456B2 (en) Generating random addresses for verification of distributed computerized devices
CN111858495B (zh) 文件信息获取方法、装置、存储介质及电子设备
CN106897045B (zh) 音频播放方法、装置和计算机设备
CN111459819A (zh) 软件测试方法及装置、电子设备、计算机可读介质
CN111858494B (zh) 文件获取方法、装置、存储介质及电子设备
CN110795297B (zh) 一种电子设备的测试方法及装置
CN113127281B (zh) 一种aspm测试方法、系统、设备以及存储介质
CN118101971B (zh) 一种解码数据的渲染方法及装置、电子设备、存储介质
CN114154944B (zh) 业务审核方法、设备及计算机可读存储介质
WO2023109613A1 (zh) 任务执行方法、装置、设备及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22794970

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22794970

Country of ref document: EP

Kind code of ref document: A1