CN113010121B - Data modification method, device, equipment and storage medium - Google Patents

Data modification method, device, equipment and storage medium Download PDF

Info

Publication number
CN113010121B
CN113010121B CN202110568488.8A CN202110568488A CN113010121B CN 113010121 B CN113010121 B CN 113010121B CN 202110568488 A CN202110568488 A CN 202110568488A CN 113010121 B CN113010121 B CN 113010121B
Authority
CN
China
Prior art keywords
data
modified
efuse
target
storage
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202110568488.8A
Other languages
Chinese (zh)
Other versions
CN113010121A (en
Inventor
孟学宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gaotuoxunda (Beijing) Microelectronics Co.,Ltd.
Original Assignee
Alto Beam (china) Inc
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 Alto Beam (china) Inc filed Critical Alto Beam (china) Inc
Priority to CN202110568488.8A priority Critical patent/CN113010121B/en
Publication of CN113010121A publication Critical patent/CN113010121A/en
Application granted granted Critical
Publication of CN113010121B publication Critical patent/CN113010121B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0604Improving or facilitating administration, e.g. storage management
    • 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

Abstract

The application provides a data modification method, a data modification device, data modification equipment and a storage medium, wherein the method comprises the following steps: determining the storage position of each data to be modified in the EFUSE according to at least one address of the data to be modified input by a user; determining the modified times of the EFUSE according to the read stored data in the EFUSE; if the modified times are 0, changing the numerical value of the effective bit of each data to be modified from 0 to 1; sequentially modifying the data to be modified according to the sequence of the storage positions from front to back, and storing the modified first target data and the effective bit with the value of 0 set for the first target data in the first target address according to the sequence of the data to be modified from the first to the last; by the method, the utilization rate of the EFUSE can be increased, the applicability of the EFUSE is improved, and waste of hardware resources caused by error writing of EFUSE data can be prevented.

Description

Data modification method, device, equipment and storage medium
Technical Field
The present application relates to the field of semiconductor chip technologies, and in particular, to a data modification method, apparatus, device, and storage medium.
Background
The EFUSE is a one-time programmable memory in the chip, before the chip leaves a factory, a user can write information in the EFUSE, but the writing operation of the EFUSE can only be written from 0 to 1, but cannot be written from 1 to 0, and the characteristic enables the user not to modify the stored data in the EFUSE.
Therefore, when a user writes data into the EFUSE of the chip, the user can only replace the new chip to perform the write operation again when the error write occurs, and the method causes the waste of hardware resources.
Disclosure of Invention
In view of this, embodiments of the present application provide a data modification method, apparatus, device and storage medium, which can not only increase the utilization rate of the EFUSE and improve the applicability of the EFUSE, but also prevent the waste of hardware resources caused by the erroneous writing of EFUSE data.
Mainly comprises the following aspects:
in a first aspect, an embodiment of the present application provides a data modification method, where the method includes:
determining the storage position of each data to be modified in the EFUSE according to at least one address of the data to be modified input by a user;
determining the modified times of the EFUSE according to the read stored data in the EFUSE;
if the number of times of modification of the EFUSE is 0, changing the numerical value of the effective bit of each data to be modified from 0 to 1;
sequentially modifying each piece of data to be modified according to the sequence from front to back of the storage position, and storing each piece of first target data obtained after modification and the valid bit with the value of 0 set for each piece of the first target data in a first target address according to the modification sequence from front to back of the data to be modified, wherein the first target address is located behind an end flag bit of a first target storage block, the first target storage block is the last storage block in at least one storage block included in the EFUSE, and for each piece of first target data, the valid bit of the first target data is adjacent to and located before the first target data;
and adding a first end flag bit with a value of 0 after the last first target data stored by the EFUSE so as to enable each first target data, the valid bit corresponding to each first target data and the first end flag bit to be positioned on the same storage block.
Optionally, if the number of times the EFUSE has been modified is 1, the method further includes:
step S1: sequentially judging whether the current data to be modified is located in a second target storage block according to the sequence of the storage positions from front to back, wherein the second target storage block is the last storage block in at least one storage block included in the EFUSE;
step S2: if the current data to be modified is located in the second target storage block, changing the value of the valid bit of the current data to be modified from 0 to 1, and storing second target data and a valid bit with the value of 0 set for the second target data after the first data, wherein the first data is the last data stored in the EFUSE, the second target data is data obtained after the current data to be modified is modified, and the valid bit of the second target data is adjacent to the second target data and is located before the second target data;
step S3: judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the steps S1 to S3 until the data to be modified does not exist after the current data to be modified;
step S4: and when the data to be modified does not exist after the current data to be modified, adding a second ending mark bit with the value of 0 after the last second target data stored by the EFUSE so as to enable each second target data, the effective bit corresponding to each second target data and the second ending mark bit to be positioned on the same storage block.
Optionally, if the current data to be modified is not located in the second target storage block, the method further includes:
step S5: judging whether the last second data stored in the EFUSE is an ending flag bit;
step S6: if the second data is not the end marker bit, sequentially storing the end marker bit with the value of 1, the serial number of the current data to be modified, third target data and the end marker bit with the value of 0 in the EFUSE after the second data, wherein the third target data is data obtained after the current data to be modified is modified;
step S7: if the second data is an end zone bit, changing the value of the end zone bit from 0 to 1, and sequentially storing the serial number of the current data to be modified, the third target data and the end zone bit with the value of 0 in the EFUSE after the end zone bit;
step S8: and judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the step S7 and the step S8 until the data to be modified does not exist after the current data to be modified, wherein when the data to be modified does not exist after the current data to be modified, each first designated data is located on the same storage block, each first designated data comprises each second target data and a valid bit corresponding to each second target data, and/or each third target data, a serial number of each data to be modified and an end flag bit located behind each third target data.
Optionally, if the number of times the EFUSE has been modified is greater than or equal to 2, the method further includes:
judging whether an ending flag bit with a value of 1 exists in the EFUSE;
if there is an end flag with a value of 1, go to step S7 and step S8.
Optionally, if there is no ending flag bit with a value of 1 in the EFUSE, the method further includes:
step S9: sequentially judging whether the current data to be modified is located in a third target storage block according to the sequence of the storage positions from front to back, wherein the third target storage block is the last storage block in at least one storage block included in the EFUSE;
step S10: if the data to be modified is located in the third target storage block, changing the value of the valid bit of the current data to be modified from 0 to 1, and storing fourth target data and a valid bit with the value of 0 set for the fourth target data after the third data, wherein the third data is the last data stored in the EFUSE, the fourth target data is obtained after the current data to be modified is modified, and the valid bit of the fourth target data is adjacent to and located before the fourth target data;
step S11: judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the steps S9 to S10 until the data to be modified does not exist after the current data to be modified;
step S12: when data to be modified does not exist after the current data to be modified, adding a third ending flag bit with a value of 0 behind the last fourth target data stored in the EFUSE so as to enable each fourth target data, the effective bit corresponding to each fourth target data and the third ending flag bit to be located on the same storage block;
step S13: if the current data to be modified is not located in the third target storage block, judging whether the last fourth data stored in the EFUSE is an end flag bit;
step S14: if the fourth data is not an end marker bit, sequentially storing an end marker bit with a value of 1, the number of the current data to be modified, fifth target data and an end marker bit with a value of 0 in the EFUSE after the fourth data, wherein the fifth target data is data obtained by modifying the current data to be modified;
step S15: if the fourth data is an end flag bit, changing the value of the end flag bit from 0 to 1, and sequentially storing the number of the current data to be modified, the fifth target data and the end flag bit with the value of 0 in the EFUSE after the end flag bit;
step S16: and judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the step S15 and the step S16 until the data to be modified does not exist after the current data to be modified, wherein when the data to be modified does not exist after the current data to be modified, each second specified data is located on the same storage block, each second specified data comprises each fourth target data and a valid bit corresponding to each fourth target data, and/or each fifth target data, a serial number of each data to be modified and an end flag bit located after each fifth target data.
Optionally, before determining the number of times the EFUSE has been modified, the method further includes:
sequentially reading the data stored in each storage block according to the arrangement sequence of the storage blocks in the EFUSE from front to back:
when the read storage block is the first storage block of the EFUSE, sequentially reading first storage data corresponding to each valid bit stored in the first storage block according to a storage sequence from front to back; judging whether a valid bit with a value of 1 exists in the valid bits of the first storage data; if the valid bit with the value of 1 exists in the valid bits of the first storage data, reading the stored data in the second storage block of the EFUSE;
when the read storage block is the second storage block of the EFUSE, sequentially reading second storage data corresponding to each valid bit stored in the second storage block according to a storage sequence from front to back; sequentially replacing the first storage data corresponding to the read valid bit with the value of 1 by using the second storage data according to the reading sequence from first to last; judging whether a valid bit with a value of 1 exists in the valid bits of the second storage data; if the valid bit with the value of 1 exists in the valid bits of the second storage data, reading the stored data in the third storage block of the EFUSE;
when the arrangement order of the read storage blocks in the EFUSE is greater than or equal to 3, sequentially reading third storage data corresponding to each valid bit stored in the storage blocks according to the storage order from front to back; sequentially replacing the storage data corresponding to the valid bit with the value of 1 read out at the previous time by using the third storage data according to the reading sequence from the first to the last; judging whether a target ending zone bit with the numerical value of 1 exists in the storage block, and if the target ending zone bit exists, reading a data number behind each target ending zone bit and fourth storage data corresponding to the data number; and for the fourth storage data corresponding to each data number, replacing the read-out storage data corresponding to the data number with the fourth storage data.
In a second aspect, an embodiment of the present application provides a data modification apparatus, where the apparatus includes:
the first determining module is used for determining the storage position of each data to be modified in the EFUSE according to the address of at least one data to be modified input by a user;
the second determining module is used for determining the modified times of the EFUSE according to the read stored data in the EFUSE;
the first modification module is used for changing the numerical value of the effective bit of each data to be modified from 0 to 1 if the number of times of modification of the EFUSE is 0;
a second modification module, configured to modify, according to a sequence from front to back of the storage location, each piece of to-be-modified data in sequence, and store, in a first target address, each piece of first target data obtained after modification and an effective bit having a value of 0 set for each piece of the first target data according to a modification sequence from first to back of the to-be-modified data, where the first target address is located after an end flag bit of a first target storage block, the first target storage block is a last storage block in at least one storage block included in the EFUSE, and for each piece of first target data, the effective bit of the first target data is adjacent to and located before the first target data;
a first adding module, configured to add a first end flag bit having a value of 0 after the last first target data stored in the EFUSE, so that each first target data, a valid bit corresponding to each first target data, and the first end flag bit are located on the same storage block.
Optionally, if the number of times the EFUSE has been modified is 1, the data modification apparatus further includes:
a first determining module, configured to perform step S1: sequentially judging whether the current data to be modified is located in a second target storage block according to the sequence of the storage positions from front to back, wherein the second target storage block is the last storage block in at least one storage block included in the EFUSE;
a third modification module, configured to execute step S2: if the current data to be modified is located in the second target storage block, changing the value of the valid bit of the current data to be modified from 0 to 1, and storing second target data and a valid bit with the value of 0 set for the second target data after the first data, wherein the first data is the last data stored in the EFUSE, the second target data is data obtained after the current data to be modified is modified, and the valid bit of the second target data is adjacent to the second target data and is located before the second target data;
a first executing module, configured to execute step S3: judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the steps S1 to S3 until the data to be modified does not exist after the current data to be modified;
a second adding module, configured to execute step S4: and when the data to be modified does not exist after the current data to be modified, adding a second ending mark bit with the value of 0 after the last second target data stored by the EFUSE so as to enable each second target data, the effective bit corresponding to each second target data and the second ending mark bit to be positioned on the same storage block.
Optionally, if the current data to be modified is not located in the second target storage block, the data modifying apparatus further includes:
a second determining module, configured to execute step S5: judging whether the last second data stored in the EFUSE is an ending flag bit;
a fourth modification module, configured to execute step S6: if the second data is not the end marker bit, sequentially storing the end marker bit with the value of 1, the serial number of the current data to be modified, third target data and the end marker bit with the value of 0 in the EFUSE after the second data, wherein the third target data is data obtained after the current data to be modified is modified;
a fifth modification module, configured to execute step S7: if the second data is an end zone bit, changing the value of the end zone bit from 0 to 1, and sequentially storing the serial number of the current data to be modified, the third target data and the end zone bit with the value of 0 in the EFUSE after the end zone bit;
a second executing module, configured to execute step S8: and judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the step S7 and the step S8 until the data to be modified does not exist after the current data to be modified, wherein when the data to be modified does not exist after the current data to be modified, each first designated data is located on the same storage block, each first designated data comprises each second target data and a valid bit corresponding to each second target data, and/or each third target data, a serial number of each data to be modified and an end flag bit located behind each third target data.
Optionally, if the number of times of modification of the EFUSE is greater than or equal to 2, the data modification apparatus further includes:
a third judging module, configured to judge whether an ending flag bit with a value of 1 exists in the EFUSE;
and a third executing module, configured to execute step S7 and step S8 if there is an end flag with a value of 1.
Optionally, if there is no ending flag bit with a value of 1 in the EFUSE, the data processing apparatus further includes:
a fourth determining module, configured to perform step S9: sequentially judging whether the current data to be modified is located in a third target storage block according to the sequence of the storage positions from front to back, wherein the third target storage block is the last storage block in at least one storage block included in the EFUSE;
a sixth modification module, configured to execute step S10: if the data to be modified is located in the third target storage block, changing the value of the valid bit of the current data to be modified from 0 to 1, and storing fourth target data and a valid bit with the value of 0 set for the fourth target data after the third data, wherein the third data is the last data stored in the EFUSE, the fourth target data is obtained after the current data to be modified is modified, and the valid bit of the fourth target data is adjacent to and located before the fourth target data;
a fourth executing module, configured to execute step S11: judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the steps S9 to S10 until the data to be modified does not exist after the current data to be modified;
a third adding module, configured to execute step S12: when data to be modified does not exist after the current data to be modified, adding a third ending flag bit with a value of 0 behind the last fourth target data stored in the EFUSE so as to enable each fourth target data, the effective bit corresponding to each fourth target data and the third ending flag bit to be located on the same storage block;
a fifth judging module, configured to execute step S13: if the current data to be modified is not located in the third target storage block, judging whether the last fourth data stored in the EFUSE is an end flag bit;
a sixth modification module, configured to execute step S14: if the fourth data is not an end marker bit, sequentially storing an end marker bit with a value of 1, the number of the current data to be modified, fifth target data and an end marker bit with a value of 0 in the EFUSE after the fourth data, wherein the fifth target data is data obtained by modifying the current data to be modified;
a seventh modification module, configured to execute step S15: if the fourth data is an end flag bit, changing the value of the end flag bit from 0 to 1, and sequentially storing the number of the current data to be modified, the fifth target data and the end flag bit with the value of 0 in the EFUSE after the end flag bit;
a fifth executing module, configured to execute step S16: and judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the step S15 and the step S16 until the data to be modified does not exist after the current data to be modified, wherein when the data to be modified does not exist after the current data to be modified, each second specified data is located on the same storage block, each second specified data comprises each fourth target data and a valid bit corresponding to each fourth target data, and/or each fifth target data, a serial number of each data to be modified and an end flag bit located after each fifth target data.
Optionally, before the second determining module is configured to determine the number of times the EFUSE has been modified, the second determining module is further configured to:
sequentially reading the data stored in each storage block according to the arrangement sequence of the storage blocks in the EFUSE from front to back:
when the read storage block is the first storage block of the EFUSE, sequentially reading first storage data corresponding to each valid bit stored in the first storage block according to a storage sequence from front to back; judging whether a valid bit with a value of 1 exists in the valid bits of the first storage data; if the valid bit with the value of 1 exists in the valid bits of the first storage data, reading the stored data in the second storage block of the EFUSE;
when the read storage block is the second storage block of the EFUSE, sequentially reading second storage data corresponding to each valid bit stored in the second storage block according to a storage sequence from front to back; sequentially replacing the first storage data corresponding to the read valid bit with the value of 1 by using the second storage data according to the reading sequence from first to last; judging whether a valid bit with a value of 1 exists in the valid bits of the second storage data; if the valid bit with the value of 1 exists in the valid bits of the second storage data, reading the stored data in the third storage block of the EFUSE;
when the arrangement order of the read storage blocks in the EFUSE is greater than or equal to 3, sequentially reading third storage data corresponding to each valid bit stored in the storage blocks according to the storage order from front to back; sequentially replacing the storage data corresponding to the valid bit with the value of 1 read out at the previous time by using the third storage data according to the reading sequence from the first to the last; judging whether a target ending zone bit with the numerical value of 1 exists in the storage block, and if the target ending zone bit exists, reading a data number behind each target ending zone bit and fourth storage data corresponding to the data number; and for the fourth storage data corresponding to each data number, replacing the read-out storage data corresponding to the data number with the fourth storage data.
In a third aspect, an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the data modification method described in any one of the above first aspects when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the data modification method in any one of the first aspect.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
the data processing method provided by the embodiment of the application can find the storage position of each data to be modified according to at least one address of the data to be modified input by a user, sequentially process each data to be modified according to the sequence of the storage positions from first to last after finding the storage position of each data to be modified, firstly change the value of the effective bit corresponding to the data to be modified from 0 to 1 for the data to be modified to be invalid, then store the first target data obtained after modifying the data to be modified in the vacant bit after the last data to be stored in the EFUSE, and set the effective bit with the value of 0 for the first target data to achieve the purpose of replacing the data to be modified in the reading process, and provides a method for invalidating the original data to be modified and writing the effective first target data in the vacant bit of the EFUSE to replace the original data to be modified, the method achieves the purpose of modifying the error-written data in the EFUSE, not only can increase the utilization rate of the EFUSE and improve the applicability of the EFUSE, but also can prevent the waste of hardware resources caused by error-writing of the EFUSE data.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a flow chart illustrating a data modification method provided in an embodiment of the present application;
FIG. 2 illustrates an exemplary diagram of a first modification of EFUSE provided by embodiment one of the present application;
FIG. 3 is a flow chart of another data modification method provided in the first embodiment of the present application;
fig. 4 is a schematic structural diagram illustrating a data modification apparatus according to a second embodiment of the present application;
fig. 5 shows a schematic structural diagram of a computer device provided in the third embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a data modification method, a data modification device, data modification equipment and a storage medium, and is described by the embodiment below.
Example one
Fig. 1 shows a flowchart of a data modification method provided in a first embodiment of the present application, and as shown in fig. 1, the method includes the following steps:
step S101: and determining the storage position of each data to be modified in the EFUSE according to at least one address of the data to be modified input by a user.
Specifically, a user determines at least one data (data to be modified) to be modified from stored data of the EFUSE, then an address of a position of each data to be modified in the EFUSE is input into the server, the server obtains the address of each data to be modified input by the user, determines a storage position of each data to be modified in the EFUSE according to the address of each data to be modified, and takes a position in the EFUSE represented by the address of the data to be modified as the storage position of the data to be modified for each data to be modified, wherein an Electrically Programmable Fuse (EFUSE) memory is a one-time Programmable memory.
Step S102: and determining the modified times of the EFUSE according to the read stored data in the EFUSE.
Specifically, the stored data in the EFUSE read by the server may include at least one valid bit, data corresponding to each valid bit, and at least one end flag bit with a value of 0, and/or at least one end flag bit with a value of 1, a data number corresponding to each end flag bit with a value of 1, and modified data corresponding to each data number, and the server determines the modified number of times of the EFUSE according to the number of the end flag bits with a value of 0, where the modified number of times is equal to the number of the end flag bits with a value of 0 minus 1.
Step S103: if the number of times of modification of the EFUSE is 0, changing the numerical value of the effective bit of each data to be modified from 0 to 1.
Specifically, if the modified number of times of the EFUSE is 0, it indicates that the data stored in the EFUSE is data written for the first time, and each data written for the first time is located in the first storage block in the EFUSE, and for each data written for the first time, the value of the valid bit of the data is 0, which indicates that the data is valid data, and the value of the valid bit of the data is 1, which indicates that the data is invalid data, and when the modified number of times of the EFUSE is 0, the data to be modified refers to the data to be written for the first time that is about to be invalid and needs to be modified, so when the data to be modified is modified, the value of the valid bit of each data to be modified located in the first storage block needs to be modified from 0 to 1.
Step S104: and sequentially modifying each piece of data to be modified according to the sequence from front to back of the storage position, and storing each piece of first target data obtained after modification and the valid bit with the value of 0 set for each piece of the first target data in a first target address according to the modification sequence from front to back of the data to be modified, wherein the first target address is located behind an end flag bit of a first target storage block, the first target storage block is the last storage block in at least one storage block included in the EFUSE, and for each piece of first target data, the valid bit of the first target data is adjacent to and located before the first target data.
Step S105: and adding a first end flag bit with a value of 0 after the last first target data stored by the EFUSE so as to enable each first target data, the valid bit corresponding to each first target data and the first end flag bit to be positioned on the same storage block.
Specifically, the storage location refers to a storage location of the data to be modified in the EFUSE, the data to be modified is modified for each data to be modified to obtain a first target data, at this time, the data to be modified is invalid data, the first target data is valid data, so that a valid bit with a value of 0 needs to be set for the first target data, the valid bit needs to be adjacent to and before the first target data, because the EFUSE is a one-time programming memory, and data on each bit in the EFUSE can only be written from 0 to 1, and cannot be written from 1 to 0, when the data in the EFUSE is modified, except for the modification that the valid bit is changed from 0 to 1, the data corresponding to the valid bit cannot be modified in situ, and the data obtained after modification needs to be stored in the empty bit remaining in the EFUSE, in the case of an EFUSE without modification, there is only one memory block in the EFUSE, namely: a first target storage block, where an end flag bit of the first target storage block indicates that data in the first target storage block is completely stored, and bits after the end flag bit of the first target storage block are all empty bits remaining in the EFUSE, so that first target data and a valid bit set for the first target data need to be stored after the end flag bit of the first target storage block according to a principle of modifying and storing first data, that is: and the storage sequence of the valid bits corresponding to each first target data and each first target data in the EFUSE is consistent with the writing sequence of the valid bits corresponding to each first target data and each first target data.
After all the first target data and the valid bits corresponding to the first target data are stored, adding a first end flag bit with a value of 0 for indicating that the modification is ended after the last stored first target data, wherein the end flag bit enables the first target data, the valid bits corresponding to the first target data and the first end flag bit obtained by the modification to be located on the same storage block, and at this time, two storage blocks exist in the EFUSE, and each end flag bit represents the end of one storage block.
It should be noted that, when the data to be modified is modified, only the value of the data to be modified can be changed, and the bit width of the data to be modified in the EFUSE cannot be changed.
For example, fig. 2 shows an exemplary diagram of a first modification of the EFUSE provided in the first embodiment of the present application, and as shown in fig. 2, before the first modification of the EFUSE, the EFUSE includes a storage block, that is: a first storage block, in which an effective bit 0 and data a, an effective bit 0 and data B, an effective bit 0 and data C, an effective bit 0 and data D, and an end flag bit 0 are sequentially stored, wherein the effective bit with a value of 0 located at the previous bit of each data represents that the data is effective data, and the end flag bit with a value of 0 at the last represents the end of the first storage block and also represents the end of the first writing; when data A, data C and data D need to be modified, the data A, the data C and the data D are all data to be modified, the EFUSE is modified for the first time, the EFUSE obtained after the first modification comprises two storage blocks, in the first storage block, the numerical value of the effective bit of the previous bit of the data A, the data C and the data D is changed from 0 to 1, so that the data stored in the first storage block are sequentially as follows: a valid bit 1 and data a, a valid bit 0 and data B, a valid bit 1 and data C, a valid bit 1 and data D, and an end flag bit 0, which is a second storage block of the EFUSE after the end flag bit 0 of the first storage block, the second storage block storing therein a first target data a obtained by modifying the data a, a first target data B obtained by modifying the data B, and a first target data C obtained by modifying the data C, in which the valid bit set for the first target data a to a value of 0 is adjacent to and before the first target data a, the valid bit set for the first target data C to a value of 0 is adjacent to and before the first target data a, the valid bit set for the first target data D to a value of 0 is adjacent to and before the first target data C, the valid bit set for the first target data D to a value of 0 is adjacent to and before the first target data D, after the first modification is finished, the first target data D is the last first target data stored in the EFUSE, so an end flag bit with a value of 0 is added behind the first target data D, so that the valid bit 0 and the first target data a, the valid bit 0 and the first target data B, the valid bit 0 and the first target data C, the valid bit 0 and the first target data D, and the end flag bit 0 located after the first target data D are all located on the second storage block, wherein the end flag bit 0 after the first target data D represents the end of the second storage block and also represents the end of the first modification, and therefore the bit bits after the end flag bit 0 after the first target data D are all the empty bit bits remaining in the EFUSE.
In the first modification process, the storage positions of the data to be modified are sequentially data a, data C and data D from front to back, so that the modification sequence of the data to be modified is sequentially data a, data C and data D from front to back, and the storage sequence of the first target data obtained after the data to be modified is modified in the EFUSE is as follows: the first target data a precedes the first target data C, which precedes the first target data D.
The data processing method provided by the embodiment of the application can find the storage position of each data to be modified according to at least one address of the data to be modified input by a user, sequentially process each data to be modified according to the sequence of the storage positions from first to last after finding the storage position of each data to be modified, firstly change the value of the effective bit corresponding to the data to be modified from 0 to 1 for the data to be modified to be invalid, then store the first target data obtained after modifying the data to be modified in the vacant bit after the last data to be stored in the EFUSE, and set the effective bit with the value of 0 for the first target data to achieve the purpose of replacing the data to be modified in the reading process, and provides a method for invalidating the original data to be modified and writing the effective first target data in the vacant bit of the EFUSE to replace the original data to be modified, the method achieves the purpose of modifying the error-written data in the EFUSE, not only can increase the utilization rate of the EFUSE and improve the applicability of the EFUSE, but also can prevent the waste of hardware resources caused by error-writing of the EFUSE data.
In a possible embodiment, if the number of times the EFUSE has been modified is 1, the method further comprises the steps of:
step S301: and sequentially judging whether the current data to be modified is located in a second target storage block according to the sequence of the storage positions from front to back, wherein the second target storage block is the last storage block in at least one storage block included in the EFUSE.
Specifically, for at least one to-be-modified data, it is necessary to sequentially determine the storage position of each to-be-modified data according to a storage sequence from front to back of each to-be-modified data, and for each determined current to-be-modified data, determine whether the current to-be-modified data is located on a last storage block in at least one storage block included in the EFUSE, and when the modified number of times of the EFUSE is 1, it indicates that the EFUSE has been modified once, so there are two storage blocks in the EFUSE, and a second storage block in the EFUSE is the last storage block in the EFUSE, that is: a second target memory block.
Step S302: if the current data to be modified is located in the second target storage block, changing the value of the valid bit of the current data to be modified from 0 to 1, and storing second target data and a valid bit with the value of 0 set for the second target data after the first data, wherein the first data is the last data stored in the EFUSE, the second target data is data obtained after the current data to be modified is modified, and the valid bit of the second target data is adjacent to the second target data and is located before the second target data.
Step S303: and judging whether the data to be modified still exists after the current data to be modified, if so, repeating the steps S301 to S303 until the data to be modified does not exist after the current data to be modified.
Step S304: and when the data to be modified does not exist after the current data to be modified, adding a second ending mark bit with the value of 0 after the last second target data stored by the EFUSE so as to enable each second target data, the effective bit corresponding to each second target data and the second ending mark bit to be positioned on the same storage block.
Fig. 3 is a flowchart illustrating another data modification method according to an embodiment of the present application, and as shown in fig. 3, starting from a first to-be-modified data in each to-be-modified data, taking the first to-be-modified data as a current to-be-modified data, determining whether the current to-be-modified data is located in a second target storage block, if the current to-be-modified data is located in the second target storage block, changing a valid bit of the current to-be-modified data from 0 to 1, storing the second target data and a valid bit having a value of 0 set for the second target data in the first data to complete modification of the current to-be-modified data, after the current to-be-modified data is modified, determining whether there is still to-be-modified data after the current to-be-modified data, if there is no to-be-modified data, adding a second end flag bit having a value of 0 after a last second target data stored in EFUSE, finishing the modification, wherein the last second target data stored in the EFUSE is the second target data obtained after the current data to be modified is modified; and if the data to be modified exists, taking the data to be modified as the current data to be modified, and repeating the operation executed on the current data to be modified.
Specifically, if the current data to be modified is the first data to be modified in each data to be modified, and the current data to be modified is located in the second target storage block, the current data to be modified is modified to obtain second target data, after the modification is finished, the current data to be modified is changed into invalid data, the modified second target data is valid data, the value of the valid bit of the current data to be modified is changed from 0 to 1, a valid bit with the value of 0 is set for the second target data, and then the second target data and the corresponding valid bit are stored in the last data stored in the EFUSE, that is: after the first data, before the storage, the first data is the end flag bit of the second storage block, and after the storage, the first data is the second target data.
After the modification of the first data to be modified is finished, judging whether the data to be modified still exists behind the data to be modified, if the data to be modified still exists and the data to be modified is also located in a second target storage block, modifying the second data to be modified by using the same modification method as the first data to be modified, wherein when the second data to be modified is modified, the first data in the EFUSE is the stored first second target data; if there is data to be modified after the second data to be modified and the data to be modified is also located in the second target storage block, the above-mentioned method for modifying the first data to be modified is referred to, and is not described herein again.
When it is determined that there is no data to be modified after the current data to be modified, it is determined that the second modification is finished, and each data to be modified is located on the second target storage block, a second end flag bit having a value of 0 is added after the last second target data stored in the EFUSE to indicate that the second modification is finished, at this time, each second target data obtained after the second modification, the valid bit corresponding to each second target data, and the second end flag bit are located on the same storage block, and the storage block is a third storage block in the EFUSE.
It should be noted that, when the data to be modified is modified, only the value of the data to be modified can be changed, and the bit width of the data to be modified in the EFUSE cannot be changed.
In a possible implementation, if the data to be modified currently is not located in the second target storage block, the method further includes the following steps:
step S305: and judging whether the last second data stored in the EFUSE is an end flag bit.
Step S306: if the second data is not the end flag bit, sequentially storing the end flag bit with the value of 1, the serial number of the current data to be modified, third target data and the end flag bit with the value of 0 in the EFUSE after the second data, wherein the third target data is data obtained after the current data to be modified is modified.
Step S307: if the second data is an end marker bit, changing the value of the end marker bit from 0 to 1, and sequentially storing the number of the current data to be modified, the third target data and the end marker bit with the value of 0 in the EFUSE after the end marker bit.
Step S308: and judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the step S307 and the step S308 until the data to be modified does not exist after the current data to be modified, wherein when the data to be modified does not exist after the current data to be modified, each first designated data is located on the same storage block, and each first designated data comprises each second target data and a valid bit corresponding to each second target data, and/or each third target data, a number of each data to be modified and an end flag bit located behind each third target data.
Fig. 3 is a flowchart illustrating another data modification method provided in an embodiment of the present application, where as shown in fig. 3, if the current data to be modified is not in the second target storage block, it is determined whether the last second data stored in the EFUSE is an end flag bit, if the second data is the end flag bit, the value of the end flag bit is changed from 0 to 1, and after the end flag bit, the number of the current data to be modified, the third target data, and the end flag bit whose value is 0 are sequentially stored in the EFUSE; and if the second data is not the end marker bit, sequentially storing the end marker bit with the value of 1, the number of the current data to be modified, the third target data and the end marker bit with the value of 0 in the EFUSE after the second data.
After the storage is finished (namely after the current data to be modified is modified), judging whether the data to be modified still exists after the current data to be modified, if so, taking the data to be modified as the current data to be modified, and repeating the operation executed on the current data to be modified from the judgment of whether the last second data stored in the EFUSE is the end marker bit to the judgment of whether the data to be modified still exists after the current data to be modified; if the data to be modified does not exist, the modification is finished.
Specifically, if the current data to be modified is not in the second target storage block, there are two situations:
in the first case, the current data to be modified is the first data to be modified, at this time, the last second data in the EFUSE is the ending flag bit of the second storage block in the EFUSE, and the ending flag bit is 1, which indicates that the modification mode used after the ending flag bit is a special modification mode; in this case, after the modification is finished, the third target data, the serial number of the data to be modified, and the end flag bit located after the third target data are located on the same storage block, where the storage block is a third storage block in the EFUSE.
In a second case, the current data to be modified is not the first data to be modified, at this time, the last second data in the EFUSE is the last second target data stored in the EFUSE, in order to indicate a subsequent modification special modification mode, an end flag bit with a value of 1 needs to be added after the last second target data, and the modification modes after the flag bit are all special modification modes; in this case, the second target data stored in the modification process, the valid bit corresponding to the second target data, the end flag bit after the last second target data, the third target data, the number of the data to be modified before the third target data, and the end flag bit after the third target data are all located on the same storage block, and the storage block is a third storage block in the EFUSE.
It should be noted that, the special modification mode is as follows: the method comprises the steps of storing the number of data to be modified, which need to be modified, after an end zone bit, then storing third target data obtained after the current data to be modified is modified after the number, and finally storing the end zone bit with the value of 0 after the third target data, wherein for at least one data to be modified, the data to be modified are modified according to the sequence of bit width of the data to be modified in EFUSE from small to large.
It should be noted again that once the special modification mode is used, the data modification sequence is disturbed, so the modification modes after the special modification mode are all special modification modes.
It should be noted again that, when the data to be modified is modified, only the value of the data to be modified can be changed, and the bit width of the data to be modified in the EFUSE cannot be changed.
In a possible embodiment, if the number of times the EFUSE has been modified is greater than or equal to 2, the method further comprises:
and judging whether an ending flag bit with a value of 1 exists in the EFUSE.
If there is an end flag with a value of 1, step S307 and step S308 are executed.
Specifically, when the number of times of modification in the EFUSE is greater than or equal to 2, the modification mode of the EFUSE may have a special modification mode, or may not have a special modification mode, and a flag of the special modification mode is an end flag bit with a value of 1, so that it is necessary to determine whether an end flag bit with a value of 1 exists in the EFUSE, and if an end flag bit with a value of 1 exists, it indicates that the special modification mode exists, and since the modification modes after the special modification mode all need to use the special modification mode, step S307 and step S308 are executed to complete the modification of each data to be modified, at this time, the number of each data to be modified stored in this modification, and the data obtained by modifying each data to be modified and the end flag bit after the data are both located on the same storage block.
It should be noted that each storage of the EFUSE generates one storage block, that is, each storage block in the EFUSE indicates that the EFUSE has been written or modified once.
In a possible embodiment, if there is no ending flag bit with a value of 1 in the EFUSE, the method further includes:
step S309: and sequentially judging whether the current data to be modified is located in a third target storage block according to the sequence of the storage positions from front to back, wherein the third target storage block is the last storage block in at least one storage block included in the EFUSE.
Step S310: if the data to be modified is located in the third target storage block, changing the value of the valid bit of the current data to be modified from 0 to 1, and storing fourth target data and the valid bit with the value of 0 set for the fourth target data after the third data, wherein the third data is the last data stored in the EFUSE, the fourth target data is the data obtained after the current data to be modified is modified, and the valid bit of the fourth target data is adjacent to and located before the fourth target data.
Step S311: and judging whether the data to be modified still exists after the current data to be modified, if so, repeating the steps S309 to S310 until the data to be modified does not exist after the current data to be modified.
Step S312: when the data to be modified does not exist after the current data to be modified, adding a third end flag bit with a value of 0 after the last fourth target data stored in the EFUSE, so that each fourth target data, the valid bit corresponding to each fourth target data and the third end flag bit are located on the same storage block.
Step S313: and if the current data to be modified is not located in the third target storage block, judging whether the last fourth data stored in the EFUSE is an end flag bit.
Step S314: if the fourth data is not an end flag bit, sequentially storing the end flag bit with the value of 1, the number of the current data to be modified, fifth target data and the end flag bit with the value of 0 in the EFUSE after the fourth data, wherein the fifth target data is data obtained by modifying the current data to be modified.
Step S315: if the fourth data is an end flag bit, changing the value of the end flag bit from 0 to 1, and after the end flag bit, sequentially storing the number of the current data to be modified, the fifth target data, and the end flag bit with the value of 0 in the EFUSE.
Step S316: judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the step S315 and the step S316 until the data to be modified does not exist after the current data to be modified, wherein when the data to be modified does not exist after the current data to be modified, each second specified data is located on the same storage block, and each second specified data comprises each fourth target data and a valid bit corresponding to each fourth target data, and/or each fifth target data, a serial number of each data to be modified and an end flag bit located after each fifth target data.
Specifically, when the ending flag bit with a value of 1 does not exist in the EFUSE, it indicates that there is no special modification mode of the EFUSE, and the modification mode adopted at this time refers to the modification mode in the second modification, that is: for the specific description of step S309 to step S316, refer to the description of step S301 to step S308, and are not repeated herein.
In one possible embodiment, before determining the number of times the EFUSE has been modified, the method further comprises:
sequentially reading the data stored in each storage block according to the arrangement sequence of the storage blocks in the EFUSE from front to back:
when the read storage block is the first storage block of the EFUSE, sequentially reading first storage data corresponding to each valid bit stored in the first storage block according to a storage sequence from front to back; judging whether a valid bit with a value of 1 exists in the valid bits of the first storage data; and if the valid bit with the value of 1 exists in the valid bits of the first storage data, reading the stored data in the second storage block of the EFUSE.
And when the read storage block is the second storage block of the EFUSE, sequentially reading second storage data corresponding to each valid bit stored in the second storage block according to a storage sequence from front to back. Sequentially replacing the first storage data corresponding to the read valid bit with the value of 1 by using the second storage data according to the reading sequence from first to last; judging whether a valid bit with a value of 1 exists in the valid bits of the second storage data; and if the valid bit with the value of 1 exists in the valid bits of the second storage data, reading the stored data in the third storage block of the EFUSE.
When the arrangement order of the read storage blocks in the EFUSE is greater than or equal to 3, sequentially reading third storage data corresponding to each valid bit stored in the storage blocks according to the storage order from front to back; sequentially replacing the storage data corresponding to the valid bit with the value of 1 read out at the previous time by using the third storage data according to the reading sequence from the first to the last; judging whether a target ending zone bit with the numerical value of 1 exists in the storage block, and if the target ending zone bit exists, reading a data number behind each target ending zone bit and fourth storage data corresponding to the data number; and for the fourth storage data corresponding to each data number, replacing the read-out storage data corresponding to the data number with the fourth storage data.
Specifically, when reading the data stored in the EFUSE, at least one of the following cases is included:
in the first case, there is only one storage block in the EFUSE, that is, the EFUSE is not modified, at this time, the numerical values of the effective bits in the storage block are all 0, so that the data corresponding to the effective bits are sequentially read according to the storage sequence from front to back of the data in the storage block, and the read data are all final data.
In the second case, there are at least two storage blocks in the EFUSE, but there is no ending flag bit with a value of 1 in each storage block, the reading method is: reading data corresponding to each effective bit stored in a first storage block according to a storage sequence from front to back, arranging the read data according to the reading sequence from front to back, setting data corresponding to the effective bit with the value of 1 in the read data to be 0, reading data corresponding to each effective bit stored in a second storage block according to the storage sequence from front to back, sequentially filling the data with the value of 0, setting the data corresponding to the effective bit with the value of 1 in the read data to be 0 after filling, and executing the reading, filling and setting operations until reading an end mark bit with the last value of 0 in the EFUSE.
In a third case, there are at least two storage blocks in the EFUSE, and there is an end flag bit with a value of 1, at this time, in the EFUSE, the modification modes after the end flag bit with the first value of 1 are all special modification modes, so the reading mode in the second case is used first until the end flag bit with the first value of 1 in the EFUSE is read, at this time, the values of the valid bits of the read data are all 0, then the data are matched with their corresponding numbers according to the sequence of the data, after the numbers are matched, at least one data number after the end flag bit with the first value of 1 and fourth storage data corresponding to the data number are read, then the arranged data corresponding to the previously matched number are replaced according to the fourth storage data corresponding to the read data number until the last fourth storage data is replaced, the data of the arrangement obtained at this time is final data.
In a possible implementation scheme, before modifying the EFUSE, data needs to be written into the EFUSE, the number of at least one piece of data to be written, the bit width of each piece of data to be written, and the data number set for each piece of data to be written according to the sequence of the bit widths from small to large are obtained, the pieces of data to be written are sequentially written into the EFUSE according to the sequence of the data numbers from small to large, and an end flag bit with a value of 0 is added after the last piece of data to be written, so that each valid bit stored in the EFUSE during the writing process is located on the same storage block, the storage block is a first storage block in the EFUSE, wherein the data located one bit before each piece of data to be written is a valid bit with a bit width of 1, after the programming is finished, the number, the data number and the bit width of each data to be programmed are not changed.
It should be noted that, for data to be programmed whose bit width is greater than a preset value, the data needs to be split into at least one data to be programmed whose bit width is less than or equal to the preset value.
It should be noted again that the writing or reading of data in EFUSE is aligned according to the bit index.
Example two
Fig. 4 is a schematic structural diagram of a data modification apparatus according to a second embodiment of the present application, and as shown in fig. 4, the data modification apparatus includes:
a first determining module 401, configured to determine, according to an address of at least one to-be-modified data input by a user, a storage location of each to-be-modified data in the EFUSE;
a second determining module 402, configured to determine the modified number of times of the EFUSE according to the read stored data in the EFUSE;
a first modification module 403, configured to change a value of a valid bit of each to-be-modified data from 0 to 1 if the number of times that the EFUSE has been modified is 0;
a second modifying module 404, configured to modify, according to the storage location from front to back, each piece of data to be modified in sequence, and store, in a first target address, each piece of first target data obtained after modification and a valid bit having a value of 0 set for each piece of the first target data according to a modification sequence of the data to be modified from first to last, where the first target address is located after an end flag bit of a first target storage block, the first target storage block is a last storage block in at least one storage block included in the EFUSE, and for each piece of first target data, the valid bit of the first target data is adjacent to and located before the first target data;
a first adding module 405, configured to add a first end flag bit with a value of 0 after the last first target data stored in the EFUSE, so that each first target data, a valid bit corresponding to each first target data, and the first end flag bit are located on the same storage block.
In a possible embodiment, if the number of times the EFUSE has been modified is 1, the data modification apparatus further includes:
a first determining module, configured to execute step S301: sequentially judging whether the current data to be modified is located in a second target storage block according to the sequence of the storage positions from front to back, wherein the second target storage block is the last storage block in at least one storage block included in the EFUSE;
a third modification module, configured to execute step S302: if the current data to be modified is located in the second target storage block, changing the value of the valid bit of the current data to be modified from 0 to 1, and storing second target data and a valid bit with the value of 0 set for the second target data after the first data, wherein the first data is the last data stored in the EFUSE, the second target data is data obtained after the current data to be modified is modified, and the valid bit of the second target data is adjacent to the second target data and is located before the second target data;
a first executing module, configured to execute step S303: judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the steps S301 to S303 until the data to be modified does not exist after the current data to be modified;
a second adding module, configured to execute step S304: and when the data to be modified does not exist after the current data to be modified, adding a second ending mark bit with the value of 0 after the last second target data stored by the EFUSE so as to enable each second target data, the effective bit corresponding to each second target data and the second ending mark bit to be positioned on the same storage block.
In a possible implementation, if the data to be modified currently is not located in the second target storage block, the data modifying apparatus further includes:
a second determining module, configured to perform step S305: judging whether the last second data stored in the EFUSE is an ending flag bit;
a fourth modification module, configured to execute step S306: if the second data is not the end marker bit, sequentially storing the end marker bit with the value of 1, the serial number of the current data to be modified, third target data and the end marker bit with the value of 0 in the EFUSE after the second data, wherein the third target data is data obtained after the current data to be modified is modified;
a fifth modification module, configured to execute step S307: if the second data is an end zone bit, changing the value of the end zone bit from 0 to 1, and sequentially storing the serial number of the current data to be modified, the third target data and the end zone bit with the value of 0 in the EFUSE after the end zone bit;
a second executing module, configured to execute step S308: and judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the step S307 and the step S308 until the data to be modified does not exist after the current data to be modified, wherein when the data to be modified does not exist after the current data to be modified, each first designated data is located on the same storage block, and each first designated data comprises each second target data and a valid bit corresponding to each second target data, and/or each third target data, a number of each data to be modified and an end flag bit located behind each third target data.
In a possible embodiment, if the number of times the EFUSE has been modified is greater than or equal to 2, the data modification apparatus further includes:
a third judging module, configured to judge whether an ending flag bit with a value of 1 exists in the EFUSE;
a third executing module, configured to execute step S307 and step S308 if there is an end flag bit with a value of 1.
In a possible embodiment, if there is no ending flag bit with a value of 1 in the EFUSE, the data processing apparatus further includes:
a fourth determining module, configured to perform step S309: sequentially judging whether the current data to be modified is located in a third target storage block according to the sequence of the storage positions from front to back, wherein the third target storage block is the last storage block in at least one storage block included in the EFUSE;
a sixth modification module, configured to execute step S310: if the data to be modified is located in the third target storage block, changing the value of the valid bit of the current data to be modified from 0 to 1, and storing fourth target data and a valid bit with the value of 0 set for the fourth target data after the third data, wherein the third data is the last data stored in the EFUSE, the fourth target data is obtained after the current data to be modified is modified, and the valid bit of the fourth target data is adjacent to and located before the fourth target data;
a fourth executing module, configured to execute step S311: judging whether the data to be modified still exists after the current data to be modified, if so, repeating the step S309 to the step S310 until the data to be modified does not exist after the current data to be modified;
a third adding module, configured to perform step S312: when data to be modified does not exist after the current data to be modified, adding a third ending flag bit with a value of 0 behind the last fourth target data stored in the EFUSE so as to enable each fourth target data, the effective bit corresponding to each fourth target data and the third ending flag bit to be located on the same storage block;
a fifth determining module, configured to perform step S313: if the current data to be modified is not located in the third target storage block, judging whether the last fourth data stored in the EFUSE is an end flag bit;
a sixth modification module, configured to execute step S314: if the fourth data is not an end marker bit, sequentially storing an end marker bit with a value of 1, the number of the current data to be modified, fifth target data and an end marker bit with a value of 0 in the EFUSE after the fourth data, wherein the fifth target data is data obtained by modifying the current data to be modified;
a seventh modifying module, configured to execute step S315: if the fourth data is an end flag bit, changing the value of the end flag bit from 0 to 1, and sequentially storing the number of the current data to be modified, the fifth target data and the end flag bit with the value of 0 in the EFUSE after the end flag bit;
a fifth executing module, configured to execute step S316: judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the step S315 and the step S316 until the data to be modified does not exist after the current data to be modified, wherein when the data to be modified does not exist after the current data to be modified, each second specified data is located on the same storage block, and each second specified data comprises each fourth target data and a valid bit corresponding to each fourth target data, and/or each fifth target data, a serial number of each data to be modified and an end flag bit located after each fifth target data.
In one possible embodiment, the configuration of the second determining module 402 is further configured to, before determining the number of times the EFUSE has been modified:
sequentially reading the data stored in each storage block according to the arrangement sequence of the storage blocks in the EFUSE from front to back:
when the read storage block is the first storage block of the EFUSE, sequentially reading first storage data corresponding to each valid bit stored in the first storage block according to a storage sequence from front to back; judging whether a valid bit with a value of 1 exists in the valid bits of the first storage data; if the valid bit with the value of 1 exists in the valid bits of the first storage data, reading the stored data in the second storage block of the EFUSE;
when the read storage block is the second storage block of the EFUSE, sequentially reading second storage data corresponding to each valid bit stored in the second storage block according to a storage sequence from front to back; sequentially replacing the first storage data corresponding to the read valid bit with the value of 1 by using the second storage data according to the reading sequence from first to last; judging whether a valid bit with a value of 1 exists in the valid bits of the second storage data; if the valid bit with the value of 1 exists in the valid bits of the second storage data, reading the stored data in the third storage block of the EFUSE;
when the arrangement order of the read storage blocks in the EFUSE is greater than or equal to 3, sequentially reading third storage data corresponding to each valid bit stored in the storage blocks according to the storage order from front to back; sequentially replacing the storage data corresponding to the valid bit with the value of 1 read out at the previous time by using the third storage data according to the reading sequence from the first to the last; judging whether a target ending zone bit with the numerical value of 1 exists in the storage block, and if the target ending zone bit exists, reading a data number behind each target ending zone bit and fourth storage data corresponding to the data number; and for the fourth storage data corresponding to each data number, replacing the read-out storage data corresponding to the data number with the fourth storage data.
The apparatus provided in the embodiments of the present application may be specific hardware on a device, or software or firmware installed on a device, etc. The device provided by the embodiment of the present application has the same implementation principle and technical effect as the foregoing method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the foregoing method embodiments where no part of the device embodiments is mentioned. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The data processing method provided by the embodiment of the application can find the storage position of each data to be modified according to at least one address of the data to be modified input by a user, sequentially process each data to be modified according to the sequence of the storage positions from first to last after finding the storage position of each data to be modified, firstly change the value of the effective bit corresponding to the data to be modified from 0 to 1 for the data to be modified to be invalid, then store the first target data obtained after modifying the data to be modified in the vacant bit after the last data to be stored in the EFUSE, and set the effective bit with the value of 0 for the first target data to achieve the purpose of replacing the data to be modified in the reading process, and provides a method for invalidating the original data to be modified and writing the effective first target data in the vacant bit of the EFUSE to replace the original data to be modified, the method achieves the purpose of modifying the error-written data in the EFUSE, not only can increase the utilization rate of the EFUSE and improve the applicability of the EFUSE, but also can prevent the waste of hardware resources caused by error-writing of the EFUSE data.
EXAMPLE III
Fig. 5 is a schematic structural diagram of a computer device provided in a third embodiment of the present application, and as shown in fig. 5, the device includes a memory 501, a processor 502, and a computer program stored in the memory 501 and executable on the processor 502, where the processor 502 implements the data modification method when executing the computer program.
Specifically, the memory 501 and the processor 502 can be general memories and processors, which are not specifically limited herein, and when the processor 502 runs a computer program stored in the memory 501, the data modification method can be executed, so that the problem of hardware resource waste caused by error writing of EFUSE data in the prior art is solved.
Example four
The embodiment of the present application further 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 computer program performs the steps of the data modification method.
Specifically, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, and the like, and when a computer program on the storage medium is run, the data modification method can be executed, so that the problem of hardware resource waste caused by error writing of the EFUSE data in the prior art is solved.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the present disclosure, which should be construed in light of the above teachings. Are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of modifying data, the method comprising:
determining the storage position of each data to be modified in the EFUSE according to at least one address of the data to be modified input by a user;
determining the modified times of the EFUSE according to the read stored data in the EFUSE;
if the number of times of modification of the EFUSE is 0, changing the numerical value of the effective bit of each data to be modified from 0 to 1;
sequentially modifying each piece of data to be modified according to the sequence from front to back of the storage position, and storing each piece of first target data obtained after modification and the valid bit with the value of 0 set for each piece of the first target data in a first target address according to the modification sequence from front to back of the data to be modified, wherein the first target address is located behind an end flag bit of a first target storage block, the first target storage block is the last storage block in at least one storage block included in the EFUSE, and for each piece of first target data, the valid bit of the first target data is adjacent to and located before the first target data;
adding a first end flag bit with a value of 0 after the last first target data stored in the EFUSE, so that each first target data, the valid bit corresponding to each first target data and the first end flag bit are located on the same storage block;
the determining the number of times of modification of the EFUSE according to the read stored data in the EFUSE includes: and determining the modified times of the EFUSE according to the number of the end marker bits with the value of 0, wherein the modified times is equal to the number of the end marker bits with the value of 0 minus 1.
2. The method of claim 1, wherein if the number of times the EFUSE has been modified is 1, the method further comprises:
step S1: sequentially judging whether the current data to be modified is located in a second target storage block according to the sequence of the storage positions from front to back, wherein the second target storage block is the last storage block in at least one storage block included in the EFUSE;
step S2: if the current data to be modified is located in the second target storage block, changing the value of the valid bit of the current data to be modified from 0 to 1, and storing second target data and a valid bit with the value of 0 set for the second target data after the first data, wherein the first data is the last data stored in the EFUSE, the second target data is data obtained after the current data to be modified is modified, and the valid bit of the second target data is adjacent to the second target data and is located before the second target data;
step S3: judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the steps S1 to S3 until the data to be modified does not exist after the current data to be modified;
step S4: and when the data to be modified does not exist after the current data to be modified, adding a second ending mark bit with the value of 0 after the last second target data stored by the EFUSE so as to enable each second target data, the effective bit corresponding to each second target data and the second ending mark bit to be positioned on the same storage block.
3. The method of claim 2, wherein if the current data to be modified is not located in the second target memory block, the method further comprises:
step S5: judging whether the last second data stored in the EFUSE is an ending flag bit;
step S6: if the second data is not the end marker bit, sequentially storing the end marker bit with the value of 1, the serial number of the current data to be modified, third target data and the end marker bit with the value of 0 in the EFUSE after the second data, wherein the third target data is data obtained after the current data to be modified is modified;
step S7: if the second data is an end zone bit, changing the value of the end zone bit from 0 to 1, and sequentially storing the serial number of the current data to be modified, the third target data and the end zone bit with the value of 0 in the EFUSE after the end zone bit;
step S8: and judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the step S7 and the step S8 until the data to be modified does not exist after the current data to be modified, wherein when the data to be modified does not exist after the current data to be modified, each first designated data is located on the same storage block, each first designated data comprises each second target data and a valid bit corresponding to each second target data, and/or each third target data, a serial number of each data to be modified and an end flag bit located behind each third target data.
4. The method of claim 3, wherein if the number of times the EFUSE has been modified is greater than or equal to 2, the method further comprises:
judging whether an ending flag bit with a value of 1 exists in the EFUSE;
if there is an end flag with a value of 1, go to step S7 and step S8.
5. The method of claim 4, wherein if an end flag bit with a value of 1 does not exist in the EFUSE, the method further comprises:
step S9: sequentially judging whether the current data to be modified is located in a third target storage block according to the sequence of the storage positions from front to back, wherein the third target storage block is the last storage block in at least one storage block included in the EFUSE;
step S10: if the data to be modified is located in the third target storage block, changing the value of the valid bit of the current data to be modified from 0 to 1, and storing fourth target data and a valid bit with the value of 0 set for the fourth target data after the third data, wherein the third data is the last data stored in the EFUSE, the fourth target data is obtained after the current data to be modified is modified, and the valid bit of the fourth target data is adjacent to and located before the fourth target data;
step S11: judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the steps S9 to S10 until the data to be modified does not exist after the current data to be modified;
step S12: when data to be modified does not exist after the current data to be modified, adding a third ending flag bit with a value of 0 behind the last fourth target data stored in the EFUSE so as to enable each fourth target data, the effective bit corresponding to each fourth target data and the third ending flag bit to be located on the same storage block;
step S13: if the current data to be modified is not located in the third target storage block, judging whether the last fourth data stored in the EFUSE is an end flag bit;
step S14: if the fourth data is not an end marker bit, sequentially storing an end marker bit with a value of 1, the number of the current data to be modified, fifth target data and an end marker bit with a value of 0 in the EFUSE after the fourth data, wherein the fifth target data is data obtained by modifying the current data to be modified;
step S15: if the fourth data is an end flag bit, changing the value of the end flag bit from 0 to 1, and sequentially storing the number of the current data to be modified, the fifth target data and the end flag bit with the value of 0 in the EFUSE after the end flag bit;
step S16: and judging whether the data to be modified still exists after the current data to be modified, if so, repeatedly executing the step S15 and the step S16 until the data to be modified does not exist after the current data to be modified, wherein when the data to be modified does not exist after the current data to be modified, each second specified data is located on the same storage block, each second specified data comprises each fourth target data and a valid bit corresponding to each fourth target data, and/or each fifth target data, a serial number of each data to be modified and an end flag bit located after each fifth target data.
6. The method of claim 1, wherein prior to determining the number of times the EFUSE has been modified, the method further comprises:
sequentially reading the data stored in each storage block according to the arrangement sequence of the storage blocks in the EFUSE from front to back:
when the read storage block is the first storage block of the EFUSE, sequentially reading first storage data corresponding to each valid bit stored in the first storage block according to a storage sequence from front to back; judging whether a valid bit with a value of 1 exists in the valid bits of the first storage data; if the valid bit with the value of 1 exists in the valid bits of the first storage data, reading the stored data in the second storage block of the EFUSE;
when the read storage block is the second storage block of the EFUSE, sequentially reading second storage data corresponding to each valid bit stored in the second storage block according to a storage sequence from front to back; sequentially replacing the first storage data corresponding to the read valid bit with the value of 1 by using the second storage data according to the reading sequence from first to last; judging whether a valid bit with a value of 1 exists in the valid bits of the second storage data; if the valid bit with the value of 1 exists in the valid bits of the second storage data, reading the stored data in the third storage block of the EFUSE;
when the arrangement order of the read storage blocks in the EFUSE is greater than or equal to 3, sequentially reading third storage data corresponding to each valid bit stored in the storage blocks according to the storage order from front to back; sequentially replacing the storage data corresponding to the valid bit with the value of 1 read out at the previous time by using the third storage data according to the reading sequence from the first to the last; judging whether a target ending zone bit with the numerical value of 1 exists in the storage block, and if the target ending zone bit exists, reading a data number behind each target ending zone bit and fourth storage data corresponding to the data number; and for the fourth storage data corresponding to each data number, replacing the read-out storage data corresponding to the data number with the fourth storage data.
7. A data modification apparatus, characterized in that the apparatus comprises:
the first determining module is used for determining the storage position of each data to be modified in the EFUSE according to the address of at least one data to be modified input by a user;
the second determining module is used for determining the modified times of the EFUSE according to the read stored data in the EFUSE;
the first modification module is used for changing the numerical value of the effective bit of each data to be modified from 0 to 1 if the number of times of modification of the EFUSE is 0;
a second modification module, configured to modify, according to a sequence from front to back of the storage location, each piece of to-be-modified data in sequence, and store, in a first target address, each piece of first target data obtained after modification and an effective bit having a value of 0 set for each piece of the first target data according to a modification sequence from first to back of the to-be-modified data, where the first target address is located after an end flag bit of a first target storage block, the first target storage block is a last storage block in at least one storage block included in the EFUSE, and for each piece of first target data, the effective bit of the first target data is adjacent to and located before the first target data;
a first adding module, configured to add a first end flag bit having a value of 0 after the last first target data stored in the EFUSE, so that each first target data, a valid bit corresponding to each first target data, and the first end flag bit are located on the same storage block;
the stored data includes at least one valid bit, data corresponding to each valid bit, and at least one end flag bit having a value of 0, and/or at least one end flag bit having a value of 1, a data number corresponding to each end flag bit having a value of 1, and modified data corresponding to each data number, and the second determining module, when configured to determine the modified number of times of the EFUSE according to the read stored data in the EFUSE, is specifically configured to: and determining the modified times of the EFUSE according to the number of the end marker bits with the value of 0, wherein the modified times is equal to the number of the end marker bits with the value of 0 minus 1.
8. The apparatus of claim 7, wherein the configuration of the second determining module, prior to being used to determine the modified number of times the EFUSE is, is further to:
sequentially reading the data stored in each storage block according to the arrangement sequence of the storage blocks in the EFUSE from front to back:
when the read storage block is the first storage block of the EFUSE, sequentially reading first storage data corresponding to each valid bit stored in the first storage block according to a storage sequence from front to back; judging whether a valid bit with a value of 1 exists in the valid bits of the first storage data; if the valid bit with the value of 1 exists in the valid bits of the first storage data, reading the stored data in the second storage block of the EFUSE;
when the read storage block is the second storage block of the EFUSE, sequentially reading second storage data corresponding to each valid bit stored in the second storage block according to a storage sequence from front to back; sequentially replacing the first storage data corresponding to the read valid bit with the value of 1 by using the second storage data according to the reading sequence from first to last; judging whether a valid bit with a value of 1 exists in the valid bits of the second storage data; if the valid bit with the value of 1 exists in the valid bits of the second storage data, reading the stored data in the third storage block of the EFUSE;
when the arrangement order of the read storage blocks in the EFUSE is greater than or equal to 3, sequentially reading third storage data corresponding to each valid bit stored in the storage blocks according to the storage order from front to back; sequentially replacing the storage data corresponding to the valid bit with the value of 1 read out at the previous time by using the third storage data according to the reading sequence from the first to the last; judging whether a target ending zone bit with the numerical value of 1 exists in the storage block, and if the target ending zone bit exists, reading a data number behind each target ending zone bit and fourth storage data corresponding to the data number; and for the fourth storage data corresponding to each data number, replacing the read-out storage data corresponding to the data number with the fourth storage data.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of the preceding claims 1-6 are implemented by the processor when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, is adapted to carry out the steps of the method of any one of the preceding claims 1 to 6.
CN202110568488.8A 2021-05-25 2021-05-25 Data modification method, device, equipment and storage medium Active CN113010121B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110568488.8A CN113010121B (en) 2021-05-25 2021-05-25 Data modification method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110568488.8A CN113010121B (en) 2021-05-25 2021-05-25 Data modification method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113010121A CN113010121A (en) 2021-06-22
CN113010121B true CN113010121B (en) 2021-09-07

Family

ID=76380810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110568488.8A Active CN113010121B (en) 2021-05-25 2021-05-25 Data modification method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113010121B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114625385B (en) * 2022-03-17 2022-09-27 集睿致远(厦门)科技有限公司 Method and device for burning and writing efuse data of chip and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203773958U (en) * 2013-10-25 2014-08-13 上海华力创通半导体有限公司 One time programmable (OTP) register read-write device
CN107908359A (en) * 2017-11-03 2018-04-13 清华大学深圳研究生院 A kind of otp memory and its data write-in and read method, safety chip
CN110136769A (en) * 2019-04-16 2019-08-16 珠海市杰理科技股份有限公司 OTP register data correcting method, device, computer equipment and storage medium
CN110489351A (en) * 2018-05-14 2019-11-22 英韧科技(上海)有限公司 Chip finger print managing device and safety chip
CN111352594A (en) * 2020-03-12 2020-06-30 上海路虹电子科技有限公司 Method and device for writing data and reading data in eFuse

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203773958U (en) * 2013-10-25 2014-08-13 上海华力创通半导体有限公司 One time programmable (OTP) register read-write device
CN107908359A (en) * 2017-11-03 2018-04-13 清华大学深圳研究生院 A kind of otp memory and its data write-in and read method, safety chip
CN110489351A (en) * 2018-05-14 2019-11-22 英韧科技(上海)有限公司 Chip finger print managing device and safety chip
CN110136769A (en) * 2019-04-16 2019-08-16 珠海市杰理科技股份有限公司 OTP register data correcting method, device, computer equipment and storage medium
CN111352594A (en) * 2020-03-12 2020-06-30 上海路虹电子科技有限公司 Method and device for writing data and reading data in eFuse

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
IBM System z9 eFUSE applications and methodology;R.F.Rizzolo;《IBM Journal of Research and Development》;20070131;全文 *

Also Published As

Publication number Publication date
CN113010121A (en) 2021-06-22

Similar Documents

Publication Publication Date Title
CN107832062B (en) Program updating method and terminal equipment
CN110673789B (en) Metadata storage management method, device, equipment and storage medium of solid state disk
CN106155596B (en) Data writing method and device
CN104424030B (en) Method and device for sharing memory by multi-process operation
CN113010121B (en) Data modification method, device, equipment and storage medium
CN109697109A (en) A kind of method, system, device and the storage medium of Division identification conflict virtual machine
CN112835528A (en) Dirty page refreshing method and device, electronic equipment and storage medium
EP1540660B1 (en) Method of and apparatus for detecting an error in writing to persistent memory
CN113568579A (en) Memory, data storage method and data reading method
CN103379145A (en) Information processing method, apparatus and system
CN110795282B (en) Data rollback method, device, equipment and storage medium
CN110032474B (en) Method, system and related components for determining snapshot occupied capacity
US7979606B2 (en) Method for storing data
CN115328851A (en) Data protection method, device, equipment and medium
CN112631648A (en) Service configuration method and device, electronic equipment and storage medium
CN114444894A (en) Enterprise risk identification method and device, storage medium and electronic equipment
CN112068948B (en) Data hashing method, readable storage medium and electronic device
CN113010105A (en) Data backup method, device, equipment and computer readable storage medium
CN115237819A (en) Data storage method, data reading method, data storage device and data reading device
CN112035378A (en) Method and system for quickly writing data into FLASH FLASH memory
CN116610269B (en) Data storage method, device, storage medium and controller
CN112988037A (en) Static wear leveling method, terminal and computer-readable storage medium
EP1014261A1 (en) Instruction look-ahead system and method
CN113625964B (en) NandFlash-based sequential storage method, electronic device and storage medium
CN103514953A (en) Emulated electrically erasable memory having an address RAM for data stored in flash memory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: No. A1, A2 and D, 8th floor, building 2, yard 1, Wangzhuang Road, Haidian District, Beijing 100082

Patentee after: Gaotuoxunda (Beijing) Microelectronics Co.,Ltd.

Address before: No. A1, A2 and D, 8th floor, building 2, yard 1, Wangzhuang Road, Haidian District, Beijing 100082

Patentee before: ALTO BEAM (CHINA) Inc.