Adaptive memory protection method and device for dynamically adjusting three-mode redundancy voting frequency

By dynamically adjusting the voting frequency of the triple redundancy memory protection scheme based on system load and error rate, the performance overhead problem of traditional schemes is solved, achieving high reliability, low power consumption, and high efficiency memory protection.

CN121455701BActive Publication Date: 2026-06-30KYLIN CORP
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
KYLIN CORP
Filing Date
2026-01-07
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Traditional triple redundancy memory protection schemes have a fixed voting operation frequency, which leads to performance bottlenecks under high load and resource waste under low load and low error rate, and lacks the ability to dynamically optimize according to the actual operating conditions of the system.

Method used

By monitoring system load rate and historical error rate, the voting frequency strategy of triple redundancy is dynamically adjusted, including high frequency mode and low frequency mode. The voting frequency is increased when the load is high or the error rate is high, and the voting frequency is decreased when the load is low and the error rate is low, and real-time or delayed voting methods are adopted.

Benefits of technology

It achieves the goal of optimizing system performance and reducing power consumption while ensuring memory reliability, thereby increasing system throughput and response speed and improving resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121455701B_ABST
    Figure CN121455701B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of computer technology and proposes an adaptive memory protection method and apparatus for dynamically adjusting the voting frequency of triple modular redundancy (TMR). It involves creating and initializing a management structure for critical data, which includes three data copy pointers to manage three copies of the critical data. The method monitors system status parameters related to the critical data in real time or periodically, including system load rate and the historical error rate of data inconsistencies in historical voting. Based on the monitored system status parameters, it dynamically adjusts the voting frequency strategy for performing a two-out-of-three voting operation on the three data copies. Following the voting frequency strategy, it performs the corresponding two-out-of-three voting operation on the three data copies. This invention can dynamically adjust the voting frequency of TMR based on system load and historical error rate, thereby significantly optimizing system performance and reducing power consumption while ensuring memory reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer technology, specifically relating to an adaptive memory protection method and apparatus for dynamically adjusting the voting frequency of triple redundancy. Background Technology

[0002] In mission-critical computing fields such as aerospace, industrial control, and financial transactions, the reliability of computer system memory is of paramount importance. Factors such as cosmic rays and electromagnetic interference can cause soft errors in memory cells, leading to system crashes or data corruption.

[0003] Triple modular redundancy (TMR) is a classic fault-tolerance technique that stores data in three independent memory locations and uses a "two-out-of-three" voting mechanism to correct errors during reads. However, traditional TMR schemes have significant drawbacks when applied to memory reliability protection: their voting operations are typically static and periodic, or triggered with every memory access. This fixed-frequency voting method incurs substantial performance overhead and power consumption because it cannot differentiate between the actual operating states of the system. Under high load, frequent voting exacerbates system performance bottlenecks; while under low load and during periods of low memory error rate, continuous high-frequency voting is an unnecessary waste of resources.

[0004] While existing technologies employ triple redundancy storage and voting principles to improve memory reliability, they do not address the inherent performance overhead issues and lack the ability to dynamically optimize based on the actual operating conditions of the system. Summary of the Invention

[0005] The purpose of this invention is to provide an adaptive memory protection method and apparatus for dynamically adjusting the voting frequency of triple redundancy, which can dynamically adjust the voting frequency of triple redundancy according to system load and historical error rate, thereby significantly optimizing system performance and reducing power consumption while ensuring memory reliability.

[0006] To achieve the above objectives, the technical solution of the present invention is as follows:

[0007] An adaptive memory protection method for dynamically adjusting the voting frequency of triple modulo redundancy includes:

[0008] S1. Create and initialize a management structure for the critical data that needs to be protected. The management structure includes three data copy pointers for managing the three data copies of the critical data.

[0009] S2. Monitor system status parameters related to the key data in real time or periodically. The system status parameters include: system load rate and the historical error rate of data inconsistency in historical voting of the management structure.

[0010] S3. Based on the monitored system status parameters, dynamically adjust the voting frequency strategy for performing a two-out-of-three voting operation on the three data replicas;

[0011] S4. Perform the corresponding two-out-of-three voting operation on the three data copies according to the voting frequency strategy.

[0012] Furthermore, the management structure described in step S1 is implemented as a module of the Linux kernel, which intercepts access to protected memory by hooking system calls or page fault handlers.

[0013] Furthermore, the management structure described in step S1 also includes an error counter to record the number of historical errors in which the management structure has experienced data inconsistencies during historical voting.

[0014] Furthermore, the historical error rate mentioned in step S2 is obtained by statistically analyzing the data from the error counter within a unit of time.

[0015] Furthermore, the system load rate mentioned in step S2 is identified by a system load status identifier set in the management structure.

[0016] Furthermore, the voting frequency strategy described in step S3 is identified by a current voting frequency strategy identifier set by the management structure.

[0017] Furthermore, the dynamic adjustment described in step S3 specifically includes:

[0018] When the system load rate is higher than the first threshold and / or the historical error rate is higher than the second threshold, the voting frequency strategy will be adjusted to high frequency mode.

[0019] When the system load rate is detected to be below the third threshold and the historical error rate is below the fourth threshold, the voting frequency strategy will be adjusted to a low-frequency mode.

[0020] Preferably, the high-frequency mode includes:

[0021] Write operations are subject to real-time voting, while read operations are subject to real-time or periodic voting.

[0022] Preferably, the low-frequency mode includes:

[0023] Write operations are subject to delayed batch voting, while read operations are subject to periodic background voting based on a timer.

[0024] In another aspect, the present invention proposes an adaptive memory protection device for dynamically adjusting the voting frequency of triple modulo redundancy, comprising:

[0025] Structure module: Creates and initializes a management structure for the critical data that needs to be protected. The management structure includes three data copy pointers for managing three data copies of the critical data.

[0026] Monitoring module: Monitors system status parameters related to the key data in real time or periodically. The system status parameters include: system load rate and the historical error rate of data inconsistency in historical voting of the management structure.

[0027] Strategy module: Based on the monitored system status parameters, dynamically adjust the voting frequency strategy for performing a two-out-of-three voting operation on the three data replicas;

[0028] Execution module: Performs the corresponding two-out-of-three voting operation on the three data copies according to the voting frequency strategy.

[0029] Compared with existing technologies, this invention achieves adaptive memory protection by dynamically adjusting the triple redundancy voting frequency based on system load and historical error rate, thus solving the inherent performance overhead problem and the lack of dynamic optimization capability based on the actual operating conditions of the system.

[0030] 1. This invention achieves intelligent self-adaptation: it upgrades the three-mode redundancy from a static, one-size-fits-all solution to a dynamic solution that intelligently senses the system state, thus achieving the best balance between reliability, performance and power consumption.

[0031] 2. This invention has significant performance improvements: During safe periods with low system load and low error rate, by reducing the voting frequency, redundant calculations and memory accesses are greatly reduced, thereby improving the overall system throughput and response speed.

[0032] 3. This invention has high reliability assurance: when the system faces high load pressure or frequent memory errors, it can automatically upgrade to the highest security level to ensure the integrity of critical data.

[0033] 4. The invention has high resource utilization efficiency: It avoids unnecessary performance and power consumption overhead during safe periods, enabling triple redundancy technology to be applied more economically to cost-sensitive scenarios. Attached Figure Description

[0034] Figure 1 This is a flowchart illustrating Embodiment 1 of the present invention;

[0035] Figure 2 This is a schematic diagram of the management structure of Embodiment 1 of the present invention;

[0036] Figure 3 This is a schematic diagram of the voting process in Embodiment 1 of the present invention;

[0037] Figure 4This is a flowchart illustrating the application process of Embodiment 2 of the present invention;

[0038] Figure 5 This is a flowchart of the strategy decision-making process in Embodiment 2 of the present invention;

[0039] Figure 6 This is a schematic diagram of the system structure of Embodiment 3 of the present invention. Detailed Implementation

[0040] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.

[0041] The present invention will now be described in detail with reference to specific embodiments and accompanying drawings.

[0042] Example 1:

[0043] This embodiment proposes an adaptive memory protection method for dynamically adjusting the voting frequency of triple modulo redundancy, such as... Figure 1 As shown, it includes:

[0044] S1. Create and initialize a management structure for the critical data that needs to be protected. The management structure includes three data copy pointers for managing the three data copies of the critical data.

[0045] The management structure, named KyTMR, is implemented as a module in the Linux kernel and intercepts access to protected memory by hooking system calls or page fault handlers.

[0046] The management structure KyTMR contains at least three data copy pointers, each pointing to one of the three redundant data copies of the critical data. Figure 2 The diagram shown is a schematic of the KyTMR structure, where the memory pointers heap1, heap2, and heap3 are the three data copy pointers.

[0047] The management structure KyTMR also includes an error counter, a system load status identifier, and a current voting frequency policy identifier.

[0048] The error counter is used to record the number of historical errors in which data inconsistencies occurred during historical voting in the management structure.

[0049] The system load status identifier is used to identify the system load rate. The identification method can be: divide the system load rate into different system load status levels, and use the system load status level to represent the system load rate for identification.

[0050] The current voting frequency strategy identifier is used to identify the current voting frequency strategy.

[0051] S2. Monitor system status parameters related to the key data in real time or periodically. The system status parameters include: system load rate and historical error rate of data inconsistency in historical voting by the management structure.

[0052] In this step, the system load rate, which is monitored in real time or periodically, is identified by the system load status identifier in the management structure KyTMR according to the divided system load levels.

[0053] The historical error rate is obtained by statistically analyzing the error counter data in the KyTMR management structure over a unit of time.

[0054] S3. Based on the monitored system status parameters, dynamically adjust the voting frequency strategy for performing a two-out-of-three voting operation on the three data copies.

[0055] Preset first and third thresholds for system load rate, and second and fourth thresholds for historical error rate. The first threshold is greater than or equal to the third threshold, and the second threshold is greater than or equal to the fourth threshold.

[0056] When the system load rate obtained from real-time or periodic monitoring is higher than the first threshold, and / or the historical error rate is higher than the second threshold, the voting frequency strategy will be adjusted to high frequency mode.

[0057] The high-frequency mode includes: performing real-time voting on write operations and performing real-time or periodic voting on read operations. Specifically, it involves performing a two-out-of-three vote immediately after a write operation on the key data, and / or performing a two-out-of-three vote immediately when a read operation on the key data is performed, or performing periodic voting.

[0058] When the system load rate monitored in real time or periodically is lower than the third threshold and the historical error rate is lower than the fourth threshold, the voting frequency strategy will be adjusted to low frequency mode.

[0059] The low-frequency mode includes: performing delayed batch voting on write operations and performing timer-based periodic background voting on read operations. Specifically, it involves: caching write operations and performing delayed batch write operations and voting when predetermined conditions are met; and / or starting a background timer to periodically perform scanning and voting operations on three copies of the critical data.

[0060] The adjusted voting frequency strategy is recorded in the current voting frequency strategy identifier of the management structure KyTMR.

[0061] S4. Perform the corresponding two-out-of-three voting operation on the three data copies according to the voting frequency strategy.

[0062] The voting process described in this embodiment is the process of obtaining correct data, and its flow is as follows: Figure 3 As shown, it includes:

[0063] Manage three key data sets using the KyTMR structure;

[0064] When executing a vote, retrieve three copies of the data stored in memory;

[0065] Determine whether the first and second sets of data are the same;

[0066] If the first and second sets of data are the same, then the first set of data is taken as the correct data.

[0067] If the first set of data is different from the second set, then determine if the first set of data is the same as the third set.

[0068] If the first and third sets of data are the same, then the second set of data is corrected, and the first set of data is taken as the correct data.

[0069] If the first and third sets of data are different, then determine whether the second and third sets of data are the same.

[0070] If the second and third sets of data are the same, then the second set of data is taken as the correct data;

[0071] If the second and third sets of data are different, an error message is sent down, indicating that all three sets of data are incorrect.

[0072] Release memory after obtaining correct data or downloading error information.

[0073] The above process describes the specific steps involved in obtaining data through triple-redundant voting.

[0074] This embodiment cleverly solves the inherent defect of excessive performance overhead in traditional triple redundancy technology by introducing system state awareness and dynamic policy adjustment mechanisms, and realizes an intelligent adaptive memory protection solution that combines high reliability and high efficiency.

[0075] Example 2:

[0076] This embodiment is the application process of the adaptive memory protection method for dynamically adjusting the voting frequency of the three-modal redundancy system described in Embodiment 1.

[0077] like Figure 4 As shown, the process begins at step S101, initializing a KyTMR management structure for critical data (e.g., navigation parameters in flight control software). For example, the KyTMR management structure can be defined in C language as follows:

[0078] “struct kytmr{

[0079]

[0080] atomic_t error_count; / / Error counter

[0081] int access_count; / / Access counter

[0082] enum{LOW,MEDIUM,HIGH}load_level; / / System load status identifier

[0083] enum{FREQ_LOW,FREQ_HIGH}vote_policy; / / Identifier for the current voting frequency policy

[0084] struct timer_list bg_timer; / / Background timer for low-frequency mode}”;

[0085] In the above structure, the system load status identifier identifies LOW, MEDIUM, and HIGH (i.e., low, medium, and high states); the current voting frequency policy identifier vote_policy identifies FREQ_LOW and FREQ_HIGH (i.e., low frequency mode and high frequency mode).

[0086] In step S102, the system monitors and detects the system load rate and historical error rate during runtime.

[0087] The system enters the runtime monitoring and decision-making loop. The kernel module will continuously monitor:

[0088] System load: Evaluate by reading / proc / loadavg or directly querying the kernel scheduler's run queue length.

[0089] Historical error rate: Calculated by the ratio of the error counter error_count to the access counter access_count in the KyTMR management structure.

[0090] Step S103 is the decision point. Set up the strategy decision engine and dynamically select the voting strategy based on the state parameters.

[0091] See the decision-making process of the strategy decision engine. Figure 5 :

[0092] If the first and third thresholds for system load rate are both preset to correspond to the system load rate of the system load status level "MEDIUM", then it can be known that when the system load status level is "HIGH", it will definitely be greater than the first threshold, and when the system load status level is "LOW", it will definitely be less than the third threshold.

[0093] The second threshold for the historical error rate is preset to 0.1%, and the fourth threshold is preset to 0.01%.

[0094] If load_level == HIGH || error_rate > 0.1%, meaning the system load rate is greater than the first threshold, or the historical error rate is greater than the second threshold, then proceed to S104 and set vote_policy = FREQ_HIGH, that is, set the voting frequency policy to high frequency mode (high frequency voting policy).

[0095] If load_level == LOW && error_rate < 0.01%, meaning the system load rate is less than the third threshold and the historical error rate is less than the fourth threshold, and both are true, then proceed to S105 and set vote_policy = FREQ_LOW, that is, set the voting frequency policy to low frequency mode (low frequency voting policy).

[0096] Otherwise, maintain the existing strategy.

[0097] If the process proceeds to step S104, then in step S106, the system will perform the corresponding operation:

[0098] High-frequency mode (S106): Each time the write() system call is executed, data is immediately written to three copies, and a "two-out-of-three" vote is triggered to ensure consistency. Each time read() is executed, a vote is also triggered immediately to return the correct data.

[0099] If the process proceeds to step S105, then in step S107, the system will perform the corresponding operation:

[0100] Low-frequency mode (S107): For write operations, data is first written to a buffer, and then batch writing and voting are performed after a certain amount has accumulated or after a specific time has elapsed. For read operations, a background timer is mainly used to periodically scan and vote on all KyTMR-protected data, while foreground read operations directly read the primary copy in most cases (which can be combined with ECC verification), thereby greatly improving read speed.

[0101] This embodiment applies the method described in Embodiment 1 to solve the inherent defect of excessive performance overhead in traditional triple redundancy technology, and achieves intelligent adaptive memory protection that combines high reliability and high efficiency.

[0102] Example 3:

[0103] This embodiment proposes an adaptive memory protection device that dynamically adjusts the voting frequency of triple modulo redundancy, such as... Figure 6 As shown, it includes:

[0104] Structure module: Creates and initializes a management structure for the critical data that needs to be protected. The management structure includes three data copy pointers for managing three data copies of the critical data.

[0105] Monitoring module: Monitors system status parameters related to the key data in real time or periodically. The system status parameters include: system load rate and the historical error rate of data inconsistency in historical voting of the management structure.

[0106] Strategy module: Based on the monitored system status parameters, dynamically adjust the voting frequency strategy for performing a two-out-of-three voting operation on the three data replicas;

[0107] Execution module: Performs the corresponding two-out-of-three voting operation on the three data copies according to the voting frequency strategy.

[0108] The management structure described in the structure module is implemented as a module in the Linux kernel, which intercepts access to protected memory by hooking system calls or page fault handlers.

[0109] The management structure in the structure module also includes an error counter that records the number of historical errors in which the management structure has data inconsistencies in historical voting.

[0110] The historical error rate in the monitoring module is obtained by statistically analyzing the data from the error counter within a unit of time.

[0111] The system load rate in the monitoring module is identified by a system load status identifier set in the management structure.

[0112] The voting frequency strategy in the strategy module is identified by a current voting frequency strategy identifier set by the management structure.

[0113] The dynamic adjustment described in the strategy module specifically includes:

[0114] When the system load rate is higher than the first threshold and / or the historical error rate is higher than the second threshold, the voting frequency strategy will be adjusted to high frequency mode.

[0115] When the system load rate is detected to be below the third threshold and the historical error rate is below the fourth threshold, the voting frequency strategy will be adjusted to a low-frequency mode.

[0116] The high-frequency modes include:

[0117] Write operations are subject to real-time voting, while read operations are subject to real-time or periodic voting.

[0118] The low-frequency modes include:

[0119] Write operations are subject to delayed batch voting, while read operations are subject to periodic background voting based on a timer.

[0120] The adaptive memory protection device for dynamically adjusting the voting frequency of the three-modal redundancy system proposed in this embodiment can realize the adaptive memory protection method for dynamically adjusting the voting frequency of the three-modal redundancy system in Embodiments 1 and 2, and has the same technical effect as Embodiments 1 and 2.

[0121] The above-described embodiments are merely preferred embodiments of the present invention and are only used to help understand the method and core ideas of this application. The scope of protection of the present invention is not limited to the above embodiments, and all technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. An adaptive memory protection method of dynamically adjusting a triple modular redundancy voting frequency, characterized by, include: S1. Create and initialize a management structure for the critical data that needs to be protected. The management structure includes three data copy pointers for managing the three data copies of the critical data. It also includes an error counter to record the number of historical errors in which the management structure has data inconsistency in historical voting. A system load status identifier is also set to indicate the system load rate; S2. Monitor system status parameters related to the key data in real time or periodically. The system status parameters include: system load rate and historical error rate of data inconsistency in historical voting of the management structure; the historical error rate is obtained by statistically analyzing the data of the error counter per unit time. S3. Based on the monitored system status parameters, dynamically adjust the voting frequency strategy for performing a two-out-of-three voting operation on the three data replicas; the dynamic adjustment specifically includes: The system has a first threshold and a third threshold for system load rate, and a second threshold and a fourth threshold for historical error rate; the first threshold is greater than or equal to the third threshold, and the second threshold is greater than or equal to the fourth threshold. When the system load rate is higher than the first threshold and / or the historical error rate is higher than the second threshold, the voting frequency strategy will be adjusted to a high-frequency mode; the high-frequency mode includes: performing real-time voting on write operations and performing real-time or periodic voting on read operations; When the system load rate is detected to be lower than the third threshold and the historical error rate is lower than the fourth threshold, the voting frequency strategy is adjusted to a low-frequency mode; the low-frequency mode includes: performing delayed batch voting for write operations and performing periodic background voting based on timers for read operations; S4. Perform the corresponding two-out-of-three voting operation on the three data copies according to the voting frequency strategy.

2. The method of claim 1, wherein, The management structure described in step S1 is implemented as a module of the Linux kernel, which intercepts access to protected memory by hooking system calls or page fault handlers.

3. The method of claim 1, wherein the method further comprises: The voting frequency strategy mentioned in step S3 is identified by a current voting frequency strategy identifier set by the management structure.

4. An adaptive memory protection device that dynamically adjusts a triple modular redundant voting frequency, the device comprising: include: Structure module: Creates and initializes a management structure for the critical data that needs to be protected. The management structure includes three data copy pointers to manage three data copies of the critical data; it also includes an error counter to record the number of historical errors of data inconsistency that occurred in the management structure during historical voting. A system load status identifier is also set to indicate the system load rate; Monitoring module: Monitors system status parameters related to the key data in real time or periodically. The system status parameters include: system load rate and historical error rate of data inconsistency in historical voting of the management structure; the historical error rate is obtained by statistically analyzing the data of the error counter per unit time. The strategy module dynamically adjusts the voting frequency strategy for performing a two-out-of-three voting operation on the three data replicas based on monitored system status parameters. This dynamic adjustment specifically includes: presetting a first and a third threshold for system load rate, and a second and a fourth threshold for historical error rate; the first threshold is greater than or equal to the third threshold, and the second threshold is greater than or equal to the fourth threshold; when the system load rate is higher than the first threshold, and / or the historical error rate is higher than the second threshold, the voting frequency strategy is adjusted to a high-frequency mode; the high-frequency mode includes: performing real-time voting for write operations and performing real-time or periodic voting for read operations; when the system load rate is detected to be lower than the third threshold, and the historical error rate is lower than the fourth threshold, the voting frequency strategy is adjusted to a low-frequency mode; the low-frequency mode includes: performing delayed batch voting for write operations and performing timer-based periodic background voting for read operations. Execution module: Performs the corresponding two-out-of-three voting operation on the three data copies according to the voting frequency strategy.

Citation Information

Patent Citations

  • Program redundancy execution voting device and method, electronic equipment and storage medium

    CN113987493A

  • Autonomous recovery method for working state of spaceborne radar

    CN115685105A