Memory fault automatic recovery system based on double memory banks
The automatic memory fault recovery system with dual storage design solves the problem of automatic detection and rapid recovery of memory faults in embedded systems, achieving data security and system stability while reducing hardware costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA FAW CO LTD
- Filing Date
- 2025-12-08
- Publication Date
- 2026-05-12
AI Technical Summary
Embedded systems lack mechanisms to automatically detect and quickly recover from memory failures during runtime, leading to data loss and system interruptions, which affects the stability and security of fields such as industrial control and automobiles.
An automatic memory fault recovery system based on dual storage is adopted. Fault detection and data synchronization are achieved through main memory sequence, memory self-test unit and data synchronization management unit. Data isolation and backup are performed using dual storage, and data recovery is performed by switching to the backup storage in real time.
It enables real-time detection and rapid recovery of memory faults, reduces system downtime, ensures data security and system stability, and reduces hardware redundancy costs.
Smart Images

Figure CN122019262A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to an automatic memory fault recovery system based on dual memory. Background Technology
[0002] Embedded systems and other computer devices, widely used in industrial control and automotive fields, have very high stability requirements compared to everyday entertainment devices. Memory is an essential component of these computers; however, because memory requires high-speed read, write, and erase operations, it is prone to failure, leading to data loss, bit flipping, and other problems. When these failures occur in embedded systems in industrial control and automotive fields, they can seriously threaten life and property safety. Summary of the Invention
[0003] To address at least one of the aforementioned technical problems, the present invention aims to provide an automatic memory fault recovery system based on dual storage.
[0004] This invention includes an automatic memory fault recovery system based on dual memory modules, the system comprising: Main memory sequence; the main memory sequence includes a first storage bank and a second storage bank, the first storage bank having a first storage partition and a third storage partition, and the second storage bank having a second storage partition; A memory self-test unit; the memory self-test unit is used to perform fault detection on the first storage unit; A data synchronization management unit; the data synchronization management unit is used to synchronize the data between the first storage partition and the second storage partition.
[0005] Furthermore, the data synchronization between the first storage partition and the second storage partition includes: During the system startup phase, all data stored in the first storage partition is copied to the second storage partition; At any time after the system startup phase, when new data is written to the first storage partition, the new data is copied to the second storage partition.
[0006] Further, the copying to the second storage partition includes: The data to be copied is compressed to obtain the first compressed data; Copy the first compressed data to the second storage partition.
[0007] Furthermore, the memory self-test unit is used to determine the faulty physical address when a fault is detected, and send the faulty physical address to the data synchronization management unit; The data synchronization management unit is also used to execute a first read / write state by default, and when the faulty physical address is detected to be located in the first storage partition, it switches to execute a second read / write state; in the first read / write state, the data synchronization management unit responds to external access to perform data read / write on the first storage partition and sets the second storage partition to be inaccessible to the outside world; in the second read / write state, the data synchronization management unit responds to external access to perform data read / write on the second storage partition and sets the first storage partition to be inaccessible to the outside world.
[0008] Furthermore, the switching to the second read / write state includes: Send an error report to the operating system; the error report includes the faulty physical address, and the error report is used to trigger the operating system to execute a high-priority interrupt; The access base address of the operating system is switched from the first storage partition to the second storage partition; Load the fault table; the fault table stores the physical address of the fault, and marks the physical address of the fault as an inaccessible address; End the high-priority interrupt.
[0009] Furthermore, the dual-memory-based automatic memory fault recovery system also includes: Fault address marking unit; the fault address marking unit is used to continuously record the fault physical address.
[0010] Furthermore, the fault address marking unit is a protected non-volatile memory independent of the first memory bank and the second memory bank.
[0011] Furthermore, the capacity of the first storage partition and the capacity of the second storage partition are both equal to a fixed value.
[0012] Furthermore, the capacity of the first storage partition is smaller than the capacity of the third storage partition.
[0013] Furthermore, the data synchronization management unit is also used for: The importance of the data to be written to the first storage bank is checked; When the importance is not greater than the importance threshold, the data to be written to the first storage body is written to the third storage partition; When the importance is greater than the importance threshold, the data volume of the data to be written to the first storage bank is checked; When the amount of data is not greater than the available capacity of the first storage partition, the data to be written to the first storage body is written to the first storage partition. When the amount of data exceeds the available capacity of the first storage partition, the data to be written to the first storage body and the data already stored in the first storage partition are compressed to obtain the second compressed data. The second compressed data is copied to the second storage partition, and the data to be written to the first storage body is written to the third storage partition.
[0014] The beneficial effects of this invention are as follows: The memory fault automatic recovery system based on dual storage in the embodiments, by setting a first storage partition and a second storage partition located in different storage banks, and using a data synchronization management unit to synchronize the data between the first storage partition and the second storage partition, can use the first storage partition as the active storage bank and the second storage partition as the backup storage bank, thereby achieving physically isolated backup of important critical data and ensuring data security; since the data synchronization performed by the data synchronization management unit is performed in real time, data synchronization can be achieved during system operation, improving the coverage of data protection; since the first storage bank includes not only the first storage partition but also a third storage partition, a partial mirror backup of the first storage bank is achieved, which is beneficial for saving hardware redundancy and reducing hardware costs compared with full memory mirror backup; by setting a memory self-test unit, when a fault is detected in the first storage bank, the second storage partition can be replaced with the first storage partition in a timely manner, thereby enabling the backup data without restarting the system, which is beneficial for ensuring the continuous normal operation of the system, thus meeting the continuous operation requirements of industrial control, transportation and other environments, ensuring safety, and improving user experience. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the automatic memory fault recovery system based on dual storage in the embodiment. Figure 2 This is a schematic diagram of steps S1-S2 executed by the memory fault automatic recovery system based on dual storage in the embodiment; Figure 3 This is a schematic diagram illustrating the principle of executing steps S1-S2 in the embodiment; Figure 4 This is a schematic diagram of steps S1-S4 executed by the memory fault automatic recovery system based on dual storage in the embodiment; Figure 5 This is a schematic diagram of the first read / write state in the embodiment; Figure 6 This is a schematic diagram of the second read / write state in the embodiment; Figure 7 This is a schematic diagram of the fault address marking unit in the embodiment; Figure 8This is a schematic diagram of steps S5-S10 executed by the memory fault automatic recovery system based on dual storage in the embodiment; Figure 9 This is a schematic diagram illustrating the principle of executing steps S9-S10 in the embodiment. Detailed Implementation
[0016] Current embedded systems' mechanisms for handling physical memory faults and their limitations mainly include: (1) There is no dedicated fault tolerance mechanism. In cost-sensitive devices, memory without ECC or redundancy protection is usually used. This method has low reliability. When a memory failure occurs, the entire system can only be hard-rebooted directly through the watchdog timer, which will cause business interruption.
[0017] (2) ECC-based error correction mechanism: ECC function is integrated in some MCUs and SoCs to protect cache and specific memory. This method can only detect and tolerate errors, but cannot recover from memory errors. For specific memory anomalies, the only solution is a hard reboot, and it cannot deal with the problem of permanent damage to physical units. (3) The memory protection unit mechanism uses the MPU unit to isolate the memory spaces of different tasks. When a task crashes due to a memory error, the operating system can terminate only the erroneous task, thus avoiding impacting the entire system. However, this method only isolates the scope of the fault and does not fix the memory fault itself. (4) One-time memory detection mechanism: A one-time memory check is performed when the system is powered on to mark bad blocks. This method can only detect permanent memory faults that exist at startup, but cannot deal with dynamic faults that occur during system operation, and lacks runtime recovery capabilities.
[0018] In summary, there is currently a lack of a mechanism in embedded systems that can automatically detect memory faults at runtime and recover quickly. This mechanism should be used to ensure minimal impact on business operations and guarantee automatic operation without manual intervention.
[0019] Based on the above principles, this embodiment provides an automatic memory fault recovery system based on dual storage. (Refer to...) Figure 1 The automatic memory fault recovery system based on dual storage includes components such as main memory sequence, memory self-test unit and data synchronization management unit, which can be specific computer hardware.
[0020] Reference Figure 1The main memory sequence comprises a first storage bank and a second storage bank, meaning it is a dual-storage design. The first storage bank has a first storage partition, Bank-A, and a third storage partition. Bank-A is a portion of the total available storage space in the first storage bank. The second storage bank has a second storage partition, Bank-B. Bank-B can either be the entire available storage space of the second storage bank, or it can be a portion of it. That is, the second storage bank can either consist solely of Bank-B (essentially dedicated to providing data synchronization and recovery support for the first storage bank), or it can include other storage partitions besides Bank-B.
[0021] In this embodiment, the first storage partition Bank-A, the second storage partition Bank-B, and the third storage partition can refer to either physical partitions in the first and second storage banks or logical partitions in the first and second storage banks. Regardless of the method, it does not affect the implementation of this embodiment.
[0022] In this embodiment, the position of the first storage partition Bank-A in the first storage bank can be represented by the offset position of the first storage partition Bank-A. This offset position can be fixed, that is, the first storage partition Bank-A is a specific partition in the first storage bank whose position remains unchanged. Similarly, the position of the second storage partition Bank-B in the second storage bank can be represented by the offset position of the second storage partition Bank-B.
[0023] In this embodiment, the capacity of the first storage partition Bank-A and the second storage partition Bank-B can be set to be the same, both equal to a fixed value. This fixed value can be set according to factors such as business needs, for example, it can be set to 100MB.
[0024] In this embodiment, since the first storage partition Bank-A and the second storage partition Bank-B belong to the first storage bank and the second storage bank respectively, and the first storage bank and the second storage bank are independent storage devices, the first storage partition Bank-A and the second storage partition Bank-B are physically isolated. Two storage devices with the same manufacturing process and specifications can be used as the first storage bank and the second storage bank respectively, so that the first storage partition Bank-A and the second storage partition Bank-B have the same specifications.
[0025] In this embodiment, the capacity of the first storage partition Bank-A can be set to be smaller than the capacity of the third storage partition. For example, if the total capacity of the first storage unit is 1GB, the capacity of the first storage partition Bank-A can be set to 100MB. In this way, the capacity of the first storage partition Bank-A only occupies a small portion of the first storage unit, while the third storage partition, which occupies most of the capacity of the first storage unit, can be used to perform other tasks.
[0026] In this embodiment, Figure 1 The dual-memory-based automatic memory fault recovery system shown can, as Figure 2 As shown, perform the following steps: S1. Perform fault detection on the first memory bank; S2. Perform data synchronization between the first storage partition and the second storage partition.
[0027] Step S1 is executed by the memory self-test unit. The memory self-test unit can be integrated within the memory controller of the first memory bank or be a separate piece of hardware logic. The memory self-test unit can periodically or on demand test the first memory bank. Specifically, the memory self-test unit can use technologies such as ECC (Error Checking and Correcting) to test the first memory bank and thus identify faulty areas within it. If the memory self-test unit does not detect a faulty area, it may not return a result. If the memory self-test unit detects a faulty area in the first memory bank, it can return the physical address of the faulty area (or its logical address within the first memory bank), i.e., the faulty physical address, and send this faulty physical address to the data synchronization management unit.
[0028] Step S2 is executed by the data synchronization management unit. Specifically, when executing step S2, which is the data synchronization step between the first storage partition and the second storage partition, the data synchronization management unit may perform the following steps: S201. During the system startup phase, copy all data stored in the first storage partition to the second storage partition; S202. At any time after the system startup phase, when new data is written to the first storage partition, copy the new data to the second storage partition.
[0029] In step S201, when the dual-storage-based memory fault automatic recovery system is powered on and other operations are performed, and the system startup phase is determined, the data synchronization management unit reads all the data from the first storage partition Bank-A and writes the data to the second storage partition Bank-B.
[0030] In step S202, after the system startup phase, the data synchronization management unit monitors whether new data has been written to the first storage partition Bank-A. If so, it synchronously writes the new data written to the first storage partition Bank-A to the second storage partition Bank-B.
[0031] By executing steps S201-S202, data synchronization between the first storage partition Bank-A and the second storage partition Bank-B can be achieved at any time, realizing real-time data synchronization during system operation.
[0032] Specifically, when the data synchronization management unit executes steps S201-S202, copying the data to be copied (including all data stored in the first storage partition Bank-A, or new data just written to the first storage partition Bank-A) to the second storage partition Bank-B, it can either directly write the data to be copied to the second storage partition Bank-B, or... Figure 3 As shown, the data to be copied is compressed to obtain the first compressed data, and then the first compressed data is written to the second storage partition Bank-B.
[0033] Generally, if the data to be copied is uncompressed data generated by business processes, the amount of the first compressed data obtained by compressing it will be less than the amount of data to be copied. Thus, even if the capacity of the second storage partition Bank-B is the same as that of the first storage partition Bank-A, the second storage partition Bank-B can store more data, providing more ample backup space for the first storage partition Bank-A. Since the second storage partition Bank-B serves as a backup for the first storage partition Bank-A, storing the compressed first data, it can be decompressed when needed to restore the original data, without affecting the use of the first storage partition Bank-A as the currently active storage.
[0034] In this embodiment, Figure 1 The dual-memory-based automatic memory fault recovery system shown can also be as follows: Figure 4 As shown, perform the following steps: S3. When a fault is detected, determine the physical address of the fault; S4. By default, the first read / write state is executed. When a faulty physical address is detected to be within the first storage partition, the second read / write state is switched to be executed.
[0035] Step S3 is performed by the memory self-test unit. The memory self-test unit sends the detected faulty physical address to the data synchronization management unit.
[0036] Step S4 is executed by the data synchronization management unit. The data synchronization management unit defaults to executing the first read / write state. The principle of the first read / write state is as follows: Figure 5 As shown, refer to Figure 5 In the first read / write state, if external hardware or software such as the operating system needs to access the main memory sequence, the operating system can request the data synchronization management unit to access it (including reading and writing data). In response to the external access, the data synchronization management unit performs data reading and writing on the first storage partition Bank-A. For the operating system, the second storage partition Bank-B is inaccessible (invisible).
[0037] In step S4, the data synchronization management unit determines which partition in the first storage bank the faulty physical address specifically maps to. If it maps to a partition outside the first storage partition Bank-A, for example, to the third storage partition, meaning there is no fault in the first storage partition Bank-A, and the data stored in the first storage partition Bank-A faces little or no risk of loss, then... Figure 5 As shown, the data synchronization management unit maintains the first read / write state.
[0038] If the data synchronization management unit determines that the faulty physical address is mapped to the first storage partition Bank-A, meaning there is a fault in the first storage partition Bank-A, and the data stored in the first storage partition Bank-A is at high risk of loss or has already been lost, the data synchronization management unit switches to... Figure 6 The second read / write state is shown.
[0039] Reference Figure 6 The second read / write state is the opposite of the first read / write state. In the second read / write state, if external hardware or software such as the operating system needs to access the main memory sequence, the operating system can request the data synchronization management unit to access it (including reading and writing data). In response to the external access, the data synchronization management unit performs data read and write on the second storage partition Bank-B. For the operating system, the first storage partition Bank-A is inaccessible (invisible).
[0040] In this embodiment, when the data synchronization management unit executes step S4, that is, the step of switching to the second read / write state, it can specifically perform the following steps: S401. Send an error report to the operating system; S402. Switch the operating system's access base address from the first storage partition to the second storage partition; S403. Load the fault table; S404. End high-priority interrupt.
[0041] In step S401, while still in the first read / write state, the data synchronization management unit sends an error report to the operating system. The error report includes the faulty physical address detected by the memory self-test unit in the first storage partition Bank-A, thereby triggering the operating system to execute a high-priority interrupt. This high-priority interrupt can have the highest priority, enabling all tasks executed by the memory fault automatic recovery system to be suspended, thus ensuring that the data in the first and second storage banks is not modified during the switch.
[0042] In step S402, the data synchronization management unit switches the operating system's access base address from the first storage partition to the second storage partition, so that when the operating system accesses the second storage partition Bank-B again, it will read and write to the second storage partition, thus switching from the first read-write state to the second read-write state.
[0043] In step S403, the data synchronization management unit loads the fault table of the stored faulty physical address, marks the faulty physical address as an inaccessible address, thereby identifying the portion of the faulty physical address mapped in the first storage partition Bank-A as a bad block and avoiding access to the bad block.
[0044] In step S404, the high-priority interrupt is terminated, the system resumes operation, and all subsequent external accesses point to the second storage partition Bank-B.
[0045] By executing steps S401-S404, the following can be achieved: Figure 5 The first read / write state shown has switched to Figure 6 The second read / write state is shown.
[0046] In this embodiment, as Figure 7 As shown, a protected non-volatile memory bank can also be set as a fault address marking unit to continuously record the fault physical address detected by the memory self-test unit. This protected non-volatile memory bank is independent of the first and second memory banks, thus effectively saving the fault physical address and providing data support for subsequent fault diagnosis.
[0047] In this embodiment, Figure 1 The dual-memory-based automatic memory fault recovery system shown can also be as follows: Figure 8 As shown, perform the following steps: S5. Perform importance detection on the data to be written to the first memory bank; S6. When the importance is not greater than the importance threshold, the data to be written to the first storage body is written to the third storage partition; S7. When the importance is greater than the importance threshold, perform a data volume check on the data to be written to the first storage bank; S8. When the amount of data is not greater than the available capacity of the first storage partition, the data to be written to the first storage body is written to the first storage partition; S9. When the amount of data exceeds the available capacity of the first storage partition, the data to be written to the first storage body and the data already stored in the first storage partition are compressed to obtain the second compressed data; S10. Copy the second compressed data to the second storage partition, and write the data to be written to the first storage body to the third storage partition.
[0048] Steps S5-S10 are executed by the data synchronization management unit. The data synchronization management unit can receive access from external sources such as the operating system, obtain data to be written to the first storage unit from external input, and thus trigger the execution of steps S5-S10.
[0049] In step S5, the data synchronization management unit can determine the importance of the data to be written to the first storage unit based on its type (e.g., algorithm code data, or data detected by sensors), source (e.g., which application it originates from), and function (e.g., underlying support data, or intermediate data generated by the application). If the importance of the data to be written to the first storage unit is detected to be greater than a preset importance threshold, then the data to be written to the first storage unit is determined to be important data (critical data); otherwise, the data to be written to the first storage unit is determined to be general data.
[0050] In step S6, the third storage partition in the first storage bank is designated as the general data area, and correspondingly, the first storage partition Bank-A is designated as the critical data area. If the importance is not greater than the importance threshold, i.e., the data to be written to the first storage bank is general data, then the data to be written to the first storage bank is directly written to the third storage partition. In this way, there is no need to occupy the space of the first storage partition Bank-A, which is the critical data area.
[0051] If the importance is not greater than the importance threshold, meaning the data to be written to the first storage unit is important data (critical data), then the data synchronization management unit proceeds to step S7 to detect the data volume of the data to be written to the first storage unit and determine whether the data volume of the data to be written to the first storage unit is greater than the available capacity of the first storage partition Bank-A (i.e., the difference between the total capacity of the first storage partition Bank-A and the amount of data currently stored in the first storage partition Bank-A). If the data volume of the data to be written to the first storage unit is less than the available capacity of the first storage partition Bank-A, meaning that the first storage partition Bank-A has already stored some data and can still store the newly written data, the data synchronization management unit proceeds to step S8 to write the newly written data to the first storage unit into the first storage partition Bank-A, thereby achieving the storage of important data (critical data). At the same time, the data synchronization management unit also proceeds to step S2 to synchronize the data between the first storage partition Bank-A and the second storage partition Bank-B, so that the data newly written to the first storage partition Bank-A is also copied to the second storage partition Bank-B.
[0052] If the amount of data to be written to the first storage bank exceeds the available capacity of the first storage partition Bank-A, that is, if the first storage partition Bank-A already has some data stored and cannot store the new data to be written to the first storage bank, the data synchronization management unit can choose to execute steps S9-S10 since the data stored in the first storage partition Bank-A itself is also important data (critical data).
[0053] The principle of steps S9-S10 is as follows: Figure 9 As shown. (Refer to...) Figure 9 The data synchronization management unit stores the newly written data from the first storage bank to the third storage partition, and combines the newly written data with the data already stored in the first storage partition Bank-A to form a... Figure 9 The data corresponding to the shaded portion in the first storage block is compressed by the data synchronization management unit to obtain a smaller amount of compressed data, which is then written to the second storage partition Bank-B. Because the second compressed data is smaller, it can be completely written to the second storage partition Bank-B.
[0054] In this embodiment, the principle of executing steps S5-S10 is as follows: By executing steps S5-S10, the storage partitions of the first storage body are divided, that is, the first storage partition Bank-A is used as the critical data area and the third storage partition is used as the general data area. This realizes the classified storage and management of data of different importance, which is conducive to ensuring data storage security. Moreover, when the newly written data to the first storage body is important data (critical data), and it is not possible to store this newly written data without modifying the data already stored in the first storage partition Bank-A, the storage of this important data (critical data) in the first storage body is realized by storing this newly written important data (critical data) in the third storage partition. On the other hand, by compressing the data to obtain the second compressed data, it can be synchronized to the second storage partition Bank-B in the second storage body, thereby realizing a complete backup of this important data (critical data), which is conducive to ensuring data storage security.
[0055] Taking the EPS (Electronic Power Steering) system controller used in automobiles as an example, the steps S1-S4 are explained.
[0056] The function of the EPS controller is to calculate and drive the motor to generate appropriate power assist based on the steering wheel torque signal and vehicle speed. Core data such as the power assist mapping data table, torque sensor data, and motor target current are strongly correlated with the algorithm code and controller safety. If a memory error such as a bit flip occurs, it can lead to calculation errors. Traditional solutions require system reset and restart, which would seriously affect driving safety. Therefore, the memory fault automatic recovery system based on dual memory banks described in this embodiment can be applied to the EPS controller.
[0057] Suppose that the EPS controller encounters an error while reading the power assist mapping data table, specifically a multi-bit error. The dual-memory-based automatic memory fault recovery system in the EPS controller can then perform the following steps: Step 1: Fault monitoring and reporting: At this time, when the memory self-test unit inside the EPS controller accesses the power mapping data table, it detects an uncorrectable multi-bit error. The self-test unit will immediately report to the operating system that an uncorrectable memory error has occurred at address 0x8000FF00. Step 2: Fault Confirmation Marking: The operating system identifies address 0x8000FF00 as Bank-A region of the help mapping data table. At this point, the operating system immediately writes the fault address into the fault address marking unit, and will permanently reclaim this erroneous address thereafter. Step 3: System Switching Preparation: The operating system triggers a non-maskable interrupt, pausing all tasks at that time, and the system enters an idle state; Step 4: Memory Switching Execution: Switch the access address of critical data such as the help mapping data table from Bank-A to Bank-B; at the same time, ensure that the memory controller is aware of the faulty address and will not cause accidental access; Step 5: System Resumption of Execution: After the switch is complete, the system recovers the context from the interrupt and returns to the normal task state. The task will read data from Bank-B and continue safe computation.
[0058] The memory fault automatic recovery system based on dual storage in this embodiment monitors memory faults by periodically running memory self-tests, marks faulty memory blocks, and performs real-time memory bank switching through AB Bank, thereby achieving effective improvements in the following four aspects and producing beneficial effects: (1) Runtime dynamic fault detection: Traditional solutions perform memory detection at startup, which can only identify and handle permanent faults during the system initialization phase. They lack an effective real-time monitoring and response mechanism for dynamic memory faults that occur during long-term system operation. However, the memory fault automatic recovery system based on dual storage in this embodiment realizes real-time detection, location and automatic recovery of dynamic memory faults during operation, which effectively improves system security.
[0059] (2) Error recovery mechanism: Common solutions such as ECC monitoring can detect and correct single-bit errors, but when encountering multi-bit errors or deterministic hardware failures, they can usually only report the error and cannot process it. The memory fault automatic recovery system based on dual memory in this embodiment implements a memory recovery mechanism, effectively filling the gap in error recovery.
[0060] (3) Real-time requirements of business operations: The most common fault recovery mechanism currently used is system restart. This method will cause a complete interruption of application services, and the hard restart time is usually more than 150ms, which will cause great problems to system services in high real-time systems. The memory fault automatic recovery system based on dual storage in this embodiment further reduces the recovery time, avoids hard reset time, realizes application-level business continuity, and effectively improves system availability.
[0061] (4) Memory resource usage: The existing full memory hardware mirroring technology requires 100% hardware memory redundancy, which is costly. The memory fault automatic recovery system based on dual storage in this embodiment distinguishes between core data code and general data code, provides key technology protection for the core part, and achieves core protection function with a very small amount of memory redundancy, thereby reducing costs.
[0062] In summary, the dual-storage-based automatic memory fault recovery system in this embodiment uses a dual-storage system to perform AB Bank backup of critical memory data; compared to no protection or using only ECC, it provides a hardware recovery mechanism; compared to full memory mirroring, it saves redundant hardware memory and significantly reduces hardware costs. This dual-storage-based automatic memory fault recovery system provides a fast recovery mechanism by using an interrupt to enter an idle and silent state before hardware switching, ensuring data consistency, while avoiding system reset, reducing system downtime, and effectively ensuring lossless system recovery operations.
[0063] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. Furthermore, the descriptions of "upper," "lower," "left," and "right" used in this disclosure are only relative to the relative positional relationships of the components of this disclosure in the accompanying drawings. The singular forms "a," "an," and "the" used in this disclosure are also intended to include the plural forms, unless the context clearly indicates otherwise. Moreover, unless otherwise defined, all technical and scientific terms used in this embodiment have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this embodiment specification is only for describing particular embodiments and is not intended to limit the invention. The term "and / or" as used in this embodiment includes any combination of one or more of the associated listed items.
[0064] It should be understood that although the terms first, second, third, etc., may be used to describe various elements in this disclosure, these elements should not be limited to these terms. These terms are only used to distinguish elements of the same type from each other. For example, a first element may also be referred to as a second element without departing from the scope of this disclosure, and similarly, a second element may also be referred to as a first element. The use of any and all instances or exemplary language (“e.g.,” “such as,” etc.) provided in this embodiment is intended only to better illustrate embodiments of the invention and, unless otherwise required, does not impose a limitation on the scope of the invention.
[0065] It should be recognized that embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can be implemented using standard programming techniques—including a non-transitory computer-readable storage medium configured with a computer program, wherein such a storage medium causes the computer to operate in a specific and predefined manner—according to the methods and drawings described in the specific embodiments. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if desired, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit (ASIC).
[0066] Furthermore, the procedures described in this embodiment can be performed in any suitable order unless otherwise indicated by this embodiment or otherwise obviously contradict the context. The procedures (or variations and / or combinations thereof) described in this embodiment can be executed under the control of one or more computer systems configured with executable instructions, and can be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. A computer program includes a plurality of instructions executable by one or more processors.
[0067] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices, etc. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention of this embodiment includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps above in conjunction with a microprocessor or other data processor. When programmed according to the methods and techniques of the invention, the invention also includes the computer itself.
[0068] A computer program can be applied to input data to perform the functions of this embodiment, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects generated on the display.
[0069] The above are merely preferred embodiments of the present invention. The present invention is not limited to the above-described embodiments. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention, as long as they achieve the technical effects of the present invention by the same means, should be included within the scope of protection of the present invention. Within the scope of protection of the present invention, the technical solutions and / or implementation methods can have various modifications and variations.
Claims
1. A memory fault automatic recovery system based on dual storage, characterized in that, The automatic memory fault recovery system based on dual memory banks includes: Main memory sequence; the main memory sequence includes a first storage bank and a second storage bank, the first storage bank having a first storage partition and a third storage partition, and the second storage bank having a second storage partition; A memory self-test unit; the memory self-test unit is used to perform fault detection on the first storage unit; A data synchronization management unit; the data synchronization management unit is used to synchronize the data between the first storage partition and the second storage partition.
2. The automatic memory fault recovery system based on dual storage as described in claim 1, characterized in that, The process of synchronizing data between the first storage partition and the second storage partition includes: During the system startup phase, all data stored in the first storage partition is copied to the second storage partition; At any time after the system startup phase, when new data is written to the first storage partition, the new data is copied to the second storage partition.
3. The automatic memory fault recovery system based on dual storage as described in claim 2, characterized in that, The copying to the second storage partition includes: The data to be copied is compressed to obtain the first compressed data; Copy the first compressed data to the second storage partition.
4. The automatic memory fault recovery system based on dual memory as described in any one of claims 1-3, characterized in that: The memory self-test unit is used to determine the physical address of the fault when a fault is detected, and send the physical address of the fault to the data synchronization management unit. The data synchronization management unit is also used to execute a first read / write state by default, and when the faulty physical address is detected to be located in the first storage partition, it switches to execute a second read / write state; in the first read / write state, the data synchronization management unit responds to external access to perform data read / write on the first storage partition and sets the second storage partition to be inaccessible to the outside world; in the second read / write state, the data synchronization management unit responds to external access to perform data read / write on the second storage partition and sets the first storage partition to be inaccessible to the outside world.
5. The automatic memory fault recovery system based on dual storage as described in claim 4, characterized in that, The switching to the second read / write state includes: Send an error report to the operating system; the error report includes the faulty physical address, and the error report is used to trigger the operating system to execute a high-priority interrupt; The access base address of the operating system is switched from the first storage partition to the second storage partition; Load the fault table; the fault table stores the physical address of the fault, and marks the physical address of the fault as an inaccessible address; End the high-priority interrupt.
6. The automatic memory fault recovery system based on dual storage as described in claim 5, characterized in that, The automatic memory fault recovery system based on dual memory banks also includes: Fault address marking unit; the fault address marking unit is used to continuously record the physical address of the fault.
7. The automatic memory fault recovery system based on dual storage as described in claim 6, characterized in that, The fault address marking unit is a protected non-volatile memory independent of the first memory bank and the second memory bank.
8. The automatic memory fault recovery system based on dual storage as described in claim 1, characterized in that: The capacity of the first storage partition and the capacity of the second storage partition are both equal to a fixed value.
9. The automatic memory fault recovery system based on dual storage as described in claim 1, characterized in that: The capacity of the first storage partition is smaller than the capacity of the third storage partition.
10. The automatic memory fault recovery system based on dual storage as described in claim 1, characterized in that, The data synchronization management unit is also used for: The importance of the data to be written to the first storage bank is checked; When the importance is not greater than the importance threshold, the data to be written to the first storage body is written to the third storage partition; When the importance is greater than the importance threshold, the data volume of the data to be written to the first storage bank is checked; When the amount of data is not greater than the available capacity of the first storage partition, the data to be written to the first storage body is written to the first storage partition. When the amount of data exceeds the available capacity of the first storage partition, the data to be written to the first storage body and the data already stored in the first storage partition are compressed to obtain the second compressed data. The second compressed data is copied to the second storage partition, and the data to be written to the first storage body is written to the third storage partition.