Backup verification error correction method, device, server and storage medium

By setting error correction data in flash memory and generating backup error correction data, the problem of firmware data handling when eccengine reliability fails is solved, ensuring the security of firmware data and server stability, and realizing the situation where eccengine is unreliable Correct checksum data handling.

CN117112287BActive Publication Date: 2024-11-12SHANGHAI HEXIN DIGITAL TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311154292.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-07
Publication Date
2024-11-12
Estimated Expiration
2043-09-07

AI Technical Summary

Technical Problem

When the reliability of the error correction memory eccengine fails, there is a lack of backup verification methods, which leads to the failure of error correction verification of firmware data during the BootLoader boot loading stage, affecting the security of firmware data and the reliability of the server.

Method used

By setting firmware data and the first error correction data in the flash memory, and performing error correction tests on the error correction memory to be tested, the second error correction data is generated, and software verification is used when eccengine is unreliable, comparing the second error correction data with The first error correction data is to judge differences and correct errors or interrupt reporting, ensuring the effectiveness and security of firmware data during handling.

Benefits of technology

It effectively ensures the security and reliability of firmware data during handling when the reliability of eccengine fails, ensures the secure start-up and stability of the server, and improves the overall reliability and stability of the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117112287B_ABST
    Figure CN117112287B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of data storage, and discloses a backup check and error correction method, device, server and storage medium, comprising: setting firmware data and first error correction data in a flash memory; performing an error correction test on an error correction memory to be tested; when the error correction memory to be tested fails the error correction test, generating second error correction data corresponding to the firmware data based on the firmware data; comparing the second error correction data with the first error correction data to determine whether there is a difference between the second error correction data and the first error correction data; when there is no difference between the second error correction data and the first error correction data, confirming that the firmware data passes the error correction check, and moving the firmware data to a storage device. In the case where an eccengine cannot perform an ecc check normally, the present invention ensures the reliability and validity of the firmware data through a backup ecc check process, further ensures the safe startup of the server, and improves the reliability and stability of the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a backup check and error correction method, device, server and storage medium. Background Art

[0002] The flash memory stores static random access storage code (SRAM code), host boot program code, and its corresponding memory error correction (ECC) check data. Since flash may have bit flips, an ECC check is required when the firmware data is moved out during the bootloader stage. ECC check is an important tool to ensure the reliability of firmware data.

[0003] In the related art, since the error correction memory eccengine has the risk of reliability failure, when the eccengine reliability fails, there is a lack of backup verification methods for the case of eccengine reliability failure, and the firmware data transfer process cannot be error-corrected, which leads to the loss of security and reliability of the firmware data. Summary of the invention

[0004] In view of this, the present invention provides a backup verification and error correction method, device, server and storage medium to solve the problem of lack of a backup verification method for the case of eccengine reliability failure.

[0005] In a first aspect, the present invention provides a backup check error correction method, the method comprising:

[0006] Setting firmware data and first error correction data in the flash memory;

[0007] Perform error correction test on the error correction memory to be tested;

[0008] When the error correction memory to be tested fails the error correction test, generating second error correction data corresponding to the firmware data based on the firmware data;

[0009] Comparing the second error correction data with the first error correction data to determine whether there is a difference between the second error correction data and the first error correction data;

[0010] When there is no difference between the second error correction data and the first error correction data, it is confirmed that the firmware data passes the error correction check, and the firmware data is transferred to the memory.

[0011] In the present invention, by performing error correction test on the error correction memory eccengine, the reliability of eccengine is guaranteed, making the firmware data more effective and safe during the transfer process. In the case that the reliability of eccengine fails and eccengine cannot perform ecc verification normally, the transfer of firmware data in the BootLoader boot loading stage is guaranteed by using a spare ecc verification process and a software verification method, thereby ensuring the reliability and effectiveness of the firmware data, further ensuring the safe startup of the server, and improving the reliability and stability of the server.

[0012] In an optional implementation, performing an error correction test on the error correction memory to be tested includes:

[0013] Setting verification data in the flash memory, the verification data corresponding to the first error correction data;

[0014] Annotating the first error correction data or the verification data;

[0015] Based on the error-annotated verification data and the first error correction data, an error correction test is performed on the error correction memory to be tested.

[0016] In this method, by adding the error correction test ECC engine test, the error correction data and verification data after error injection are used to perform error correction test on the error correction memory to be tested, so that the reliability of the ECC engine can be verified in real time, effectively and repeatedly, and the effectiveness and security of the firmware data FW data transfer can be guaranteed.

[0017] In an optional implementation, when the error correction memory to be tested passes the error correction test, the error correction check is performed on the firmware data using the error correction memory to be tested, and when the firmware data passes the error correction check, the firmware data is moved to the memory.

[0018] In this method, when the error correction test is successful, the firmware data is ecc checked using eccengine, and the firmware data is moved only after the firmware data passes the ecc check, thereby ensuring the validity and security of the firmware data moved to the memory.

[0019] In an optional implementation, when the firmware data fails to pass the error correction check, the transfer of the firmware data is interrupted, and the failure of the firmware data to pass the error correction check is reported.

[0020] In this manner, when the firmware data fails to pass the ECC check, an interrupt report is performed, further ensuring that the firmware data transferred to the memory is firmware data with validity and security.

[0021] In an optional implementation, generating second error correction data corresponding to the firmware data based on the firmware data includes:

[0022] Convert firmware data into binary firmware data;

[0023] An XOR operation is performed on the binary firmware data to generate second error correction data corresponding to the firmware data.

[0024] In this method, when the eccengine loses reliability, second ecc data corresponding to the firmware data is generated by software, which facilitates the subsequent use of the second ecc data for ecc verification, replacing the failed eccengine for ecc verification, thereby ensuring the validity and reliability of the firmware data when the eccengine fails.

[0025] In an optional implementation, when there is a difference between the second error correction data and the first error correction data, determining whether the difference between the second error correction data and the first error correction data is a single bit error or a double bit error;

[0026] When the difference between the second error correction data and the first error correction data is a single bit error, error correction is performed on the firmware data to obtain error-corrected firmware data;

[0027] The error-corrected firmware data is transferred to the memory.

[0028] In this method, since a single-bit error can be corrected in the ECC check algorithm, when it is detected that the difference between the ECC data generated in the first and second situations is a single-bit error, a corresponding correction is performed, and the corrected firmware data can be transferred to the memory, thereby ensuring that the firmware data transferred to the memory is valid and secure.

[0029] In an optional implementation, when the difference between the second error correction data and the first error correction data is a double-bit error, the firmware data is stopped from being transferred to the memory, an interrupt is triggered, and an interrupt is reported.

[0030] In this method, since double-bit errors can only be detected but not corrected in the ECC check algorithm, when a double-bit error occurs between ECC data, it is necessary to interrupt the firmware data transfer process and report the interruption, which further ensures that the firmware data transferred to the memory is valid and secure data, and avoids the damage that erroneous data may cause to the memory.

[0031] In a second aspect, the present invention provides a backup check and error correction device, the device comprising:

[0032] A data storage module, used for setting firmware data and first error correction data in the flash memory;

[0033] An error correction test module is used to perform an error correction test on the error correction memory to be tested;

[0034] A standby error correction module, used to generate second error correction data corresponding to the firmware data based on the firmware data when the error correction memory to be tested fails the error correction test;

[0035] A data comparison module, used to compare the second error correction data with the first error correction data to determine whether there is a difference between the second error correction data and the first error correction data;

[0036] The data transfer module is used to confirm that the firmware data passes the error correction check when there is no difference between the second error correction data and the first error correction data, and transfer the firmware data to the memory.

[0037] In a third aspect, the present invention provides a server, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the backup check and error correction method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0038] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the backup check and error correction method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 It is a flowchart of a backup check and error correction method according to an embodiment of the present invention.

[0041] Figure 2 It is a schematic diagram of the fwdata firmware data handling process in the bootloader stage according to an embodiment of the present invention.

[0042] Figure 3 It is a flowchart of a software-based standby ECC check according to an embodiment of the present invention.

[0043] Figure 4 4 is a flow chart of another alternative check and error correction method according to an embodiment of the present invention.

[0044] Figure 5It is a flowchart of another alternative check and error correction method according to an embodiment of the present invention.

[0045] Figure 6 It is a schematic diagram of the storage method of fwdata and eccdata in flash according to an embodiment of the present invention.

[0046] Figure 7 4 is a structural block diagram of a standby check and error correction device according to an embodiment of the present invention.

[0047] Figure 8 It is a schematic diagram of the hardware structure of the server according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0049] In the related art, since the error correction memory eccengine has the risk of reliability failure, when the eccengine reliability fails, there is a lack of backup verification methods for the case of eccengine reliability failure, and the firmware data transfer process cannot be error-corrected, which leads to the loss of security and reliability of the firmware data.

[0050] In order to solve the above problems, a backup check and error correction method is provided in the embodiment of the present invention, which is used in the server. It should be noted that its execution subject can be a backup check and error correction device, which can be implemented as part or all of the server through software, hardware or a combination of software and hardware. Among them, the server can be a terminal or a client or a server. The server can be a server or a server cluster composed of multiple servers. The terminal in the embodiment of the present application can be a smart phone, a personal computer, a tablet computer and other intelligent hardware devices. In the following method embodiments, the execution subject is taken as an example for explanation.

[0051] The server in this embodiment is suitable for the use scenario of using eccengine to perform verification during the fwdata transportation process in the bootloader stage to ensure the safe startup of the server's large and small cores. The present invention provides a backup verification and error correction method, and by performing error correction tests on the error correction memory eccengine, the reliability of eccengine is guaranteed, making the firmware data more effective and safe during the transportation process. In the case where the reliability of eccengine fails and eccengine cannot perform ecc verification normally, the backup ecc verification process uses software verification to ensure the transportation of firmware data in the BootLoader boot loading stage, ensure the reliability and effectiveness of the firmware data, further ensure the safe startup of the server, and improve the reliability and stability of the server.

[0052] According to an embodiment of the present invention, an embodiment of a backup check and error correction method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0053] In this embodiment, a backup check and error correction method is provided, which can be used for the above-mentioned server with flash memory and eccengine. Figure 1 is a flow chart of a backup check and error correction method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0054] Step S101, setting firmware data and first error correction data in a flash memory.

[0055] In one example, since the data stored in the flash memory has the characteristic of not being able to be maliciously modified externally, the firmware data fwdata and the ecc data ECC_DATA_ORIGIN (ie, the first error correction data) corresponding to the firmware data fwdata are stored in the flash memory to ensure the reliability of both.

[0056] Step S102, performing an error correction test on the error correction memory to be tested.

[0057] In one example, before officially carrying out fwdata transfer, the reliability of eccengine needs to be verified first, so as to know whether eccengine is reliable.

[0058] Step S103, when the error correction memory to be tested fails the error correction test, generating second error correction data corresponding to the firmware data based on the firmware data.

[0059] In one example, when the eccengine is unreliable, a backup software-based ecc verification method is required, so the second ecc verification data ECC_DATA_SOFT, i.e., the second error correction data, needs to be generated based on the firmware data fwdata in the flash memory by software.

[0060] Step S104: compare the second error correction data with the first error correction data to determine whether there is a difference between the second error correction data and the first error correction data.

[0061] In an example, the software ECC check is performed by comparing the ECC data: whether there is a difference between the second error correction data ECC_DATA_SOFT and the first error correction data ECC_DATA_ORIGIN.

[0062] Step S105 , when there is no difference between the second error correction data and the first error correction data, confirm that the firmware data passes the error correction check, and transfer the firmware data to the memory.

[0063] In an example, when there is no difference between the second error correction data ECC_DATA_SOFT and the first error correction data ECC_DATA_ORIGIN, it is confirmed that the firmware data fwdata passes the ecc check, and the firmware data fwdata can be moved to the static random access memory sram area.

[0064] In one implementation scenario, the flash stores the sram code and hostboot code, as well as their corresponding ecc check data. Since the flash may have bit flips, an ecc check is required when the bootloader phase moves the flash out. Ecc check is an important tool to ensure the reliability of the flash data. If the reliability of the ecc engine fails, the security and reliability of the flash data cannot be guaranteed. Figure 2 FIG. 1 is a schematic diagram of the fwdata firmware data handling process in the bootloader stage according to an embodiment of the present invention. Figure 2 As shown, by storing a copy of the verification data and its corresponding ecc data in the flash, an ECC engine reliability verification is performed before the formal fw is moved, so that we can know whether the ecc engine is reliable. If the reliability verification passes, the normal flow is used to move the fw, and the hardware ECC engine is used to perform the ecccheck work; if it is unreliable, the backup ECC verification method is used, that is, the ECC software verification solution.

[0065] Figure 3 FIG. 1 is a flowchart of a software-based standby ECC check according to an embodiment of the present invention. Figure 3As shown, in the case of ECC engine reliability failure, the soft ecc check flow is entered, and the process of the backup ECC check scheme (i.e., software ECC check scheme) includes: sequentially reading 4 bytes of data (i.e., fwdata firmware data) from the fw data area; using a software method to generate 1 byte of eccdata: ECC_DATA_SOFT (i.e., the second error correction data), wherein bits 0-6 of ECC_DATA_SOFT are valid data, and bit7 is set to 0. Secondly, 1 byte of ecc data: ECC_DATA_ORIGIN (i.e., the first error correction data) is sequentially read from the ecc data area; then, the ecc data: ECC_DATA_SOFT and ECC_DATA_ORIGIN are compared to see if there is a difference. If there is no difference, it means that the 4 bytes of fwdata pass the ECC check, and the 4 bytes of fwdata can be moved to the sram area; if there is a difference, the ecc software algorithm is used to calculate whether it is a single-bit error or a double-bit error, and a single-bit error is corrected, and after the error correction, the fw data is moved to the sram; a double-bit error triggers an interrupt for interrupt reporting.

[0066] The backup verification and error correction method provided in this embodiment ensures the reliability of eccengine by performing error correction tests on the error correction memory eccengine, making the firmware data more effective and safe during the transfer process. In the case where the reliability of eccengine fails and eccengine cannot perform ecc verification normally, the backup ecc verification process adopts a software verification method to ensure the transfer of firmware data in the BootLoader boot loading stage, ensure the reliability and effectiveness of the firmware data, further ensure the safe startup of the server, and improve the reliability and stability of the server.

[0067] In this embodiment, a backup check and error correction method is provided, which can be used for the above-mentioned server with flash memory and eccengine. Figure 4 is a flow chart of another alternative check and error correction method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:

[0068] Step S401, setting firmware data and first error correction data in the flash memory. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0069] Step S402, performing an error correction test on the error correction memory to be tested.

[0070] Specifically, the above step S402 includes:

[0071] Step S4021, setting verification data in the flash memory.

[0072] In the embodiment of the present invention, the verification data corresponds to the first error correction data.

[0073] Step S4022, annotate the first error correction data or verification data.

[0074] Step S4023: performing an error correction test on the error correction memory to be tested based on the error-annotated verification data and the first error correction data.

[0075] In this method, by adding the error correction test ECC engine test, the error correction data and verification data after error injection are used to perform error correction test on the error correction memory to be tested, so that the reliability of the ECC engine can be verified in real time, effectively and repeatedly, and the effectiveness and security of the firmware data FW data transfer can be guaranteed.

[0076] Step S4024, when the error correction memory to be tested passes the error correction test, the error correction check is performed on the firmware data using the error correction memory to be tested, and when the firmware data passes the error correction check, the firmware data is transferred to the memory.

[0077] In this method, when the error correction test is successful, the firmware data is ecc checked using eccengine, and the firmware data is moved only after the firmware data passes the ecc check, thereby ensuring the validity and security of the firmware data moved to the memory.

[0078] Step S4025, when the firmware data fails to pass the error correction check, the transfer of the firmware data is interrupted, and the fact that the firmware data fails to pass the error correction check is reported.

[0079] In this manner, when the firmware data fails to pass the ECC check, an interrupt report is performed, further ensuring that the firmware data transferred to the memory is firmware data with validity and security.

[0080] In one example, verifying the reliability of the ECC engine to be tested may include: modifying the stored fwdata data 0x30 to 0x33 (i.e., double-bit modification) by software to obtain testdata, and then moving the data to the data cache of the ECCengine, and moving the corresponding ecc data ECC_DATA_ORIGIN to the ecc cache, at which point the data has been modified. Read the test data from the data cache. Since the data has been modified, if an interrupt is triggered and the interrupt is displayed as a double-bit error, and the error position also matches the modified position, it means that the ecc engine is reliable, otherwise it means that the ecc engine is not reliable. If the ecc engine is reliable, proceed to the next step: start moving fw and perform ecc check. If the ecc check passes, move fw to sram; if it fails, the interrupt is reported for corresponding processing.

[0081] Step S403: When the error correction memory to be tested fails the error correction test, second error correction data corresponding to the firmware data is generated based on the firmware data. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0082] Step S404: Compare the second error correction data with the first error correction data to determine whether there is a difference between the second error correction data and the first error correction data. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0083] Step S405: When there is no difference between the second error correction data and the first error correction data, confirm that the firmware data passes the error correction check and transfer the firmware data to the memory. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.

[0084] The backup verification and error correction method provided in this embodiment, by adding an error correction test ecc engine test, performs error correction test on the error correction data and verification data after error injection on the error correction memory to be tested, which can verify the reliability of the ecc engine in real time, effectively and repeatedly, and ensure the effectiveness and security of the firmware data fw data transfer. When the error correction test is successful, the firmware data is ecc checked by eccengine, and the firmware data is transferred when the firmware data passes the ecc check, thereby ensuring the effectiveness and security of the firmware data transferred to the memory. In the case that the firmware data fails the ecc check, an interrupt report is performed, further ensuring that the firmware data transferred to the memory is firmware data with effectiveness and security.

[0085] In this embodiment, a backup check and error correction method is provided, which can be used for the above-mentioned server with flash memory and eccengine. Figure 5 is a flow chart of a backup check and error correction method according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:

[0086] Step S501, setting firmware data and first error correction data in the flash memory. Figure 4 Step S401 of the illustrated embodiment will not be described in detail here.

[0087] Step S502: Perform an error correction test on the error correction memory to be tested. Figure 4 Step S402 of the illustrated embodiment will not be described in detail here.

[0088] Step S503: When the error correction memory to be tested fails the error correction test, second error correction data corresponding to the firmware data is generated based on the firmware data.

[0089] Specifically, the above step S503 includes:

[0090] Step S5031, converting the firmware data into binary firmware data.

[0091] Step S5032: Perform an XOR operation on the binary firmware data to generate second error correction data corresponding to the firmware data.

[0092] In one example, 4 bytes of data are first read sequentially from the fw data area, and a software method is used to generate 1 byte of ECC data: ECC_DATA_SOFT, in which only bits 0-6 are valid data and bit 7 is set to 0.

[0093] Specifically, the generation method of ECC_DATA_SOFT includes: first, converting 4-byte data into 32-bit binary data; second, performing XOR operation and combination calculation on the 32-bit data; finally, 7 bits of data will be generated after XOR, and the 7 bits of data are the ECC data ECC_DATA_SOFT.

[0094] Take 4byte data: 0x30060000 as an example,

[0095] 1. Convert 4-byte data to binary: 0011 0000 0000 0110 0000 0000 0000 0000

[0096] 2. XOR the bits 0, 1, 2, 3, 4, 5, 6, 7, 14, 19, 22, 24, 30, and 31 of the binary data generated above to obtain bit 0;

[0097] XOR the bits 1, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 21, 21, 29 of the binary data generated above to get bit 1;

[0098] XOR the bits 2, 3, 11, 16, 17, 18, 19, 20, 21, 22, 23, 26, 27, 29, and 30 of the binary data generated above to obtain bit 2;

[0099] XOR the bits 3, 2, 6, 10, 13, 15, 16, 24, 25, 26, 27, 28, 29, 30, and 31 of the binary data generated above to obtain bit 3;

[0100] XOR the bits 4, 1, 2, 5, 7, 9, 12, 15, 20, 21, 22, 23, 25, 26, and 28 of the binary data generated above to obtain bit 4;

[0101] XOR the bits 5, 0, 5, 6, 8, 12, 13, 14, 16, 17, 18, 19, 20, and 28 of the binary data generated above to obtain bit 5;

[0102] XOR the bits 6, 0, 1, 3, 4, 8, 9, 10, 11, 17, 23, 25, 27, and 31 of the binary data generated above to obtain bit 6;

[0103] Finally, we get data1=bit3bit2bit1bit0, data0=0bit6bit5bit4; concatenate data0data: ecc data=(data0<<4)|data1;

[0104] In this way, 7-bit ecc data generated by 32-bit data can be obtained, and finally combined into 1-byte ecc data, namely ECC_DATA_SOFT.

[0105] In this method, when the eccengine loses reliability, second ecc data corresponding to the firmware data is generated by software, which facilitates the subsequent use of the second ecc data for ecc verification, replacing the failed eccengine for ecc verification, thereby ensuring the validity and reliability of the firmware data when the eccengine fails.

[0106] Step S504: compare the second error correction data with the first error correction data to determine whether there is a difference between the second error correction data and the first error correction data.

[0107] In one example, since the origin ecc data is generated by the 32:7 ecc algorithm, the soft eccdata must also be generated by the software algorithm in 32:7, thus ensuring that the origin ecc data and the soft ecc data are consistent. Figure 6 FIG. 1 is a schematic diagram of a storage method of data and eccdata in flash according to an embodiment of the present invention. Figure 6 As shown in the figure, Byte1-byte4, i.e. 32 bits of data, corresponds to byte1, i.e. 7 bits of check data (here, the check data generated by ECC is bit0-bit6, a total of 7 bits, and bit7 is set to 0 to ensure 1-byte alignment). Therefore, in the software ECC check algorithm, 4 bytes of data are read first, and 1 byte of ECC data, i.e. soft ECC data, is generated from the 4 bytes. Then, the corresponding 1 byte of ECC data, i.e. origin ECC data, in the flash is read out. The two correspond to each other and can remain consistent.

[0108] Step S505 , when there is no difference between the second error correction data and the first error correction data, confirm that the firmware data passes the error correction check, and transfer the firmware data to the memory.

[0109] Specifically, at the same time as the above step S505, the backup verification and error correction method also includes:

[0110] Step S506: when there is a difference between the second error correction data and the first error correction data, determine whether the difference between the second error correction data and the first error correction data is a single-bit error or a double-bit error.

[0111] Step S507, when the difference between the second error correction data and the first error correction data is a single bit error, error correction is performed on the firmware data to obtain error-corrected firmware data.

[0112] Step S508, transferring the error-corrected firmware data to a memory.

[0113] Step S509, when the difference between the second error correction data and the first error correction data is a double bit error, stop transferring the firmware data to the memory, trigger an interrupt and perform an interrupt reporting.

[0114] In one example, when there is a difference between ECC_DATA_SOFT and ECC_DATA_ORIGIN, the ecc software algorithm is used to calculate whether the difference between ECC_DATA_SOFT and ECC_DATA_ORIGIN is a single-bit error or a double-bit error. A single-bit error is corrected, and after correction, the fw data is moved to sram; a double-bit error triggers an interrupt for interrupt reporting.

[0115] In this method, since a single-bit error can be corrected in the ecc check algorithm, when it is detected that the difference between the ecc data generated in the first and second situations is a single-bit error, the corresponding correction is performed, and the corrected firmware data can be transferred to the memory, ensuring that the firmware data transferred to the memory is valid and safe. Since a double-bit error can only be detected and cannot be corrected in the ecc check algorithm, when a double-bit error occurs between ecc data, the firmware data transfer process needs to be interrupted and the interruption report is performed, which further ensures that the firmware data transferred to the memory is valid and safe data, and avoids the damage that the erroneous data may cause to the memory.

[0116] The backup check and error correction method provided in this embodiment generates second ecc data corresponding to the firmware data through software when the eccengine loses reliability, so as to facilitate the subsequent use of the second ecc data for ecc check, replace the eccengine with a fault to perform ecc check, and ensure the validity and reliability of the firmware data when the eccengine is in a state. Since a single-bit error can be corrected in the ecc check algorithm, when it is detected that the difference between the ecc data generated in the first and second different situations is a single-bit error, a corresponding correction is performed, and the error-corrected firmware data can be transferred to the memory, ensuring that the firmware data transferred to the memory is valid and safe. Since a double-bit error can only be detected and cannot be corrected in the ecc check algorithm, when a double-bit error occurs between ecc data, it is necessary to interrupt the firmware data transfer process and report the interruption, further ensuring that the firmware data transferred to the memory is data with validity and security, and avoiding the possible harm of erroneous data to the memory.

[0117] In the present embodiment, a kind of spare check and error correction device is also provided, and this device is used to realize the above-mentioned embodiment and preferred implementation mode, and the description that has been made is not repeated here. As used below, the term "module" can realize the combination of software and / or hardware of predetermined function. Although the device described in the following embodiment is preferably realized by software, the realization of hardware, or the combination of software and hardware is also possible and conceived.

[0118] This embodiment provides a backup check and error correction device, such as Figure 7 As shown, including:

[0119] The data storage module 701 is used to set the firmware data and the first error correction data in the flash memory. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0120] The error correction test module 702 is used to perform an error correction test on the error correction memory to be tested. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0121] The backup error correction module 703 is used to generate second error correction data corresponding to the firmware data based on the firmware data when the error correction memory to be tested fails the error correction test. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0122] The data comparison module 704 is used to compare the second error correction data with the first error correction data to determine whether there is a difference between the second error correction data and the first error correction data. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0123] The data transfer module 705 is used to confirm that the firmware data passes the error correction check when there is no difference between the second error correction data and the first error correction data, and transfer the firmware data to the memory. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.

[0124] In some optional implementations, the error correction test module 702 includes:

[0125] The verification data setting unit is used to set verification data in the flash memory, where the verification data corresponds to the first error correction data.

[0126] The data error annotation unit is used to perform error annotation on the first error correction data or the verification data.

[0127] The error correction test unit is used to perform an error correction test on the error correction memory to be tested based on the error-annotated verification data and the first error correction data.

[0128] In some optional implementations, the standby check and error correction device further includes:

[0129] The error correction unit is used to perform error correction check on the firmware data using the error correction memory to be tested when the error correction memory to be tested passes the error correction test, and to transfer the firmware data to the memory when the firmware data passes the error correction check.

[0130] In some optional implementations, the error correction unit includes:

[0131] The error correction check failure unit is used to interrupt the transfer of the firmware data when the firmware data fails the error correction check, and report that the firmware data fails the error correction check.

[0132] In some optional implementations, the standby error correction module 703 includes:

[0133] The data conversion unit is used to convert the firmware data into binary firmware data.

[0134] The error correction data generating unit is used to perform an XOR operation on the binary firmware data to generate second error correction data corresponding to the firmware data.

[0135] In some optional implementations, the standby check and error correction device further includes:

[0136] The difference judgment unit is used to judge whether the difference between the second error correction data and the first error correction data is a single bit error or a double bit error when there is a difference between the second error correction data and the first error correction data.

[0137] The data error correction unit is used to correct the firmware data when the difference between the second error correction data and the first error correction data is a single-bit error, so as to obtain the corrected firmware data.

[0138] The data transfer unit is used to transfer the error-corrected firmware data to the memory.

[0139] In some optional implementations, the standby check and error correction device further includes:

[0140] The interrupt reporting unit is used to stop transferring the firmware data to the memory, trigger an interrupt and perform interrupt reporting when the difference between the second error correction data and the first error correction data is a double bit error.

[0141] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0142] The backup check and error correction device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0143] The embodiment of the present invention also provides a server having the above Figure 7 The spare check and error correction device shown.

[0144] See also Figure 8 , Figure 8 is a schematic diagram of the structure of a server provided by an optional embodiment of the present invention, such as Figure 8 As shown, the server includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the server, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple servers can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.

[0145] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0146] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0147] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the server, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the server via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0148] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0149] The server further comprises a communication interface 30 for the server to communicate with other devices or a communication network.

[0150] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0151] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A backup check and error correction method, characterized in that: The method comprises: Setting firmware data and first error correction data in the flash memory; Perform error correction test on the error correction memory to be tested; When the error correction memory to be tested fails the error correction test, second error correction data corresponding to the firmware data is generated based on the firmware data, including: converting the firmware data into binary firmware data; performing an XOR operation on the binary firmware data to generate second error correction data corresponding to the firmware data, wherein the generation process of the second error correction data includes: sequentially reading the firmware data from the firmware data area using a software method, converting the firmware data into the binary firmware data, and inputting 32-bit binary firmware data; extracting bit0, 1, 2, 3, 4, 5, 6, 7, 14, 19, 22, 24, 30, 31 in the binary firmware data, performing XOR calculation, and saving the result to bit0; extracting bit4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 21, 24, 29 in the binary firmware data, performing XOR calculation, and saving the result to bit1; extracting bit3, 11, 1 6, 17, 18, 19, 20, 21, 22, 23, 26, 27, 29, 30, perform XOR calculation, and save the result to bit2; extract bit2, 6, 10, 13, 15, 16, 24, 25, 26, 27, 28, 29, 30, 31 in the binary firmware data, perform XOR calculation, and save the result to bit3; extract bit1, 2, 5, 7, 9, 12, 15, 20, 21, 22, 23, 25, 26, 28, perform XOR calculation, and save the result to bit4; extract bit0, 5, 6, 8, 12, 13, 14, 16, 17, 18, 19, 20, 28 in the binary firmware data, perform XOR calculation, and save the result to bit5; extract bit0, 1, 3, 4, 8, 9, 10, 11, 17, 23, 25, 27, 31 in the binary firmware data, perform XOR calculation, and save the result to bit6; obtain data1 = bit3 bit2 bit1 bit0, data0 = 0 bit6 bit5 bit4; concatenate data0 and data1 in the following manner: eccdata = (data0<<4) | data1, and obtain the second error correction data; Comparing the second error correction data with the first error correction data to determine whether there is a difference between the second error correction data and the first error correction data; When there is no difference between the second error correction data and the first error correction data, it is confirmed that the firmware data passes the error correction check, and the firmware data is transferred to the memory.

2. The method according to claim 1, characterized in that The error correction test of the error correction memory to be tested comprises: Setting verification data in the flash memory, the verification data corresponding to the first error correction data; Annotating errors on the first error correction data or the verification data; Based on the error-annotated verification data and the first error correction data, an error correction test is performed on the error correction memory to be tested.

3. The method according to claim 1, characterized in that When the error correction memory to be tested passes the error correction test, the error correction check is performed on the firmware data using the error correction memory to be tested, and when the firmware data passes the error correction check, the firmware data is transferred to the memory.

4. The method according to claim 3, characterized in that When the firmware data fails to pass the error correction check, the transfer of the firmware data is interrupted, and the failure of the firmware data to pass the error correction check is reported.

5. The method according to claim 1, characterized in that When there is a difference between the second error correction data and the first error correction data, determining whether the difference between the second error correction data and the first error correction data is a single bit error or a double bit error; When the difference between the second error correction data and the first error correction data is a single bit error, error correction is performed on the firmware data to obtain error-corrected firmware data; The error-corrected firmware data is transferred to the memory.

6. The method according to claim 5, characterized in that When the difference between the second error correction data and the first error correction data is a double-bit error, the firmware data is stopped from being transferred to the memory, an interrupt is triggered, and an interrupt is reported.

7. A backup check and error correction device, characterized in that: The device comprises: A data storage module, used for setting firmware data and first error correction data in the flash memory; An error correction test module is used to perform an error correction test on the error correction memory to be tested; A spare error correction module, used for generating second error correction data corresponding to the firmware data based on the firmware data when the error correction memory to be tested fails the error correction test, including: converting the firmware data into binary firmware data; performing an XOR operation on the binary firmware data to generate second error correction data corresponding to the firmware data, wherein the generation process of the second error correction data includes: sequentially reading the firmware data from the firmware data area using a software method, converting the firmware data into the binary firmware data, and inputting 32-bit binary firmware data; extracting bit0, 1, 2, 3, 4, 5, 6, 7, 14, 19, 22, 24, 30, 31 in the binary firmware data, performing XOR calculation, and saving the result to bit0; extracting bit4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 21, 24, 29 in the binary firmware data, performing XOR calculation, and saving the result to bit1; extracting bit3 in the binary firmware data , 11, 16, 17, 18, 19, 20, 21, 22, 23, 26, 27, 29, 30, perform XOR calculation, and save the result to bit2; extract bit2, 6, 10, 13, 15, 16, 24, 25, 26, 27, 28, 29, 30, 31 in the binary firmware data, perform XOR calculation, and save the result to bit3; extract bit1, 2, 5, 7, 9, 12, 15, 20, 21, 22 in the binary firmware data, 23, 25, 26, 28, perform XOR calculation, and save the result to bit4; extract bit0, 5, 6, 8, 12, 13, 14, 16, 17, 18, 19, 20, 28 in the binary firmware data, perform XOR calculation, and save the result to bit5; extract bit0, 1, 3, 4, 8, 9, 10, 11, 17, 23, 25, 27, 31 in the binary firmware data, perform XOR calculation, and save the result to bit6; obtain data1 = bit3bit2bit1bit0, data0 = 0bit6bit5bit4; concatenate data0 and data1 in the following manner: ecc data = (data0<<4) | data1, and obtain the second error correction data; A data comparison module, used for comparing the second error correction data with the first error correction data, and determining whether there is a difference between the second error correction data and the first error correction data; The data transfer module is used to confirm that the firmware data passes the error correction check when there is no difference between the second error correction data and the first error correction data, and transfer the firmware data to the memory.

8. A server, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the backup check and error correction method according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the backup check and error correction method according to any one of claims 1 to 6.