A processing method, device, electronic device and storage medium

By responding to BIOS write instructions in an electronic device, determining and using address offset to store data to be changed, the problem of redundancy and low efficiency of storage space caused by data structure update is solved, and the utilization rate and storage efficiency of storage space are improved. Reduces startup time and data loss risk.

CN112905498BActive Publication Date: 2024-11-26LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110204850.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-23
Publication Date
2024-11-26
Estimated Expiration
2041-02-23

AI Technical Summary

Technical Problem

During the startup process of electronic devices, when data changes, the existing technology needs to update the entire data structure, resulting in an increase in redundant content in the storage space, a decrease in effective utilization, and a long time to store or erase the operation, increasing the startup time and data Loss probability.

Method used

By responding to the write instructions sent by the basic input and output system, the address offset of the data to be changed is determined, and data is stored in the nonvolatile storage medium based on the offset, avoiding updating the entire data structure and reducing redundant storage.

Benefits of technology

It improves the storage space utilization and storage efficiency of non-volatile storage media, reduces the read and write time and number of erases, and reduces the probability of BIOS downtime or stop working.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112905498B_ABST
    Figure CN112905498B_ABST
Patent Text Reader

Abstract

The present application discloses a processing method, device, electronic device and storage medium, wherein the method comprises: in response to a write instruction sent by a basic input / output system, determining data to be changed stored in a non-volatile storage medium; in the non-volatile storage medium, determining a stored data structure matching the data to be changed; based on the stored data structure, determining an address offset of the data to be changed; based on the address offset, storing the data to be changed in the non-volatile storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information processing technology, and in particular to a processing method, device, electronic device and storage medium. Background Art

[0002] In the related art, when an electronic device is storing internal related data during the startup phase, if any data changes, the entire data structure corresponding to the changed data to be processed usually needs to be updated and re-stored; this will result in redundant content in the limited storage space, thereby reducing the effective utilization of the storage space. Summary of the invention

[0003] In view of this, embodiments of the present application hope to provide a processing method, device, electronic device and storage medium.

[0004] To achieve the above purpose, the technical solution of this application is implemented as follows:

[0005] The present application provides a processing method, which includes:

[0006] In response to a write instruction sent by a basic input / output system, determining data to be changed stored in a non-volatile storage medium;

[0007] In the non-volatile storage medium, determining a stored data structure that matches the data to be changed;

[0008] Based on the stored data structure, determining the address offset of the data to be changed;

[0009] Based on the address offset, the data to be changed is stored in the non-volatile storage medium.

[0010] The embodiment of the present application further provides a processing device, the processing device comprising: a determination module and a storage module, wherein:

[0011] The determination module is used to determine the data to be changed stored in the non-volatile storage medium in response to the write instruction sent by the basic input and output system;

[0012] The determination module is further used to determine, in the non-volatile storage medium, a stored data structure that matches the data to be changed;

[0013] The determining module is further used to determine the address offset of the data to be changed based on the stored data structure;

[0014] The storage module is used to store the data to be changed in the non-volatile storage medium based on the address offset.

[0015] The embodiment of the present application further provides an electronic device, the electronic device comprising: a processor, a memory and a communication bus; wherein:

[0016] The communication bus is used to realize the communication connection between the processor and the memory;

[0017] The processor is used to execute the program in the memory to implement the above-mentioned processing method.

[0018] Accordingly, an embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the processing method as described above.

[0019] The processing method, device, electronic device and storage medium provided by the embodiments of the present application, wherein, in response to a write instruction sent by a basic input / output system, data to be changed stored in a non-volatile storage medium is determined; in the non-volatile storage medium, a stored data structure matching the data to be changed is determined; based on the stored data structure, an address offset of the data to be changed is determined; based on the address offset, the data to be changed is stored in the non-volatile storage medium; in this way, based on the write instruction sent by the basic input / output system, the address offset corresponding to the stored data structure in the non-volatile storage medium is determined, and the data to be changed is stored based on the address offset, which can improve the utilization rate and storage rate of the storage space in the non-volatile storage medium. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a schematic diagram of storing relevant data in NVRAM in relative technology;

[0021] Figure 2 A flowchart of a processing method provided in an embodiment of the present application;

[0022] Figure 3 A flowchart of another processing method provided in an embodiment of the present application;

[0023] Figure 4 A flowchart of another processing method provided in an embodiment of the present application;

[0024] Figure 5a A schematic diagram of a data structure provided in an embodiment of the present application;

[0025] Figure 5b A schematic diagram of a data structure stored in an EEPROM according to an embodiment of the present application;

[0026] Figure 6A schematic diagram of a process of writing data in an EEPROM provided in an embodiment of the present application;

[0027] Figure 7 A schematic diagram of a process for reading data from an EEPROM provided in an embodiment of the present application;

[0028] Figure 8 A schematic diagram of the structure of a processing device provided in an embodiment of the present application;

[0029] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0031] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0032] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the present application.

[0033] In the related art, when an electronic device stores data related to the Unified Extensible Firmware Interface (UEFI) through the Basic Input Output System (BIOS) during the startup process, the data is usually stored in a fixed storage area, such as: Non-Volatile Random Access Memory (NVRAM); Figure 1 As shown, it is a schematic diagram of storing relevant data in NVRAM in the related technology; wherein, Figure 1a, b and c are all display interfaces presented by data stored in NVRAM, and this interface is generally provided for R&D personnel; at the same time, the options of item in the electronic device during startup are presented in the form of Figure 1 If the user of the electronic device modifies the options in the Setup or the parameters in the Setup change, the BIOS needs to modify the stored data and re-store the data to the NVRAM.

[0034] Among them, during the boot process of the electronic device, when the user operating the electronic device sets relevant data or changes a certain firmware, the data in the relevant data structure will be changed, and the data structure containing the changed data needs to be updated and stored again; at the same time, during the storage or sorting process, the electronic device usually takes a long time, which may cause the relevant data set by the user or the updated firmware to be lost; in addition, due to limited storage space, after a period of storage, the memory will correspondingly start the garbage collection mechanism to perform relevant erasing actions to erase the corresponding storage blocks inside the NVRAM, which will increase the probability of loss of relevant data set by the user based on the BIOS; at the same time, the erasing action is time-consuming and may increase the boot time.

[0035] Based on the above problems, the present application provides a processing method, which is applied to electronic equipment, referring to Figure 2 As shown, the method comprises the following steps:

[0036] Step 101 : In response to a write instruction sent by a basic input / output system, determine data to be changed stored in a non-volatile storage medium.

[0037] In the embodiment of the present application, the electronic device may be any device with data processing capability.

[0038] The electronic device responds to a write instruction sent by a basic input and output system, namely, BIOS, and determines the data to be changed that needs to be stored in a non-volatile storage medium based on the write instruction.

[0039] It should be noted that non-volatile storage medium refers to a storage medium or memory in which the data stored will not be lost when the electronic device is turned off or suddenly or accidentally turned off.

[0040] In the embodiments of the present application, the non-volatile storage medium may be any non-volatile storage medium, such as an electrically erasable programmable read-only memory (EEPROM), a non-volatile dual in-line memory module (NVDIMM) or NVRAM, etc. In the following other embodiments of the present application, EEPROM is used to refer to the non-volatile storage medium.

[0041] In an embodiment of the present application, the electronic device determines the data to be changed stored in the EEPROM in response to a write instruction sent by the basic BIOS; in a feasible implementation method, the electronic device can determine that the corresponding storage medium is the EEPROM based on the write instruction sent by the BIOS and the storage medium information carried in the write instruction.

[0042] It should be noted that in the embodiment of the present application, the BIOS and the EEPROM can communicate through a serial peripheral interface (SPI); wherein the SPI is a high-speed, full-duplex and synchronous communication bus, which only occupies four wires on the chip pins in the hardware implementation link, thereby saving the chip pins.

[0043] The data to be changed may be data generated during the operation of any electronic device, and may also be data generated during the startup phase of the electronic device.

[0044] In a feasible implementation, during the startup phase of the electronic device, the user operating the electronic device changes or sets a certain parameter to generate the data to be changed.

[0045] In another feasible implementation, during the startup phase of the electronic device, the electronic device detects the data to be changed generated by a change in a corresponding firmware.

[0046] In the embodiment of the present application, the data to be changed is stored based on the data structure; wherein the data structure is the way in which the electronic device stores and organizes data; at the same time, the data structure refers to a collection of data elements that have one or more specific relationships with each other; generally, the operating efficiency and storage efficiency of the electronic device can be improved based on the data structure; it should be noted that the data structure is often related to efficient retrieval algorithms and indexing technologies.

[0047] It should be noted that the data structure includes: the logical structure of data; among them, the storage form of the logical structure in the storage space corresponding to the electronic device is called the physical structure of the data; usually the logical structure of a data structure can be expressed as a variety of storage structures according to needs, and the commonly used storage structures include sequential storage, chain storage, index storage and hash storage.

[0048] Among them, the data to be changed can be one byte, two or more bytes, and the present application does not impose any limitation on the specific size of the data to be changed; accordingly, the data to be changed can be displayed in any form of binary, octal and hexadecimal, and the present application does not impose any limitation on this.

[0049] Step 102: Determine, in a non-volatile storage medium, a stored data structure that matches the data to be changed.

[0050] In an embodiment of the present application, the electronic device determines in the EEPROM a stored data structure that matches the data to be changed.

[0051] The data to be changed is relative to the stored data structure, that is, in the EEPROM, the stored data structure contains historical data corresponding to the data to be changed; in other words, the electronic device needs to update the historical data based on the data to be changed.

[0052] It should be noted that the data storage format within the stored data structure and the data size it occupies are not limited in this application.

[0053] Accordingly, in the EEPROM, the storage area of ​​the stored data structure, ie, the storage address, the storage method, etc., are not limited in this application.

[0054] Step 103: Determine the address offset of the data to be changed based on the stored data structure.

[0055] In an embodiment of the present application, the electronic device determines the address offset of the data to be changed based on the determined stored data structure; wherein the address offset may refer to the location information of the historical data corresponding to the data to be changed in the stored data structure, or may refer to the address information of the data to be changed in the EEPROM based on the stored data structure; or may further refer to the address information of the data to be changed that needs to be stored in the EEPROM. The specific reference to the address offset is not limited in the present application.

[0056] The address offset may be displayed in any form such as binary, octal, or hexadecimal, and this application does not impose any limitation on this.

[0057] In a feasible implementation, the electronic device directly determines, from the stored data structure, the location information of the historical data corresponding to the data to be changed in the stored data structure, and determines the location information as the address offset.

[0058] In another feasible implementation, the electronic device jointly determines the address offset based on the storage address of the stored data structure in the EEPROM and the position information of the historical data corresponding to the data to be changed in the stored data structure.

[0059] It should be noted that the offset in computer assembly language is defined as: the distance between the actual address of the storage unit and the segment address of the segment it is in is called the intra-segment offset, also known as the "effective address or offset"; the segment address is shifted left by four bits and added to the effective address to form the logical address. Generally speaking, the segment address is independently compiled by the central processing unit (CPU) of the electronic device, but the offset is written by the R&D personnel of the electronic device. In other words, the offset is the difference between the logical address of the program and the beginning of the segment.

[0060] Step 104: based on the address offset, store the data to be changed in a non-volatile storage medium.

[0061] In the embodiment of the present application, the electronic device directly stores the data to be changed in the EEPROM based on the acquired address offset.

[0062] In a feasible implementation, the electronic device determines the address information that can store the data to be changed in the EEPROM based on the storage address of the stored data structure and the amount of data occupied by the data to be changed, and then determines the address offset of the data to be changed based on the storage address, data amount and address information, and stores the data to be changed.

[0063] In another feasible implementation, the electronic device determines address pointer information related to the data to be changed in the stored data structure based on the address offset, and randomly stores the data to be changed in the EEPROM based on the address pointer information.

[0064] It should be noted that, in the EEPROM, the address offset of the data to be changed is determined based on the stored data structure; and according to the address offset, the data to be changed is stored in the EEPROM; in this way, it is possible to change any data in the data structure table by storing only the changed data; thereby avoiding the need to store the entire changed data structure as in the relative technology; at the same time, the electronic device does not need to store too much redundant data in the EEPROM, thereby improving the utilization and storage rate of the storage space corresponding to the stored data.

[0065] The processing method provided in the embodiment of the present application determines the data to be changed stored in the non-volatile storage medium in response to the write instruction sent by the basic input and output system; determines the stored data structure matching the data to be changed in the non-volatile storage medium; determines the address offset of the data to be changed based on the stored data structure; stores the data to be changed in the non-volatile storage medium based on the address offset; in this way, based on the write instruction sent by the basic input and output system, determines the address offset corresponding to the stored data structure in the non-volatile storage medium, and stores the data to be changed based on the address offset, which can improve the utilization rate and storage rate of the storage space in the non-volatile storage medium.

[0066] Based on the above embodiments, the present application also provides a processing method, which is applied to electronic equipment, referring to Figure 2 and Figure 3 As shown, the method comprises the following steps:

[0067] Step 201: Determine the starting address of a stored data structure in a non-volatile storage medium.

[0068] In an embodiment of the present application, the electronic device determines the starting address of the stored data structure from the EEPROM.

[0069] The starting address is the storage address of the stored data in the EEPROM. The storage address can be expressed in binary, octal, hexadecimal, etc., and this application does not impose any limitation on this.

[0070] It should be noted that the storage address includes the starting position information and the ending position information of the stored data structure stored in the EEPROM; wherein the storage interval corresponding to the address between the starting position information and the ending position information is used to store the stored data structure.

[0071] Step 202: Determine the intermediate offset of the data to be changed in the stored data structure.

[0072] In an embodiment of the present application, the electronic device determines the intermediate offset corresponding to the data to be changed based on the stored data structure.

[0073] It should be noted that the address information of a data structure stored in the EEPROM is: 0F00H to 0F0FH, and the data representing the data structure has a total of 16 bytes; among them, 0F00H is the starting address, the address offset 05H bytes forward from the starting address is 0F05H, 0F05H is the offset address, and 05H is the offset.

[0074] Step 203: Determine the address offset in the non-volatile storage medium based on the start address and the intermediate offset.

[0075] In the embodiment of the present application, the electronic device adds or subtracts the start address and the intermediate offset to determine the address offset of the historical data corresponding to the data to be changed in the EEPROM.

[0076] Accordingly, when the electronic device executes step 104, that is, the electronic device stores the data to be changed in the non-volatile storage medium based on the address offset, it can also be implemented by the following steps 204 to 205:

[0077] Step 204: Determine the interval to be stored in the non-volatile storage medium.

[0078] In an embodiment of the present application, the electronic device determines a readable and writable area in the EEPROM, and determines the readable and writable area as the interval to be stored; the address of the interval to be stored may be adjacent to or not adjacent to the address of the stored data structure, and the present application does not impose any limitation on this.

[0079] The specific size of the storage interval and the specific location in the EEPROM are not limited in this application.

[0080] Step 205: based on the address offset, store the data to be changed into the interval to be stored.

[0081] In the embodiment of the present application, the electronic device can store the data to be changed in the storage interval of the EEPROM based on the address offset corresponding to the data to be changed in the EEPROM.

[0082] It should be noted that, in the embodiment of the present application, the address offset may refer to the specific location information of the historical data in the EEPROM, wherein the historical data is the historical data corresponding to the data to be changed in the stored data structure.

[0083] It should be noted that, in the embodiment of the present application, the data to be changed is stored in the EEPROM by determining the address offset; in this way, it is possible to change any data in the data structure table by only storing the changed data; thereby, the electronic device does not need to store redundant data in the EEPROM, so as to improve the utilization and storage rate of the storage space corresponding to the stored data; illustratively, among the relevant data, if any data changes, it is necessary to store 2480 bytes of content when re-storing the data structure corresponding to the data, while in the embodiment of the present application, if any data changes, it is only necessary to store the changed data, such as only 6 to 10 bytes of content.

[0084] In a feasible implementation, when the electronic device executes step 205, that is, when the electronic device stores the to-be-changed data in the to-be-stored interval based on the address offset, it can also be implemented by the following steps 205a to 205b:

[0085] Step 205a: Determine the amount of data to be changed.

[0086] In the embodiment of the present application, the amount of data occupied by the data to be changed is determined; wherein the amount of data may be one byte, two bytes or more, and the present application does not impose any limitation on this.

[0087] Step 205b: based on the address offset and the data amount, store the data to be changed into the interval to be stored.

[0088] In an embodiment of the present application, the electronic device stores the data to be changed in a storage interval based on the address offset and the data volume. In other words, the storage area occupied by the data volume is determined in the storage interval and stored, and the relevant address index information of the current data to be changed is updated based on the address offset.

[0089] It should be noted that in the embodiment of the present application, by determining the specific amount of data to be changed and determining the storage interval that can be stored in the EEPROM, and storing the data to be changed based on the address offset, the data to be changed can be stored in the EEPROM more quickly and accurately, thereby further improving the accuracy of data storage while increasing the utilization rate of the storage space occupied by the data to be changed.

[0090] The processing method provided in the embodiment of the present application is based on the write instruction sent by the basic input and output system, and determines the address offset corresponding to the stored data structure in the non-volatile storage medium, the data amount of the data to be changed, and the space to be stored in the non-volatile storage medium. The data to be changed is stored, which can avoid the need to store the entire data structure corresponding to the data to be changed, and ensure that the data to be changed is stored accurately; at the same time, it can improve the utilization rate and storage rate of the storage space in the non-volatile storage medium; and further reduce the corresponding read and write time and erase times of the non-volatile storage medium, that is, it can reduce the probability of BIOS crashing or stopping working.

[0091] Based on the above embodiments, the present application also provides a processing method, which is applied to electronic equipment, referring to Figures 2 to 4 As shown, the method comprises the following steps:

[0092] In the embodiment of the present application, after the electronic device executes step 205b, that is, after the electronic device stores the to-be-changed data into the to-be-stored interval based on the address offset and the data amount, the electronic device may further execute the following steps 301 to 302:

[0093] Step 301: Determine the storage address of the to-be-changed data in the to-be-stored interval.

[0094] In the embodiment of the present application, after the electronic device stores the data to be changed in the interval to be stored, it is necessary to obtain and determine the current storage address of the data to be changed so that the electronic device can perform the next operation.

[0095] The specific representation of the storage address may be in any form such as hexadecimal, binary, or octal, and this application does not impose any limitation on this.

[0096] Step 302: Based on the storage address and the address offset, update the address field information related to the data to be changed in the stored data structure.

[0097] In an embodiment of the present application, the electronic device updates address field information related to the data to be changed in the stored data structure based on the storage address and the address offset.

[0098] In a feasible implementation, when the electronic device executes step 302, that is, when the electronic device updates the address field information related to the data to be changed in the stored data structure based on the storage address and the address offset, it can also be implemented by the following steps 302a to 302b:

[0099] Step 302a: Determine the address field information of the data to be changed in the stored data structure from the address offset.

[0100] In an embodiment of the present application, the electronic device determines the address domain information corresponding to the data to be changed in the stored data structure based on the address offset; wherein the address domain information includes but is not limited to: the storage address of the historical data corresponding to the data to be changed, the data volume of the historical data, and the name of the historical data, etc., and the present application does not impose any limitation on the specific reference in the address domain information.

[0101] Step 302b: Update the address domain information based on the storage address.

[0102] In an embodiment of the present application, the electronic device updates the address field information in the stored data structure based on the storage address of the data to be changed.

[0103] In a feasible implementation, the electronic device overwrites the historical address in the address domain information based on the stored address.

[0104] In another feasible implementation, the electronic device marks the historical address in the address field information as invalid based on the storage address, and stores the storage address to mark it as currently valid.

[0105] In a feasible implementation, when the electronic device executes step 302b, it may further execute the following steps A1 to A2:

[0106] Step A1: Mark the historical address in the address domain information as invalid.

[0107] In the embodiment of the present application, the electronic device needs to mark the historical address in the address field information as invalid, that is, the historical data stored at the historical address is invalid data.

[0108] Step A2: Mark the storage address in the address field information as valid.

[0109] In the embodiment of the present application, the electronic device needs to first update the storage address to the address domain information, and mark the storage address in the address domain information as valid, that is, the data currently at the storage address, that is, the data to be changed, is the current valid data.

[0110] It should be noted that in the embodiment of the present application, the address offset is used to update the address information in the address field information corresponding to the data to be changed, so that the address of the data stored in the EEPROM is more accurate; at the same time, by determining that the current storage address is a valid address, the accuracy of the electronic device in reading related data later can be improved.

[0111] Based on this, in an embodiment of the present application, based on the write instruction sent by the basic input and output system, the relationship between the specific data and the display item is clearly indicated by determining the address offset, and stored in the EEPROM, that is, the electronic device stores the relevant data to be changed in the corresponding storage area through the BIOS; in this way, it is possible to avoid simply copying the data structure where the updated data is located as in the relative technology, but instead use the offset and address field information, that is, the valid bit, to achieve the use of a linked list on a storage medium based on SPI communication to indicate the last valid value, that is, the storage address of the data to be changed; in this way, when the electronic device stores the relevant data based on the BIOS, there is no need to store additional redundant data, thereby improving the utilization rate and storage rate of the corresponding storage space.

[0112] The processing method provided in the embodiment of the present application is based on the write instruction sent by the basic input and output system, and stores the data to be changed on the premise of determining the address offset corresponding to the stored data structure in the non-volatile storage medium, the data amount of the data to be changed, and the space to be stored in the non-volatile storage medium. This can avoid the need to store the entire data structure corresponding to the data to be changed, ensure the accurate storage of the data to be changed, and improve the utilization rate and storage rate of the storage space in the non-volatile storage medium; thereby reducing the corresponding reading and writing time and erasing times of the non-volatile storage medium, that is, reducing the probability of BIOS crashing or stopping working.

[0113] Based on the above embodiments, Figure 5a As shown, it is a schematic diagram of a data structure provided in an embodiment of the present application; wherein, 501 is a specific manifestation of the data structure, and the data structure specifically includes: a globally unique identifier (Globally Unique Identifier, GUID), a variable name (variable name) and corresponding DATA0, DATA1, DATA2 and DATA3; wherein, GUID is a digital identifier with a binary length of 128 bits generated by an algorithm; GUID is mainly used in a network or system with multiple nodes and multiple electronic devices; ideally, any electronic device and electronic device cluster will not generate two identical GUIDs; accordingly, 502 is a more specific detailed description of the data structure; that is, each data DATA0, DATA1, DATA2 and DATA3 has its corresponding Sig0, Sig1, Sig2 and Sig3; wherein, each Sig0, Sig1, Sig2 and Sig3 has the following information: Index (index information), Address (storage address information), Invalid (invalid information) and Reserved (reserved).

[0114] Accordingly, if Figure 5bAs shown, it is a schematic diagram of a data structure provided by an embodiment of the present application for storing in an EEPROM; wherein, 505 is a schematic diagram of how to store if any data in the data structure changes based on the processing method provided by the embodiment of the present application; that is, when DATA1 changes and needs to be re-stored, it is only necessary to re-store the updated DATA1; when DATA2 changes and needs to be re-stored, it is only necessary to re-store the updated DATA2; at the same time, when DATA1 changes again and needs to be re-stored, it is only necessary to re-store the updated DATA1 again; accordingly, 504 is a schematic diagram of how to store if any data in the data structure changes in the relative technology; that is, when DATA1 changes and needs to be re-stored, it is necessary to re-store the updated DATA1 and the data structure where DATA1 is located; correspondingly, 506 shows the expression form of the change of any data in a data structure, wherein "00 06 FF 00 0006" and "FF FF FF 00 00 00" are the changed data.

[0115] like Figure 6 As shown, it is a flow chart of writing data in EEPROM provided by an embodiment of the present application; firstly, execute step 601 to read the data to be written, that is, the data to be changed in the embodiment of the present application; execute step 602 to determine the "name" of the data in the EEPROM or based on the custom data; that is, corresponding to the stored data structure in the embodiment of the present application, and execute step 603 to obtain the current invalid data corresponding to the data; that is, the historical data involved in the embodiment of the present application, and based on the address offset of the historical data in the stored data structure, and the address information of the stored data structure in the EEPROM, calculate the address information of the next data to be changed that needs to be stored, that is, step 604, and determine the writable address; then write the data in 601 based on the address determined in step 604, that is, execute step 605, and write the data at the address; after the writing is completed, execute step 606 to check whether the writing status is successful, if the writing is unsuccessful, return the error information, that is, 608; if the writing is successful, execute step 607 to update the pointer information corresponding to the historical data, and point the pointer to the address of the current written data.

[0116] Correspondingly, such as Figure 7 As shown, a schematic diagram of a process of reading data in an EEPROM provided in an embodiment of the present application; Figure 7As shown, first execute step 701 to read the data; and execute step 702 to search for the "name" of the data, that is, search for the data to be read in the EEPROM or based on the custom data, and determine the "name" of the data, that is, the stored data structure corresponding to the embodiment of the present application; and determine the index information of the data from the data structure, that is, "Index", that is, step 703; determine the current storage address of the data based on the Index, that is, execute step 704 to search for the "Block" of the data; if there is no "Block", directly output the inspection result and return the error information, that is, step 708; if there is a "Block", check whether the address information stored in the "Block" is valid, that is, execute step 705, if valid, directly read the data from the "Block" and return, if the "Block" is invalid, obtain the new address from the "Sig Block", and accordingly perform a check to see if the execution steps are completed, that is, execute step 707, and the inspection ends; if not, search for the "Block" of the data again, that is, return to execute step 704, and if so, return the error, that is, execute step 708.

[0117] Based on the above embodiments, the present application also provides a processing device 8, which can be applied to Figures 2 to 4 In a processing method provided in a corresponding embodiment, referring to Figure 8 As shown, the processing device 8 may include: a determination module 81 and a storage module 82, wherein:

[0118] A determination module 81, configured to determine the data to be changed stored in the non-volatile storage medium in response to a write instruction sent by the basic input and output system;

[0119] The determination module 81 is further used to determine a stored data structure matching the data to be changed in the non-volatile storage medium;

[0120] The determination module 81 is further used to determine the address offset of the data to be changed based on the stored data structure;

[0121] The storage module 82 is used to store the data to be changed in a non-volatile storage medium based on the address offset.

[0122] In other embodiments of the present application, the determination module 81 is also used to determine the starting address of the stored data structure in the non-volatile storage medium; determine the intermediate offset of the data to be changed in the stored data structure; and determine the address offset in the non-volatile storage medium based on the starting address and the intermediate offset.

[0123] In other embodiments of the present application, the storage module 82 is further used to determine the interval to be stored in the non-volatile storage medium; based on the address offset, the data to be changed is stored in the interval to be stored.

[0124] In other embodiments of the present application, the storage module 82 is further used to determine the amount of data to be changed; based on the address offset and the data amount, the data to be changed is stored in the interval to be stored.

[0125] In other embodiments of the present application, the processing device 8 also includes an update module 83, which is used to determine the storage address of the data to be changed in the interval to be stored; based on the storage address and the address offset, the address domain information related to the data to be changed in the stored data structure is updated.

[0126] In other embodiments of the present application, the update module 83 is further used to determine the address domain information of the data to be changed in the stored data structure from the address offset; and update the address domain information based on the storage address.

[0127] In other embodiments of the present application, the update module 83 is further used to mark the historical address in the address domain information as invalid; and mark the storage address in the address domain information as valid.

[0128] It should be noted that the specific implementation process of the steps executed by each module in this embodiment can be referred to Figures 2 to 4 The implementation process of the processing method provided in the corresponding embodiment will not be repeated here.

[0129] The processing device provided in the embodiment of the present application stores the data to be changed based on the write instruction sent by the basic input and output system, and on the premise of determining the address offset corresponding to the stored data structure in the non-volatile storage medium, the data amount of the data to be changed, and the space to be stored in the non-volatile storage medium. This can avoid the need to store the entire data structure corresponding to the data to be changed, ensure the accurate storage of the data to be changed, and improve the utilization rate and storage rate of the storage space in the non-volatile storage medium. This can reduce the corresponding read and write time and erase times of the non-volatile storage medium, that is, it can reduce the probability of BIOS crashing or stopping working.

[0130] Based on the above embodiments, the embodiments of the present application further provide an electronic device 9, which can be applied to Figures 2 to 4 In a processing method provided in a corresponding embodiment, referring to Fig. 9 As shown, the electronic device 9 may include: a processor 91, a memory 92 and a communication bus 93, wherein:

[0131] The communication bus 93 is used to realize the communication connection between the processor 91 and the memory 92 .

[0132] The processor 91 is used to execute the program of the processing method stored in the memory 92 to achieve the reference Figures 2 to 4 The corresponding embodiment provides a processing method.

[0133] It should be noted that the specific implementation process of the steps executed by the processor in this embodiment can refer to Figures 2 to 4 The implementation process of the processing method provided in the corresponding embodiment will not be repeated here.

[0134] The electronic device provided in the embodiment of the present application stores the data to be changed based on the write instruction sent by the basic input and output system, and on the premise of determining the address offset corresponding to the stored data structure in the non-volatile storage medium, the data amount of the data to be changed, and the space to be stored in the non-volatile storage medium. This can avoid the need to store the entire data structure corresponding to the data to be changed, ensure the accurate storage of the data to be changed, and improve the utilization rate and storage rate of the storage space in the non-volatile storage medium; thereby reducing the corresponding read and write time and erase times of the non-volatile storage medium, that is, reducing the probability of BIOS crashing or stopping working.

[0135] Based on the foregoing embodiments, the embodiments of the present application provide a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following. Figures 2 to 4 The corresponding embodiments provide steps of the processing method.

[0136] It should be noted that the above-mentioned computer-readable storage medium can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various electronic devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0137] It should be noted that, in this article, the terms "include", "comprises" or any other variations 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 sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0138] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0140] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0141] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0143] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A processing method, the method comprising: In response to a write instruction sent by a basic input / output system, determining data to be changed stored in a non-volatile storage medium; wherein the data to be changed includes data generated by the device during startup; In the non-volatile storage medium, determining a stored data structure that matches the data to be changed; Based on the stored data structure, determining the address offset of the data to be changed; Based on the address offset, the data to be changed is stored in the non-volatile storage medium to update the historical data corresponding to the data to be changed; wherein the historical data corresponding to the data to be changed is located in the stored data structure.

2. The method according to claim 1, wherein determining the address offset of the data to be changed based on the stored data structure comprises: In the non-volatile storage medium, determining a starting address of the stored data structure; Determine the intermediate offset of the data to be changed in the stored data structure; Based on the start address and the intermediate offset, the address offset is determined in the non-volatile storage medium.

3. The method according to claim 1, storing the to-be-changed data in the non-volatile storage medium based on the address offset, comprises: Determining a to-be-stored interval in the non-volatile storage medium; Based on the address offset, the to-be-changed data is stored in the to-be-stored interval.

4. The method according to claim 3, storing the to-be-changed data in the to-be-stored interval based on the address offset, comprises: Determining the amount of data to be changed; Based on the address offset and the data amount, the to-be-changed data is stored in the to-be-stored interval.

5. The method according to claim 4, after storing the to-be-changed data in the to-be-stored interval based on the address offset and the data amount, the method further comprises: Determine the storage address of the to-be-changed data in the to-be-stored interval; Based on the storage address and the address offset, address field information related to the data to be changed in the stored data structure is updated.

6. The method according to claim 5, wherein the updating of address field information related to the to-be-changed data in the stored data structure based on the storage address and the address offset comprises: Determining address domain information of the data to be changed in the stored data structure from the address offset; Based on the stored address, the address domain information is updated.

7. The method according to claim 6, further comprising: Marking the historical addresses in the address domain information as invalid; The storage address in the address field information is marked as valid.

8. A processing device, comprising: Determine the module and the storage module; wherein: The determination module is used to determine the data to be changed stored in the non-volatile storage medium in response to the write instruction sent by the basic input and output system; wherein the data to be changed includes data generated by the device during the startup process; The determination module is further used to determine, in the non-volatile storage medium, a stored data structure that matches the data to be changed; The determining module is further used to determine the address offset of the data to be changed based on the stored data structure; The storage module is used to store the data to be changed in the non-volatile storage medium based on the address offset to update the historical data corresponding to the data to be changed; wherein the historical data corresponding to the data to be changed is located in the stored data structure.

9. An electronic device, comprising: A processor, a memory, and a communication bus; wherein: The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute the program in the memory to implement the processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing one or more programs, wherein the one or more programs can be executed by one or more processors to implement the steps of the processing method according to any one of claims 1 to 7.