Reinforcement protection method, device and equipment for memory firmware and readable storage medium

By obtaining and using firmware verification codes for error correction, the problem of data errors in memory firmware in a radiated environment is solved, and the firmware update and protection is realized to ensure the stable operation of the memory.

CN119149278APending Publication Date: 2024-12-17SHENZHEN STATE MICROELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411118202.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In a radiated environment, memory firmware is susceptible to damage, resulting in data errors and system failures, and the prior art is difficult to effectively protect.

Method used

By obtaining the first firmware verification code corresponding to the error correction data of the loaded target firmware, the error correction process is performed based on the verification code. If the number of error bits meets the preset conditions, the target firmware data is updated to the storage area and the backup data area , realize automatic error correction and protection.

Benefits of technology

It effectively enhances the protection of firmware, ensures the stable operation of the memory, and prevents firmware programs from running away or failing to run.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149278A_ABST
    Figure CN119149278A_ABST
Patent Text Reader

Abstract

The invention provides a memory firmware reinforcement protection method, apparatus and device, and a readable storage medium. The method comprises the steps of obtaining a first firmware check code corresponding to firmware data to be corrected of loaded target firmware; performing error correction processing on the firmware data to be subjected to error correction according to the first firmware check code; if the first error bit number of the firmware data to be subjected to error correction meets a preset data updating condition, determining first correction data which is obtained after error correction processing and corresponds to the firmware data to be subjected to error correction as target firmware data; and updating the target firmware data to the storage area where the target firmware is located and the storage area where the backup data is located. Through the implementation of the scheme of the invention, the special check code is set to carry out error correction on the abnormal firmware data, so that the firmware can be effectively prevented from being damaged even in an irradiation environment, the firmware can be quickly recovered to be normal when the firmware has an error, the reliability of the firmware is improved, and the normal function of the memory is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer storage technology, and in particular to a method, device, equipment and readable storage medium for reinforcing protection of memory firmware. Background Art

[0002] With the development of the aerospace industry, various spacecraft emerge in an endless stream. There is a high-energy ion radiation environment in space. Various artificial satellites and spacecraft will be exposed to radiation from solar cosmic rays, galactic cosmic rays and radiation belts. These radiations may cause varying degrees of damage to the electronic components in the satellites or spacecraft, affecting the normal operation of the electronic components on the spacecraft. In severe cases, it may lead to aerospace accidents.

[0003] As a data storage medium, with the reduction of process size in recent years, most errors in space are caused by the logical state jump of semiconductor devices (such as eMMC, SSD and other firmware), such as single-event upsets causing errors in memory storage content; Single-Event Upsets (SEU) refers to the jump of the potential state of components caused by radiation, "0" becomes "1", or "1" becomes "0", and even causes physical damage to the device. When the memory is affected by radiation and produces a single-event upset effect, causing the data stored in the device to be wrong, it may cause the device to fail, thereby causing the entire system to fail. To ensure the normal operation of the memory and the system, the relevant technology usually calls the backup data for use when an error is detected in the firmware data. However, if the backup data also has errors, then this method will be difficult to avoid the firmware program running away or failing to run. Summary of the invention

[0004] The embodiments of the present application provide a method, device, equipment and readable storage medium for reinforcing and protecting memory firmware, which can at least solve the problem that memory firmware data is easily damaged in an irradiated environment.

[0005] A first aspect of an embodiment of the present application provides a method for reinforcing and protecting memory firmware, comprising: obtaining a first firmware inspection code corresponding to firmware data to be corrected of a loaded target firmware;

[0006] performing error correction processing on the firmware data to be corrected according to the first firmware check code;

[0007] If the first error bit number of the firmware data to be corrected meets the preset data update condition, the first correction data corresponding to the firmware data to be corrected obtained after the error correction process is determined as the target firmware data;

[0008] The target firmware data is updated to the storage area where the target firmware is located and the storage area where the backup data is located.

[0009] A second aspect of an embodiment of the present application provides a memory firmware reinforcement protection device, including: an acquisition module, used to acquire a first firmware inspection code corresponding to firmware data to be corrected of a loaded target firmware;

[0010] An error correction module, used for performing error correction processing on the firmware data to be corrected according to the first firmware check code;

[0011] a determination module, configured to determine first corrected data corresponding to the firmware data to be corrected obtained after error correction processing as target firmware data if the first number of error bits of the firmware data to be corrected meets a preset data update condition;

[0012] The update module is used to update the target firmware data to the storage area where the target firmware is located and the storage area where the backup data is located.

[0013] A third aspect of an embodiment of the present application provides an electronic device, comprising: a memory and a processor, wherein the processor is used to execute a computer program stored in the memory, and when the processor executes the computer program, it implements each step of the memory firmware reinforcement protection method provided in the first aspect of the embodiment of the present application.

[0014] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, each step of the memory firmware reinforcement protection method provided in the first aspect of the embodiment of the present application is implemented.

[0015] As can be seen from the above, according to the memory firmware reinforcement protection method, device, equipment and readable storage medium provided by the present application scheme, the first firmware check code corresponding to the firmware data to be corrected of the loaded target firmware is obtained; the firmware data to be corrected is corrected according to the first firmware check code; if the first error bit number of the firmware data to be corrected meets the preset data update condition, the first correction data corresponding to the firmware data to be corrected obtained after the error correction process is determined as the target firmware data; the target firmware data is updated to the storage area where the target firmware is located and the storage area where the backup data is located. Through the implementation of the present application scheme, a special check code is set to correct abnormal firmware data, and automatic updates are performed in time when the firmware fails, which greatly enhances the protection of the firmware and ensures the stable operation of the memory. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A basic flow chart of a memory firmware reinforcement protection method provided in the first embodiment of the present application;

[0017] Figure 2 A schematic diagram of the structure of a memory provided in the first embodiment of the present application;

[0018] Figure 3 A detailed flowchart of a memory firmware reinforcement protection method provided in the second embodiment of the present application;

[0019] Figure 4 A schematic diagram of a program module of a memory firmware reinforcement protection device provided in a third embodiment of the present application;

[0020] Figure 5 A schematic diagram of the structure of an electronic device provided in the fourth embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0022] In the description of the embodiments of the present application, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the embodiments of the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0023] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0024] In the embodiments of the present application, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral one; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.

[0025] In the related art, non-volatile memories such as eMMC and SSD products usually contain controllers and NAND Flash. The firmware of eMMC, SSD and other memories can usually be stored on NAND Flash. The controller loads the normal firmware program and runs the program to meet the memory function requirements. In an irradiated environment, both the firmware and the backup firmware in NAND Flash may have firmware data errors due to the single particle flip effect, causing the controller firmware program to run away or fail to run, and the memory function to fail. In addition, irradiation may also cause the memory device to latch and a large current to appear, which may damage the NAND Flash and make the firmware completely unable to run.

[0026] In order to solve the problem in the related art that the memory firmware data is easily damaged under the irradiation environment, the first embodiment of the present application provides a memory firmware reinforcement protection method, such as Figure 1 The basic flow diagram of the memory firmware reinforcement protection method provided in this embodiment is as follows. The memory firmware reinforcement protection method includes the following steps:

[0027] Step 101: Obtain a first firmware verification code corresponding to firmware data to be corrected of a loaded target firmware.

[0028] Specifically, Figure 2 As shown, the structure of the memory of this embodiment includes a controller, NAND Flash, ROM and other structures. A target firmware area for storing firmware data can be set in the NAND Flash. The ROM has good SEU immunity. The first firmware check code can be stored independently in the ROM. The code length of the firmware check code can be configured according to the space size of the ROM and the firmware size, thereby determining the threshold parameter corresponding to the strongest error correction capability.

[0029] Step 102: Perform error correction processing on the firmware data to be corrected according to the first firmware check code.

[0030] Specifically, based on an ECC algorithm such as an LDPC error correction algorithm, error correction processing can be performed on the firmware data to be corrected according to the first firmware check code, that is, erroneous bits of the firmware data to be corrected can be identified and corrected, and the corrected data obtained is the new firmware data.

[0031] Step 103: If the first error bit number of the firmware data to be corrected meets a preset data update condition, the first corrected data corresponding to the firmware data to be corrected obtained after the error correction process is determined as the target firmware data.

[0032] Specifically, the first error bit number of the firmware data to be corrected found in the error correction process is counted, and it is determined whether the first error bit number meets the preset data update condition, that is, whether the first error bit number falls into a preset evaluation interval, the lower limit of which is the first error correction capability threshold, and the upper limit is the second error correction capability threshold, which is the maximum error correction capability value. If the first error bit number falls into the preset evaluation interval, it means that the error correction is successful, and the error correction process is necessary, and the generated first correction data is correct and valid, and can be used to make the firmware run normally; if the first error bit number is greater than the second error correction capability threshold, it means that the error correction has failed.

[0033] Step 104: Update the target firmware data to the storage area where the target firmware is located and the storage area where the backup data is located.

[0034] Specifically, the target firmware data obtained after error correction is updated to the storage area where the target firmware is located (ie, the target firmware area) and the backup firmware area, so that the target firmware and the entire memory can operate normally.

[0035] In one implementation of the present embodiment, before the above-mentioned step of obtaining the first firmware verification code corresponding to the firmware data to be corrected of the loaded target firmware, it also includes: after the memory is powered on, obtaining initial firmware data from the storage area where the target firmware is located; wherein the initial firmware data includes the first content data and the first verification code of the target firmware; operating the first content data based on a preset verification algorithm to obtain a first verification parameter; comparing the first verification code and the first verification parameter; if the comparison result is that the first verification code and the first verification parameter are the same, determining the initial firmware data as the target firmware data; if the comparison result is that the first verification code and the first verification parameter are different, determining the initial firmware data as the firmware data to be corrected.

[0036] Specifically, after the memory is powered on, the NAND Flash is initialized, and the initial firmware data is loaded. It can be determined whether the initial firmware data is incorrect. If it is correct, it can continue to be used for firmware operation. If it is incorrect, it can be corrected. The above-mentioned verification algorithm can be a hash algorithm, such as: checksum algorithm, MD5 algorithm, CRC algorithm, etc. The hash algorithm can calculate the first verification parameter corresponding to the first content data, and then the initial firmware data can be judged. It can be understood that in some other implementations, when the initial firmware data cannot be read normally, it can also be determined that the initial firmware data is abnormal firmware data and needs to be corrected.

[0037] In one implementation of the present embodiment, after the above-mentioned step of performing error correction processing on the firmware data to be corrected according to the first firmware check code, it also includes: comparing the first error bit number of the firmware data to be corrected with the first error correction capability threshold; if the first error bit number is less than the first error correction capability threshold, it is determined that the initial firmware data can enable the target firmware to continue to operate normally.

[0038] Specifically, Figure 2 As shown, a backup firmware area for storing backup data is also provided in the NAND Flash. If the first error bit number falls into the preset evaluation interval, that is, the first error bit number is greater than or equal to the first error correction capability threshold and less than or equal to the second error correction capability threshold, it means that there are still relatively many errors in the initial backup data, and the target firmware data with successful error correction needs to be updated to the target firmware area so that the target firmware enters a normal operating state; at the same time, the target firmware data with successful error correction is updated to the storage area where the backup data is located, so that it can be called when the subsequent firmware fails. If the first error bit number is less than the first error correction capability threshold, it means that the error in the initial firmware data does not affect the normal operation of the firmware, that is, the firmware and the backup firmware are still safe and reliable, and it does not matter if the firmware data and the backup data are not updated, thereby saving operating resources. In a specific embodiment, the above-mentioned second error correction capability threshold can be set to N bits (for example, N can be set to 120), and the first error correction capability threshold can be set to M bits, 0≤M<N. Of course, in some other implementations, even if the first error bit number is less than the first error correction capability threshold, the successfully corrected target firmware data can be updated to the target firmware area to fully ensure stable operation of the firmware; this is not limited here.

[0039] Furthermore, in one implementation of the present embodiment, after the above-mentioned step of performing error correction processing on the firmware data to be corrected according to the first firmware check code, it also includes: if the number of first error bits of the firmware data to be corrected is greater than the second error correction capability threshold, obtaining backup data corresponding to the target firmware from the storage area where the backup data of the memory is located; verifying the backup data based on a preset verification algorithm; if the verification result indicates that the backup data is the target firmware data, updating the backup data to the storage area where the target firmware is located.

[0040] Specifically, if the first error bit number of the firmware data to be corrected is greater than the second error correction capability threshold, it means that the error correction has failed and the data obtained by the error correction process is not correct firmware data. The firmware can be made to run normally by calling the correct backup data.

[0041] In one implementation of the present embodiment, the backup data includes second content data and a second verification code of the target firmware; the above-mentioned step of verifying the backup data based on a preset verification algorithm includes: based on the preset verification algorithm, operating the second content data to obtain a second verification parameter; comparing the second verification code and the second verification parameter; if the comparison result is that the second verification code and the second verification parameter are the same, the backup data is confirmed as the target firmware data; if the comparison result is that the second verification code and the second verification parameter are different, the backup data is confirmed as backup data to be corrected.

[0042] Specifically, the above-mentioned verification algorithm can be a hash algorithm, such as: checksum algorithm, MD5 algorithm, CRC algorithm, etc. The hash algorithm can calculate the second verification parameter corresponding to the second content data, and then determine whether the backup data is incorrect; if the backup data is correct, it is determined as the target firmware data and updated to the target firmware area; if the backup data is incorrect, it can be first determined as the backup data to be corrected, so as to perform subsequent error correction processing.

[0043] In one implementation of the present embodiment, after the above-mentioned step of verifying the backup data based on a preset verification algorithm, it also includes: if the verification result indicates that the backup data is backup data to be corrected, obtaining a second firmware verification code corresponding to the backup data to be corrected; performing error correction processing on the backup data to be corrected according to the second firmware verification code; if the second error bit number of the backup data to be corrected meets the preset data update condition, determining the second corrected data corresponding to the backup data to be corrected obtained after the error correction processing as the target firmware data; and updating the target firmware data to the storage area where the target firmware is located.

[0044] Specifically, the second firmware check code may also be stored in the above-mentioned ROM. The above-mentioned error correction process for the backup data to be corrected may also be implemented based on an ECC error correction algorithm such as an LDPC error correction algorithm, which is not limited here. If the second error bit number of the backup data to be corrected meets the preset data update condition, it means that the error correction is successful, and the obtained second correction data corresponding to the backup data to be corrected is correct and valid data, which can be used to enable the firmware to run normally. If the second error bit number of the backup data to be corrected is greater than the second error correction capability threshold, it means that the error correction has failed, the obtained second correction data corresponding to the backup data to be corrected is unavailable, and the memory function fails.

[0045] In one implementation of the present embodiment, after the above-mentioned step of updating the target firmware data to the storage area where the target firmware is located, it also includes: monitoring the real-time current of the memory; when the real-time current is greater than or equal to the preset current, starting the anti-latch protection program of the target firmware to put the memory into a soft reset state or a power-off state.

[0046] Specifically, Figure 2 As shown, a current limiting module is also provided in the structure of the memory, and the current limiting module can monitor the real-time current value of the memory. When a large current appears, the power supply of the NAND Flash can be cut off to prevent overcurrent from damaging the firmware in the NAND Flash. More specifically, in an irradiated environment, during the normal operation of the memory, the current limiting module can be used to monitor the internal current. When the current exceeds a preset current (for example, X, where X can be set to 1.5 times the maximum value of the normal current), the NAND Flash can be protected against latching, and soft reset, power-off and other operations can be performed to eliminate the large current and prevent firmware damage.

[0047] Based on the technical solution of the embodiment of the present application, the first firmware check code corresponding to the firmware data to be corrected of the loaded target firmware is obtained; the firmware data to be corrected is corrected according to the first firmware check code; if the first error bit number of the firmware data to be corrected meets the preset data update condition, that is, if the first error bit number of the firmware data to be corrected is greater than or equal to the first error correction capability threshold and less than or equal to the second error correction capability threshold, the first correction data corresponding to the firmware data to be corrected obtained after the error correction process is determined as the target firmware data; the target firmware data is updated to the storage area where the target firmware is located and the storage area where the backup data is located. Through the implementation of the solution of the present application, the firmware is reinforced by the check code, the ECC error correction protection firmware, and the redundant firmware can be automatically updated in time, the internal current monitoring and anti-latch reinforcement protection are greatly enhanced, and the protection of the firmware is greatly enhanced to ensure the stable operation of the memory.

[0048] Figure 3 The method in is a refined memory firmware reinforcement protection method provided in the second embodiment of the present application, and the memory firmware reinforcement protection method includes:

[0049] Phase 1:

[0050] The memory is powered on, the NAND Flash is initialized, and the initial firmware data is loaded; it is determined whether the initial firmware data is firmware data to be corrected. Specifically, the initial firmware data includes the first content data and the first check code of the target firmware; the first content data is calculated based on a preset check algorithm to obtain a first check parameter; the first check code and the first check parameter are compared; if the comparison result is that the first check code and the first check parameter are the same, the initial firmware data is determined to be the target firmware data; if the comparison result is that the first check code and the first check parameter are different, the initial firmware data is determined to be firmware data to be corrected.

[0051] Phase 2:

[0052] If the initial firmware data is the firmware data to be corrected, then the first firmware check code corresponding to the firmware data to be corrected is obtained; the firmware data to be corrected is corrected according to the first firmware check code; it is determined whether the error correction is successful; if the error correction is successful, the first correction data corresponding to the firmware data to be corrected obtained after the error correction processing is determined as the target firmware data that can enable the normal operation of the firmware; thereby it can be further determined whether it is necessary to update the target firmware data to the storage area where the target firmware is located and the storage area where the backup data is located. That is, it is determined whether the first error bit number of the firmware data to be corrected falls into a preset evaluation interval, the lower limit of the interval of the evaluation interval is the first error correction capability threshold, and the upper limit of the interval is the second error correction capability threshold. If the first error bit number is less than the first error correction capability threshold, it means that even if the firmware data is not corrected and updated, it will not affect the normal operation of the firmware; if the first error bit number falls into the preset evaluation interval, it means that the error correction is successful, and the error correction processing is necessary, and the generated first correction data is correct and valid, and can be used to enable the normal operation of the firmware; if the first error bit number is greater than the second error correction capability threshold, it means that the error correction fails.

[0053] Phase 3:

[0054] If the error correction fails, the backup data corresponding to the target firmware is obtained from the storage area where the backup data of the memory is located; the backup data is verified based on a preset verification algorithm; if the verification is successful, that is, the verification result shows that the backup data is the target firmware data, the backup data is updated to the storage area where the target firmware is located, that is, the memory operates normally after the backup firmware is synchronously replaced with the firmware; if the verification fails, that is, the verification result shows that the backup data is the backup data to be corrected; the second firmware verification code corresponding to the backup data to be corrected is obtained; error correction processing is performed on the backup data to be corrected according to the second firmware verification code; if the second error bit number of the backup data to be corrected meets the preset data update condition, the second corrected data corresponding to the backup data to be corrected obtained after the error correction processing is determined as the target firmware data; and the target firmware data is updated to the storage area where the target firmware is located.

[0055] Phase 4:

[0056] The real-time current of the memory is monitored; when the real-time current is greater than or equal to the preset current, the anti-latch protection program of the target firmware is started to make the memory enter a soft reset state or a power-off state.

[0057] In this embodiment, the redundancy of the memory controller firmware includes the backup redundancy of NAND Flash and the firmware redundancy of the controller ROM inside the memory with ECC error correction. Through the implementation of this embodiment, the firmware on the NAND Flash can be automatically updated in a timely manner when an error occurs, and the real-time current inside the memory can be monitored and anti-latch reinforcement protection can be performed to prevent memory function failure.

[0058] It should be understood that the size of the serial number of each step in this embodiment does not mean the order of execution of the steps. The execution order of each step should be determined by its function and internal logic, and should not constitute a sole limitation on the implementation process of the embodiment of this application.

[0059] Figure 4 A memory firmware reinforcement protection device is provided in the third embodiment of the present application. The memory firmware reinforcement protection device can be applied to the aforementioned memory firmware reinforcement protection method. Figure 4 As shown, the memory firmware reinforcement protection device mainly includes:

[0060] An acquisition module 401 is used to acquire a first firmware inspection code corresponding to the firmware data to be corrected of the loaded target firmware;

[0061] An error correction module 402 is used to perform error correction processing on the firmware data to be corrected according to the first firmware check code;

[0062] The determination module 403 is configured to determine the first corrected data corresponding to the firmware data to be corrected obtained after the error correction process as the target firmware data if the first error bit number of the firmware data to be corrected meets the preset data update condition.

[0063] The updating module 404 is used to update the target firmware data to the storage area where the target firmware is located and the storage area where the backup data is located.

[0064] In some implementations of the present embodiment, the reinforcement protection device also includes a verification module, which is specifically used to: after the memory is powered on, obtain initial firmware data from the storage area where the target firmware is located; wherein the initial firmware data includes first content data and a first verification code of the target firmware; based on a preset verification algorithm, the first content data is operated to obtain a first verification parameter; the first verification code and the first verification parameter are compared; if the comparison result is that the first verification code and the first verification parameter are the same, the initial firmware data is determined as the target firmware data; if the comparison result is that the first verification code and the first verification parameter are different, the initial firmware data is determined as firmware data to be corrected.

[0065] Furthermore, in some implementations of this embodiment, the determination module is also specifically used to: compare the first error bit number of the firmware data to be corrected with the first error correction capability threshold; if the first error bit number is less than the first error correction capability threshold, determine that the initial firmware data can enable the target firmware to continue to operate normally.

[0066] Furthermore, in some implementations of this embodiment, the acquisition module is also specifically used for: if the first error bit number of the firmware data to be corrected is greater than the second error correction capability threshold, then the backup data corresponding to the target firmware is obtained from the storage area where the backup data of the memory is located. The verification module is also specifically used for: verifying the backup data based on a preset verification algorithm. The reinforcement protection device also includes a calling module, and the calling module is specifically used for: if the verification result shows that the backup data is the target firmware data, then updating the backup data to the storage area where the target firmware is located.

[0067] Furthermore, in some implementations of the present embodiment, the backup data includes second content data and a second verification code of the target firmware; accordingly, when the verification module executes the above-mentioned function of verifying the backup data based on the preset verification algorithm, it is specifically used to: based on the preset verification algorithm, operate on the second content data to obtain a second verification parameter; compare the second verification code and the second verification parameter; if the comparison result is that the second verification code and the second verification parameter are the same, the backup data is confirmed as the target firmware data; if the comparison result is that the second verification code and the second verification parameter are different, the backup data is confirmed as backup data to be corrected.

[0068] Further, in some implementations of the present embodiment, after verifying the backup data based on a preset verification algorithm, the acquisition module is also specifically used to: if the verification result shows that the backup data is backup data to be corrected, then obtain the second firmware verification code corresponding to the backup data to be corrected. The error correction module is also specifically used to: perform error correction processing on the backup data to be corrected according to the second firmware verification code. The determination module is also specifically used to: if the second error bit number of the backup data to be corrected meets the preset data update condition, then determine the second corrected data corresponding to the backup data to be corrected obtained after the error correction processing as the target firmware data. The update module is also specifically used to: update the target firmware data to the storage area where the target firmware is located.

[0069] Furthermore, in some implementations of the present embodiment, the reinforcement protection device also includes an anti-latch module, which is used to: monitor the real-time current of the memory after updating the target firmware data to the storage area where the target firmware is located; when the real-time current is greater than or equal to the preset current, start the anti-latch protection program of the target firmware to put the memory into a soft reset state or a power-off state.

[0070] According to the memory firmware reinforcement protection device provided by this embodiment, the first firmware check code corresponding to the firmware data to be corrected of the loaded target firmware is obtained; the firmware data to be corrected is corrected according to the first firmware check code; if the first error bit number of the firmware data to be corrected meets the preset data update condition, the first correction data corresponding to the firmware data to be corrected obtained after the error correction process is determined as the target firmware data; the target firmware data is updated to the storage area where the target firmware is located and the storage area where the backup data is located. Through the implementation of the scheme of this application, a special check code is set to correct the abnormal firmware data, and the firmware is automatically updated in time when an error occurs, which greatly enhances the protection of the firmware and ensures the stable operation of the memory.

[0071] Figure 5 An electronic device is provided in the fourth embodiment of the present application. The electronic device can be used to implement the memory firmware reinforcement protection method in the above-mentioned embodiment, mainly including:

[0072] A memory 501, a processor 502, and a computer program 503 stored in the memory 501 and executable on the processor 502, the memory 501 and the processor 502 are connected via communication. When the processor 502 executes the computer program 503, the method in the first or second embodiment described above is implemented. The number of processors may be one or more.

[0073] The memory 501 may be a high-speed random access memory (RAM) memory, or a non-volatile memory, such as a disk memory. The memory 501 is used to store executable program codes, and the processor 502 is coupled to the memory 501 .

[0074] It is understandable that the memory 501 storing the computer program 503 in this embodiment and the memory storing the target firmware, backup firmware, ROM storing the verification code and other components can be the same memory or different memories. Exemplarily, multiple storage units can be set in the same memory, the target firmware, ROM storing the verification code and backup firmware can be stored in some of the storage units, and the computer program 503 can be stored in another part of the storage units, which is not limited here.

[0075] Furthermore, the embodiment of the present application also provides a computer-readable storage medium, which may be provided in the above-mentioned electronic device. The computer-readable storage medium may be the above-mentioned Figure 5 Memory in the illustrated embodiment.

[0076] The computer readable storage medium stores a computer program, and when the program is executed by the processor, the memory firmware reinforcement protection method in the aforementioned embodiment is implemented. Furthermore, the computer storable medium can also be a U disk, a mobile hard disk, a read-only memory (ROM), a RAM, a magnetic disk or an optical disk, and other media that can store program codes.

[0077] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0078] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0079] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0080] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a readable storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned readable storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0081] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0082] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0083] The above is a description of the memory firmware reinforcement protection method, device, equipment and readable storage medium provided in the present application. For technicians in this field, according to the ideas of the embodiments of the present application, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for strengthening and protecting memory firmware, characterized in that: The reinforcement protection method comprises: Obtaining a first firmware check code corresponding to the firmware data to be corrected of the loaded target firmware; performing error correction processing on the firmware data to be corrected according to the first firmware verification code; If the first number of error bits of the firmware data to be corrected meets a preset data update condition, determining the first corrected data corresponding to the firmware data to be corrected obtained after error correction processing as the target firmware data; The target firmware data is used to update the storage area where the target firmware is located and the storage area where the backup data is located.

2. The memory firmware reinforcement protection method according to claim 1, characterized in that: Before obtaining the first firmware inspection code corresponding to the firmware data to be corrected of the loaded target firmware, the method further includes: After the memory is powered on, initial firmware data is obtained from the storage area where the target firmware is located; wherein the initial firmware data includes first content data and a first check code of the target firmware; Performing operation on the first content data based on a preset verification algorithm to obtain a first verification parameter; Comparing the first verification code with the first verification parameter; If the comparison result is that the first verification code and the first verification parameter are the same, determining the initial firmware data as the target firmware data; If the comparison result is that the first verification code and the first verification parameter are different, the initial firmware data is determined as firmware data to be corrected.

3. The memory firmware reinforcement protection method according to claim 1, characterized in that: After the error correction processing is performed on the firmware data to be corrected according to the first firmware check code, the method further includes: Comparing a first number of error bits of the firmware data to be corrected with a first error correction capability threshold; If the first number of error bits is less than the first error correction capability threshold, it is determined that the initial firmware data can enable the target firmware to continue to run normally.

4. The memory firmware reinforcement protection method according to claim 1, characterized in that: After the error correction processing is performed on the firmware data to be corrected according to the first firmware check code, the method further includes: If the first error bit number of the firmware data to be corrected is greater than the second error correction capability threshold, acquiring the backup data corresponding to the target firmware from the storage area where the backup data of the memory is located; Verifying the backup data based on a preset verification algorithm; If the verification result shows that the backup data is the target firmware data, the backup data is updated to the storage area where the target firmware is located.

5. The memory firmware reinforcement protection method according to claim 4, characterized in that: The backup data includes the second content data and the second verification code of the target firmware; The verifying the backup data based on a preset verification algorithm includes: Based on a preset verification algorithm, the second content data is operated to obtain a second verification parameter; Comparing the second verification code with the second verification parameter; If the comparison result is that the second verification code and the second verification parameter are the same, confirming the backup data as the target firmware data; If the comparison result is that the second verification code and the second verification parameter are different, the backup data is confirmed as backup data to be corrected.

6. The memory firmware reinforcement protection method according to claim 4, characterized in that: After verifying the backup data based on the preset verification algorithm, the method further includes: If the verification result indicates that the backup data is backup data to be corrected, obtaining a second firmware verification code corresponding to the backup data to be corrected; performing error correction processing on the backup data to be corrected according to the second firmware verification code; If the second error bit number of the backup data to be corrected is less than or equal to the second error correction capability threshold, determining the second corrected data corresponding to the backup data to be corrected obtained after error correction processing as the target firmware data; The target firmware data is updated to the storage area where the target firmware is located.

7. The memory firmware reinforcement protection method according to any one of claims 1 to 6, characterized in that: After the target firmware data is updated in the storage area where the target firmware is located, the method further includes: Monitor the real-time current of the memory; When the real-time current is greater than or equal to the preset current, the anti-latch protection program of the target firmware is started to make the memory enter a soft reset state or a power-off state.

8. A memory firmware reinforcement protection device, characterized in that: The reinforcement protection device comprises: An acquisition module, used for acquiring a first firmware check code corresponding to the firmware data to be corrected of the loaded target firmware; an error correction module, configured to perform error correction processing on the firmware data to be corrected according to the first firmware check code; a determination module, configured to determine first corrected data corresponding to the firmware data to be corrected obtained after error correction processing as target firmware data if the first number of error bits of the firmware data to be corrected meets a preset data update condition; The update module is used to update the storage area where the target firmware is located and the storage area where the backup data is located with the target firmware data.

9. An electronic device, characterized in that: The device comprises a memory and a processor, wherein: The processor is used to execute the computer program stored in the memory; When the processor executes the computer program, the steps in the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.